# US 2018/0321994 A1 · Method and apparatus for monitoring a message transmission frequency in a robot operating system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2018/0321994 A1
- Document ID: US20180321994A1
- Status: Published application
- Kind: A1
- Application number: 16/039,144
- Filed: 2018-07-18
- Published: 2018-11-08
- Earliest claimed: 2016-09-06
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science and Technology Co., Ltd.
- Inventors: Yu MA; Weide ZHANG; Wei HE; Haifeng WANG; Yibing LIANG; Zhuo CHEN
- Web page: https://patentgrep.com/patent/US20180321994A1

## CPC

- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06F 11/3006: {where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems (multiprogramming arrangements G06F9/46; allocation of resources G06F9/50)}
- G06F 11/3013: {where the computing system is an embedded system, i.e. a combination of hardware and software dedicated to perform a certain function in mobile devices, printers, automotive or aircraft systems (testing or monitoring of control systems or parts thereof G05B23/02)}
- G06F 11/3024: {where the computing system component is a central processing unit [CPU]}
- G06F 11/3055: {Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available (error or fault processing without redundancy G06F11/0703; error detection or correction by redundancy in data representation G06F11/08; error detection or correction of the data by redundancy in operations G06F11/14; error detection or correction by redundancy in hardware G06F11/16)}
- G06F 11/3072: {where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting}
- G06F 2201/81: Threshold
- G06F 2209/508: Monitor
- Y10S 901/50: Miscellaneous
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

This disclosure discloses a method and apparatus for monitoring a message transmission frequency in a robot operating system. A specific implementation of the method includes: writing to-be-transmitted messages, into a pre-allocated memory; obtaining time points when the to-be-transmitted messages are written into the memory, and recording the time points in a preset time point list; determining a message transmission frequency within a preset time interval based on the time points in the time point list; and comparing the message transmission frequency with a preset message transmission frequency threshold, and generating monitoring information based on a comparing result. This implementation monitors the message transmission frequency of a process to thereby avoid information codes related to monitoring of each application from being added to the application so as to reduce the program debuging cost, and improve the monitoring efficiency.

## Claims

### Claim 1

A method for monitoring a message transmission frequency in a robot operating system to reduce program debugging cost or improve monitoring efficiency, comprising:
writing to-be-transmitted messages into a pre-allocated memory;
obtaining time points when the to-be-transmitted messages are written into the memory, and recording the time points in a preset time point list;
determining a message transmission frequency within a preset time interval based on the time points in the time point list;
comparing the message transmission frequency with a preset message transmission frequency threshold; and
generating monitoring information based on a comparing result,
wherein the determining the message transmission frequency within the preset time interval based on the time points in the time point list comprises:
counting a number of the time points in the time point list within the preset time interval, and determining the number of the time points as a message transmission number; and
determining the message transmission frequency based on the message transmission number and the time points in the time point list,
the determining the message transmission frequency based on the message transmission number and the time points in the time point list comprises:
retrieving an earliest time point within the preset time interval from the time point list as a first message transmission time point;
retrieving a latest time point within the preset time interval from the time point list as a last message transmission time point; and
calculating the message transmission frequency in an equation of:
f
=
n
-
1
T
n
-
T
1
,
where T1 represents the first message transmission time point, Tn represents the last message transmission time point, n represents the message transmission number, wherein n is a positive integer greater than or equal to 2, and f represents the message transmission frequency.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising:
loading a preset configuration file, wherein the configuration file is retrieved when a process is started, and the configuration file comprises identification information of the process, the message transmission frequency threshold, and transmission protocol information of the robot operating system.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the obtaining the time points when the to-be-transmitted messages are written into the memory, and recording the time points in the preset time point list comprises:
invoking a preset notification function to record the time points when the to-be-transmitted messages are written into the memory.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the obtaining the time points when the to-be-transmitted messages are written into the memory, and recording the time points in the preset time point list comprises:
if the time point list is full, removing an earliest time point in the time point list according to an order of the time points when the to-be-transmitted messages are written into the memory recorded in the time point list, and adding the obtained time point to the time point list.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the monitoring information comprises a monitoring level, and
the comparing the message transmission frequency with the preset message transmission frequency threshold, and generating the monitoring information based on the comparing result comprises:
generating the monitoring information at a first monitoring level, if the message transmission frequency is above a first preset message transmission frequency threshold and below a second preset message transmission frequency threshold;
generating the monitoring information at a second monitoring level, if the message transmission frequency is above the second preset message transmission frequency threshold and below a third preset message transmission frequency threshold; and
generating the monitoring information at a third monitoring level, if the message transmission frequency is below the first preset message transmission frequency threshold or above the third preset message transmission frequency threshold; and
determining a message transmission state based on the monitoring information.

### Claim 6 (depends on 1)

The method according to claim 1, further comprising:
sending the monitoring information to a server supporting the robot operating system.

### Claim 7

An apparatus for monitoring a message transmission frequency in a robot operating system to reduce program debugging cost or improve monitoring efficiency, the apparatus comprising:
at least one processor; and
a memory storing instructions, the instructions when executed by the at least one processor, cause the at least one processor to perform operations, the operations comprising:
writing to-be-transmitted messages into a pre-allocated memory;
obtaining time points when the to-be-transmitted messages are written into the memory, and recording the time points in a preset time point list;
determining a message transmission frequency within a preset time interval based on the time points in the time point list; and
comparing the message transmission frequency with a preset message transmission frequency threshold, and generating monitoring information based on a comparing result,
wherein the determining the message transmission frequency within the preset time interval based on the time points in the time point list comprises:
counting a number of the time points in the time point list within the preset time interval, and determining the number of the time points as a message transmission number; and
determining the message transmission frequency based on the message transmission number and the time points in the time point list,
the determining the message transmission frequency based on the message transmission number and the time points in the time point list comprises:
retrieving an earliest time point within the preset time interval from the time point list as a first message transmission time point;
retrieving a latest time point within the preset time interval from the time point list as a last message transmission time point; and
calculating the message transmission frequency in an equation of:
f
=
n
-
1
T
n
-
T
1
,
where T1 represents the first message transmission time point, Tn represents the last message transmission time point, n represents the message transmission number, wherein n is a positive integer greater than or equal to 2, and f represents the message transmission frequency.

### Claim 8 (depends on 7)

The apparatus according to claim 7, wherein the operations further comprise:
loading a preset configuration file, wherein the configuration file is retrieved when a process is started, and the configuration file comprises identification information of the process, the message transmission frequency threshold, and transmission protocol information of the robot operating system.

### Claim 9 (depends on 7)

The apparatus according to claim 7, wherein the obtaining the time points when the to-be-transmitted messages are written into the memory, and recording the time points in the preset time point list comprises:
invoking a preset notification function to record the time points when the to-be-transmitted messages are written into the memory.

### Claim 10 (depends on 9)

The apparatus according to claim 9, wherein the obtaining the time points when the to-be-transmitted messages are written into the memory, and recording the time points in the preset time point list comprises:
if the time point list is full, removing an earliest time point in the time point list according to an order of the time points when the to-be-transmitted messages are written into the memory recorded in the time point list, and adding the obtained time point to the time point list.

### Claim 11 (depends on 7)

The apparatus according to claim 7, wherein the monitoring information comprises a monitoring level, and
the comparing the message transmission frequency with the preset message transmission frequency threshold, and generating the monitoring information based on the comparing result comprises:
generating the monitoring information at a first monitoring level, if the message transmission frequency is above a first preset message transmission frequency threshold and below a second preset message transmission frequency threshold;
generating the monitoring information at a second monitoring level, if the message transmission frequency is above the second preset message transmission frequency threshold and below a third preset message transmission frequency threshold; and
generating the monitoring information at a third monitoring level, if the message transmission frequency is below the first preset message transmission frequency threshold or above the third preset message transmission frequency threshold; and
determining a message transmission state based on the monitoring information.

### Claim 12 (depends on 7)

The apparatus according to claim 7, wherein operations further comprise:
sending the monitoring information to a server supporting the robot operating system.

### Claim 13

A non-transitory computer-readable storage medium storing a computer program, the computer program when executed by one or more processors, causes the one or more processors to perform operations, the operations comprising:
writing to-be-transmitted messages into a pre-allocated memory;
obtaining time points when the to-be-transmitted messages are written into the memory, and recording the time points in a preset time point list;
determining a message transmission frequency within a preset time interval based on the time points in the time point list;
comparing the message transmission frequency with a preset message transmission frequency threshold; and
generating monitoring information based on a comparing result,
wherein the determining the message transmission frequency within the preset time interval based on the time points in the time point list comprises:
counting a number of the time points in the time point list within the preset time interval, and determining the number of the time points as a message transmission number; and
determining the message transmission frequency based on the message transmission number and the time points in the time point list,
the determining the message transmission frequency based on the message transmission number and the time points in the time point list comprises:
retrieving an earliest time point within the preset time interval from the time point list as a first message transmission time point;
retrieving a latest time point within the preset time interval from the time point list as a last message transmission time point; and
calculating the message transmission frequency in an equation of:
f
=
n
-
1
T
n
-
T
1
,
where T1 represents the first message transmission time point, Tn represents the last message transmission time point, n represents the message transmission number, wherein n is a positive integer greater than or equal to 2, and f represents the message transmission frequency.
