Message processing method, device and computer equipment based on robot operating system
By using message processing methods in the robot operating system, receiving, storing and pushing message data, the problem of high APP development cost in the prior art is solved, and lower development and maintenance costs and higher system stability are achieved.
Patent Information
- Application Number
- CN202010411167.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-15
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-05-15
AI Technical Summary
In the prior art, it is necessary to develop APPs to control robots, resulting in high initial development costs and later maintenance costs.
The message processing method based on the robot operating system is adopted to receive, store and push message data, and message nodes related to the message subject are promptly obtained to meet the business needs of the robot's functional services.
It reduces the initial development costs and later maintenance costs, improves the stability of the robot operating system, and avoids the problem of global robot deactivation caused by a single APP failure.
Smart Images

Figure CN111694644B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a message processing method, device and computer equipment based on a robot operating system. Background Art
[0002] Robotics is a systematic project that involves many disciplines such as mechanics, electronics, control, communication, and software. Developing a robot requires a lot of effort, including mechanical design, circuit board drawing, driver writing, communication architecture design, assembly and integration, debugging, and writing various perception, decision-making, and control algorithms. Each task takes a lot of time.
[0003] With the advancement of technology, the division of labor in the robotics industry has begun to become more detailed and multi-layered. Today, motors, chassis, lidar, cameras, robotic arms and other components are produced by different manufacturers. The social division of labor has accelerated the development of the robotics industry. The integration of various components requires a unified software platform. In the field of robotics, this platform is the Robot Operating System (ROS).
[0004] At present, most of the service robots on the market can be disassembled into a structure of intelligent terminal + sensor + actuator. In the development of robots, an application (APP) is usually used to control all the logic and behavior of the robot, including voice dialogue, motion control, intelligent interaction, sensor response, etc.
[0005] However, this approach makes the application's functionality and software scale very large, which not only increases the initial development cost and makes it difficult to maintain in the later stages, but also means that the robot will not be able to work without the application. Summary of the invention
[0006] In view of this, the present application provides a message processing method, device and computer equipment based on a robot operating system, the main purpose of which is to solve the technical problem that the current method of developing an APP to control the robot will result in high initial development costs and subsequent maintenance costs.
[0007] According to one aspect of the present application, a message processing method based on a robot operating system is provided, the method comprising:
[0008] Receiving message data sent by a message node, wherein the message node corresponds to an input or output device in the robot;
[0009] According to the message subject corresponding to the message data, storing the message data in a message queue corresponding to the message subject;
[0010] Push the message data in the message queue to the target message node that subscribes to the message topic.
[0011] According to another aspect of the present application, a message processing device based on a robot operating system is provided, the device comprising:
[0012] A receiving module, used to receive message data sent by a message node, wherein the message node corresponds to an input or output device in the robot;
[0013] A storage module, used for storing the message data in a message queue corresponding to the message subject according to the message subject corresponding to the message data;
[0014] The push module is used to push the message data in the message queue to the target message node that subscribes to the message topic.
[0015] According to another aspect of the present application, a non-volatile readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned message processing method based on the robot operating system is implemented.
[0016] According to another aspect of the present application, a computer device is provided, comprising a non-volatile readable storage medium, a processor, and a computer program stored on the non-volatile readable storage medium and executable on the processor, wherein the processor implements the above-mentioned message processing method based on the robot operating system when executing the program.
[0017] By means of the above technical scheme, the present application provides a message processing method, device and computer equipment based on a robot operating system. The present application can use the input or output device in the robot as a message node, and then set the message subscription mechanism according to the message subject, so that the message node related to the message subject can obtain the message data related to the message subject in time to meet the needs of the robot's functional business. Compared with the current method of developing an APP to control the robot, the present application does not need to develop a specific APP to control all the logic and behavior of the robot, reducing the initial development cost and later maintenance cost, and does not need to integrate a software development kit (SDK) or plug-in for each function. The function of the system service can be called using a unified interface. And if a single message node fails, it will only cause a certain functional disorder, and will not cause the entire robot to be unusable, thereby improving the stability of the robot operating system.
[0018] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, which can be implemented in accordance with the contents of the specification, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the local application. In the drawings:
[0020] Figure 1 A schematic diagram of a flow chart of a message processing method based on a robot operating system provided in an embodiment of the present application is shown;
[0021] Figure 2 A schematic flow chart of another message processing method based on a robot operating system provided in an embodiment of the present application is shown;
[0022] Figure 3 A schematic diagram showing an example of a message subscription mechanism provided in an embodiment of the present application is shown;
[0023] Figure 4 A flow chart of a message processing device based on a robot operating system provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0025] In view of the current need to develop an APP to control the robot, which will cause high initial development costs and later maintenance costs, this embodiment provides a new robot system framework that integrates ROS and instant messaging (IM). The system framework can be divided into several levels, such as hardware layer, system layer, and application layer.
[0026] At the hardware level, the main control board on the robot is connected to input devices (such as capacitive touch sensors, ID card readers, etc.) and output devices (such as LED light control boards, dot matrix control boards, steering gear control boards, etc.) through serial ports, input / output (I / O), etc. for communication control. At the system hardware level, each input device and output device corresponds to a software service for control.
[0027] At the system level, it can be composed of message nodes, message channels, and message scheduling strategies. Among them, each service corresponding to each input and output device at the hardware level is called a functional node of the robot operating system. Each node can receive messages (such as control commands) to control output devices, and can also send certain messages (such as sensor data, video images collected by cameras), so these functional nodes can be used as message nodes.
[0028] The robot operating system is a distributed system. In the specific implementation, the data message is distributed with the message server as the center. The message server supports communication methods such as point-to-point communication and topic subscription push. Each message node is connected together based on the message server to transmit messages and data, and the message service schedules and distributes the data message.
[0029] The message server and the message node can communicate messages through the message channel. For example, the specific implementation scheme can refer to the cross-process communication between Android Services and be edited using the Android Interface Definition Language (AIDL). It should be noted that this embodiment is not limited to cross-process communication methods such as sockets.
[0030] The message scheduling strategy can be a message scheduling strategy that integrates subscription / push and IM communication in ROS. Several communication modes are designed in the message server: subscription / push, point-to-point communication, and system broadcast.
[0031] In the application layer, the system framework opens the above-mentioned communication methods (such as subscription / push, point-to-point communication, system broadcast, etc.), allowing the application layer program to access the system layer message server as a message node, so that the application layer can realize the following functions:
[0032] (1) Receive the data status of the robot sensor (message node) by subscribing to messages;
[0033] (2) By pushing messages, it simulates system and sensor event messages and supports developers to customize the functions of horizontally expanding robots;
[0034] (3) Through point-to-point communication, the functions of calling certain system services can be specified with less system overhead;
[0035] (4) Application developers do not need to integrate SDK or plug-ins for each function. They can use a unified interface to call the functions of system services. Moreover, if service applications developed by other developers are connected to the robot system framework, they can also directly call the functions of other developers' horizontal expansion.
[0036] Based on the above robot system framework, in order to illustrate its specific application process, this embodiment provides a message processing method based on the robot operating system, such as Figure 1 As shown, the method includes:
[0037] 101. The message server receives message data sent by the message node.
[0038] The message node corresponds to an input or output device in the robot. The execution subject of this embodiment may be a message processing device or equipment, which may be configured on the message server side.
[0039] 102. According to the message subject corresponding to the message data, the received message data is stored in a message queue corresponding to the message subject.
[0040] In this embodiment, each message node can compress and encapsulate the message data according to a certain communication protocol and pass it to the message server; the message server then passes the received message data to the message queue of the corresponding message topic, wherein the message server sets a message queue for each topic to store the message data sent by each message node. For example, each message topic has its own corresponding message queue, and then the message server stores the target message data in the message queue corresponding to the target message topic according to the target message topic of the received target message data. When the message node sends the message data to the message server, it can use the AIDL message channel to send it.
[0041] The message subject determination process in this embodiment may specifically include: determining the message subject corresponding to the message data according to the identifier of the message node that sends the message data and the content of the message data. For example, according to the functions that can be realized by the message node, statistics are made in advance on which message data can be sent by each message node, and which topics the content of these message data may include, and a mapping relationship between the identifier of the message node, the content of the message data, and the message subject is established, and then according to the content of the message data currently uploaded by the message node and the identifier of the node, the corresponding message subject is found using the mapping relationship, and the message data is then stored in the message queue corresponding to the message subject.
[0042] 103. Push the message data in the message queue of the message topic to the target message node that subscribes to the message topic.
[0043] For this embodiment, each message node can choose to subscribe to a specific message topic from the message server. The message server can take out the message data from the message queue of the corresponding topic and send it to all message nodes subscribed to the message topic. For example, message node A subscribes to the message data about message topic B, and then takes out the message data stored in the message queue corresponding to message topic B and sends it to message node A.
[0044] It should be noted that the message processing mechanism in this embodiment can also be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. This embodiment can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This embodiment can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0045] Through the message processing method based on the robot operating system in this embodiment, the input or output device in the robot can be used as a message node, and then the message subscription mechanism is set according to the message subject, so that the message node related to the message subject can obtain the message data related to the message subject in time to meet the needs of the robot's functional business. Compared with the current method of developing an APP to control the robot, this application does not need to develop a specific APP to control all the logic and behavior of the robot, reducing the initial development cost and later maintenance cost, and does not need to integrate SDK or plug-ins for each function. The function of the system service can be called using a unified interface. And if a single message node fails, it will only cause a certain functional disorder, and will not cause the entire robot to be unusable, thereby improving the stability of the robot operating system.
[0046] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another message processing method based on the robot operating system is provided, such as Figure 2 As shown, the method includes:
[0047] 201. The message server receives message data sent by the message node.
[0048] 202. Determine a message value level corresponding to the message data according to business feedback record information after pushing historical message data to a target message node.
[0049] The similarity between the historical message data and the currently received message data is greater than a preset threshold (which can be preset according to actual needs). The message value level can be used to reflect the impact of the message data on the subscriber. For example, the message value level can specifically include high level, medium level, low level, no level, etc.
[0050] Because sometimes not all messages uploaded by message nodes are useful or normal messages for subscribers, some may be abnormal messages for subscribers. Receiving such message data will increase the probability of abnormalities in subsequent related businesses. Therefore, if these message data are also stored in the message queue, it will not only take up too much space, increase the processing pressure of the message queue, and may cause performance degradation. It will also cause abnormalities in subsequent related businesses.
[0051] In order to solve the above problem, in this embodiment, before the message data is stored in the message queue of the corresponding message topic, the message value level can be evaluated for the message data, and then according to the message value level and the current state information of the message queue, it is determined whether to store the message data in the message queue of the corresponding message topic. In this way, some useless or abnormal message data can be filtered out in advance, so that the message data sent to the subscriber subsequently is as valuable as possible and will not cause abnormalities in related business.
[0052] In order to accurately obtain the message value level corresponding to the message data, it is optional to combine the means of big data analysis, based on the feedback record information of the relevant business after the historical message data is pushed to the target message node, and use the machine learning model to accurately evaluate. Specifically, before step 202, it can also include: obtaining the probability value of abnormality of the relevant business after the historical message data is pushed to the target message node from the feedback record information of the relevant business; and obtaining the sample message feature information corresponding to each of the historical message data (such as sending time, sender information, message type, message content, message validity period, etc.); then create a model training set, which contains different sample message feature information, and the probability values corresponding to different sample message feature information, that is, the probability value of abnormality of the relevant business after the historical message data with the sample message feature information is pushed to the target message node; finally, the created model training set can be used to train a machine learning model for message value level evaluation, for example, through algorithms such as convolutional neural networks, decision trees, and random forests. During the model training process, a training stop standard can also be set, that is, the accuracy of the model test result is greater than a certain threshold.
[0053] Correspondingly, step 202 may specifically include: inputting the message feature information of the message data into the created machine learning model, so as to obtain target sample message feature information having a similarity greater than a preset threshold with the message feature information, and a target probability value corresponding to the target sample message feature information, and outputting the message value level corresponding to the message data according to the target probability value.
[0054] For example, the larger the probability value, the lower the message value level; the smaller the probability value, the higher the message value level. The message value levels corresponding to different probability value intervals are pre-set, and then the corresponding message value level can be found by determining which probability value interval the target probability value is in.
[0055] 203. Determine whether to store the message data in the message queue of the blockchain node according to the message value level corresponding to the message data and the current status information of the message queue corresponding to the message topic.
[0056] In this embodiment, not only the message value level is referred to, but also the current status information of the message queue corresponding to the message subject is combined to make a comprehensive judgment on whether to store it. When it is determined to be stored after the judgment, the message data can be stored in the message queue corresponding to the message subject of a blockchain node. By storing the message data in the blockchain in this way, the privacy and security of the message data can be further guaranteed.
[0057] It should be noted that the blockchain referred to in this embodiment is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network-processed information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0058] Exemplarily, step 203 may specifically include: if the message value level is less than or equal to a first preset level threshold (which can be used to judge message data of no value or close to no value level), then cancel storing the message data in the message queue of the corresponding message topic of the blockchain node; if the current status information of the message queue of the corresponding message topic meets the preset busy status standard (which can be judged according to the current proportion of the number of message data in the message queue, for example, the larger the current proportion of the number of message data, the busier the message queue is currently. By setting a certain busy status standard, it is possible to accurately judge whether the message queue is currently busy), and the message value level is greater than the first preset level threshold and less than or equal to the second preset level threshold (which can be used to judge message data of low value or close to low value level), then cancel storing the message data in the message queue of the corresponding message topic of the blockchain node; if the message value level is greater than the second preset level threshold, it is determined to store the message data in the message queue of the corresponding message topic of the blockchain node.
[0059] For example, after obtaining the message value level, a comprehensive judgment can be made based on the current status information of the message queue whether to store the message data in the message queue. If the message value level is relatively low and the message queue is currently busy, the message data can be cancelled from being stored in the message queue; if the message value level is relatively high and the message queue is currently in a relatively idle state, the message data can be stored in the message queue; if the message value level is higher than a certain threshold, it is equivalent to a core message. At this time, as long as the message queue is not fully loaded, the message data should be stored in the message queue to meet the needs of the subscriber.
[0060] The above optional method can combine the message value of the message data and the current busyness of the message queue. When the message queue is relatively busy, the message data with relatively high message value can be stored in the message queue as much as possible, thereby increasing the possibility that high-value message data can be sent to subscribers when the message queue is relatively busy, and thus high-value message data can be sent to subscribers in a timely manner.
[0061] 204. If it is determined that the message data is stored in the message queue corresponding to the message topic, the message data is stored in the message queue corresponding to the message topic of the blockchain node.
[0062] 205. Push the message data in the message queue of the message topic to the target message node that subscribes to the message topic.
[0063] For example, the message subscription mechanism for a message node can be as follows Figure 3 As shown, application 1 and application 2 (equivalent to two message nodes) can configure local subscription and push topics in advance, and the subsequent message server can send message data of the subscribed topics to them.
[0064] Optionally, in order to meet specific business needs, the method of this embodiment may also include: recording the timestamp when the message data is stored in the message queue; and then regularly or irregularly clearing out expired message data in the message queue according to the recorded timestamp to save storage space in the message queue.
[0065] Accordingly, step 205 may specifically include: pushing message data in the message queue whose timestamps match a preset time range to the target message node. For example, when subscribing, the message node may select the message data that matches a certain time range, such as the latest message data uploaded to a queue corresponding to a message topic, or the message data uploaded to the queue corresponding to the topic on the same day. Then, after finding the message queue corresponding to the topic, the message server returns the message data corresponding to the subscription of the message node according to the timestamp corresponding to the message data in the queue.
[0066] After receiving the subscription message data pushed by the message server, the message node can determine whether it needs to perform corresponding control operations according to the received subscription message data. If necessary, it sends a target message data forwarding request to the message server.
[0067] For example, in order to monitor whether the front connector of the robot is vertically inserted into the specified position of the insertion hole of the object to be transported, the front connector control device (message node A) in the handling robot needs to subscribe to the relative position message data sent by the corresponding position sensor (message node B). Message node A determines whether the front connector of the robot has been successfully inserted into the specified position of the insertion hole based on the received relative position message data. If it is determined that it has been successfully inserted into the specified position of the insertion hole, message node A sends the corresponding target message data to the device that controls the movement of the robot (message node C) through the message server, so that message node C can control the robot to stop the insertion movement.
[0068] In order to achieve accurate transmission of message data between message nodes, the process shown in the following steps 206 to 207 may be executed.
[0069] 206. The message server receives a forwarding request for target message data sent by the first target message node.
[0070] The forwarding request is sent by the first target message node according to the message data of the subscription push, and the forwarding request carries the node identifier of the second target message node, which is generated according to the process number and process name.
[0071] 207. Forward the target message data to the second target message node according to the node identifier of the second target message node.
[0072] Integrating the idea of instant messaging IM, in the message server, in order to clarify the identification of each message node, a node list can be maintained and an identification can be set for each message node (it should be noted that the identification method is not limited, and the process number + process name can be used as the identification of the message node in the implementation of this embodiment, as shown in Table 1).
[0073] Table 1
[0074] Serial number Process number Process name 1 43424 Application 1 2 6436 Application 2 3 321 Hardware 1 Service 4 64382 Hardware 2 Services
[0075] In this embodiment, a certain message node can specify the object to which the message is sent (by specifying an identifier). For example, based on the content of Table 1 above, by specifying the identifier of the message node, it is specified that the message data sent by the message node A can be received by the message node B; or by specifying the identifier of the message node, it is specified that the message node C only receives the message data sent by the message node D, etc. In this way, the accurate transmission of the message data can be guaranteed to avoid the occurrence of transmission errors.
[0076] Furthermore, in order to meet more business needs, optionally, as part of the message server improvement mechanism, a message broadcast mechanism is provided. Accordingly, the method of this embodiment may also include: obtaining the connected message nodes; then determining the node types corresponding to the connected message nodes; and finally sending message data of the corresponding node type to the connected message nodes. Through this optional method, all message nodes connected to the message server, whether subscribed or not, can receive specific types of message data, such as alarms for abnormal states, etc.
[0077] By applying the robot system framework and the message processing method of the robot operating system, the following functions can be achieved:
[0078] (1) The functions are completely decomposed, relatively independent, and easy to maintain. There can be multiple message nodes, each of which acts as a "sensor" or "actuator" of the robot, used to control independent hardware or collect sensor information to perform a relatively simple task or process.
[0079] (2) System stability: A single node error will only cause a certain functional failure and will not make the entire robot unusable.
[0080] (3) The functions of this system are highly expandable and flexible. Not only limited to system services, but also other applications are allowed to access the message framework at the application layer. Each application can obtain the robot's sensor data and control hardware actuators. For example, to add a new face tracking function to the robot head, the traditional method requires adding the algorithm and control function to the application. When another application wants to use it, the same operation is required. In the system framework of this embodiment, only a face tracking service needs to be added, and any application that wants this function only needs to send the relevant control instructions to the message server.
[0081] Further, as Figure 1 to Figure 2 The specific implementation of the method shown in the embodiment provides a message processing device based on a robot operating system, such as Figure 4 As shown, the device includes: a receiving module 31, a storage module 32, and a pushing module 33.
[0082] A receiving module 31, which can be used to receive message data sent by a message node, wherein the message node corresponds to an input or output device in the robot;
[0083] The storage module 32 may be used to store the message data in a message queue corresponding to the message subject according to the message subject corresponding to the message data;
[0084] The push module 33 may be used to push the message data in the message queue to the target message node that subscribes to the message topic.
[0085] In a specific application scenario, the device further includes: a determination module;
[0086] A determination module, which can be used to determine the message value level corresponding to the message data according to the business feedback record information after the historical message data is pushed to the target message node, wherein the similarity between the historical message data and the message data is greater than a preset threshold;
[0087] The determination module can also be used to determine whether to store the message data in the message queue of the blockchain node based on the message value level and the current status information of the message queue.
[0088] In a specific application scenario, the determination module can also be used to obtain, from the business feedback record information, a probability value of an abnormality occurring in a related business after the historical message data is pushed; obtain sample message feature information corresponding to each of the historical message data; create a model training set, the model training set containing different sample message feature information, and the probability values corresponding to the different sample message feature information; and use the model training set to train a machine learning model.
[0089] The determination module can be specifically used to input the message feature information of the message data into the machine learning model so as to obtain target sample message feature information whose similarity with the message feature information is greater than a preset threshold, and a target probability value corresponding to the target sample message feature information, and output the message value level corresponding to the message data according to the target probability value.
[0090] In a specific application scenario, the determination module can also be used to cancel the storage of the message data in the message queue of the blockchain node if the message value level is less than or equal to the first preset level threshold; if the current state information of the message queue meets the preset busy state standard, and the message value level is greater than the first preset level threshold and less than or equal to the second preset level threshold, cancel the storage of the message data in the message queue of the blockchain node; if the message value level is greater than the second preset level threshold, determine to store the message data in the message queue of the blockchain node;
[0091] The storage module 32 can be specifically used to store the message data in the message queue of the blockchain node if it is determined to store the message data in the message queue.
[0092] In a specific application scenario, the device may also include: a recording module and a cleaning module;
[0093] A recording module, which can be used to record the timestamp when the message data is stored in the message queue;
[0094] A cleaning module, which can be used to clean up expired message data in the message queue regularly or irregularly according to the recorded timestamp;
[0095] The push module 33 may be specifically configured to push message data in the message queue whose timestamps are within a preset time range to the target message node.
[0096] In a specific application scenario, the receiving module 31 may also be used to receive a forwarding request for target message data sent by a first target message node, wherein the forwarding request is sent by the first target message node according to the message data pushed by the subscription, and the forwarding request carries a node identifier of a second target message node, and the node identifier is generated according to a process number and a process name;
[0097] The push module 33 may also be configured to forward the target message data to the second target message node according to the node identifier.
[0098] In a specific application scenario, the device may further include: an acquisition module;
[0099] An acquisition module, which can be used to acquire the connected message nodes; determine the node types corresponding to the connected message nodes;
[0100] The push module 33 may also be used to send message data of a corresponding node type to the connected message node.
[0101] It should be noted that for other corresponding descriptions of the functional units involved in the message processing device based on the robot operating system provided in this embodiment, please refer to Figure 1 to Figure 2 The corresponding description in will not be repeated here.
[0102] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The message processing method based on the robot operating system is shown.
[0103] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0104] Based on the above Figure 1 , Figure 2 The method shown, and Figure 4 In order to achieve the above-mentioned purpose, the present embodiment further provides a computer device, which can be a personal computer, a server, a network device, etc. The physical device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The message processing method based on the robot operating system is shown.
[0105] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0106] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0107] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the technical solution of this embodiment, compared with the current method of developing an APP to control the robot, the present application does not need to develop a specific APP to control all the logic and behavior of the robot, reducing the initial development cost and later maintenance cost, and does not need to integrate SDK or plug-ins for each function. The function of the system service can be called using a unified interface. And if a single message node fails, it will only cause a certain functional disorder, and will not cause the entire robot to be unusable, thereby improving the stability of the robot operating system.
[0109] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0110] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A message processing method based on a robot operating system, characterized in that: include: Receiving message data sent by a message node, wherein the message node corresponds to an input or output device in the robot; According to the message subject corresponding to the message data, storing the message data in a message queue corresponding to the message subject; Push the message data in the message queue to the target message node subscribed to the message topic; According to the message subject corresponding to the message data, storing the message data in a message queue corresponding to the message subject includes: Determine a message value level corresponding to the message data; the message value level is used to reflect the impact of the message data on the subscriber; If the current state information of the message queue meets the idle state standard and the message value level is greater than a first preset level threshold, or if the message value level is greater than a second preset level threshold, determine to store the message data in the message queue corresponding to the message topic; Before storing the message data in a message queue corresponding to the message topic according to the message topic corresponding to the message data, the method further includes: Determine the message value level corresponding to the message data according to the business feedback record information after pushing the historical message data to the target message node, wherein the similarity between the historical message data and the message data is greater than a preset threshold; Determining whether to store the message data in the message queue of the blockchain node according to the message value level and the current state information of the message queue; Before determining the message value level corresponding to the message data according to the business feedback record information after the historical message data is pushed to the target message node, the method further includes: Obtaining, from the business feedback record information, a probability value of an abnormality occurring in the relevant business after the historical message data is pushed; Obtaining sample message feature information corresponding to each of the historical message data; Creating a model training set, wherein the model training set includes different sample message feature information and the probability values corresponding to the different sample message feature information respectively; Using the model training set, training a machine learning model; Determining the message value level corresponding to the message data according to the business feedback record information after the historical message data is pushed to the target message node specifically includes: The message feature information of the message data is input into the machine learning model to obtain target sample message feature information whose similarity with the message feature information is greater than a preset threshold, and a target probability value corresponding to the target sample message feature information, and output the message value level corresponding to the message data according to the target probability value.
2. The method according to claim 1, characterized in that: The determining whether to store the message data in the message queue of the blockchain node according to the message value level and the current state information of the message queue specifically includes: If the message value level is less than or equal to a first preset level threshold, canceling the storage of the message data in the message queue of the blockchain node; If the current status information of the message queue meets the preset busy status standard, and the message value level is greater than the first preset level threshold and less than or equal to the second preset level threshold, then cancel storing the message data in the message queue of the blockchain node; If the message value level is greater than the second preset level threshold, determining to store the message data in the message queue of the blockchain node; According to the message subject corresponding to the message data, storing the message data in a message queue corresponding to the message subject specifically includes: If it is determined to store the message data in the message queue, the message data is stored in the message queue of the blockchain node.
3. The method according to claim 1, characterized in that The method further comprises: Record the timestamp when the message data is stored in the message queue; Cleaning up expired message data in the message queue regularly or irregularly according to the recorded timestamp; The pushing the message data in the message queue to the target message node subscribed to the message topic specifically includes: Pushing message data in the message queue whose timestamps are within a preset time range to the target message node.
4. The method according to claim 1, characterized in that After pushing the message data in the message queue to the target message node subscribed to the message topic, the method further includes: Receive a forwarding request for target message data sent by a first target message node, wherein the forwarding request is sent by the first target message node according to the message data pushed by subscription, and the forwarding request carries a node identifier of a second target message node, wherein the node identifier is generated according to a process number and a process name; According to the node identifier, the target message data is forwarded to the second target message node.
5. The method according to claim 1, characterized in that The method further comprises: Get the connected message node; Determine the node type corresponding to each of the accessed message nodes; Sending message data of a corresponding node type to the connected message node.
6. A message processing device based on a robot operating system, characterized in that: include: A receiving module, used to receive message data sent by a message node, wherein the message node corresponds to an input or output device in the robot; A storage module, used for storing the message data in a message queue corresponding to the message subject according to the message subject corresponding to the message data; A push module, used to push the message data in the message queue to the target message node subscribed to the message topic; The storage module is specifically used to determine the message value level corresponding to the message data; the message value level is used to reflect the impact of the message data on the subscriber; If the current state information of the message queue meets the idle state standard and the message value level is greater than a first preset level threshold, or if the message value level is greater than a second preset level threshold, determine to store the message data in the message queue corresponding to the message topic; A determination module, which can be used to determine the message value level corresponding to the message data according to the business feedback record information after the historical message data is pushed to the target message node, wherein the similarity between the historical message data and the message data is greater than a preset threshold; The determination module may also be used to determine whether to store the message data in the message queue of the blockchain node according to the message value level and the current state information of the message queue; The determination module can also be used to obtain, from the business feedback record information, a probability value of an abnormality occurring in a related business after the historical message data is pushed; obtain sample message feature information corresponding to each of the historical message data; create a model training set, the model training set containing different sample message feature information, and the probability values corresponding to the different sample message feature information; train a machine learning model using the model training set; input the message feature information of the message data into the machine learning model to obtain target sample message feature information having a similarity greater than a preset threshold corresponding to the message feature information, and a target probability value corresponding to the target sample message feature information, and output a message value level corresponding to the message data according to the target probability value.
7. A non-volatile readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the message processing method based on a robot operating system according to any one of claims 1 to 5 is implemented.
8. A computer device comprising a non-volatile readable storage medium, a processor, and a computer program stored in the non-volatile readable storage medium and executable on the processor, characterized in that: When the processor executes the program, the message processing method based on the robot operating system according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Message pushing method and device
CN107872494A
Message publishing, processing and subscribing method, device and system
CN110875935A