CN110572315A - Information interaction method and device, robot and storage medium - Google Patents

Information interaction method and device, robot and storage medium Download PDF

Info

Publication number
CN110572315A
CN110572315A CN201910851104.6A CN201910851104A CN110572315A CN 110572315 A CN110572315 A CN 110572315A CN 201910851104 A CN201910851104 A CN 201910851104A CN 110572315 A CN110572315 A CN 110572315A
Authority
CN
China
Prior art keywords
monitoring terminal
robot
notification message
long connection
notification
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.)
Pending
Application number
CN201910851104.6A
Other languages
Chinese (zh)
Inventor
支涛
应甫臣
李广胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yunji Technology Co Ltd
Original Assignee
Beijing Yunji Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yunji Technology Co Ltd filed Critical Beijing Yunji Technology Co Ltd
Priority to CN201910851104.6A priority Critical patent/CN110572315A/en
Publication of CN110572315A publication Critical patent/CN110572315A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0604Management of faults, events, alarms or notifications using filtering, e.g. reduction of information by using priority, element types, position or time
    • H04L41/0609Management of faults, events, alarms or notifications using filtering, e.g. reduction of information by using priority, element types, position or time based on severity or priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0686Additional information in the notification, e.g. enhancement of specific meta-data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/02User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail using automatic reactions or user delegation, e.g. automatic replies or chatbot-generated messages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/224Monitoring or handling of messages providing notification on incoming messages, e.g. pushed notifications of received messages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Abstract

The application provides an information interaction method and device, a robot and a storage medium. The information interaction method is applied to the robot and comprises the following steps: generating a notification message for notifying a current operation state when the change of the operation state is detected; and sending the notification message to a target monitoring terminal, wherein the target monitoring terminal is a monitoring terminal marked as a subscription notification state, and the subscription notification state is used for indicating that the target monitoring terminal subscribes the notification message. The method avoids the condition of information loss in the information interaction process and improves the reliability of information interaction.

Description

Information interaction method and device, robot and storage medium
Technical Field
the application relates to the field of communication, in particular to a method and device for information interaction, a robot and a storage medium.
background
In the development or use process of the robot, the monitoring end needs to acquire the running state of the robot and then sends a corresponding instruction according to the running state of the robot. When acquiring the running state of the robot, the prior art adopts a mode of periodically acquiring the running state, that is, at intervals, the monitoring end sends a request for acquiring the running state to the robot, and the robot returns.
In the existing mode for acquiring the running state, because the acquired running state is periodic, only one running state at a single time point can be acquired, and if the running state acquired at the current moment is A and the running state acquired at the previous moment is B, the running state in the period from the running state B to the running state A is not acquired by the monitoring end, the running state acquired by the monitoring end is incomplete, namely, information is lost, so that the monitoring end cannot accurately grasp the running condition of the robot in the development or use process.
Disclosure of Invention
An object of the embodiments of the present application is to provide an information interaction method and apparatus, a robot, and a storage medium, so as to avoid a situation of information loss in an information interaction process and improve reliability of information interaction.
In a first aspect, an embodiment of the present application provides an information interaction method, which is applied to a robot, and the method includes: generating a notification message for notifying a current operation state when the change of the operation state is detected; and sending the notification message to a target monitoring terminal, wherein the target monitoring terminal is a monitoring terminal marked as a subscription notification state, and the subscription notification state is used for indicating that the target monitoring terminal subscribes the notification message.
in the embodiment of the application, when the robot detects that the running state changes, a notification message for notifying the current running state is generated, and the notification message is sent to the target monitoring terminal subscribed to the notification message. Compared with the prior art, the target monitoring terminal can subscribe the notification message of the robot, when the running state of the robot changes, the robot can actively send the corresponding notification message to the target monitoring terminal, which is equivalent to that the robot actively notifies the running state, so that the target monitoring terminal can acquire each running state of the robot, the loss of information is avoided, and the reliability of information interaction is improved.
As a possible implementation manner, generating a notification message for notifying the current operation state includes: and packaging the description information of the current running state according to a preset notification message format to generate the notification message, wherein the description information comprises state explanation and state content.
In the embodiment of the application, the notification message encapsulates description information of the current operating state, so that each operating state has more detailed information, and the monitoring end is convenient to comprehensively analyze the operating state of the robot.
as a possible implementation manner, encapsulating the description information of the current operating state according to a preset notification message format, and generating the notification message includes: generating a message ID; determining the severity level of the notification message according to the description information; and packaging the ID, the description information and the severity level according to the preset notification message format to generate the notification message.
In the embodiment of the application, besides the description information, the severity level and the message ID are also included in the notification message, so that the notification message specification is easy to read.
as a possible implementation manner, encapsulating the ID, the description information, and the severity level according to the preset notification message format, and generating the notification message includes: and packaging the ID, the description information and the severity level according to a JSON character string format to generate the notification message.
In the embodiment of the application, each item of information is encapsulated by adopting a JSON character string format, the JSON format is a lightweight data exchange format, a robot end is easy to generate, a monitoring end is convenient to analyze, and the transmission efficiency of data can be effectively improved.
As a possible implementation, before generating the notification message for notifying the current operation state, the method further includes: receiving a long connection establishment request sent by the target monitoring terminal; the establishment request comprises the IP of the target monitoring terminal; establishing long connection with the target monitoring terminal according to the IP of the target monitoring terminal; and marking the target monitoring terminal as a subscription notification state when receiving a subscription notification request sent by the target monitoring terminal.
in the embodiment of the application, in order to enable the robot to send the notification message to the target monitoring terminal, the robot and the target monitoring terminal need to establish a long connection first, and after the long connection is established, data interaction can be performed between the target monitoring terminal and the robot at any time, so that information loss is avoided.
As a possible implementation manner, the establishing a long connection with the target monitoring terminal according to the long connection establishment request includes: establishing a TCP long connection with the target monitoring terminal according to the IP of the monitoring terminal; correspondingly, the sending the notification message to a target monitoring end includes: and sending the notification message to the target monitoring terminal through a TCP protocol.
In the embodiment of the application, a TCP (transmission control protocol) is adopted for data transmission, the TCP is a connection-oriented, reliable and byte stream-based transport layer communication protocol, and the data transmission efficiency and the communication reliability between the monitoring end and the robot can be improved.
In a second aspect, an embodiment of the present application provides an information interaction method, which is applied to a robot, and the method includes: receiving a long connection establishment request sent by a monitoring terminal, wherein the establishment request comprises an IP of the monitoring terminal; establishing long connection with the monitoring terminal according to the IP of the monitoring terminal; and marking the monitoring terminal as a subscription notification state when receiving a subscription notification request sent by the monitoring terminal.
In the embodiment of the application, the robot establishes long connection with the monitoring terminal, and marks the monitoring terminal as a subscription notification state, so that data interaction can be performed between the monitoring terminal and the robot at any time, and further, information loss is avoided.
In a third aspect, an embodiment of the present application provides an information interaction method, which is applied to a monitoring end, and the method includes: determining a robot to be monitored; generating a long connection establishment request for establishing long connection with the robot, and sending the long connection establishment request to the robot; upon determining that a long connection with the robot is established successfully, sending a subscription notification request to the robot.
in the embodiment of the application, the monitoring end establishes long connection with the robot and requests the robot to subscribe for notification, so that data interaction can be performed between the monitoring end and the robot at any time, and further information loss is avoided.
In a fourth aspect, an embodiment of the present application provides an information interaction apparatus, where the apparatus includes a functional module configured to implement the method described in the first aspect and any one of possible implementation manners of the first aspect.
In a fifth aspect, an embodiment of the present application provides an information interaction apparatus, where the apparatus includes a functional module for implementing the method of the second aspect.
In a sixth aspect, an embodiment of the present application provides an information interaction apparatus, which includes functional modules for implementing the method described in the third aspect.
In a seventh aspect, an embodiment of the present application provides a robot, including: a memory and a processor, the memory and the processor connected; the memory is used for storing programs; the processor calls a program stored in the memory to perform the method as described in the first aspect and any one of the possible implementations of the first aspect and the second aspect.
in an eighth aspect, an embodiment of the present application provides a readable storage medium, where a computer program is stored on the readable storage medium, and the computer program, when executed by a computer, performs the steps of the method according to the first aspect and any one of the possible implementation manners of the first aspect, the second aspect, and the third aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic structural diagram of an information interaction system according to an embodiment of the present application;
fig. 2 is a schematic flow chart of information interaction provided in an embodiment of the present application;
FIG. 3 is a flowchart of an embodiment of a method implemented in an information interaction system according to the present disclosure;
FIG. 4 is a flowchart of a method for information interaction provided by an embodiment of the present application;
fig. 5 is a functional block diagram of an information interaction apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Before the method for information interaction provided by the embodiment of the application is introduced, an application scenario of the method is introduced.
Referring to fig. 1, fig. 1 is an information interaction system 100 provided in an embodiment of the present application, where the information interaction system 100 includes robots 101 and monitoring terminals 102, where the number of the robots 101 and the number of the monitoring terminals 102 are not limited to one, one robot 101 corresponds to multiple monitoring terminals 102, and one monitoring terminal 102 corresponds to multiple robots 101, that is, one monitoring terminal 102 may monitor multiple robots 101, and one robot 101 may also be monitored by multiple monitoring terminals 102.
among them, the robot 101 may be various advanced robots for non-manufacturing industry and serving human beings, including: service robots, underwater robots, entertainment robots, military robots, agricultural robots, and the like. The robot is a machine device which automatically executes work, can receive human commands, can run a preset program, and realizes various functions by means of self power and control capacity.
The monitoring terminal 102 is used for monitoring the robot, and may be a server, a cloud, a monitoring client, and the like. The monitoring client may be, for example, a monitoring device, such as a computer, a mobile phone, etc.; but also an application installed on the electronic device, etc.
In addition, in the information interaction system 100, the robot 101 and the monitoring terminal 102 belong to the same domain, and the corresponding relationship between the robot 101 and the monitoring terminal 102 is configurable, for example, there are 10 robots in the system, and the 10 robots are provided with numbers 1-10, 2 monitoring terminals, and are provided with numbers 01-02, so the configured corresponding relationship may be: the monitoring terminal 102 with the number of 01 is responsible for monitoring the robots 101 with the numbers of 1-5; the monitoring terminal 102 numbered 02 is responsible for monitoring of the robot 101 numbered 6-10. The configured corresponding relationship may also be: the monitoring terminal 102 numbered 01 and the monitoring terminal 102 numbered 02 both monitor the robot 101 numbered 1-10. Further, after the corresponding relationship is configured, the monitoring terminal 102 and the robot 101 establish communication connection according to the corresponding relationship, so as to realize data transmission.
The information interaction system 100 can be used in various scenarios such as the development of robots, or the monitoring of robots during operation. For example: when developing the functions of the robot 101, a developer collects the operating state of the robot by using an application program (the monitoring terminal 102) and debugs the related functions of the robot 101. For another example: in the operation process of the robot 101, the monitoring terminal 102 collects the operation state of the robot to determine that the robot is operating normally, and if a problem occurs, maintenance is performed in time.
Based on the information interaction system 100 and the application scenario thereof, a method of information interaction will be described next.
referring to fig. 2, which is a schematic view of an interaction flow provided in the embodiment of the present application, as shown in fig. 2, a communication connection has been established between a robot 101 and a monitoring terminal 102 in advance according to a corresponding relationship, and the monitoring terminal 102 subscribes to a notification message of the robot 101 corresponding to the monitoring terminal 102. If the running state of the robot 101 is a, generating a corresponding notification message and sending the notification message to the monitoring terminal 102 to notify the running state a; when the running state of the robot 101 changes to B for some reason, a corresponding notification message is generated and sent to the monitoring terminal 102 to notify the running state B; when the operation state changes to C for some reason, a corresponding notification message is generated and sent to the monitoring terminal 102 to notify the operation state C.
Referring to fig. 3, a system interaction flow chart is provided for the embodiment of the present application, where the interaction flow shown in fig. 3 is a process of establishing a connection between the robot 101 and the monitoring terminal 102 and completing message subscription, and the interaction flow includes:
Step 201: the monitoring terminal 102 determines the robot 101 to be monitored.
Step 202: the monitoring terminal 102 generates a long connection establishment request for establishing a long connection with the robot 101, and transmits the request to the robot 101. The establishment request includes an IP (Internet Protocol) address of the monitoring terminal 102.
Step 203: the robot 101 receives the long connection establishment request sent by the monitoring terminal 102.
step 204: the robot 101 establishes a long connection with the monitoring terminal 102 according to the IP of the monitoring terminal 102.
Step 205: the monitoring terminal 102 determines that the long connection with the robot 101 is successfully established, and sends a subscription notification request to the robot 101.
Step 206: the robot 101 receives a subscription notification request from the monitoring terminal 102, and marks the monitoring terminal 102 as a subscription notification state.
It should be noted that, steps 201 to 206 describe a process of establishing a connection and completing a message subscription at a time, if the robot 101 needs to be monitored by multiple monitoring terminals 102, then the multiple monitoring terminals 102 and the robot may establish a connection and complete a message subscription according to steps 201 to 206.
The flow of steps 201-206 will be described below.
For step 201, an alternative implementation: the monitoring terminal 102 determines the robot to be monitored according to the pre-configured corresponding relationship. It can be understood that the corresponding relationship between each monitoring terminal 102 and the robot 101 is configured in advance, so the monitoring terminal 102 can determine the robot 101 corresponding to itself directly according to the corresponding relationship. As the monitoring terminal 102 numbered 01 illustrated in the foregoing embodiment corresponds to the robot 101 numbered 1 to 5, the monitoring terminal 102 determines that the robot 101 numbered 1 to 5 is the robot 101 to be monitored. In addition, when the robot 101 to be monitored is determined, the identity information of the robot 101 to be monitored, such as the IP address and the serial number of the robot 101, is determined, so that the monitoring terminal 102 can perform subsequent operations and processing according to the identity information.
for step 202, the long connection establishment request includes the IP of the monitoring terminal 102, and also indicates that the monitoring terminal 102 needs to establish a long connection with the robot 101. The long connection means that a plurality of data packets can be continuously transmitted on one connection, and if no data packet is transmitted during the connection holding period, a link detection packet needs to be transmitted by two parties. The IP of the monitoring peer 102 is used to represent the identity of the monitoring peer 102. When the monitoring terminal 102 transmits the request, the transmission is performed according to the IP of the robot 101. The long connection establishment request may further include a data transmission protocol agreed by the monitoring terminal 102 and the robot 101, so that the two transmit data through the agreed protocol when transmitting data.
After step 202, the robot 101 executes step 203, receiving a setup request.
After step 204, the robot 101 executes step 204 to establish a long connection with the monitoring terminal 102. In step 204, the robot 101 may first perform authentication on the monitoring terminal 102 according to the IP in the establishment request. It can be understood that the preset correspondence between the robot 101 and the monitoring terminal 102 is synchronized to the robot 101 and the monitoring terminal 102, and therefore the robot 101 is also aware of the monitoring terminal 102 corresponding to itself. Further, the robot 101 compares the identity information of the monitoring terminal 102 in the configured corresponding relationship with the IP in the establishment request, and if the identity information is consistent with the IP in the establishment request, it indicates that the monitoring terminal 102 that sent the request is the monitoring terminal 102 corresponding to the robot, and if the identity information is not consistent with the IP in the establishment request, it indicates that the monitoring terminal 102 that sent the request is not the monitoring terminal 102 corresponding to the robot. Further, when the monitoring terminal 102 passes the authentication, the robot 101 establishes a long connection with the monitoring terminal 102.
How to establish a long connection is essentially after completing one read-write before the robot 101 and the monitoring terminal 102, i.e. the connection is successful. When the robot 101 receives the request sent by the monitoring terminal 102, which corresponds to a connection being established, the robot 101 may choose to maintain the connection, i.e. to establish a long connection, or to close the long connection. Therefore, in step 204, if the identity of the monitoring terminal 102 is verified to pass, the robot 101 maintains the connection relationship with the monitoring terminal 102, so as to establish a long connection. If the identity of the monitoring terminal 102 is not verified, the robot 101 closes the connection relation with the monitoring terminal 102, and thus the long connection is disconnected.
Further, in step 205, the way for the monitoring end 102 to determine whether the long connection with the robot 101 is successfully established may be: sending a detection message to the robot 101, and when receiving a response to the detection message fed back by the robot 101, representing that the long connection with the robot 101 is successfully established. If no response to the probe message is received, it represents a failure to establish a long connection with the robot 101. The reason for the failure to establish a long connection may be due to poor network conditions, or system failure, etc. The monitoring terminal 102 may choose to re-establish a long connection with the robot 101.
When determining that the long connection is successfully established, the monitoring terminal 102 sends a subscription notification request to the robot 101, and if the defined request format is a character string, the content of the request may be: "api _ describe _ notification". The character string means that the monitoring terminal 102 requests the robot 101 to push a notification message to itself in real time.
Further, when receiving the subscription notification request, the robot 101 marks the monitoring terminal 102 that sent the subscription notification request as a subscription notification state, where the subscription notification state is used to indicate that the monitoring terminal 102 has subscribed to the notification message of the robot 101. In subsequent operations, whenever a notification message is generated, it is synchronized to the monitoring terminal 102 in real time over a long connection.
In addition, in steps 202 to 205, the long connection established between the robot 101 and the monitoring terminal 102 may be a long connection of various Transmission protocols, such as TCP (Transmission Control Protocol), HTTP (hypertext Transfer Protocol), and the like. The reliability of the TCP protocol is high, and the transmission efficiency is also high.
as can be seen from steps 201 to 206, in the embodiment of the present application, the monitoring terminal 102 establishes a long connection with the robot 101, and requests the robot 101 for a subscription notification, so that data interaction can be performed between the monitoring terminal 102 and the robot 101 at any time, and thus, information loss is avoided.
Referring to fig. 4, a flowchart of a method for information interaction applied to the robot 101 according to an embodiment of the present application is shown in fig. 4, where the flow shown in fig. 4 is an implementation flow after the robot 101 is marked with a subscription notification status, and the method includes:
Step 301: upon detecting the change in the operating state, a notification message for notifying the current operating state is generated.
Step 302: and sending the notification message to the target monitoring terminal. The target monitoring terminal is the monitoring terminal 102 marked as a subscription notification state, and the subscription notification state is used for indicating that the target monitoring terminal has subscribed to the notification message.
in this embodiment, when detecting the change in the operation state, the robot 101 generates a notification message for notifying the current operation state, and sends the notification message to the target monitoring terminal subscribed to the notification message. Compared with the prior art, the target monitoring terminal can subscribe the notification message of the robot 101, when the running state of the robot changes, the corresponding notification message can be actively sent to the target monitoring terminal, which is equivalent to that the robot 101 actively notifies the running state, so that the target monitoring terminal can acquire each running state of the robot 101, information loss is avoided, and the reliability of information interaction is improved.
Since the robot 101 may be monitored by a plurality of monitoring terminals 102, there may be a plurality of target monitoring terminals 102, and if there are a plurality of target monitoring terminals 102, the notification message may be sent to the plurality of target monitoring terminals 102 at the same time
For step 301, an alternative implementation: and packaging the description information of the current running state according to a preset notification message format to generate a notification message, wherein the description information comprises state explanation and state content.
wherein, for the description information, it can be understood to be used for describing the current operation state. The state interpretation is used to explain what state the current operating state is, and also corresponds to the name or definition of the operating state. The status content is used to indicate specific information related to the operational status. For example, assuming that the current running state is too low in power, the state interpretation may be "too low in power"; the status content may include a current remaining power.
By encapsulating the description information of the current operating state in the notification message, each operating state has more detailed information, which facilitates the monitoring terminal 102 to comprehensively analyze the operating state of the robot 101.
further, the step of encapsulating the description information of the current operation state according to a preset notification message format to generate a notification message includes: generating a message ID; determining the severity level of the notification message according to the description information; and packaging the ID, the description information and the severity level according to a preset notification message format to generate a notification message.
As for the ID (Identity document) of the notification, it can be used to represent the uniqueness of the notification message. In generating the IDs of the notifications, an ID number may be determined according to the order of the current notification message, for example, the ID of the first notification message of the robot 101 may be 001, the ID of the second notification message may be 002, and the IDs of the subsequent notification messages may be analogized in turn. When the ID of the current notification is generated, the ID of the previous notification message may be detected, and +1 is the ID of the current notification. As for the ID number, the representation manner thereof is not limited herein, and may be, for example, a fixed-length character string type, a total of five bytes, each byte ranging from 0 to 9, the first two bytes representing a large type, and the last three bytes representing a small type divided from the large type.
For the severity level, the importance of the notification message may be represented, and the importance of the notification message may be determined according to the description information of the operation state. Such as: the notification message is serious assuming that the robot 101 is in use and the current operation state is low power, which may cause the robot 101 to stop working at any time. In implementation, the severity levels of various kinds of known description information can be defined in advance, then the description information is stored in correspondence with the severity levels, and when the notification message is generated, the severity level of the notification message can be determined directly according to the severity levels of the stored description information. In an embodiment of the present application, the severity level may include: the notification message includes four types of "info", "warming", "error", and "false", where info represents that the notification message is only one piece of synchronization information, and serves as a notification, such as normal power on, normal power off, and the like; warning stands for the status indicated by the notification message being a warning, such as low battery; error represents that the current running state belongs to an error state and is not in accordance with a normal running condition, such as task abnormal interruption; the fatal represents the most serious state and must be processed in time, such as system halt.
In addition to the ID, severity level, and description information, the time at which the notification is sent may be attached when the notification message is generated. Its format may be, for example, a reshaped Unix timestamp: leap seconds were not considered for the number of seconds elapsed since 1/1970 (midnight of UTC/GMT).
further, the format of the notification message may be various data exchange formats, such as: JSON (JavaScript Object Notation, JS Object Notation) format; XML (Extensible Markup Language), and the like.
The JSON format is an example of a lightweight data exchange format. Easy to read and write by people. And is easy to be analyzed and generated by a machine. Any supported type can be represented by JSON, such as strings, numbers, objects, arrays, and the like.
Some specific examples are given next to the encapsulated notification message in conjunction with the JSON format, and in each example, code represents a notification ID; description stands for state interpretation; time _ stamp represents the time at which the notification is sent; level represents the severity level of the notification; the data represents status content.
Example one: task start notification message:
{
“code”:“01001”,
“description”:“The move task is started.”,
“time_stamp”:1566457914,
“level”:“info”,
data { "target": foreground "}
}
In The encapsulated notification message shown in example 1, The notification ID is "01001", The status is interpreted as "The mobile task is started", The timestamp of The notification is 1566457914, The specific time can be obtained by converting The timestamp, and The specific content of The status attached to The notification is: the target is as follows: and (6) foreground.
Example 2: and (4) task ending notification:
{
“code”:“01003”,
“description”:“The move task is failed.”,
“time_stamp”:1566457924,
“level”:“warning”,
Data, target, foreground, replay, failure reason, etc
}
In The encapsulated notification message shown in example 2, The notification ID is "01003", The status is interpreted as "The mobile task is failed", The timestamp of The notification is 1566457924, The specific time can be obtained by converting The timestamp, and The specific content of The status attached to The notification is: the target is as follows: foreground, reason: the reason for failure.
Example three: and (4) charging notification:
{
“code”:“02000”,
“description”:“Charge state is changed.”,
“time_stamp”:1566457934,
“level”:“info”,
“data”:{“state”:“on”}
}
In the encapsulated notification message shown in example 3, the notification ID is "02000", the state is interpreted as "Charge state is changed", the timestamp of the notification issuance is 1566457934, the specific time can be obtained by converting the timestamp, and the specific content of the state attached to the notification is: the state is as follows: and starting.
Example 4: notification of low battery:
{
“code”:“02001”,
“description”:“Low battery reminder.”,
“time_stamp”:1566457944,
“level”:“warning”,
“data”:{“remaining_percent”:10}
}
In the packaged notification message shown in example 4, the notification ID is "02001", the state is interpreted as "Low battery timer", the timestamp of the notification is 1566457944, the specific time can be obtained by converting the timestamp, and the specific content of the state attached to the notification is: the percentage of electric quantity is as follows: 10.
it should be noted that in the data entry, the content is different for each notification, and it may be of an empty type (i.e., no field) or a JSON type (i.e., a specific field).
as can be seen from examples 1 to 4, the entire notification is sent in a JSON-formatted character string, the fields have no fixed arrangement order, and the length of the fields may not be specified, and the fields can be easily parsed and used in different languages.
Further, in step 302, according to the long connection of different transport protocols established in the foregoing embodiment, when sending the notification message, the notification message may be sent according to the corresponding transport protocol directly. For example: the long TCP connection is established, and in step 302, the notification message is sent to the target monitoring end through the TCP protocol.
for the monitoring terminal 102, after receiving the notification message, the notification message is directly parsed according to the JSON format, and then the parsed content is displayed, so that a user of the monitoring terminal 102 can know the running state of the robot 101 in real time.
Based on the same inventive concept, please refer to fig. 5, an embodiment of the present application further provides an information interaction apparatus 400, which is applied to a robot, and the information interaction apparatus 400 includes: a generating module 401 and a sending module 402.
The generating module 401 is configured to generate a notification message for notifying the current operation state when the operation state change is detected. A sending module 402, configured to send the notification message to a target monitoring end, where the target monitoring end is a monitoring end marked as a subscription notification state, and the subscription notification state is used to indicate that the target monitoring end has subscribed to the notification message.
Optionally, the generating module 401 is further configured to package description information of the current operating state according to a preset notification message format, and generate the notification message, where the description information includes a state interpretation and a state content.
Optionally, the generating module 401 is further configured to: generating a message ID; determining the severity level of the notification message according to the description information; and packaging the ID, the description information and the severity level according to the preset notification message format to generate the notification message.
Optionally, the generating module 401 is further configured to encapsulate the ID, the description information, and the severity level according to a JSON string format, and generate the notification message.
Optionally, the apparatus 400 for information interaction further includes: the receiving module is used for receiving the long connection establishment request sent by the target monitoring terminal; the establishment request comprises the IP of the target monitoring terminal. The establishing module is used for establishing long connection with the target monitoring terminal according to the IP of the target monitoring terminal; a marking module: and when receiving a subscription notification request sent by the target monitoring terminal, marking the target monitoring terminal as a subscription notification state.
Optionally, the establishing module is further configured to establish a long TCP connection with the target monitoring end according to the IP of the monitoring end. The generating module 401 is further configured to send the notification message to the target monitoring end through a TCP protocol.
The embodiments and specific examples of the method for information interaction in the foregoing embodiments are also applicable to the apparatus in fig. 5, and a person skilled in the art can clearly know the implementation method of the apparatus for information interaction in fig. 5 through the foregoing detailed description of the method for information interaction, so that details are not described here for the sake of brevity of the description.
based on the same inventive concept, the embodiment of the present application further provides an information interaction device, which is applied to a robot, and the device includes: the receiving module is used for receiving a long connection establishment request sent by a monitoring end, wherein the establishment request comprises an IP of the monitoring end; the establishing module is used for establishing long connection with the monitoring terminal according to the IP of the monitoring terminal; and the marking module is used for marking the monitoring end as a subscription notification state when receiving the subscription notification request sent by the monitoring end.
based on the same inventive concept, the embodiment of the present application further provides an information interaction device, which is applied to a monitoring end, and the device includes: the determining module is used for determining the robot to be monitored; the processing module is used for generating a long connection establishment request for establishing long connection with the robot and sending the long connection establishment request to the robot; the processing module is further configured to send a subscription notification request to the robot upon determining that the long connection with the robot is established successfully.
Based on the same inventive concept, the embodiment of the present application further provides a robot, including: the device comprises a memory and a processor, wherein the memory is connected with the processor.
The memory can store various software programs and modules, such as program instructions/modules corresponding to the method and the device for information interaction applied to the robot provided by the embodiment of the application. The processor executes various functional applications and data processing by running software programs and modules stored in the memory, namely, the method for information interaction in the embodiment of the present application is realized.
The Memory may include, but is not limited to, RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (electrically Erasable Programmable Read-Only Memory), and the like.
the processor may be an integrated circuit chip having signal processing capabilities. Can be a general purpose Processor including a CPU (Central Processing Unit), NP (Network Processor), etc.; but may also be a digital signal processor, an application specific integrated circuit, an off-the-shelf programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components. Which may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Based on the same inventive concept, the present application further provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a computer, the computer program performs the steps in the information interaction method according to any of the above embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (13)

1. a method for information interaction, which is applied to a robot, the method comprising:
Generating a notification message for notifying a current operation state when the change of the operation state is detected;
And sending the notification message to a target monitoring terminal, wherein the target monitoring terminal is a monitoring terminal marked as a subscription notification state, and the subscription notification state is used for indicating that the target monitoring terminal subscribes the notification message.
2. The method of claim 1, wherein generating a notification message for notifying a current operating state comprises:
And packaging the description information of the current running state according to a preset notification message format to generate the notification message, wherein the description information comprises state explanation and state content.
3. the method of claim 2, wherein encapsulating the description information of the current operation state according to a preset notification message format to generate the notification message comprises:
Generating a message ID;
Determining the severity level of the notification message according to the description information;
And packaging the ID, the description information and the severity level according to the preset notification message format to generate the notification message.
4. The method of claim 3, wherein encapsulating the ID, the description information, and the severity level according to the preset notification message format to generate the notification message comprises:
And packaging the ID, the description information and the severity level according to a JSON character string format to generate the notification message.
5. The method of claim 1, wherein prior to generating the notification message for notifying the current running state, the method further comprises:
receiving a long connection establishment request sent by the target monitoring terminal; the establishment request comprises the IP of the target monitoring terminal;
Establishing long connection with the target monitoring terminal according to the IP of the target monitoring terminal;
And marking the target monitoring terminal as a subscription notification state when receiving a subscription notification request sent by the target monitoring terminal.
6. the method according to claim 5, wherein establishing a long connection with the target monitoring terminal according to the long connection establishment request comprises:
Establishing a TCP long connection with the target monitoring terminal according to the IP of the monitoring terminal;
correspondingly, the sending the notification message to a target monitoring end includes:
And sending the notification message to the target monitoring terminal through a TCP protocol.
7. A method for information interaction, which is applied to a robot, the method comprising:
Receiving a long connection establishment request sent by a monitoring terminal, wherein the establishment request comprises an IP of the monitoring terminal;
Establishing long connection with the monitoring terminal according to the IP of the monitoring terminal;
And marking the monitoring terminal as a subscription notification state when receiving a subscription notification request sent by the monitoring terminal.
8. A method for information interaction is applied to a monitoring end, and the method comprises the following steps:
determining a robot to be monitored;
Generating a long connection establishment request for establishing long connection with the robot, and sending the long connection establishment request to the robot;
upon determining that a long connection with the robot is established successfully, sending a subscription notification request to the robot.
9. An information interaction device, which is applied to a robot, the device comprising:
The generating module is used for generating a notification message for notifying the current running state when the running state change is detected;
And the sending module is used for sending the notification message to a target monitoring terminal, the target monitoring terminal is a monitoring terminal marked as a subscription notification state, and the subscription notification state is used for indicating that the target monitoring terminal subscribes the notification message.
10. An information interaction device, which is applied to a robot, the device comprising:
The receiving module is used for receiving a long connection establishment request sent by a monitoring end, wherein the establishment request comprises an IP of the monitoring end;
the establishing module is used for establishing long connection with the monitoring terminal according to the IP of the monitoring terminal;
and the marking module is used for marking the monitoring end as a subscription notification state when receiving the subscription notification request sent by the monitoring end.
11. an information interaction device, which is applied to a monitoring end, the device comprising:
the determining module is used for determining the robot to be monitored;
The processing module is used for generating a long connection establishment request for establishing long connection with the robot and sending the long connection establishment request to the robot;
The processing module is further configured to send a subscription notification request to the robot upon determining that the long connection with the robot is established successfully.
12. A robot, comprising: a memory and a processor, the memory and the processor connected;
The memory is used for storing programs;
The processor calls a program stored in the memory to perform the method of any of claims 1-7.
13. a readable storage medium, having stored thereon a computer program for performing the steps of the method according to any one of claims 1-8 when the computer program is executed by a computer.
CN201910851104.6A 2019-09-06 2019-09-06 Information interaction method and device, robot and storage medium Pending CN110572315A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910851104.6A CN110572315A (en) 2019-09-06 2019-09-06 Information interaction method and device, robot and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910851104.6A CN110572315A (en) 2019-09-06 2019-09-06 Information interaction method and device, robot and storage medium

Publications (1)

Publication Number Publication Date
CN110572315A true CN110572315A (en) 2019-12-13

Family

ID=68778607

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910851104.6A Pending CN110572315A (en) 2019-09-06 2019-09-06 Information interaction method and device, robot and storage medium

Country Status (1)

Country Link
CN (1) CN110572315A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813516A (en) * 2020-06-29 2020-10-23 中国平安人寿保险股份有限公司 Resource control method and device, computer equipment and storage medium
CN112025703A (en) * 2020-08-21 2020-12-04 北京云迹科技有限公司 Robot self-diagnosis method, device and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236952A (en) * 2013-05-16 2013-08-07 浪潮通信信息系统有限公司 Blazeds (BS)-based alarm monitoring method
CN103259684A (en) * 2013-05-23 2013-08-21 世纪龙信息网络有限责任公司 Internet service monitoring method and system
CN108881406A (en) * 2018-05-30 2018-11-23 郑州云海信息技术有限公司 A kind of Internet of Things cloud monitoring system based on modular data center
CN109756351A (en) * 2017-11-01 2019-05-14 中国石油化工股份有限公司 A kind of automatic notice and response system for system unit state change
CN109753399A (en) * 2017-11-01 2019-05-14 中国石油化工股份有限公司 Automatic notification and response method for system unit state change

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236952A (en) * 2013-05-16 2013-08-07 浪潮通信信息系统有限公司 Blazeds (BS)-based alarm monitoring method
CN103259684A (en) * 2013-05-23 2013-08-21 世纪龙信息网络有限责任公司 Internet service monitoring method and system
CN109756351A (en) * 2017-11-01 2019-05-14 中国石油化工股份有限公司 A kind of automatic notice and response system for system unit state change
CN109753399A (en) * 2017-11-01 2019-05-14 中国石油化工股份有限公司 Automatic notification and response method for system unit state change
CN108881406A (en) * 2018-05-30 2018-11-23 郑州云海信息技术有限公司 A kind of Internet of Things cloud monitoring system based on modular data center

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813516A (en) * 2020-06-29 2020-10-23 中国平安人寿保险股份有限公司 Resource control method and device, computer equipment and storage medium
CN111813516B (en) * 2020-06-29 2023-04-11 中国平安人寿保险股份有限公司 Resource control method and device, computer equipment and storage medium
CN112025703A (en) * 2020-08-21 2020-12-04 北京云迹科技有限公司 Robot self-diagnosis method, device and system
CN112025703B (en) * 2020-08-21 2022-07-12 北京云迹科技股份有限公司 Robot self-diagnosis method, device and system

Similar Documents

Publication Publication Date Title
CN110808874B (en) Cross-machine-room service monitoring method and device, storage medium and server
CN110688280B (en) Management system, method, equipment and storage medium for alarm event
CN104065526B (en) A kind of method and apparatus of server failure alarm
CN109962827B (en) Equipment link detection method, device, equipment and readable storage medium
CN112202635B (en) Link monitoring method and device, storage medium and electronic device
CN110572315A (en) Information interaction method and device, robot and storage medium
CN110705893A (en) Service node management method, device, equipment and storage medium
CN110809262B (en) COAP protocol-based operation and maintenance management method for Internet of things equipment
CN112422684A (en) Target message processing method and device, storage medium and electronic device
CN113220481A (en) Request processing and feedback method and device, computer equipment and readable storage medium
CN104639459A (en) Data transmission method and system for electrical energy metering terminal
Narita et al. Reliable cloud-based robot services
CN111367795A (en) Performance test method based on benchmark service and related equipment
KR20130108874A (en) Method and apparatus for providing improved notification services for smart terminal
CN116248721A (en) Management method and device of Internet of things equipment, computer equipment and storage medium
CN111049741B (en) Method for improving communication reliability, communication system and terminal equipment
CN111552907A (en) Message processing method, device, equipment and storage medium
CN112671822B (en) Service request processing method, device, storage medium, server and system
KR20210011243A (en) Method and apparatus for monitoring HTTP/2 header compressed packet
CN110852537A (en) Service quality detection method and device
CN112769889B (en) Service data pushing method and device, storage medium and electronic device
CN116614345A (en) Communication method, application system, storage medium and program product
CN114465963B (en) Switch abnormity detection method and device, electronic equipment and computer readable medium
CN114157725B (en) Method, device, server, electronic equipment and storage medium for equipment linkage
CN115277595B (en) Data transmission method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 201, building 4, courtyard 8, Dongbeiwang West Road, Haidian District, Beijing

Applicant after: Beijing Yunji Technology Co.,Ltd.

Address before: Room 201, building 4, courtyard 8, Dongbeiwang West Road, Haidian District, Beijing

Applicant before: BEIJING YUNJI TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20191213

RJ01 Rejection of invention patent application after publication