WO2021114816A1 - 基于机器人操作系统的消息处理方法、装置及计算机设备 - Google Patents

基于机器人操作系统的消息处理方法、装置及计算机设备 Download PDF

Info

Publication number
WO2021114816A1
WO2021114816A1 PCT/CN2020/117776 CN2020117776W WO2021114816A1 WO 2021114816 A1 WO2021114816 A1 WO 2021114816A1 CN 2020117776 W CN2020117776 W CN 2020117776W WO 2021114816 A1 WO2021114816 A1 WO 2021114816A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
node
data
message data
target
Prior art date
Application number
PCT/CN2020/117776
Other languages
English (en)
French (fr)
Inventor
周宸
龚连银
周宝
贾怀礼
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021114816A1 publication Critical patent/WO2021114816A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/043Real-time or near real-time messaging, e.g. instant messaging [IM] using or handling presence information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/214Monitoring or handling of messages using selective forwarding

Definitions

  • This 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.
  • Robot is a system engineering, which involves many disciplines such as mechanics, electronics, control, communication, software and so on. It takes a lot of effort to develop a robot. It requires designing machinery, drawing circuit boards, writing drivers, designing communication architecture, assembly and integration, debugging, and writing various perception decision-making and control algorithms. Each task requires a lot of time. .
  • ROS Robot Operating System
  • this application provides a message processing method, device and computer equipment based on the robot operating system, the main purpose is to solve the current need to develop APP to control the robot, which will cause high early development costs and late maintenance costs Technical issues.
  • a message processing method based on a robot operating system includes: receiving message data sent by a message node, wherein the message node corresponds to an input or output device in the robot; The message topic corresponding to the message data is stored in the message queue corresponding to the message topic; the message data in the message queue is pushed to the target message node that subscribes to the message topic.
  • a message processing device based on a robot operating system, the device comprising: a receiving module for receiving message data sent by a message node, wherein the message node corresponds to the input or Output device; storage module, used to store the message data in a message queue corresponding to the message topic according to the message topic corresponding to the message data; push module, used to subscribe to the target message of the message topic The node pushes the message data in the message queue.
  • a non-volatile readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the following method is implemented: receiving message data sent by a message node, wherein: The message node corresponds to the input or output device in the robot; according to the message topic corresponding to the message data, the message data is stored in the message queue corresponding to the message topic; and the target message subscribed to the message topic The node pushes the message data in the message queue.
  • a computer device including a non-volatile readable storage medium, a processor, and a computer program stored on the non-volatile readable storage medium and running on the processor,
  • the processor executes the program, the following method is implemented: receiving message data sent by a message node, where the message node corresponds to an input or output device in a robot; according to the message subject corresponding to the message data, the message The data is stored in the message queue corresponding to the message topic; the message data in the message queue is pushed to the target message node subscribing to the message topic.
  • This application does not need to develop a specific APP to control all the logic and behavior of the robot, reduce the cost of early development and later maintenance, and does not need to integrate software development kits (Software Development Kit, SDK) or plug-ins for each function, and use a unified interface to call The function of the system service.
  • software development Kit Software Development Kit, SDK
  • plug-ins for each function, and use a unified interface to call The function of the system service.
  • a single message node error will only cause a certain dysfunction, and will not cause the entire robot to be unusable, thereby improving the stability of the robot operating system.
  • Fig. 1 shows a schematic flowchart of a message processing method based on a robot operating system provided by an embodiment of the present application.
  • Fig. 2 shows a schematic flowchart of another message processing method based on a robot operating system provided by an embodiment of the present application.
  • Fig. 3 shows a schematic diagram of an example of a message subscription mechanism provided by an embodiment of the present application.
  • FIG. 4 shows a schematic flowchart of a message processing apparatus based on a robot operating system provided by an embodiment of the present application.
  • the technical solution of the present application can be applied to the fields of artificial intelligence, blockchain and/or smart city technology, involving robotics technology, which can realize message processing based on a robot-based operating system and realize smart life.
  • the data involved in this application can be stored in the blockchain, such as distributed storage through the blockchain.
  • the solution of this embodiment provides a new type of 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.
  • the main control board on the robot communicates with input devices (such as capacitive touch sensors, ID card readers, etc.) and output devices (such as LED lights) through serial ports, input/output (I/O), etc.
  • input devices such as capacitive touch sensors, ID card readers, etc.
  • output devices such as LED lights
  • each input device and output device corresponds to a software service for control.
  • each service corresponding to each input and output device of the hardware layer is called the functional node of the robot operating system.
  • Each node can receive messages (such as control commands) to control the output device, and can also send some kind of messages (such as Sensor data, video images collected by cameras), so these functional nodes can be used as message nodes.
  • the robot operating system is a distributed system.
  • the data message is distributed with the message server as the center.
  • the message server supports point-to-point communication, topic subscription push and other communication methods.
  • the message nodes are connected together based on the message server to transfer messages and data, and the message service dispatches and distributes the data messages.
  • the message server and the message node can carry out message communication through the message channel.
  • the specific implementation scheme can refer to the cross-process communication between Android Service and use the Android interface definition language (Android Interface Definition Language, AIDL) for editing. It should be noted that this embodiment is not limited to cross-process communication methods, such as sockets.
  • 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.
  • the above-mentioned communication methods (such as subscription/push, peer-to-peer communication, system broadcast, etc.) are opened to allow application layer programs to be used as message nodes to access the message server of the system layer, so that the application layer can Achieve the following functions.
  • this embodiment provides a message processing method based on a robot operating system. As shown in FIG. 1, the method includes the following steps.
  • the message server receives the message data sent by the message node.
  • the message node corresponds to the input or output device in the robot.
  • the execution subject of this embodiment may be a message processing apparatus or device, which may be configured on the message server side.
  • the message subject corresponding to the message data store the received message data in a message queue corresponding to the message subject.
  • each message node can compress and encapsulate the message data according to a certain communication protocol and transfer it to the message server; the message server transfers the received message data to the message queue corresponding to the message topic.
  • the message server sets up a message queue for each topic to store the message data sent by each message node. For example, each message subject 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 subject according to the target message subject of the received target message data.
  • the message node specifically sends the message data to the message server, it can use the AIDL message channel to send it.
  • the process of determining the message subject in this embodiment may specifically include: determining the message subject corresponding to the message data according to the identity of the message node sending the message data and the content of the message data. For example, according to the functions that can be realized by the message node, the statistics of the message data that each message node can send, and the topics of the message data content can be included, and the identification of the message node, the message data content, and the message subject are established. Then, according to the content of the message data currently uploaded by the message node and the identifier of the node, the mapping relationship is used to find the corresponding message topic, and then the message data is stored in the message queue corresponding to the message topic.
  • 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 that subscribe to the message topic. For example, message node A subscribes to 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.
  • the message processing mechanism in this embodiment can also be used in many general or special computer system environments or configurations.
  • This embodiment may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • 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 these distributed computing environments, remote processing devices connected through a communication network perform tasks.
  • program modules can be located in local and remote computer storage media including storage devices.
  • the input or output device in the robot can be used as the message node, and then the message subscription mechanism can be set according to the message topic, so that the message node related to the message topic can obtain the information related to the message topic in time.
  • this application does not need to develop a specific APP to control all the logic and behavior of the robot, which reduces the pre-development cost and post-maintenance cost, and does not need to integrate SDK or plug-ins for each function, and adopt a unified interface
  • the function of the system service can be called.
  • a single message node error will only cause a certain dysfunction, and will not cause the entire robot to be unusable, thereby improving the stability of the robot operating system.
  • the message server receives the message data sent by the message node.
  • 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 degree of influence of the message data on the subscriber.
  • the message value level may specifically include high-level, medium-level, low-level, and no-level message values.
  • the messages uploaded by the message node are sometimes not all useful or normal messages for the subscriber, some may be abnormal messages for the subscriber. Receiving such message data will cause subsequent related services. The probability value of occurrence of an abnormality increases. 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. And it also causes the follow-up related business to be prone to abnormalities.
  • the message value level of the message data can be evaluated, and then according to the message value level and the current status information of the message queue, it is determined whether to add The message data is stored in the message queue corresponding to the message subject. In this way, some useless or abnormal message data can be filtered out in advance, so that the subsequent message data sent to the subscriber is as valuable as possible and will not cause related business abnormalities.
  • the message value level corresponding to the message data In order to accurately obtain the message value level corresponding to the message data, optionally, it can be combined with big data analysis methods, based on the feedback record information of the relevant business after the historical message data is pushed to the target message node, and the machine learning model is used for accurate evaluation.
  • the method may further include: obtaining, from the feedback record information of the related business after the historical message data is pushed to the target message node, the probability value of the abnormal occurrence of the related business after the historical message data is pushed; and obtaining the respective corresponding historical message data Sample message feature information (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 different sample message feature information respectively Corresponding probability value, that is, the probability value of abnormal sending of related services after the historical message data with the message characteristic information of the sample is pushed to the target message node; finally, the created model training set can be used to train the machine used for message value evaluation Learning the model, for example, can use algorithms such as convolutional neural network, decision tree, random forest, etc.
  • the training stop standard can also be set, that is, the accuracy of the model test result can be greater than a certain threshold.
  • step 202 may specifically include: inputting the message feature information of the message data into the created machine learning model, so as to obtain the target sample message feature information whose corresponding similarity with the message feature information is greater than a preset threshold, and The target probability value corresponding to the message feature information of the target sample, and the message value level corresponding to the message data is output according to the target probability value.
  • the message value level corresponding to different probability value intervals is set in advance, and then the corresponding message value level can be found by determining which probability value interval the target probability value is in.
  • the message data can be stored in a message queue corresponding to the message topic of a blockchain node. By storing the message data in the blockchain, the privacy and security of the message data can be further ensured.
  • Blockchain is essentially a decentralized database. It is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network processing information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • step 203 may specifically include: if the message value level is less than or equal to the first preset level threshold (which can be used to judge message data of worthless or close to worthless level), cancel storing the message data in the blockchain In the message queue corresponding to the message topic of the node; if the current status information of the message queue corresponding to the message topic meets the preset busy state standard (can be judged according to the proportion of the current number of message data in the message queue, for example, the current number of message data The larger the proportion, the busier the message queue is currently.
  • the first preset level threshold which can be used to judge message data of worthless or close to worthless level
  • the message value level is greater than the first preset level threshold and less than or equal to the second preset level Threshold (can be used to judge low-value or similar low-value message data), 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 corresponding to the message topic of the blockchain node.
  • Threshold can be used to judge low-value or similar low-value message data
  • the message value level After obtaining the message value level, it is possible to comprehensively determine whether to store the message data in the message queue according to the current status information of the message queue. If the message value level is relatively low and the message queue is currently busy, you can cancel storing the message data in the message queue; if the message value level is relatively high and the message queue is currently relatively idle, you can use the message data Stored in the message queue; if the message value level is higher than a certain threshold, it is equivalent to the core message. At this time, as long as the message queue is not full, the message data should be stored in the message queue to meet the needs of subscribers.
  • the message value of the message data and the current busyness of the message queue can be combined.
  • the message data with more message value can be stored in the message queue as much as possible, which improves the high-value message data. It is possible to send to the subscriber when the message queue is busy, so that high-value message data can be sent to the subscriber in time.
  • the message subscription mechanism of the message node can be shown in Figure 3.
  • Application 1 and Application 2 (equivalent to two message nodes) can configure local subscriptions and push topics in advance, and the subsequent message server can send them messages subscribed to topics data.
  • the method of this embodiment may further include: recording the timestamp when the message data is stored in the message queue; then, periodically or irregularly, clearing the expired message data in the message queue according to the recorded timestamp , In order to save storage space in the message queue.
  • step 205 may specifically include: pushing message data in the message queue with a time stamp in the preset time range to the target message node.
  • a message node subscribes, it can select the message data in which time range the subscription conforms to, such as the latest message data uploaded to the queue corresponding to a certain message topic, or the message data uploaded to the queue corresponding to the topic on the same day.
  • the message server finds the message queue corresponding to the topic, it returns the message data corresponding to the subscription of the message node according to the timestamp corresponding to the message data in the queue.
  • the message node After the message node receives the subscription message data pushed by the message server, it can determine whether a corresponding control operation needs to be performed according to the received subscription message data, and if necessary, sends a target message data forwarding request to the message server.
  • the front connector control device (message node A) in the handling robot needs to subscribe to the corresponding position sensor (message node B) 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 handled.
  • the message node A judges whether the front connector of the robot has been successfully inserted into the designated position of the insertion hole according to the received relative position message data. If it is determined that the insertion hole has been successfully inserted at the designated position, the message node A sends the corresponding target message data to the device (message node C) that controls the robot movement through the message server, so that the message node C can control the robot to stop the insertion movement.
  • the message server receives the forwarding request of the target message data sent by the first target message node.
  • 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 the node identifier of the second target message node, and the node identifier is generated according to the process number and the process name.
  • a node list can be maintained, and an identification is set for each message node (it should be noted that the identification method is not limited.
  • the process number + process name can be used as the identification of the message node, as shown in Table 1).
  • Serial number Process ID Process name 1 43424 Application 1 2 6436 Application 2 3 321 Hardware 1 service 4 64382 Hardware 2 service
  • a certain message node can specify the object to which the message is sent (by specifying the identifier). For example, based on the content of Table 1 above, by specifying the identifier of the message node, the message data sent by the designated message node A can be received by the message node B ; Or by specifying the identity of the message node, the specified message node C only receives the message data sent by the message node D, etc. In this way, the accurate transmission of message data can be ensured, and error transmission can be avoided.
  • a message broadcast mechanism is provided. Accordingly, the method of this embodiment may further include: obtaining the message node that has been accessed; and then determining that the message node has been accessed. The node type corresponding to each of the accessed message nodes; finally, the message data of the corresponding node type is sent to the accessed message node.
  • all message nodes that access the message server, whether subscribed or not, can receive specific types of message data, such as alarms that can be used for abnormal conditions.
  • each node acts as a "sensor” or “executor” of the robot, used to control independent hardware or collect sensor information, and perform a relatively simple task or process.
  • the function of this system has high expansibility and flexibility. Not limited to system services, other applications are allowed to access the message framework at the application layer, and each application can obtain robot sensor data and control hardware actuators. For example, to add a new robot head face tracking function, the traditional method needs to add the algorithm and control function to the application. When another application wants to use it, the same operation is also required. Under the system framework in this embodiment, only one face tracking service needs to be added, and any application that wants this function only needs to send related control instructions to the message server.
  • this embodiment provides a message processing device based on a robot operating system.
  • the device includes: a receiving module 31, a storage module 32, Push module 33.
  • the receiving module 31 can be used to receive message data sent by a message node, where the message node corresponds to an input or output device in the robot.
  • the storage module 32 may be configured to store the message data in a message queue corresponding to the message subject according to the message subject corresponding to the message data.
  • the pushing module 33 may be used to push the message data in the message queue to the target message node subscribing to the message topic.
  • the device also includes: a determining module.
  • the determining module 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 historical message data is similar to the message data The degree is greater than the preset threshold.
  • the determining 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 status information of the message queue.
  • the determining module may also be used to obtain from the service feedback record information, the probability value of the abnormality of the related service after the historical message data is pushed; obtain the sample message characteristic information corresponding to each of the historical message data; A model training set is created, and the model training set contains different sample message feature information and the probability values corresponding to the different sample message feature information; using the model training set, a machine learning model is trained.
  • the determining module can be specifically used to input the message feature information of the message data into the machine learning model, so as to obtain the target sample message feature information whose corresponding similarity with the message feature information is greater than a preset threshold, and the message feature information with the target Sample message feature information corresponding to the target probability value, and output the message value level corresponding to the message data according to the target probability value.
  • the determining module can be specifically used to cancel storing 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 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, cancel the message data Stored in the message queue 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 blockchain node.
  • the storage module 32 may be specifically configured 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.
  • the device may also include: a recording module and a cleaning module.
  • the recording module can be used to record the time stamp when the message data is stored in the message queue.
  • the cleaning module can be used to clean up the expired message data in the message queue according to the recorded time stamp regularly or irregularly.
  • the pushing module 33 may be specifically configured to push message data with a time stamp in the message queue within a preset time range to the target message node.
  • the receiving module 31 may also be used to receive a forwarding request of target message data sent by the first target message node, where the forwarding request is sent by the first target message node according to the message data pushed by the subscription. Yes, the forwarding request carries the node identifier of the second target message node, and the node identifier is generated according to the process number and the process name.
  • the pushing module 33 may also be configured to forward the target message data to the second target message node according to the node identifier.
  • the device may further include: an acquisition module.
  • the obtaining module can be used to obtain the accessed message node; determine the node type corresponding to each of the accessed message node.
  • the push module 33 may also be used to send message data of the corresponding node type to the accessed message node.
  • this embodiment also provides a storage medium on which a computer program is stored, and when the program is executed by a processor, some or all of the steps in the above method can be implemented.
  • the message processing method based on the robot operating system as shown in Fig. 1 and/or Fig. 2 is implemented.
  • the storage medium involved in this application may be a readable storage medium (or may be referred to as a computer-readable storage medium), and the storage medium may be non-volatile, such as a non-volatile readable storage medium, or Is volatile, such as volatile readable storage media.
  • the technical solution of this application can be embodied in the form of a software product, which can be stored in a storage medium such as a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods in each implementation scenario of this application.
  • a storage medium such as a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.)
  • a computer device which can be a personal computer, a server, or a network device, etc.
  • this embodiment also provides a computer device, which can specifically be a personal computer, a server, or a network device.
  • 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 implement the message processing method based on the robot operating system shown in FIG. 1 and FIG. 2.
  • the computer device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, and so on.
  • the user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, and the like.
  • the optional network interface can include standard wired interface, wireless interface (such as Bluetooth interface, WI-FI interface), etc.
  • 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 combine certain components, or arrange different components.
  • 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 aforementioned physical devices, and supports the operation of information processing programs and other software and/or programs.
  • the network communication module is used to realize the communication between the various components in the storage medium and the communication with other hardware and software in the physical device.
  • this application can be implemented by means of software plus a necessary general hardware platform, or can be implemented by hardware.
  • this application does not need to develop a specific APP to control all the logic and behavior of the robot, reducing the pre-development cost and post-maintenance cost, and there is no need for each function.
  • a single message node error will only cause a certain dysfunction, and will not cause the entire robot to be unusable, thereby improving the stability of the robot operating system.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Manipulator (AREA)

Abstract

一种基于机器人操作系统的消息处理方法、装置及计算机设备,涉及人工智能技术领域。其中方法包括:消息服务器接收消息节点发送的消息数据(101),其中,所述消息节点对应机器人中的输入或输出设备;然后根据消息数据对应的消息主题,将接收到的消息数据存储在与所述消息主题对应的消息队列中(102);最后向订阅消息主题的目标消息节点,推送消息主题的消息队列中的消息数据(103)。该方法无需开发特定APP控制机器人所有逻辑和行为,减少前期开发成本和后期维护成本。此外,该方法还涉及区块链技术,消息数据可存储于区块链中,以保证数据私密和安全性。

Description

基于机器人操作系统的消息处理方法、装置及计算机设备
本申请要求于2020年5月15日提交中国专利局、申请号为202010411167.2,发明名称为“基于机器人操作系统的消息处理方法、装置及计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其是涉及到一种基于机器人操作系统的消息处理方法、装置及计算机设备。
背景技术
机器人是一个系统工程,它涉及机械、电子、控制、通信、软件等诸多学科。开发一个机器人需要花很大的功夫,需要设计机械、画电路板、写驱动程序、设计通信架构、组装集成、调试、以及编写各种感知决策和控制算法,每一个任务都需要花费大量的时间。
随着技术进步,机器人产业分工开始走向细致化、多层次化,如今的电机、底盘、激光雷达、摄像头、机械臂等等元器件都有不同厂家专门生产。社会分工加速了机器人行业的发展。而各个部件的集成就需要一个统一的软件平台,在机器人领域,这个平台就是机器人操作系统(Robot Operating System,ROS)。
发明人意识到,目前,市面上服务的机器人,大部分可以拆解成智能终端+传感器+执行器这种结构。在机器人的开发上,通常使用一个应用(Application,APP)控制机器人所有逻辑和行为,包括语音对话、运动控制、智能交互、传感器响应等。
然而,发明人发现,这种方法使得该应用的功能和软件规模变得很庞大,不但前期开发成本较高,并且后期不容易维护,而且一旦没有这个应用,机器人将无法工作。
技术问题
有鉴于此,本申请提供了一种基于机器人操作系统的消息处理方法、装置及计算机设备,主要目的在于解决目前需要开发APP来控制机器人的方式,会造成前期开发成本和后期维护成本都较高的技术问题。
技术解决方案
根据本申请的一个方面,提供了一种基于机器人操作系统的消息处理方法,该方法包括:接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备;根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中;向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
根据本申请的另一个方面,提供了一种基于机器人操作系统的消息处理装置,该装置包括:接收模块,用于接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备;存储模块,用于根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中;推送模块,用于向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
根据本申请的又一个方面,提供了一种非易失性可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现以下方法:接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备;根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中;向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
根据本申请的再一个方面,提供了一种计算机设备,包括非易失性可读存储介质、处理器及存储在非易失性可读存储介质上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下方法:接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备;根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中;向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
有益效果
本申请无需开发特定APP控制机器人所有逻辑和行为,减少前期开发成本和后期维护成本,也无需为每个功能集成软件开发工具包(Software Development Kit,SDK)或者插件,采用统一的接口即可调用系统服务的功能。并且单一的消息节点出错,只会造成某个功能障碍,并不会导致整个机器人无法使用,从而可提高机器人操作系统的稳定性。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了本申请的上述和其他目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本地申请的不当限定。
图1示出了本申请实施例提供的一种基于机器人操作系统的消息处理方法的流程示意图。
图2示出了本申请实施例提供的另一种基于机器人操作系统的消息处理方法的流程示意图。
图3示出了本申请实施例提供的一种消息订阅机制示例的示意图。
图4示出了本申请实施例提供的一种基于机器人操作系统的消息处理装置的流程示意图。
本发明的实施方式
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互结合。
本申请的技术方案可应用于人工智能、区块链和/或智慧城市技术领域,涉及机器人技术,可实现基于机器人的操作系统的消息处理,实现智慧生活。可选的,本申请涉及的数据可存储于区块链中,比如通过区块链分布式存储。
针对目前需要开发APP来控制机器人的方式,会造成前期开发成本和后期维护成本都较高的技术问题,本实施例方案提供了一种新型的融合ROS和即时通信(IM)的机器人系统框架。该系统框架可分为硬件层、系统层、应用层等几个层次。
在硬件层方面,机器人上的主控板上通过串口、输入/输出(I/O)等方式,与输入设备(如电容触摸传感、身份证读卡器等)和输出设备(如LED灯控制板、点阵控制板、舵机控制板等)相连,进行通信控制。在系统硬件层,每个输入设备和输出设备对应一个软件服务进行控制。
在系统层方面,可由消息节点、消息通道、消息调度策略几个部分组成。其中,与硬件层每个输入输出设备对应的每个服务称之为机器人操作系统的功能节点,每个节点能够接收消息(如控制命令)控制输出设备,也能够向外发送某种消息(如传感器的数据、摄像头采集的视频图像),因此这些功能节点可作为消息节点。
机器人操作系统是分布式系统。在具体执行中,以消息服务器为中心进行数据消息的分发,该消息服务器支持点对点通信、主题的订阅推送等通讯方式。各个消息节点基于该消息服务器连接在一起,传递消息和数据,由消息服务对数据消息进行调度和分发。
消息服务器与消息节点可通过消息通道进行消息通信,例如,具体实现方案可参照Android Service 之间的跨进程通信,利用Android接口定义语言(Android Interface Definition Language,AIDL)进行编辑,需要说明的是,本实施例可不限于跨进程通讯方法,如socket等。
消息调度策略可为融合ROS中的订阅/推送和IM通信的消息调度策略。在消息服务器设计了几种通信模式:订阅/推送、点对点通信、系统广播。
在应用层方面,本系统框架中,开放以上所述的通信方式(如订阅/推送、点对点通信、系统广播等),允许应用层程序作为消息节点接入系统层的消息服务器,使得应用层能够实现以下功能。
(1)通过订阅消息的方式,接收机器人传感器(消息节点)的数据状态。
(2)通过推送的方式,模拟系统、传感器事件消息,支持开发者自定义横向拓展机器人的功能。
(3)通过点对点通讯的方式,能够以较小的系统开销指定调用某些系统服务的功能。
(4)应用开发者所开发的应用,无需为每个功能集成SDK或者插件,采用统一的接口即可调用系统服务的功能。不仅如此,若其他开发者开发的服务应用接入了本机器人系统框架,也可以直接调用其他开发者横向拓展的功能。
基于上述机器人系统框架,为了说明其具体的应用过程,本实施例提供了一种基于机器人操作系统的消息处理方法,如图1所示,该方法包括以下步骤。
101、消息服务器接收消息节点发送的消息数据。
其中,消息节点对应机器人中的输入或输出设备。对于本实施例的执行主体可为用于消息处理装置或设备,可配置在消息服务器侧。
102、根据消息数据对应的消息主题,将接收到的消息数据存储在与消息主题对应的消息队列中。
在本实施例中,每个消息节点能够将消息数据按照一定的通讯协议进行压缩封装,传递到消息服务器;消息服务器将接收到的消息数据再传递到对应消息主题(topic)的消息队列中,其中,消息服务器为每个主题设置有消息队列进行存储每个消息节点发出的消息数据。例如,每个消息主题都有各自对应的消息队列,然后消息服务器根据接收到的目标消息数据的目标消息主题,将该目标消息数据存储到对应该目标消息主题的消息队列中。消息节点向消息服务器具体发送消息数据时,可利用AIDL消息通道进行发送。
对于本实施例中的消息主题确定过程,具体可包括:可根据发送消息数据的消息节点的标识以及该消息数据的内容,确定该消息数据对应的消息主题。例如,预先根据消息节点可实现的功能,统计每个消息节点可发送的消息数据有哪些,以及这些消息数据内容的主题可包括哪些,建立消息节点的标识、消息数据内容、消息主题三者之间的映射关系,然后根据该消息节点当前上传的消息数据的内容以及该节点的标识,利用该映射关系找到对应的消息主题,进而将该消息数据存储在与该消息主题对应的消息队列中。
103、向订阅消息主题的目标消息节点,推送该消息主题的消息队列中的消息数据。
对于本实施例,每个消息节点能够向消息服务器选择订阅特定的消息主题。消息服务器能够从对应主题的消息队列中,取出消息数据发送给所有订阅该消息主题的消息节点。例如,消息节点A订阅了关于消息主题B的消息数据,然后将存储在消息主题B对应消息队列的消息数据取出发送给消息节点A。
需要说明的是,本实施例中的消息处理机制还可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
通过本实施例中的基于机器人操作系统的消息处理方法,可将机器人中的输入或输出设备作为消息节点,然后根据消息主题设定消息订阅机制,使得消息主题相关的消息节点能够及时获取到与该消息主题相关的消息数据,以满足机器人功能业务的需求。与目前需要开发APP来控制机器人的方式相比,本申请无需开发特定APP控制机器人所有逻辑和行为,减少前期开发成本和后期维护成本,也无需为每个功能集成SDK或者插件,采用统一的接口即可调用系统服务的功能。并且单一的消息节点出错,只会造成某个功能障碍,并不会导致整个机器人无法使用,从而可提高机器人操作系统的稳定性。
进一步的,作为上述实施例具体实施方式的细化和扩展,为了完整说明本实施例中的具体实施过程,提供了另一种基于机器人操作系统的消息处理方法,如图2所示,该方法包括以下步骤。
201、消息服务器接收消息节点发送的消息数据。
202、根据向目标消息节点推送历史消息数据后的业务反馈记录信息,确定消息数据对应的消息价值等级。
其中,历史消息数据与当前接收到的消息数据之间的相似度大于预设阈值(可根据实际需求进行预设)。消息价值等级可用于反映消息数据对订阅方的影响程度。例如,消息价值等级具体可包括高等级、中等级、低等级、无等级等的消息价值。
由于消息节点上传的消息对于订阅方来说,有时也并非全部是有用的消息或者是正常的消息,有些可能对订阅方来说是一些异常的消息,接收此类的消息数据会造成后续相关业务出现异常的概率值增加。因此如果将这些消息数据也存入在消息队列中不但会占用过多的空间,增加消息队列的处理压力,可能会出现性能的下降。而且还造成后续相关业务容易出现异常。
为了解决上述问题,在本实施例中,在消息数据存入对应消息主题的消息队列之前,可对消息数据进行消息价值等级评估,然后根据消息价值等级和消息队列的当前状态信息,确定是否将消息数据存储在对应消息主题的消息队列中。通过这种方式,可将一些无用或异常的消息数据提前过滤掉,以便后续向订阅方发送的尽可能是有消息价值的、且不会造成相关业务异常的消息数据。
为了精确得到消息数据对应的消息价值等级,可选的,可结合大数据分析的手段,基于历史消息数据推送给目标消息节点后相关业务的反馈记录信息,利用机器学习模型来准确评估。具体在步骤202之前,还可包括:从历史消息数据推送给目标消息节点后相关业务的反馈记录信息中,获取历史消息数据推送后相关业务发生异常的概率值;以及获取历史消息数据各自对应的样本消息特征信息(如发送时间、发送方信息、消息类型、消息内容、消息的有效期等);然后创建模型训练集,该模型训练集中包含不同的样本消息特征信息,以及不同样本消息特征信息分别对应的概率值,即具有该样本消息特征信息的历史消息数据推送给目标消息节点后相关业务发送异常的概率值;最后可利用创建得到的模型训练集,训练得到用于消息价值等级评估的机器学习模型,例如可通过卷积神经网络、决策树、随机森林等算法,在模型训练过程中,还可设定训练停止标准,即模型测试结果的准确率大于一定阈值即可。
相应的,步骤202具体可包括:将消息数据的消息特征信息输入到创建得到的机器学习模型中,以便获取与该消息特征信息对应相似度大于预置阈值的目标样本消息特征信息,以及与该目标样本消息特征信息对应的目标概率值,并根据该目标概率值输出消息数据对应的消息价值等级。
例如,概率值越大,消息价值等级越低;概率值越小,消息价值等级越高。预先设定不同概率值区间分别对应的消息价值等级,然后通过判定目标概率值所在哪个概率值区间,即可找到对应的消息价值等级。
203、根据消息数据对应的消息价值等级和对应消息主题的消息队列的当前状态信息,确定是否将消息数据存储在区块链节点的该消息队列中。
在本实施例中,不但要参考消息价值等级,还要结合对应消息主题的消息队列的当前状态信息进行综合评判是否存入。在经过判定后确定存入时,可将消息数据存储于一区块链节点的与该消息主题对应的消息队列中。通过这种将消息数据存储于区块链的方式,可进一步保证消息数据的私密和安全性。
需要说明的是,本实施例所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络处理的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
示例性的,步骤203具体可包括:若消息价值等级小于或等于第一预设等级阈值(可用于评判无价值或近似于无价值等级的消息数据),则取消将消息数据存储在区块链节点的对应消息主题的消息队列中;若对应消息主题的消息队列的当前状态信息符合预设繁忙状态标准(可根据消息队列中当前的消息数据数量占比进行判别,例如,当前的消息数据数量占比越大说明消息队列当前越繁忙,通过设置一定的繁忙状态标准,可准确判别消息队列当前是否繁忙),且消息价值等级大于第一预设等级阈值、且小于或等于第二预设等级阈值(可用于评判低价值或近似于低价值等级的消息数据),则取消将消息数据存储在区块链节点的对应消息主题的消息队列中;若消息价值等级大于第二预设等级阈值,则确定将消息数据存储在区块链节点的对应消息主题的消息队列中。
例如,得到消息价值等级之后,可根据消息队列的当前状态信息进行综合判定是否将该消息数据存入消息队列中。如果消息价值等级比较低,且消息队列当前处于繁忙状态,则可取消将该消息数据存入消息队列中;如果消息价值等级比较高,且消息队列当前处于相对空闲状态,则可将该消息数据存入消息队列中;如果消息价值等级高于一定阈值,相当于核心消息,此时只要消息队列不是满载情况,都应将该消息数据存入到消息队列中,以满足订阅方的需求。
通过上述可选方式可结合消息数据的消息价值以及消息队列当前的繁忙程度,在消息队列比较繁忙时尽可能的将比较有消息价值的消息数据存入消息队列中,提升了高价值的消息数据在消息队列比较繁忙时也能发送给订阅方的可能性,进而可及时向订阅方发送高价值的消息数据。
204、若确定将消息数据存储在对应消息主题的消息队列中,则将消息数据存储在区块链节点的与该消息主题对应的消息队列中。
205、向订阅消息主题的目标消息节点,推送该消息主题的消息队列中的消息数据。
例如,对于消息节点的消息订阅机制可如图3所示,应用1和应用2(相当于两个消息节点),可提前配置本地订阅及推送主题,后续消息服务器可向他们发送订阅主题的消息数据。
可选的,为了满足具体的业务需求,本实施例方法还可包括:记录消息数据存入消息队列时的时间戳;然后定时或不定时根据记录的时间戳,清理消息队列中的过期消息数据,以便节省消息队列中的存储空间。
相应的,步骤205具体可包括:向目标消息节点,推送消息队列中时间戳符合预设时间范围的消息数据。例如,消息节点订阅时可选取订阅符合哪些时间范围的消息数据,如最新上传到某消息主题对应队列的消息数据、或者当天上传到该主题对应队列的消息数据等。然后消息服务器在找到对应主题的消息队列后,根据该队列中消息数据对应的时间戳,返回消息节点相应订阅的消息数据。
消息节点接收消息服务器推送的订阅消息数据后,可根据接收到的订阅消息数据判断是否需要执行相应的控制操作,若需要,则向消息服务器发送目标消息数据转发请求。
例如,搬运机器人中的前置连接头控制设备(消息节点A)为了监控机器人的前置连接头是否垂直插入到待搬运物体的插入孔的指定位置处,需要订阅相应位置传感器(消息节点B)发送的相对位置消息数据。消息节点A根据接收到的该相对位置消息数据,判断机器人的前置连接头是否已成功插入该插入孔的指定位置处。如果判定已成功插入该插入孔的指定位置处时,消息节点A通过消息服务器向控制机器人运动的装置(消息节点C)发送相应的目标消息数据,以便消息节点C能够控制机器人停止插入的运动。
为了实现消息节点之间消息数据的准确传递,可执行以下步骤206至207所示的过程。
206、消息服务器接收第一目标消息节点发送的目标消息数据的转发请求。
其中,转发请求是第一目标消息节点根据订阅推送的消息数据发送的,转发请求中携带有第二目标消息节点的节点标识,节点标识是根据进程号和进程名称生成的。
207、根据第二目标消息节点的节点标识,将目标消息数据转发给第二目标消息节点。
融合即时通讯IM的思想,在消息服务器中,为了明确各个消息节点的标识,可维护了一个节点列表,并为每个消息节点设置了标识(需要说明的是,该标识方式可不做限定,本实施例实现中可采用进程号+进程名作为消息节点的标识,如表1所示)。
表1。
序号 进程号 进程名
1 43424 应用1
2 6436 应用2
3 321 硬件1服务
4 64382 硬件2服务
本实施例中,某个消息节点能够指定消息发送的对象(通过指定标识),例如,基于上述表1内容,通过指定消息节点的标识,指定消息节点A发送的消息数据可由消息节点B来接收;或者通过指定消息节点的标识,指定消息节点C只接收消息节点D发送的消息数据等。通过这种方式可保证消息数据的准确传递,避免传错的情况发生。
进一步的,为了满足更多的业务需求,可选的,作为消息服务器完善机制的一部分,提供消息广播机制,相应的,本实施例方法还可包括:获取已接入的消息节点;然后确定已接入的消息节点各自对应的节点类型;最后向已接入的消息节点发送与其对应节点类型的消息数据。通过这种可选方式,能够让所有接入消息服务器的消息节点,无论订阅与否,均可接收到特定类型的消息数据,如可用于异常状态的报警等。
通过应用本机器人系统框架,以及本机器人操作系统的消息处理方法,可实现以下功能。
(1)功能完全分解,相对独立,便于维护。可以存在多个消息节点,每个节点作为机器人的“传感器”或者“执行器”,用于控制独立的硬件或者收集传感器的信息,执行某个相对简单的任务或进程。
(2)系统稳定性,单一的节点出错,只会造成某个功能障碍,并不会导致整个机器人无法使用。
(3)本系统的功能具有很高的拓展性和灵活性。不仅限于系统服务,在应用层允许其他应用接入该消息框架,每个应用均能够获取机器人的传感器数据和控制硬件执行器。比如,新增一个机器人头部人脸跟踪功能,传统方法需要在应用中加入该算法和控制功能,当另外一个应用想用的时候,也需要同样的操作。在本实施例中的系统框架下,只需要加入一个人脸跟踪服务,任何想要该功能的应用只需要发送相关的控制指令至消息服务器即可。
进一步的,作为图1至图2所示方法的具体实现,本实施例提供了一种基于机器人操作系统的消息处理装置,如图4所示,该装置包括:接收模块31、存储模块32、推送模块33。
接收模块31,可用于接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备。
存储模块32,可用于根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中。
推送模块33,可用于向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
在具体的应用场景中,本装置还包括:确定模块。
确定模块,可用于根据向所述目标消息节点推送历史消息数据后的业务反馈记录信息,确定所述消息数据对应的消息价值等级,其中,所述历史消息数据与所述消息数据之间的相似度大于预设阈值。
确定模块,还可用于根据所述消息价值等级和所述消息队列的当前状态信息,确定是否将所述消息数据存储在区块链节点的所述消息队列中。
在具体的应用场景中,确定模块,还可用于从所述业务反馈记录信息中,获取历史消息数据推送后相关业务发生异常的概率值;获取所述历史消息数据各自对应的样本消息特征信息;创建模型训练集,所述模型训练集中包含不同的样本消息特征信息,以及所述不同样本消息特征信息分别对应的所述概率值;利用所述模型训练集,训练得到机器学习模型。
确定模块,具体可用于将所述消息数据的消息特征信息输入到所述机器学习模型,以便获取与所述消息特征信息对应相似度大于预置阈值的目标样本消息特征信息,以及与所述目标样本消息特征信息对应的目标概率值,并根据所述目标概率值输出所述消息数据对应的消息价值等级。
在具体的应用场景中,确定模块,具体还可用于若所述消息价值等级小于或等于第一预设等级阈值,则取消将所述消息数据存储在区块链节点的所述消息队列中;若所述消息队列的当前状态信息符合预设繁忙状态标准,且所述消息价值等级大于所述第一预设等级阈值、且小于或等于第二预设等级阈值,则取消将所述消息数据存储在区块链节点的所述消息队列中;若所述消息价值等级大于所述第二预设等级阈值,则确定将所述消息数据存储在区块链节点的所述消息队列中。
存储模块32,具体可用于若确定将所述消息数据存储在所述消息队列中,则将所述消息数据存储在区块链节点的所述消息队列中。
在具体的应用场景中,本装置还可包括:记录模块和清理模块。
记录模块,可用于记录所述消息数据存入所述消息队列时的时间戳。
清理模块,可用于定时或不定时根据记录的时间戳,清理所述消息队列中的过期消息数据。
推送模块33,具体可用于向所述目标消息节点,推送所述消息队列中时间戳符合预设时间范围的消息数据。
在具体的应用场景中,接收模块31,还可用于接收第一目标消息节点发送的目标消息数据的转发请求,所述转发请求是所述第一目标消息节点根据订阅推送的所述消息数据发送的,所述转发请求中携带有第二目标消息节点的节点标识,所述节点标识是根据进程号和进程名称生成的。
推送模块33,还可用于根据所述节点标识,将所述目标消息数据转发给所述第二目标消息节点。
在具体的应用场景中,本装置还可包括:获取模块。
获取模块,可用于获取已接入的消息节点;确定所述已接入的消息节点各自对应的节点类型。
推送模块33,还可用于向所述已接入的消息节点发送与其对应节点类型的消息数据。
需要说明的是,本实施例提供的一种基于机器人操作系统的消息处理装置所涉及各功能单元的其它相应描述,可以参考图1至图2中的对应描述,在此不再赘述。
基于上述如图1和图2所示方法,相应的,本实施例还提供了一种存储介质,其上存储有计算机程序,该程序被处理器执行时可实现上述方法中的部分或全部步骤,比如实现上述如图1和/或图2所示的基于机器人操作系统的消息处理方法。
可选的,本申请涉及的存储介质可以是可读存储介质(或者可以称为计算机可读存储介质),该存储介质可以是非易失性的,如非易失性可读存储介质,也可以是易失性的,如易失性可读存储介质。
基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个存储介质如非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施场景的方法。
基于上述如图1、图2所示的方法,以及图4所示的虚拟装置实施例,为了实现上述目的,本实施例还提供了一种计算机设备,具体可以为个人计算机、服务器、网络设备等,该实体设备包括存储介质和处理器;存储介质,用于存储计算机程序;处理器,用于执行计算机程序以实现上述如图1和图2所示的基于机器人操作系统的消息处理方法。
可选的,该计算机设备还可以包括用户接口、网络接口、摄像头、射频(Radio Frequency,RF)电路,传感器、音频电路、WI-FI模块等等。用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard)等,可选用户接口还可以包括USB接口、读卡器接口等。网络接口可选的可以包括标准的有线接口、无线接口(如蓝牙接口、WI-FI接口)等。
本领域技术人员可以理解,本实施例提供的计算机设备结构并不构成对该实体设备的限定,可以包括更多或更少的部件,或者组合某些部件,或者不同的部件布置。
存储介质中还可以包括操作系统、网络通信模块。操作系统是管理上述实体设备硬件和软件资源的程序,支持信息处理程序以及其它软件和/或程序的运行。网络通信模块用于实现存储介质内部各组件之间的通信,以及与该实体设备中其它硬件和软件之间通信。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可以借助软件加必要的通用硬件平台的方式来实现,也可以通过硬件实现。通过应用本实施例的技术方案,与目前需要开发APP来控制机器人的方式相比,本申请无需开发特定APP控制机器人所有逻辑和行为,减少前期开发成本和后期维护成本,也无需为每个功能集成SDK或者插件,采用统一的接口即可调用系统服务的功能。并且单一的消息节点出错,只会造成某个功能障碍,并不会导致整个机器人无法使用,从而可提高机器人操作系统的稳定性。
本领域技术人员可以理解附图只是一个优选实施场景的示意图,附图中的模块或流程并不一定是实施本申请所必须的。本领域技术人员可以理解实施场景中的装置中的模块可以按照实施场景描述进行分布于实施场景的装置中,也可以进行相应变化位于不同于本实施场景的一个或多个装置中。上述实施场景的模块可以合并为一个模块,也可以进一步拆分成多个子模块。
上述本申请序号仅仅为了描述,不代表实施场景的优劣。以上公开的仅为本申请的几个具体实施场景,但是,本申请并非局限于此,任何本领域的技术人员能思之的变化都应落入本申请的保护范围。

Claims (20)

  1. 一种基于机器人操作系统的消息处理方法,其中,包括:
    接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备;
    根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中;
    向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
  2. 根据权利要求1所述的方法,其中,所述根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中之前,所述方法还包括:
    根据向所述目标消息节点推送历史消息数据后的业务反馈记录信息,确定所述消息数据对应的消息价值等级,其中,所述历史消息数据与所述消息数据之间的相似度大于预设阈值;
    根据所述消息价值等级和所述消息队列的当前状态信息,确定是否将所述消息数据存储在区块链节点的所述消息队列中。
  3. 根据权利要求2所述的方法,其中,所述根据向所述目标消息节点推送历史消息数据后的业务反馈记录信息,确定所述消息数据对应的消息价值等级之前,还包括:
    从所述业务反馈记录信息中,获取历史消息数据推送后相关业务发生异常的概率值;
    获取所述历史消息数据各自对应的样本消息特征信息;
    创建模型训练集,所述模型训练集中包含不同的样本消息特征信息,以及所述不同样本消息特征信息分别对应的所述概率值;
    利用所述模型训练集,训练得到机器学习模型;
    所述根据向所述目标消息节点推送历史消息数据后的业务反馈记录信息,确定所述消息数据对应的消息价值等级,具体包括:
    将所述消息数据的消息特征信息输入到所述机器学习模型,以便获取与所述消息特征信息对应相似度大于预置阈值的目标样本消息特征信息,以及与所述目标样本消息特征信息对应的目标概率值,并根据所述目标概率值输出所述消息数据对应的消息价值等级。
  4. 根据权利要求3所述的方法,其中,所述根据所述消息价值等级和所述消息队列的当前状态信息,确定是否将所述消息数据存储在区块链节点的所述消息队列中,具体包括:
    若所述消息价值等级小于或等于第一预设等级阈值,则取消将所述消息数据存储在区块链节点的所述消息队列中;
    若所述消息队列的当前状态信息符合预设繁忙状态标准,且所述消息价值等级大于所述第一预设等级阈值、且小于或等于第二预设等级阈值,则取消将所述消息数据存储在区块链节点的所述消息队列中;
    若所述消息价值等级大于所述第二预设等级阈值,则确定将所述消息数据存储在区块链节点的所述消息队列中;
    所述根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中,具体包括:
    若确定将所述消息数据存储在所述消息队列中,则将所述消息数据存储在区块链节点的所述消息队列中。
  5. 根据权利要求1所述的方法,其中,所述方法还包括:
    记录所述消息数据存入所述消息队列时的时间戳;
    定时或不定时根据记录的时间戳,清理所述消息队列中的过期消息数据;
    所述向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据,具体包括:
    向所述目标消息节点,推送所述消息队列中时间戳符合预设时间范围的消息数据。
  6. 根据权利要求1所述的方法,其中,在所述向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据之后,所述方法还包括:
    接收第一目标消息节点发送的目标消息数据的转发请求,所述转发请求是所述第一目标消息节点根据订阅推送的所述消息数据发送的,所述转发请求中携带有第二目标消息节点的节点标识,所述节点标识是根据进程号和进程名称生成的;
    根据所述节点标识,将所述目标消息数据转发给所述第二目标消息节点。
  7. 根据权利要求1所述的方法,其中,所述方法还包括:
    获取已接入的消息节点;
    确定所述已接入的消息节点各自对应的节点类型;
    向所述已接入的消息节点发送与其对应节点类型的消息数据。
  8. 一种基于机器人操作系统的消息处理装置,其中,包括:
    接收模块,用于接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备;
    存储模块,用于根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中;
    推送模块,用于向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
  9. 一种存储介质,其上存储有计算机程序,其中,所述程序被处理器执行时实现以下方法:
    接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备;
    根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中;
    向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
  10. 根据权利要求9所述的存储介质,其中,所述根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中之前,所述程序被处理器执行时还用于实现:
    根据向所述目标消息节点推送历史消息数据后的业务反馈记录信息,确定所述消息数据对应的消息价值等级,其中,所述历史消息数据与所述消息数据之间的相似度大于预设阈值;
    根据所述消息价值等级和所述消息队列的当前状态信息,确定是否将所述消息数据存储在区块链节点的所述消息队列中。
  11. 根据权利要求9所述的存储介质,其中,所述程序被处理器执行时还用于实现:
    记录所述消息数据存入所述消息队列时的时间戳;
    定时或不定时根据记录的时间戳,清理所述消息队列中的过期消息数据;
    所述向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据时,具体实现:
    向所述目标消息节点,推送所述消息队列中时间戳符合预设时间范围的消息数据。
  12. 根据权利要求9所述的存储介质,其中,在所述向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据之后,所述程序被处理器执行时还用于实现:
    接收第一目标消息节点发送的目标消息数据的转发请求,所述转发请求是所述第一目标消息节点根据订阅推送的所述消息数据发送的,所述转发请求中携带有第二目标消息节点的节点标识,所述节点标识是根据进程号和进程名称生成的;
    根据所述节点标识,将所述目标消息数据转发给所述第二目标消息节点。
  13. 根据权利要求9所述的存储介质,其中,所述程序被处理器执行时还用于实现:
    获取已接入的消息节点;
    确定所述已接入的消息节点各自对应的节点类型;
    向所述已接入的消息节点发送与其对应节点类型的消息数据。
  14. 一种计算机设备,包括存储介质、处理器及存储在存储介质上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现以下方法:
    接收消息节点发送的消息数据,其中,所述消息节点对应机器人中的输入或输出设备;
    根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中;
    向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据。
  15. 根据权利要求14所述的计算机设备,其中,所述根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中之前,所述处理器执行所述程序时还用于实现:
    根据向所述目标消息节点推送历史消息数据后的业务反馈记录信息,确定所述消息数据对应的消息价值等级,其中,所述历史消息数据与所述消息数据之间的相似度大于预设阈值;
    根据所述消息价值等级和所述消息队列的当前状态信息,确定是否将所述消息数据存储在区块链节点的所述消息队列中。
  16. 根据权利要求15所述的计算机设备,其中,所述根据向所述目标消息节点推送历史消息数据后的业务反馈记录信息,确定所述消息数据对应的消息价值等级之前,所述处理器执行所述程序时还用于实现:
    从所述业务反馈记录信息中,获取历史消息数据推送后相关业务发生异常的概率值;
    获取所述历史消息数据各自对应的样本消息特征信息;
    创建模型训练集,所述模型训练集中包含不同的样本消息特征信息,以及所述不同样本消息特征信息分别对应的所述概率值;
    利用所述模型训练集,训练得到机器学习模型;
    所述根据向所述目标消息节点推送历史消息数据后的业务反馈记录信息,确定所述消息数据对应的消息价值等级时,具体实现:
    将所述消息数据的消息特征信息输入到所述机器学习模型,以便获取与所述消息特征信息对应相似度大于预置阈值的目标样本消息特征信息,以及与所述目标样本消息特征信息对应的目标概率值,并根据所述目标概率值输出所述消息数据对应的消息价值等级。
  17. 根据权利要求16所述的计算机设备,其中,所述根据所述消息价值等级和所述消息队列的当前状态信息,确定是否将所述消息数据存储在区块链节点的所述消息队列中时,具体实现:
    若所述消息价值等级小于或等于第一预设等级阈值,则取消将所述消息数据存储在区块链节点的所述消息队列中;
    若所述消息队列的当前状态信息符合预设繁忙状态标准,且所述消息价值等级大于所述第一预设等级阈值、且小于或等于第二预设等级阈值,则取消将所述消息数据存储在区块链节点的所述消息队列中;
    若所述消息价值等级大于所述第二预设等级阈值,则确定将所述消息数据存储在区块链节点的所述消息队列中;
    所述根据所述消息数据对应的消息主题,将所述消息数据存储在与所述消息主题对应的消息队列中时,具体实现:
    若确定将所述消息数据存储在所述消息队列中,则将所述消息数据存储在区块链节点的所述消息队列中。
  18. 根据权利要求14所述的计算机设备,其中,所述处理器执行所述程序时还用于实现:
    记录所述消息数据存入所述消息队列时的时间戳;
    定时或不定时根据记录的时间戳,清理所述消息队列中的过期消息数据;
    所述向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据时,具体实现:
    向所述目标消息节点,推送所述消息队列中时间戳符合预设时间范围的消息数据。
  19. 根据权利要求14所述的计算机设备,其中,在所述向订阅所述消息主题的目标消息节点,推送所述消息队列中的消息数据之后,所述处理器执行所述程序时还用于实现:
    接收第一目标消息节点发送的目标消息数据的转发请求,所述转发请求是所述第一目标消息节点根据订阅推送的所述消息数据发送的,所述转发请求中携带有第二目标消息节点的节点标识,所述节点标识是根据进程号和进程名称生成的;
    根据所述节点标识,将所述目标消息数据转发给所述第二目标消息节点。
  20. 根据权利要求14所述的计算机设备,其中,所述处理器执行所述程序时还用于实现:
    获取已接入的消息节点;
    确定所述已接入的消息节点各自对应的节点类型;
    向所述已接入的消息节点发送与其对应节点类型的消息数据。
PCT/CN2020/117776 2020-05-15 2020-09-25 基于机器人操作系统的消息处理方法、装置及计算机设备 WO2021114816A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010411167.2A CN111694644A (zh) 2020-05-15 2020-05-15 基于机器人操作系统的消息处理方法、装置及计算机设备
CN202010411167.2 2020-05-15

Publications (1)

Publication Number Publication Date
WO2021114816A1 true WO2021114816A1 (zh) 2021-06-17

Family

ID=72477786

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117776 WO2021114816A1 (zh) 2020-05-15 2020-09-25 基于机器人操作系统的消息处理方法、装置及计算机设备

Country Status (2)

Country Link
CN (1) CN111694644A (zh)
WO (1) WO2021114816A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709216A (zh) * 2021-08-06 2021-11-26 支付宝(杭州)信息技术有限公司 一种向业务系统推送信息的方法及装置
CN115037758A (zh) * 2022-04-27 2022-09-09 浪潮通信技术有限公司 消息同步方法及服务器
CN116909780A (zh) * 2023-09-12 2023-10-20 天津卓朗昆仑云软件技术有限公司 基于内存的本地分布式队列插件、系统和队列处理方法

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111694644A (zh) * 2020-05-15 2020-09-22 平安科技(深圳)有限公司 基于机器人操作系统的消息处理方法、装置及计算机设备
CN111949418B (zh) * 2020-07-10 2023-10-24 北京思特奇信息技术股份有限公司 一种订阅消息处理方法和装置
CN112785432B (zh) * 2021-01-22 2022-02-18 支付宝(杭州)信息技术有限公司 基于区块链的设备控制方法、装置、设备和存储介质
CN113967912A (zh) * 2021-10-21 2022-01-25 深圳市亚博智能科技有限公司 一种机器人控制系统及其控制方法
CN117573907B (zh) * 2024-01-16 2024-04-26 北京航空航天大学杭州创新研究院 一种移动机器人数据存储方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6408328B1 (en) * 1996-04-05 2002-06-18 Harry R. Haury Self configuring peer to peer inter process messaging system
CN106534338A (zh) * 2016-12-05 2017-03-22 东北大学 一种云机器人系统及实现方法
US20180270331A1 (en) * 2013-09-13 2018-09-20 John Wason System and method for implementing augmented object members for remote procedure call
CN109889455A (zh) * 2019-02-15 2019-06-14 浙江吉利汽车研究院有限公司 一种实时消息处理装置
CN111694644A (zh) * 2020-05-15 2020-09-22 平安科技(深圳)有限公司 基于机器人操作系统的消息处理方法、装置及计算机设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102083009A (zh) * 2009-11-27 2011-06-01 中国移动通信集团山东有限公司 数据信息发送方法及装置
CN107872494B (zh) * 2016-09-28 2020-12-08 腾讯科技(深圳)有限公司 一种消息推送方法和装置
CN106777228A (zh) * 2016-12-26 2017-05-31 北京金山安全软件有限公司 一种消息推送方法、装置及电子设备
US10713692B2 (en) * 2017-10-13 2020-07-14 Oath Inc. Systems and methods for user propensity classification and online auction design
CN110875935B (zh) * 2018-08-30 2023-03-24 阿里巴巴集团控股有限公司 消息发布、处理、订阅方法、装置及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6408328B1 (en) * 1996-04-05 2002-06-18 Harry R. Haury Self configuring peer to peer inter process messaging system
US20180270331A1 (en) * 2013-09-13 2018-09-20 John Wason System and method for implementing augmented object members for remote procedure call
CN106534338A (zh) * 2016-12-05 2017-03-22 东北大学 一种云机器人系统及实现方法
CN109889455A (zh) * 2019-02-15 2019-06-14 浙江吉利汽车研究院有限公司 一种实时消息处理装置
CN111694644A (zh) * 2020-05-15 2020-09-22 平安科技(深圳)有限公司 基于机器人操作系统的消息处理方法、装置及计算机设备

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709216A (zh) * 2021-08-06 2021-11-26 支付宝(杭州)信息技术有限公司 一种向业务系统推送信息的方法及装置
CN115037758A (zh) * 2022-04-27 2022-09-09 浪潮通信技术有限公司 消息同步方法及服务器
CN116909780A (zh) * 2023-09-12 2023-10-20 天津卓朗昆仑云软件技术有限公司 基于内存的本地分布式队列插件、系统和队列处理方法
CN116909780B (zh) * 2023-09-12 2023-11-17 天津卓朗昆仑云软件技术有限公司 基于内存的本地分布式队列插件、系统和队列处理方法

Also Published As

Publication number Publication date
CN111694644A (zh) 2020-09-22

Similar Documents

Publication Publication Date Title
WO2021114816A1 (zh) 基于机器人操作系统的消息处理方法、装置及计算机设备
JP2019067387A (ja) 異常検出のためのシステム、方法、およびコンピュータプログラム製品
CN110209820B (zh) 用户标识检测方法、装置及存储介质
US10754869B2 (en) Managing data format of data received from devices in an internet of things network
US20090083210A1 (en) Exchange of syncronization data and metadata
CN108306804A (zh) 一种Ethercat主站控制器及其通信方法和系统
CN113127307A (zh) 溯源请求的处理方法、相关装置、系统及存储介质
CN109039803A (zh) 一种处理回调通知消息的方法、系统及计算机设备
JP7339321B2 (ja) 機械学習モデル更新方法、コンピュータプログラムおよび管理装置
US10044838B2 (en) Method of automatically setting protocol in programmable logic controller system
CN113630463B (zh) 一种基于kubeedge的智慧教室录播终端设备管理系统及方法
CN104270432B (zh) 基于钻井行业实时数据服务系统及数据交互方法
CN107800780B (zh) 数据服务方法、装置、存储介质和计算机设备
US20100217423A1 (en) Method for Providing Functions in an Industrial Automation System, Control Program and Industrial Automation System
CN112541038A (zh) 时序数据管理方法、系统、计算设备及存储介质
Lee et al. Cooperative big data processing engine for fast reaction in internet of things environment: greater than the sum of its parts
CN111400598A (zh) 信息推送方法、服务器、多端口转发器和存储介质
CN113641509A (zh) 一种物联网数据处理方法及装置
CN112693502A (zh) 基于大数据架构的城市轨道交通监察系统及方法
CN117290428B (zh) 物联设备的数据管理方法、设备和可读存储介质
CN114691373B (zh) 边缘计算设备接口通信方法、边缘节点设备及存储介质
CN113542103B (zh) 社交通信群组中账号的邀请监测方法、装置及移动终端
WO2017023322A1 (en) Influence spread maximization in social networks
CN117132348A (zh) 资源交互方法、装置、计算机设备和存储介质
CN117406960A (zh) 一种敏捷分析场景的低代码社交数据计算平台和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20897857

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20897857

Country of ref document: EP

Kind code of ref document: A1