US20180321995A1 - Method and apparatus for monitoring a message transmission frequency in a robot operating system - Google Patents
Method and apparatus for monitoring a message transmission frequency in a robot operating system Download PDFInfo
- Publication number
- US20180321995A1 US20180321995A1 US16/039,151 US201816039151A US2018321995A1 US 20180321995 A1 US20180321995 A1 US 20180321995A1 US 201816039151 A US201816039151 A US 201816039151A US 2018321995 A1 US2018321995 A1 US 2018321995A1
- Authority
- US
- United States
- Prior art keywords
- message transmission
- transmission frequency
- time point
- preset
- monitoring
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/32—Monitoring with visual or acoustical indication of the functioning of the machine
- G06F11/324—Display of status information
- G06F11/325—Display of status information by lamps or LED's
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3006—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3013—Monitoring arrangements specially adapted to the computing system or computing system component being monitored 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3024—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
- G06F11/3072—Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/81—Threshold
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/508—Monitor
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y10—TECHNICAL SUBJECTS COVERED BY FORMER USPC
- Y10S—TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y10S901/00—Robots
- Y10S901/50—Miscellaneous
Definitions
- the present application generally relates to the field of computer technology, particularly to the field of Internet technology, and more particularly to a method and apparatus for monitoring a message transmission frequency in a robot operating system.
- a Robot Operating System is a standard open source code operating system, it provides a series of software frameworks and utilities to assist a software developer in creating application software, and to provide hardware abstraction, control on underlying devices, implementation of common functions, inter-process message communication, management on data packets, and other functions.
- the ROS is a distributed processing framework in which the developer can individually design an executable file. Different processes can receive and publish various information (e.g., sensing, control, states, plans).
- There are applications running in the robot operating system each of which can be regarded as a node. The robot operating system provides its own solution to monitor message transmission frequencies of the respective nodes.
- the respective nodes on which the operating system operates are monitored separately, at the same time information related to monitoring of the respective nodes is added to each node, thus increasing the development and testing cost, and incurring technical problems in operation.
- This monitoring method may also have difficulties to monitor a message transmission frequency of a third-party node.
- An objective of the present application is to provide an improved method and apparatus for monitoring a message transmission frequency in a robot operating system so as to address the technical problem mentioned in the foregoing Background section.
- an embodiment of the present application provides an improved method for monitoring a message transmission frequency in a robot operating system, the method including: 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.
- the method further includes: 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 processes, the message transmission frequency threshold, and transmission protocol information of the robot operating system.
- 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.
- 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.
- 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:
- T1 represents the first message transmission time point
- T n represents the last message transmission time point
- n represents the message transmission number
- n is a positive integer greater than or equal to 2
- f represents the message transmission frequency
- the monitoring information comprises a monitoring level
- 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.
- the method further further comprising: sending the monitoring information to a server supporting the robot operating system.
- an embodiment of the present application provides an apparatus for monitoring a message transmission frequency in a robot operating system, the apparatus including: 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.
- the apparatus further comprises: a loading unit configured to load a preset configuration file, wherein the configuration file is retrieved when processes are started, and the configuration file includes identification information of the processes, the message transmission frequency thresholds, and transmission protocol information of the robot operating system.
- the obtaining unit includes: 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.
- 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.
- the determining unit includes: 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.
- 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:
- T1 represents the first message transmission time point
- T n represents the last message transmission time point
- n represents the message transmission number
- n is a positive integer greater than or equal to 2
- f represents the message transmission frequency
- the monitoring information includes 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.
- the apparatus is further configured: to send the monitoring information to a server supporting the robot operating system.
- the to-be-transmitted messages are written into the pre-allocated memory, the time points when the to-be-transmitted messages are written into the memory are recorded in the preset time point list; thereafter the message transmission frequency within the predetermined time interval is determined based on the time points recorded in the time point list; and finally the message transmission frequency is compared with a preset message transmission frequency threshold, and the monitoring information is generated based on the comparing result, to thereby reduce the program debugging cost, and improve the monitoring efficiency.
- FIG. 1 is an architectural diagram of an exemplary system in which the present application may be implemented
- FIG. 2 is a flow chart of a method for monitoring a message transmission frequency in a robot operating system according to an embodiment of the present application
- FIG. 3 is a schematic diagram of an application scenario of a method for monitoring a message transmission frequency in a robot operating system according to the present application
- FIG. 4 is a flow chart of a method for monitoring a message transmission frequency in a robot operating system according to another embodiment of the present application
- FIG. 5 is a schematic structural diagram of a apparatus for monitoring a message transmission frequency in a robot operating system according to of an embodiment the present application.
- FIG. 6 is a schematic structural diagram of a computer system adapted to implement a terminal device or a server of the embodiments of the present application.
- FIG. 1 illustrates an exemplary system architecture 100 in which a method or apparatus for monitoring a message transmission frequency in a robot operating system according to an embodiment of the present application may be implemented.
- the system architecture 100 may include a driverless vehicle 101 , a cloud server 106 , and a network 105 .
- the network serves as a medium providing a communication link between the driverless vehicle 101 and the cloud server 106 .
- the network 105 may include various types of connections, e.g., wired or wireless communication links, or optic fiber cables.
- the cloud server 106 may be a server providing various services, e.g., a server configured to provide the driverless vehicle 101 with a message transmission abnormality indication.
- the driverless vehicle 101 may be provided with acquiring devices 102 and 103 , and a vehicle-mounted controller 104 .
- the acquiring devices 102 and 103 may transmit acquired information to the vehicle-mounted controller 104 in various communication ways (e.g., over a wired or wireless communication link, or an optic fiber cable).
- the acquiring devices 102 and 103 may be various electronic devices acquiring surrounding environment information, including but not limited to a camera, a radar, etc.
- the vehicle-mounted controller 104 uses an improved robot operating system to convert the surrounding environment information acquired by the acquiring devices 102 and 103 , and the message transmission abnormality indication information provided by the backend server 106 into control information, so that the vehicle travels stably and precisely on a road.
- the method for monitoring the message transmission frequency in the robot operating system according to an embodiment of the present application is generally performed by the vehicle-mounted controller 104 , and accordingly an apparatus for monitoring a message transmission frequency in a robot operating system according to an embodiment of the present application is generally provided in the vehicle-mounted controller 104 .
- FIG. 1 the numbers of acquiring devices, driverless vehicles, and backend servers in FIG. 1 are merely illustrative. Any number of acquiring devices, driverless vehicles, and backend servers may be provided based on the actual requirements.
- the vehicle-mounted controller may also operate separately without any backend server or network.
- FIG. 2 illustrating a flow 200 of a method for monitoring a message transmission frequency in a robot operating system according to an embodiment of the present application.
- the method for monitoring the message transmission frequency in the robot operating system includes the following steps:
- Step 201 write to-be-transmitted messages into a pre-allocated memory.
- the memory configured to store the to-be-transmitted messages is pre-allocated in an operating system on which the method for monitoring the message transmission frequency in the robot operating system operates in FIG. 1 (e.g., the robot operating system in the vehicle-mounted controller illustrated in FIG. 1 ), where the to-be-transmitted messages may be received messages, or messages to be sent.
- the memory may be a shared memory, where the shared memory refers to a memory accessible to different processes in a multi-process computer.
- the process that sends messages may store the to-be-transmitted messages into the shared memory pre-allocated by the robot operating system, and the process that receives messages may retrieve the messages from the shared memory in accordance with a transmission protocol between the two processes, thus realizing the communication between the processes.
- Step 202 obtain time points when the to-be-transmitted messages are written into the memory, and record the time points in a preset time point list.
- each application corresponds to at least one process, and each process may be regarded as a process node; and if there is a to-be-transmitted message between the processes, the time point when one of the processes writes the to-be-transmitted message into the memory will be obtained, and the obtained time point will be recorded in the time point list. Since there are a number of processes in the robot operating system, such a time point list is preset for each process that records message transmission time points of the process.
- the data recording approach of the above-mentioned time point list may be a circular recording approach, that is, the time points may be recorded sequentially in the time point list in the order of time, and after all the resources in the time point list are occupied, if there is a time point to be recorded, the data with the earliest recording time point will be shifted cyclically out of the time point list, and the latest time point will be populated at the location vacant after the data are shifted.
- Step 203 determine a message transmission frequency within a preset time interval based on the time points in the time point list.
- the robot operating system may retrieve the time points within the predetermined time interval from the time point list based on the time points when the messages are written into the memory recorded in the time point list in step 202 , and determine the message transmission frequency within the time interval based on the time points in the period of time. For example, the robot operating system may count the number of messages written into the memory within a time interval. If the interval of time is 2 seconds, the number of messages within the 2 seconds will be counted to thereby determine the message transmission frequency within the 2 seconds.
- Step 204 compare the message transmission frequency with a preset message transmission frequency threshold, and generate monitoring information based on a comparing result.
- the message transmission frequency obtained in step 203 is compared with the preset message transmission frequency thresholds, and the monitoring information related to the comparing result is generated based on the result.
- the monitoring information may be a comparison report which has not been processed, or a message transmission frequency alarm report obtained as a result of an analysis by a preset diagnosis system.
- FIG. 3 is a schematic diagram 300 of an application scenario of the method for monitoring a message transmission frequency in a robot operating system according to this embodiment.
- the vehicle-mounted controller firstly initiates an instruction to the robot operating system to monitor a message transmission frequency of a message sending process of a vehicle speed sensor, and after a message sending process writes messages into the memory pre-allocated in the robot operating system, time points when the messages are written into the memory are recorded at this time into the time point list preset in the robot operating system. For example, 6 time points when the messages are written into the memory, i.e., “Time point 1 ” to “Time point 6 ”, are recorded in the time point list in FIG.
- the message transmission frequency of the message sending process will be “12 times per second”, and the robot operating system will compare the actually obtained message transmission frequency with the preset message transmission frequency thresholds, generate monitoring information based on the comparing result, and monitor the message sending process.
- the time points when the messages are transmitted are recorded, the actual message transmission frequency is determined and compared with the preset message transmission frequency thresholds, and the monitoring information is generated, thereby reducing the program debugging cost and improving the monitoring efficiency.
- FIG. 4 illustrating a flow 400 of a method for monitoring a message transmission frequency in a robot operating system according to of another embodiment the present application.
- the flow 400 of the method for monitoring the message transmission frequency in the robot operating system includes the following steps:
- Step 401 write to-be-transmitted messages into a pre-allocated memory.
- the memory configured to store the to-be-transmitted messages is pre-allocated in an operating system on which the method for monitoring the message transmission frequency in the robot operating system operates (e.g., the robot operating system in the vehicle-mounted controller illustrated in FIG. 1 ), where the to-be-transmitted messages may be received messages, or messages to be sent.
- the to-be-transmitted messages may be stored into the memory pre-allocated in the robot operating system.
- Step 402 load a preset configuration file.
- processes in the operating system on which the method for monitoring the message transmission frequency in the robot operating system operates may communicate a message with each other by subscribing to a topic, that is, a topic is a protocol.
- each application corresponds to at least one process, and each process may be regarded as a process node; and the nodes may transmit a message with each other by putting the message into one or more topics, and the nodes may issue a message in a topic, and alike receive a message by subscribing to a topic.
- the node may issue a message regardless whether there is another node to receive the message.
- the robot operating system operating on the vehicle-mounted controller loads automatically the configuration file in which process identification information of each of the processes is stored.
- the process identification information may be a process identifier, for example.
- Transmission protocol information is further stored in the configuration file. Since a protocol in the robot operating system is a topic, it should be appreciated that the transmission protocol information here is a topic name; and preset message transmission frequency thresholds are further stored in the configuration file.
- Step 403 invoke a preset notification function to record time points when the to-be-transmitted messages are written into the memory.
- the robot operating system in the vehicle-mounted controller may have the preset notification function, and after the messages are written into the memory in step 401 , the notification function is invoked by a main function of the message transmitting process to record the time points when the to-be-transmitted messages are written into the memory.
- step 4031 is performed in the notification function:
- the step 4031 is to obtain the time points when the to-be-transmitted messages are written into the memory, and to record the time points into a preset time point list.
- the time point list is further preset in the robot operating system, and the notification function obtains the time points when the to-be-transmitted messages are written into the memory, and then records the obtained time points into the time point list.
- the earliest time point recorded in the time point list will be removed according to the order of the time points when the to-be-transmitted messages are written into the memory recorded in the time point list, and thereafter the obtained time point will be added to the preset time point list.
- Step 404 count the number of time points in the time point list within the preset time interval, and determine the number of time points as the message transmission number.
- a message transmitting thread may count the number of time points in the time point list within the preset time interval based on the time points recorded in the time point list in step 403 , and also determine the number of time points as the message transmission number of the message transmitting process in the robot operating system within the predetermined period of time.
- Step 405 determine the message transmission frequency based on the message transmission number and the time points in the time point list.
- the message transmission frequency may be determined based on the message transmission number obtained in step 404 , and the time points recorded in the time point list. For example, the message transmission number within one second may be counted and determined as the message transmission frequency of the message transmitting process.
- the earliest time point in the preset time interval is retrieved from the time point list as a first message transmission time point.
- the latest time point in the preset time interval is retrieved from the time point list as a last message transmission time point.
- the message transmission frequency of the current process is calculated in the equation of:
- T 1 represents the first message transmission time point
- T n represents the last message transmission time point
- n represents the message transmission number
- n is a positive integer greater than or equal to 2
- f represents the message transmission frequency of the process.
- Step 406 compare the message transmission frequency with a preset message transmission frequency threshold, and generate monitoring information based on a comparing result.
- the message transmission frequency obtained in step 405 is compared with the preset message transmission frequency thresholds, and the monitoring information related to the comparing result is generated based on the result,
- the message transmission frequency thresholds are recorded in the configuration file, and retrieved directly when the configuration file is loaded in step 402 .
- the monitoring information further includes a 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, the monitoring information at a first monitoring level will be generated. If the message transmission frequency is above the second preset message transmission frequency threshold and below a third preset message transmission frequency threshold, the monitoring information at a second monitoring level will be generated. If the message transmission frequency is below the first preset message transmission frequency threshold or above the third preset message transmission frequency threshold, the monitoring information at a third monitoring level will be generated.
- the monitoring information at the first monitoring level may indicate that the message transmission frequency of the process is normal; the monitoring information at the third monitoring level may indicate that the message transmission frequency of the process is abnormal, and it may be determined that an application corresponding to the process is abnormal, based on the detected abnormal condition of the message transmission frequency of the process, and at this time the application will not be adopted; the monitoring information at the second monitoring level may indicate that the message transmission frequency of the process is critical, and at this time it may be determined whether the process is normal, based on the degree of importance of the application corresponding to the process.
- a number of sensors arranged on a driverless vehicle e.g., a sensor configured to control the vehicle to turn and controlled by a vehicle-mounted controller.
- the operating system operating on the vehicle-mounted controller is a robot operating system.
- a number of processes controlling the operating of the sensor may communicate with each other.
- a frequency threshold is preset in a configuration file, then if the message transmission frequency of the process is below 0.8 times the frequency threshold or above 1.1 times the frequency threshold, it will be determined that the message transmission frequency of the process at this time is abnormal, so that it may be determined that the sensor is operating abnormally; if the message transmission frequency is between 0.9 times the frequency threshold and 1.1 times the frequency threshold, it will be determined that the message transmission frequency of the process at this time is normal, and it will be determined whether the sensor is operating normally by further determining whether all the processes related to the operating sensor are normal; and if the message transmission frequency is between 0.8 times the frequency threshold and 0.9 times the frequency threshold, since the sensor configured to control turning is an important sensor of the driverless vehicle, it may be determined whether the sensor is operating normally by determining whether the other processes are operating normally, for example, if message transmission frequencies of the other processes are normal, it will be determined that the sensor is operating normally.
- Step 407 transmit the monitoring information to a server supporting the robot operating system.
- the robot operating system may send information about the message transmission frequency to the server supporting the robot operating system based on the monitoring information generated in step 406 .
- a monitoring thread can be created in the message transmitting process, and the monitoring thread is configured to send the monitoring information to the server, so that the server obtains the real-time message transmission state of the process.
- the configuration file is added into which firstly information, such as message transmission frequency thresholds, and transmission protocols, are stored; secondly the notification function is added so that the time points when the messages are written into the memory may be recorded using the notification function; and lastly the monitoring information is additionally transmitted to the server supporting the robot operating system, so that the process itself may monitor the message transmission frequency thereof, thereby increasing the flexibility in monitoring the message transmission frequency.
- firstly information such as message transmission frequency thresholds, and transmission protocols
- the notification function is added so that the time points when the messages are written into the memory may be recorded using the notification function
- the monitoring information is additionally transmitted to the server supporting the robot operating system, so that the process itself may monitor the message transmission frequency thereof, thereby increasing the flexibility in monitoring the message transmission frequency.
- the apparatus 500 for monitoring the message transmission frequency in the robot operating system includes a writing unit 501 , an obtaining unit 502 , a determining unit 503 , and a generating unit 504 .
- the writing unit 501 is configured to write to-be-transmitted messages into a pre-allocated memory
- the obtaining unit 502 is 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
- the determining unit 503 is configured to determine a message transmission frequency within a preset time interval based on the time points in the time point list
- the generating unit 504 is configured to compare the message transmission frequency with a preset message transmission frequency threshold, and to generate monitoring information based on a comparing result.
- the concrete processes of the writing unit 501 , the obtaining unit 502 , the determining unit 503 , and the generating unit 504 can refer to the detailed descriptions of the step 201 , the step 202 , the step 203 , and the step 204 in the embodiment corresponding to FIG. 2 , and will not be repeated herein.
- the apparatus 500 further includes a loading unit (not illustrated) configured to load a preset configuration file.
- the configuration file is retrieved when processes are started, and the configuration file includes identification information of the processes, the message transmission frequency thresholds, and transmission protocol information of the robot operating system.
- the obtaining unit 502 of the apparatus 500 includes an invoking sub-unit (not illustrated) configured to invoke a preset notification function to record the time points when the to-be-transmitted messages are written into the memory.
- the obtaining unit 502 of the apparatus 500 is further configured to, if the time point list is full, remove the earliest time point in the time point list according to the order of the time points when the to-be-transmitted messages are written into the memory recorded in the time point list, and thereafter add the obtained time point to the preset time point list.
- the determining unit 503 of the apparatus 500 includes: a counting sub-unit (not illustrated) configured to count the number of time points in the time point list within the preset time interval, and to determine the number of time points as the message transmission number; and a determining sub-unit (not illustrated) configured to determine the message transmission frequency based on the message transmission number, and the time points in the time point list.
- the determining sub-unit of the apparatus 500 is further configured: to retrieve the earliest time point within the preset time interval from the time point list as a first message transmission time point; to retrieve the latest time point within the preset time interval from the time point list as a last message transmission time point; and to calculate the message transmission frequency in the equation of:
- T 1 represents the first message transmission time point
- T n represents the last message transmission time point
- n represents the message transmission number
- n is a positive integer greater than or equal to 2
- f represents the message transmission frequency
- the monitoring information includes a monitoring level; and the generating unit 504 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.
- the apparatus 500 is further configured to send the monitoring information to a server supporting the robot operating system.
- FIG. 6 a schematic structural diagram of a computer system 600 adapted to implement a terminal apparatus of the embodiments of the present application is shown.
- the computer system 600 includes a central processing unit (CPU) 601 , which may execute various appropriate actions and processes in accordance with a program stored in a read-only memory (ROM) 602 or a program loaded into a random access memory (RAM) 603 from a storage portion 608 .
- the RAM 603 also stores various programs and data required by operations of the system 600 .
- the CPU 601 , the ROM 602 and the RAM 603 are connected to each other through a bus 604 .
- An input/output (I/O) interface 605 is also connected to the bus 604 .
- the following components are connected to the I/O interface 605 : an input portion 606 including a keyboard, a mouse etc.; an output portion 607 comprising a liquid crystal display device (LCD), a speaker, etc.; a storage portion 608 including a hard disk and the like; and a communication portion 609 comprising a network interface card, such as a LAN card and a modem.
- the communication portion 609 performs communication processes via a network, such as the Internet.
- a driver 610 is also connected to the I/O interface 605 as required.
- a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, and a semiconductor memory, may be installed on the driver 610 , to facilitate the retrieval of a computer program from the removable medium 611 , and the installation thereof on the storage portion 608 as needed.
- an embodiment of the present disclosure includes a computer program product, which comprises a computer program that is tangibly embedded in a machine-readable medium.
- the computer program comprises program codes for executing the method of the flow charts.
- the computer program may be downloaded and installed from a network via the communication portion 609 , and/or may be installed from the removable media 611 .
- the computer program when executed by the CPU 601 , executes the above-mentioned functions in the methods of the present application.
- each block in the flow charts and block diagrams may represent a module, a program segment, or a code portion.
- the module, the program segment, or the code portion comprises one or more executable instructions for implementing the specified logical function.
- the functions denoted by the blocks may occur in a sequence different from the sequences shown in the figures. For example, in practice, two blocks in succession may be executed, depending on the involved functionalities, substantially in parallel, or in a reverse sequence.
- each block in the block diagrams and/or the flow charts and/or a combination of the blocks may be implemented by a dedicated hardware-based system executing specific functions or operations, or by a combination of a dedicated hardware and computer instructions.
- the units involved in the embodiments of the present application may be implemented by way of software or hardware.
- the described units may also be provided in a processor, for example, described as: a processor, comprising a writing unit, an obtaining unit, a determining unit and a generating unit, where the names of these units are not considered as a limitation to the units or modules.
- the writing unit may also be described as “a unit for writing to-be-transmitted messages into a pre-allocated memory”.
- the present application further provides a computer readable storage medium.
- the computer readable storage medium may be the computer readable storage medium included in the apparatus in the above embodiments, or a stand-alone computer readable storage medium which has not been assembled into the apparatus.
- the computer readable storage medium stores one or more programs.
- the one or more programs when executed by a device, cause the device to perform a method for monitoring a message transmission frequency in a robot operating system, 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.
- inventive scope of the present application is not limited to the technical solutions formed by the particular combinations of the above technical features.
- inventive scope should also cover other technical solutions formed by any combinations of the above technical features or equivalent features thereof without departing from the concept of the invention, such as, technical solutions formed by replacing the features as disclosed in the present application with (but not limited to), technical features with similar functions.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Manipulator (AREA)
- Testing And Monitoring For Control Systems (AREA)
Abstract
Description
- This application claims the priority of Chinese Patent Application No. 201610806462.1, entitled “Method and Apparatus for Monitoring a Message Transmission Frequency in a Robot Operating System,” filed on Sep. 6, 2016, the content of which is incorporated herein by reference in its entirety.
- The present application generally relates to the field of computer technology, particularly to the field of Internet technology, and more particularly to a method and apparatus for monitoring a message transmission frequency in a robot operating system.
- A Robot Operating System (ROS) is a standard open source code operating system, it provides a series of software frameworks and utilities to assist a software developer in creating application software, and to provide hardware abstraction, control on underlying devices, implementation of common functions, inter-process message communication, management on data packets, and other functions. The ROS is a distributed processing framework in which the developer can individually design an executable file. Different processes can receive and publish various information (e.g., sensing, control, states, plans). There are applications running in the robot operating system, each of which can be regarded as a node. The robot operating system provides its own solution to monitor message transmission frequencies of the respective nodes.
- However in the solution provided by the existing robot operating systems to monitor the message transmission frequency, the respective nodes on which the operating system operates are monitored separately, at the same time information related to monitoring of the respective nodes is added to each node, thus increasing the development and testing cost, and incurring technical problems in operation. This monitoring method may also have difficulties to monitor a message transmission frequency of a third-party node.
- An objective of the present application is to provide an improved method and apparatus for monitoring a message transmission frequency in a robot operating system so as to address the technical problem mentioned in the foregoing Background section.
- In a first aspect, an embodiment of the present application provides an improved method for monitoring a message transmission frequency in a robot operating system, the method including: 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.
- In some embodiments, the method further includes: 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 processes, the message transmission frequency threshold, and transmission protocol information of the robot operating system.
- In some embodiments, 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.
- In some embodiments, 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.
- In some embodiments, 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.
- In some embodiments, 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:
-
- 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
- In some embodiments, 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.
- In some embodiments, the method further further comprising: sending the monitoring information to a server supporting the robot operating system.
- In a second aspect, an embodiment of the present application provides an apparatus for monitoring a message transmission frequency in a robot operating system, the apparatus including: 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.
- In some embodiments, the apparatus further comprises: a loading unit configured to load a preset configuration file, wherein the configuration file is retrieved when processes are started, and the configuration file includes identification information of the processes, the message transmission frequency thresholds, and transmission protocol information of the robot operating system.
- In some embodiments, the obtaining unit includes: 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.
- In some embodiments, 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.
- In some embodiments, the determining unit includes: 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.
- In some embodiments, 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:
-
- 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
- In some embodiments, the monitoring information includes 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.
- In some embodiments, the apparatus is further configured: to send the monitoring information to a server supporting the robot operating system.
- With the method and apparatus for monitoring a message transmission frequency in a robot operating system according to the embodiments of the present application, the to-be-transmitted messages are written into the pre-allocated memory, the time points when the to-be-transmitted messages are written into the memory are recorded in the preset time point list; thereafter the message transmission frequency within the predetermined time interval is determined based on the time points recorded in the time point list; and finally the message transmission frequency is compared with a preset message transmission frequency threshold, and the monitoring information is generated based on the comparing result, to thereby reduce the program debugging cost, and improve the monitoring efficiency.
- Other features, objectives, and advantages of the present application will become more apparent upon reading the detailed description to non-limiting embodiments made with reference to the accompanying drawings, wherein:
-
FIG. 1 is an architectural diagram of an exemplary system in which the present application may be implemented; -
FIG. 2 is a flow chart of a method for monitoring a message transmission frequency in a robot operating system according to an embodiment of the present application; -
FIG. 3 is a schematic diagram of an application scenario of a method for monitoring a message transmission frequency in a robot operating system according to the present application; -
FIG. 4 is a flow chart of a method for monitoring a message transmission frequency in a robot operating system according to another embodiment of the present application; -
FIG. 5 is a schematic structural diagram of a apparatus for monitoring a message transmission frequency in a robot operating system according to of an embodiment the present application; and -
FIG. 6 is a schematic structural diagram of a computer system adapted to implement a terminal device or a server of the embodiments of the present application. - The present application will be further described below in detail in combination with the accompanying drawings and the embodiments. It should be appreciated that the specific embodiments described herein are merely used for explaining the relevant invention, rather than limiting the invention. In addition, it should be noted that, for the ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
- It should also be noted that the embodiments in the present application and the features in the embodiments may be combined with each other on a non-conflict basis. The present application will be described below in detail with reference to the accompanying drawings and in combination with the embodiments.
-
FIG. 1 illustrates anexemplary system architecture 100 in which a method or apparatus for monitoring a message transmission frequency in a robot operating system according to an embodiment of the present application may be implemented. - As illustrated in
FIG. 1 , thesystem architecture 100 may include adriverless vehicle 101, acloud server 106, and anetwork 105. The network serves as a medium providing a communication link between thedriverless vehicle 101 and thecloud server 106. Thenetwork 105 may include various types of connections, e.g., wired or wireless communication links, or optic fiber cables. - The
cloud server 106 may be a server providing various services, e.g., a server configured to provide thedriverless vehicle 101 with a message transmission abnormality indication. - The
driverless vehicle 101 may be provided with acquiringdevices controller 104. The acquiringdevices controller 104 in various communication ways (e.g., over a wired or wireless communication link, or an optic fiber cable). The acquiringdevices controller 104 uses an improved robot operating system to convert the surrounding environment information acquired by the acquiringdevices backend server 106 into control information, so that the vehicle travels stably and precisely on a road. - It should be noted that that the method for monitoring the message transmission frequency in the robot operating system according to an embodiment of the present application is generally performed by the vehicle-mounted
controller 104, and accordingly an apparatus for monitoring a message transmission frequency in a robot operating system according to an embodiment of the present application is generally provided in the vehicle-mountedcontroller 104. - It should be appreciated that the numbers of acquiring devices, driverless vehicles, and backend servers in
FIG. 1 are merely illustrative. Any number of acquiring devices, driverless vehicles, and backend servers may be provided based on the actual requirements. The vehicle-mounted controller may also operate separately without any backend server or network. - Further reference will be made to
FIG. 2 illustrating aflow 200 of a method for monitoring a message transmission frequency in a robot operating system according to an embodiment of the present application. The method for monitoring the message transmission frequency in the robot operating system includes the following steps: -
Step 201, write to-be-transmitted messages into a pre-allocated memory. - The memory configured to store the to-be-transmitted messages is pre-allocated in an operating system on which the method for monitoring the message transmission frequency in the robot operating system operates in
FIG. 1 (e.g., the robot operating system in the vehicle-mounted controller illustrated inFIG. 1 ), where the to-be-transmitted messages may be received messages, or messages to be sent. The memory may be a shared memory, where the shared memory refers to a memory accessible to different processes in a multi-process computer. In this embodiment, when processes are communicating with each other, the process that sends messages may store the to-be-transmitted messages into the shared memory pre-allocated by the robot operating system, and the process that receives messages may retrieve the messages from the shared memory in accordance with a transmission protocol between the two processes, thus realizing the communication between the processes. -
Step 202, obtain time points when the to-be-transmitted messages are written into the memory, and record the time points in a preset time point list. - In this embodiment, there is further the time point list preset in the robot operating system, and there area number of processes running in the robot operating system, each application corresponds to at least one process, and each process may be regarded as a process node; and if there is a to-be-transmitted message between the processes, the time point when one of the processes writes the to-be-transmitted message into the memory will be obtained, and the obtained time point will be recorded in the time point list. Since there are a number of processes in the robot operating system, such a time point list is preset for each process that records message transmission time points of the process.
- In this embodiment, the data recording approach of the above-mentioned time point list may be a circular recording approach, that is, the time points may be recorded sequentially in the time point list in the order of time, and after all the resources in the time point list are occupied, if there is a time point to be recorded, the data with the earliest recording time point will be shifted cyclically out of the time point list, and the latest time point will be populated at the location vacant after the data are shifted.
-
Step 203, determine a message transmission frequency within a preset time interval based on the time points in the time point list. - In this embodiment, the robot operating system may retrieve the time points within the predetermined time interval from the time point list based on the time points when the messages are written into the memory recorded in the time point list in
step 202, and determine the message transmission frequency within the time interval based on the time points in the period of time. For example, the robot operating system may count the number of messages written into the memory within a time interval. If the interval of time is 2 seconds, the number of messages within the 2 seconds will be counted to thereby determine the message transmission frequency within the 2 seconds. -
Step 204, compare the message transmission frequency with a preset message transmission frequency threshold, and generate monitoring information based on a comparing result. - In this embodiment, there are a number of message transmission frequency thresholds preset in the robot operating system operating on the vehicle-mounted controller as illustrated in
FIG. 1 . The message transmission frequency obtained instep 203 is compared with the preset message transmission frequency thresholds, and the monitoring information related to the comparing result is generated based on the result. The monitoring information may be a comparison report which has not been processed, or a message transmission frequency alarm report obtained as a result of an analysis by a preset diagnosis system. - Further reference will be made to
FIG. 3 which is a schematic diagram 300 of an application scenario of the method for monitoring a message transmission frequency in a robot operating system according to this embodiment. In the application scenario illustrated inFIG. 3 , the vehicle-mounted controller firstly initiates an instruction to the robot operating system to monitor a message transmission frequency of a message sending process of a vehicle speed sensor, and after a message sending process writes messages into the memory pre-allocated in the robot operating system, time points when the messages are written into the memory are recorded at this time into the time point list preset in the robot operating system. For example, 6 time points when the messages are written into the memory, i.e., “Time point 1” to “Time point 6”, are recorded in the time point list inFIG. 3 , and the number of time points in the time point list at this time is counted. Assuming the time from “Time point 1” to “Time point 6” is 0.5 second, the message transmission frequency of the message sending process will be “12 times per second”, and the robot operating system will compare the actually obtained message transmission frequency with the preset message transmission frequency thresholds, generate monitoring information based on the comparing result, and monitor the message sending process. - With the method and apparatus for monitoring the message transmission frequency in the robot operating system according to the embodiments of the present application, the time points when the messages are transmitted are recorded, the actual message transmission frequency is determined and compared with the preset message transmission frequency thresholds, and the monitoring information is generated, thereby reducing the program debugging cost and improving the monitoring efficiency.
- Further reference will be made to
FIG. 4 illustrating a flow 400 of a method for monitoring a message transmission frequency in a robot operating system according to of another embodiment the present application. The flow 400 of the method for monitoring the message transmission frequency in the robot operating system includes the following steps: -
Step 401, write to-be-transmitted messages into a pre-allocated memory. - In this embodiment, the memory configured to store the to-be-transmitted messages is pre-allocated in an operating system on which the method for monitoring the message transmission frequency in the robot operating system operates (e.g., the robot operating system in the vehicle-mounted controller illustrated in
FIG. 1 ), where the to-be-transmitted messages may be received messages, or messages to be sent. In this embodiment, the to-be-transmitted messages may be stored into the memory pre-allocated in the robot operating system. -
Step 402, load a preset configuration file. - In this embodiment, processes in the operating system on which the method for monitoring the message transmission frequency in the robot operating system operates (e.g., the robot operating system in the vehicle-mounted controller illustrated in
FIG. 1 ) may communicate a message with each other by subscribing to a topic, that is, a topic is a protocol. There are a number of processes running in the robot operating system, each application corresponds to at least one process, and each process may be regarded as a process node; and the nodes may transmit a message with each other by putting the message into one or more topics, and the nodes may issue a message in a topic, and alike receive a message by subscribing to a topic. The node may issue a message regardless whether there is another node to receive the message. - After the to-be-transmitted messages are written into the memory in
step 401, the robot operating system operating on the vehicle-mounted controller loads automatically the configuration file in which process identification information of each of the processes is stored. The process identification information may be a process identifier, for example. Transmission protocol information is further stored in the configuration file. Since a protocol in the robot operating system is a topic, it should be appreciated that the transmission protocol information here is a topic name; and preset message transmission frequency thresholds are further stored in the configuration file. -
Step 403, invoke a preset notification function to record time points when the to-be-transmitted messages are written into the memory. - In this embodiment, the robot operating system in the vehicle-mounted controller may have the preset notification function, and after the messages are written into the memory in
step 401, the notification function is invoked by a main function of the message transmitting process to record the time points when the to-be-transmitted messages are written into the memory. - In this embodiment, after the notification function is invoked in
step 403, the operation ofstep 4031 is performed in the notification function: - The
step 4031 is to obtain the time points when the to-be-transmitted messages are written into the memory, and to record the time points into a preset time point list. - In this embodiment, the time point list is further preset in the robot operating system, and the notification function obtains the time points when the to-be-transmitted messages are written into the memory, and then records the obtained time points into the time point list.
- In some optional implementations of this embodiment, after the time point list is full, if the latest time point is obtained, then the earliest time point recorded in the time point list will be removed according to the order of the time points when the to-be-transmitted messages are written into the memory recorded in the time point list, and thereafter the obtained time point will be added to the preset time point list.
-
Step 404, count the number of time points in the time point list within the preset time interval, and determine the number of time points as the message transmission number. - In this embodiment, a message transmitting thread may count the number of time points in the time point list within the preset time interval based on the time points recorded in the time point list in
step 403, and also determine the number of time points as the message transmission number of the message transmitting process in the robot operating system within the predetermined period of time. -
Step 405, determine the message transmission frequency based on the message transmission number and the time points in the time point list. - In this embodiment, the message transmission frequency may be determined based on the message transmission number obtained in
step 404, and the time points recorded in the time point list. For example, the message transmission number within one second may be counted and determined as the message transmission frequency of the message transmitting process. There are a number of threads configured in each process in the robot operating system, and if the processes transmit a message with each other, then a separate thread will be further created in the message transmitting processes to calculate the message transmission frequency. - In some optional implementations of this embodiment, the earliest time point in the preset time interval is retrieved from the time point list as a first message transmission time point.
- The latest time point in the preset time interval is retrieved from the time point list as a last message transmission time point.
- The message transmission frequency of the current process is calculated in the equation of:
-
- where T1 represents the first message transmission time point, Tn represents the last message transmission time point, n represents the message transmission number, where n is a positive integer greater than or equal to 2, and f represents the message transmission frequency of the process.
-
Step 406, compare the message transmission frequency with a preset message transmission frequency threshold, and generate monitoring information based on a comparing result. - In this embodiment, there are a number of message transmission frequency thresholds preset in the robot operating system operating on the vehicle-mounted controller as illustrated in
FIG. 1 , the message transmission frequency obtained instep 405 is compared with the preset message transmission frequency thresholds, and the monitoring information related to the comparing result is generated based on the result, The message transmission frequency thresholds are recorded in the configuration file, and retrieved directly when the configuration file is loaded instep 402. - In some optional implementations of this embodiment, the monitoring information further includes a 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, the monitoring information at a first monitoring level will be generated. If the message transmission frequency is above the second preset message transmission frequency threshold and below a third preset message transmission frequency threshold, the monitoring information at a second monitoring level will be generated. If the message transmission frequency is below the first preset message transmission frequency threshold or above the third preset message transmission frequency threshold, the monitoring information at a third monitoring level will be generated. The monitoring information at the first monitoring level may indicate that the message transmission frequency of the process is normal; the monitoring information at the third monitoring level may indicate that the message transmission frequency of the process is abnormal, and it may be determined that an application corresponding to the process is abnormal, based on the detected abnormal condition of the message transmission frequency of the process, and at this time the application will not be adopted; the monitoring information at the second monitoring level may indicate that the message transmission frequency of the process is critical, and at this time it may be determined whether the process is normal, based on the degree of importance of the application corresponding to the process.
- By way of example, there are a number of sensors arranged on a driverless vehicle, e.g., a sensor configured to control the vehicle to turn and controlled by a vehicle-mounted controller. The operating system operating on the vehicle-mounted controller is a robot operating system. A number of processes controlling the operating of the sensor may communicate with each other. Taking one of the processes as an example, if a frequency threshold is preset in a configuration file, then if the message transmission frequency of the process is below 0.8 times the frequency threshold or above 1.1 times the frequency threshold, it will be determined that the message transmission frequency of the process at this time is abnormal, so that it may be determined that the sensor is operating abnormally; if the message transmission frequency is between 0.9 times the frequency threshold and 1.1 times the frequency threshold, it will be determined that the message transmission frequency of the process at this time is normal, and it will be determined whether the sensor is operating normally by further determining whether all the processes related to the operating sensor are normal; and if the message transmission frequency is between 0.8 times the frequency threshold and 0.9 times the frequency threshold, since the sensor configured to control turning is an important sensor of the driverless vehicle, it may be determined whether the sensor is operating normally by determining whether the other processes are operating normally, for example, if message transmission frequencies of the other processes are normal, it will be determined that the sensor is operating normally.
-
Step 407, transmit the monitoring information to a server supporting the robot operating system. - In this embodiment, the robot operating system may send information about the message transmission frequency to the server supporting the robot operating system based on the monitoring information generated in
step 406. For example, a monitoring thread can be created in the message transmitting process, and the monitoring thread is configured to send the monitoring information to the server, so that the server obtains the real-time message transmission state of the process. - As can be seen from
FIG. 4 , unlike the embodiment corresponding toFIG. 2 , in this embodiment, firstly the configuration file is added into which firstly information, such as message transmission frequency thresholds, and transmission protocols, are stored; secondly the notification function is added so that the time points when the messages are written into the memory may be recorded using the notification function; and lastly the monitoring information is additionally transmitted to the server supporting the robot operating system, so that the process itself may monitor the message transmission frequency thereof, thereby increasing the flexibility in monitoring the message transmission frequency. Further reference will be made toFIG. 5 , as an implementation of the methods illustrated in the above-mentioned drawings, the present application provides an embodiment for an apparatus for monitoring a message transmission frequency in a robot operating system. The embodiment of the apparatus corresponds to the embodiment of the method as illustrated inFIG. 2 , and the apparatus may be specifically applied to various electronic devices. - As illustrated in
FIG. 5 , theapparatus 500 for monitoring the message transmission frequency in the robot operating system according to this embodiment includes awriting unit 501, an obtainingunit 502, a determiningunit 503, and agenerating unit 504. Thewriting unit 501 is configured to write to-be-transmitted messages into a pre-allocated memory; the obtainingunit 502 is 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; the determiningunit 503 is configured to determine a message transmission frequency within a preset time interval based on the time points in the time point list; and thegenerating unit 504 is configured to compare the message transmission frequency with a preset message transmission frequency threshold, and to generate monitoring information based on a comparing result. - In this embodiment, the concrete processes of the
writing unit 501, the obtainingunit 502, the determiningunit 503, and thegenerating unit 504 can refer to the detailed descriptions of thestep 201, thestep 202, thestep 203, and thestep 204 in the embodiment corresponding toFIG. 2 , and will not be repeated herein. - In some optional implementations of this embodiment, the
apparatus 500 further includes a loading unit (not illustrated) configured to load a preset configuration file. The configuration file is retrieved when processes are started, and the configuration file includes identification information of the processes, the message transmission frequency thresholds, and transmission protocol information of the robot operating system. - In some optional implementations of this embodiment, the obtaining
unit 502 of theapparatus 500 includes an invoking sub-unit (not illustrated) configured to invoke a preset notification function to record the time points when the to-be-transmitted messages are written into the memory. - In some optional implementations of this embodiment, the obtaining
unit 502 of theapparatus 500 is further configured to, if the time point list is full, remove the earliest time point in the time point list according to the order of the time points when the to-be-transmitted messages are written into the memory recorded in the time point list, and thereafter add the obtained time point to the preset time point list. - In some optional implementations of this embodiment, the determining
unit 503 of theapparatus 500 includes: a counting sub-unit (not illustrated) configured to count the number of time points in the time point list within the preset time interval, and to determine the number of time points as the message transmission number; and a determining sub-unit (not illustrated) configured to determine the message transmission frequency based on the message transmission number, and the time points in the time point list. - In some optional implementations of this embodiment, the determining sub-unit of the
apparatus 500 is further configured: to retrieve the earliest time point within the preset time interval from the time point list as a first message transmission time point; to retrieve the latest time point within the preset time interval from the time point list as a last message transmission time point; and to calculate the message transmission frequency in the equation of: -
- where T1 represents the first message transmission time point, Tn represents the last message transmission time point, n represents the message transmission number, where n is a positive integer greater than or equal to 2, and f represents the message transmission frequency.
- In some optional implementations of this embodiment, the monitoring information includes a monitoring level; and the
generating unit 504 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. - In some optional implementations of this embodiment, the
apparatus 500 is further configured to send the monitoring information to a server supporting the robot operating system. - Referring to
FIG. 6 , a schematic structural diagram of acomputer system 600 adapted to implement a terminal apparatus of the embodiments of the present application is shown. - As shown in
FIG. 6 , thecomputer system 600 includes a central processing unit (CPU) 601, which may execute various appropriate actions and processes in accordance with a program stored in a read-only memory (ROM) 602 or a program loaded into a random access memory (RAM) 603 from astorage portion 608. TheRAM 603 also stores various programs and data required by operations of thesystem 600. TheCPU 601, theROM 602 and theRAM 603 are connected to each other through abus 604. An input/output (I/O)interface 605 is also connected to thebus 604. - The following components are connected to the I/O interface 605: an
input portion 606 including a keyboard, a mouse etc.; anoutput portion 607 comprising a liquid crystal display device (LCD), a speaker, etc.; astorage portion 608 including a hard disk and the like; and acommunication portion 609 comprising a network interface card, such as a LAN card and a modem. Thecommunication portion 609 performs communication processes via a network, such as the Internet. Adriver 610 is also connected to the I/O interface 605 as required. Aremovable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, and a semiconductor memory, may be installed on thedriver 610, to facilitate the retrieval of a computer program from theremovable medium 611, and the installation thereof on thestorage portion 608 as needed. - In particular, according to an embodiment of the present disclosure, the process described above with reference to the flow charts may be implemented in a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which comprises a computer program that is tangibly embedded in a machine-readable medium. The computer program comprises program codes for executing the method of the flow charts. In such an embodiment, the computer program may be downloaded and installed from a network via the
communication portion 609, and/or may be installed from theremovable media 611. The computer program, when executed by theCPU 601, executes the above-mentioned functions in the methods of the present application. - The flow charts and block diagrams in the figures illustrate architectures, functions and operations that may be implemented according to the system, the method and the computer program product of the various embodiments of the present invention. In this regard, each block in the flow charts and block diagrams may represent a module, a program segment, or a code portion. The module, the program segment, or the code portion comprises one or more executable instructions for implementing the specified logical function. It should be noted that, in some alternative implementations, the functions denoted by the blocks may occur in a sequence different from the sequences shown in the figures. For example, in practice, two blocks in succession may be executed, depending on the involved functionalities, substantially in parallel, or in a reverse sequence. It should also be noted that, each block in the block diagrams and/or the flow charts and/or a combination of the blocks may be implemented by a dedicated hardware-based system executing specific functions or operations, or by a combination of a dedicated hardware and computer instructions.
- The units involved in the embodiments of the present application may be implemented by way of software or hardware. The described units may also be provided in a processor, for example, described as: a processor, comprising a writing unit, an obtaining unit, a determining unit and a generating unit, where the names of these units are not considered as a limitation to the units or modules. For example, the writing unit may also be described as “a unit for writing to-be-transmitted messages into a pre-allocated memory”.
- In another aspect, the present application further provides a computer readable storage medium. The computer readable storage medium may be the computer readable storage medium included in the apparatus in the above embodiments, or a stand-alone computer readable storage medium which has not been assembled into the apparatus. The computer readable storage medium stores one or more programs. The one or more programs, when executed by a device, cause the device to perform a method for monitoring a message transmission frequency in a robot operating system, 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.
- The foregoing is only a description of the preferred embodiments of the present application and the applied technical principles. It should be appreciated by those skilled in the art that the inventive scope of the present application is not limited to the technical solutions formed by the particular combinations of the above technical features. The inventive scope should also cover other technical solutions formed by any combinations of the above technical features or equivalent features thereof without departing from the concept of the invention, such as, technical solutions formed by replacing the features as disclosed in the present application with (but not limited to), technical features with similar functions.
Claims (15)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/039,151 US10127093B1 (en) | 2016-09-06 | 2018-07-18 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
Applications Claiming Priority (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610806462 | 2016-09-06 | ||
CN201610806462.1 | 2016-09-06 | ||
CN201610806462.1A CN107797902B (en) | 2016-09-06 | 2016-09-06 | Method and device for monitoring message transmission frequency of robot operating system |
US15/410,446 US10055265B2 (en) | 2016-09-06 | 2017-01-19 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
US16/039,151 US10127093B1 (en) | 2016-09-06 | 2018-07-18 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/410,446 Continuation US10055265B2 (en) | 2016-09-06 | 2017-01-19 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
Publications (2)
Publication Number | Publication Date |
---|---|
US20180321995A1 true US20180321995A1 (en) | 2018-11-08 |
US10127093B1 US10127093B1 (en) | 2018-11-13 |
Family
ID=61281287
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/410,446 Active 2037-02-20 US10055265B2 (en) | 2016-09-06 | 2017-01-19 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
US16/039,144 Active US10127092B1 (en) | 2016-09-06 | 2018-07-18 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
US16/039,151 Active US10127093B1 (en) | 2016-09-06 | 2018-07-18 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
Family Applications Before (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/410,446 Active 2037-02-20 US10055265B2 (en) | 2016-09-06 | 2017-01-19 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
US16/039,144 Active US10127092B1 (en) | 2016-09-06 | 2018-07-18 | Method and apparatus for monitoring a message transmission frequency in a robot operating system |
Country Status (2)
Country | Link |
---|---|
US (3) | US10055265B2 (en) |
CN (1) | CN107797902B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110086789B (en) * | 2019-04-17 | 2021-07-13 | 腾讯科技(深圳)有限公司 | Data transmission method, device, equipment and medium |
CN112311616B (en) * | 2019-08-01 | 2022-07-19 | 北京百度网讯科技有限公司 | Data communication frequency statistical method, device and storage medium |
CN111031105B (en) * | 2019-11-26 | 2022-06-28 | 北京百度网讯科技有限公司 | Statistical method, device, equipment and storage medium for message frequency in automatic driving |
CN111382672A (en) * | 2019-12-31 | 2020-07-07 | 国网北京市电力公司 | Cheating monitoring method and device for online examination |
CN111813516B (en) * | 2020-06-29 | 2023-04-11 | 中国平安人寿保险股份有限公司 | Resource control method and device, computer equipment and storage medium |
CN113286009B (en) * | 2021-07-20 | 2021-10-26 | 上海景吾智能科技有限公司 | Playing method and system for viewing robot rossbag in real time through remote HTTP webpage |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2930020B2 (en) * | 1996-07-18 | 1999-08-03 | 日本電気株式会社 | Communication control device |
JPH11110320A (en) * | 1997-10-03 | 1999-04-23 | Matsushita Electric Ind Co Ltd | Message exchange device |
US7299470B2 (en) * | 2001-09-13 | 2007-11-20 | International Business Machines Corporation | Method and system for regulating communication traffic using a limiter thread |
JP3864251B2 (en) * | 2002-12-06 | 2006-12-27 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Message processing apparatus, message processing method, and message processing program |
EP2169551A1 (en) * | 2008-09-26 | 2010-03-31 | Siemens Aktiengesellschaft | Method for dispatching of application messages |
CN103839006B (en) | 2010-11-29 | 2017-07-28 | 北京奇虎科技有限公司 | Procedure identification method and device based on machine learning |
EP2805297A4 (en) * | 2012-01-20 | 2015-04-01 | Chicago Mercantile Exchange | Adaptive volume control |
CN103686854B (en) * | 2012-09-17 | 2018-05-04 | 中兴通讯股份有限公司 | The method and apparatus for controlling AP |
CN103795580B (en) * | 2012-10-29 | 2016-10-26 | 腾讯科技(深圳)有限公司 | A kind of data monitoring method, system and relevant device |
CN105373460B (en) * | 2014-08-14 | 2019-03-26 | 腾讯科技(深圳)有限公司 | The alarm method and system of monitoring message |
CN105246025B (en) * | 2015-09-08 | 2018-09-14 | 宇龙计算机通信科技(深圳)有限公司 | A kind of method and device of control V2X business transmission |
CN105549556B (en) * | 2015-12-17 | 2018-06-26 | 东北大学 | A kind of data collection and transfering system and method for industrial process real time monitoring |
-
2016
- 2016-09-06 CN CN201610806462.1A patent/CN107797902B/en active Active
-
2017
- 2017-01-19 US US15/410,446 patent/US10055265B2/en active Active
-
2018
- 2018-07-18 US US16/039,144 patent/US10127092B1/en active Active
- 2018-07-18 US US16/039,151 patent/US10127093B1/en active Active
Also Published As
Publication number | Publication date |
---|---|
US20180321994A1 (en) | 2018-11-08 |
CN107797902A (en) | 2018-03-13 |
US10127093B1 (en) | 2018-11-13 |
US10127092B1 (en) | 2018-11-13 |
US10055265B2 (en) | 2018-08-21 |
US20180067788A1 (en) | 2018-03-08 |
CN107797902B (en) | 2021-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10127093B1 (en) | Method and apparatus for monitoring a message transmission frequency in a robot operating system | |
US9967222B2 (en) | Method and device for managing shared memory in robot operating system | |
US11055169B2 (en) | Forecasting workload transaction response time | |
US10331521B2 (en) | Method and apparatus for monitoring robot operating system | |
EP3575975B1 (en) | Method and apparatus for operating smart network interface card | |
CN110888783A (en) | Monitoring method and device of micro-service system and electronic equipment | |
CN109743209B (en) | Method and device for transmitting information | |
CN110727560A (en) | Cloud service alarm method and device | |
CN111008105A (en) | Distributed system call relation visualization method and device | |
EP2354945A1 (en) | Noisy monitor detection and intermittent fault isolation | |
CN114490272A (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
US20160028606A1 (en) | Scalable Extendable Probe for Monitoring Host Devices | |
CN110417597B (en) | Method and device for monitoring certificate, electronic equipment and readable storage medium | |
CN107612755A (en) | The management method and its device of a kind of cloud resource | |
CN116701123A (en) | Task early warning method, device, equipment, medium and program product | |
CN114896168B (en) | Quick debugging system, method and memory for automatic driving algorithm development | |
CN111897701B (en) | Alarm processing method, device, computer system and medium for application | |
CN114024867A (en) | Network anomaly detection method and device | |
CN109960659B (en) | Method and device for detecting application program | |
WO2022015313A1 (en) | Generation of alerts of correlated time-series behavior of environments | |
US20130212210A1 (en) | Rule engine manager in memory data transfers | |
EP3968572A1 (en) | A method for providing log entries | |
CN110221869B (en) | Method and device for configuring data center operating environment | |
CN117251341A (en) | Real-time monitoring method and device for cache service cluster, electronic equipment and medium | |
CN115174588A (en) | Bandwidth control method, device, equipment, storage medium and program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
FEPP | Fee payment procedure |
Free format text: ENTITY STATUS SET TO UNDISCOUNTED (ORIGINAL EVENT CODE: BIG.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
AS | Assignment |
Owner name: APOLLO INTELLIGENT DRIVING TECHNOLOGY (BEIJING) CO., LTD., CHINA Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.;REEL/FRAME:058241/0248 Effective date: 20210923 |
|
MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1551); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 4 |