IP Library Granted Patent US 10,055,265
Granted Patent B2
US 10,055,265 · App. 15/410,446 · Granted Aug 21, 2018

Method and apparatus for monitoring a message transmission frequency in a robot operating system

Inventors: Yu Ma (Beijing, CN); Weide Zhang (Beijing, CN); Wei He (Beijing, CN); Haifeng Wang (Beijing, CN); Yibing Liang (Beijing, CN); Zhuo Chen (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.
G06F9/546G06F11/3024G06F11/3055Y10S901/50
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,055,265
App. No.
15/410,446
Granted
Aug 21, 2018
Kind
B2
Abstract

This discolor 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 debugging cost, and improve the monitoring efficiency.

Claims (81)

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 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; and

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.

2. 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.

3. The method according to claim 1 , 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.

4. The method according to claim 3 , wherein 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, T n 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.

5. 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.

6. The method according to claim 1 , further comprising:

sending the monitoring information to a server supporting the robot operating system.

7. An apparatus for monitoring a message transmission frequency in a robot operating system to reduce program debugging cost or improve monitoring efficiency, comprising:

a writing unit configured to write to-be-transmitted messages into a pre-allocated memory;

an obtaining unit configured to obtain time points when the to-be-transmitted messages are written into the memory, and to record the time points in a preset time point list;

a determining unit configured to determine a message transmission frequency within a preset time interval based on the time points in the time point list; and

a generating unit configured to compare the message transmission frequency with a preset message transmission frequency threshold, and to generate monitoring information based on a comparing result,

wherein the obtaining unit comprises:

an invoking sub-unit configured to invoke a preset notification function to record the time points when the to-be-transmitted messages are written into the memory, and the obtaining unit is further configured to remove 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 add the obtained time point to the time point list, if the time point list is full.

8. The apparatus according to claim 7 , further comprising:

a loading unit configured to load a preset configuration file, wherein the configuration file is retrieved when processes are started, and the configuration file comprises identification information of the processes, the message transmission frequency threshold, and transmission protocol information of the robot operating system.

9. The apparatus according to claim 7 , wherein the determining unit comprises:

a counting sub-unit configured to count a number of the time points in the time point list within the preset time interval, and to determine the number of time points as a message transmission number; and

a determining sub-unit configured to determine the message transmission frequency based on the message transmission number and the time points in the time point list.

10. The apparatus according to claim 9 , wherein the determining sub-unit is further configured to:

retrieve an earliest time point within the preset time interval from the time point list of as a first message transmission time point; retrieve a latest time point within the preset time interval from the time point list as a last message transmission time point; and calculate the message transmission frequency in an equation of:

f

=

n

-

1

T

n

-

T

1

,

where T1 represents the first message transmission time point, T n 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.

11. The apparatus according to claim 7 , wherein the monitoring information comprises a monitoring level, and

the generating unit is further configured to:

generate 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;

generate 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

generate 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

determine a message transmission state based on the monitoring information.

12. The apparatus according to claim 7 , wherein the apparatus is further configured to:

send the monitoring information to a server supporting the robot operating system.

13. A non-transitory storage medium storing one or more programs, the one or more programs when executed by a device, causing the device to perform a method for monitoring a message transmission frequency in a robot operating system to reduce program debugging cost or improve monitoring efficiency, the method 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 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; and

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.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 23, 2017
From: MA, YU; ZHANG, WEIDE; HE, WEI; WANG, HAIFENG; LIANG, YIBING; CHEN, ZHUO
To: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.
Reel/Frame 041074/0219 →
Priority Claims (1)
CN 2016 1 0806462 · Sep 6, 2016 · national
Continuity (1)
Related Publication 20180067788A1 · Mar 8, 2018