Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In order to illustrate the technical means of the present invention, the following description is given by way of specific examples.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for a robot to connect to a network according to an embodiment of the present invention. The method can be applied to a robot with a network connection function, and is specifically detailed as follows:
s101: it is detected whether an existing network connection exists.
In this embodiment, the process of the robot detecting whether there is an existing network connection may be: the robot detects whether a terminal device is connected to network connection modules such as a wireless network connection module, a wired network connection module, an infrared connection module, a Bluetooth connection module and the like. The case where the robot does not perform network connection includes: the robot has no connection to the network, such as a newly purchased robot; or the robot may have a network configuration changed, for example, a user; it may also be that the network environment in which the robot is located has changed and the robot needs to connect to a new network.
S102: and if the existing network connection does not exist, acquiring the network configuration parameters of the first terminal equipment.
In this embodiment, the first terminal device may be a mobile phone, a personal computer, a tablet computer, a bluetooth device, an infrared device, a Near Field Communication (NFC) device, a Radio Frequency Identification (RFID) device, or the like. The network configuration parameters of the first device may include: the device type of the first device and information of the network connection of the first device, such as information of the type, name, password, etc. of the network connection.
Specifically, the process of acquiring the network configuration parameter of the first terminal device may be that the first terminal device actively acquires the network configuration parameter of the first terminal device, or passively receives the network configuration parameter sent by the first terminal device.
S103: and establishing a new network connection with the first terminal equipment according to the network configuration parameters.
In this embodiment, the establishing of the new network connection with the first terminal device according to the network configuration parameter may be: and selecting a corresponding specific network connection mode and a new network connection of the first terminal device according to the device type of the first device and the network connection information of the first device in the network configuration parameters of the first device. For example, when the device type of the first device is an NFC device, a new network connection is established with the first terminal device through an NFC wireless communication manner.
It can be known from the above description that, by detecting whether there is an existing network connection, if there is no existing network connection, acquiring a network configuration parameter of a first terminal device, and establishing a new network connection with the first terminal device according to the network configuration parameter, the embodiment of the present invention directly establishes a new network connection with the first terminal device by acquiring the network configuration parameter of the first terminal device, thereby omitting processes for manually connecting and configuring a network, making the operation of a robot for connecting to a network simpler, and improving connection efficiency.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for a robot to connect to a network according to another embodiment of the present invention. On the basis of the above embodiment, the step S102 is specifically detailed as follows:
s201: and sending a network connection request to the first terminal equipment, wherein the network connection request comprises equipment parameters of the robot, and the equipment parameters are used for indicating the first terminal equipment to generate network configuration parameters matched with the robot.
In this embodiment, the device parameter of the robot may be any network connection mode that can be implemented by the robot, including but not limited to a wireless network connection, a wired network connection, an infrared connection, a bluetooth connection, an NFC connection, an RFID connection, and the like.
Specifically, the generation of the network configuration parameter matched with the robot by the first terminal device may be: and generating network configuration parameters corresponding to the network connection mode according to the network connection mode of the robot. The network configuration parameters correspond to a network connection mode, such as parameters of a wireless name, an encryption type, a password and the like of a wireless network connection.
In an embodiment of the present invention, the network connection request may be sent to all terminal devices in the same lan in a broadcast manner, so that it is ensured that the first terminal device can obtain the network connection request of the robot in time.
S202: and receiving the network configuration parameters returned by the first terminal equipment.
As can be seen from the above description, in the embodiment, the robot actively sends the network connection request to the first terminal device, so that the robot actively establishes the network connection with the terminal device.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for a robot to connect to a network according to another embodiment of the present invention. On the basis of the above embodiment, the step S102 is specifically detailed as follows:
s301: and receiving a network configuration request sent by the first terminal equipment.
In this embodiment, the first terminal device may automatically send a network configuration request to the robot upon detecting that the robot is in no network connection. Wherein the network configuration request includes a device identification of the first terminal device.
S302: and sending the equipment parameters to the first terminal equipment according to the network configuration request, wherein the equipment parameters are used for indicating the first terminal equipment to generate the network configuration parameters matched with the robot.
In this embodiment, the device parameters of the robot may be sent to the first terminal device according to the device identifier of the first terminal device.
S303: and receiving the network configuration parameters returned by the first terminal equipment.
As can be seen from the above description, in the present embodiment, the robot passively receives the network configuration request sent by the first terminal device, and the robot passively establishes a network connection with the terminal device may be implemented.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for a robot to connect to a network according to another embodiment of the present invention. On the basis of the above embodiment, after the step S103, the method further includes:
s401: it is detected whether the new network connection with the first terminal device is successful.
In this embodiment, the process of detecting whether the new network connection with the first terminal device is successful may be to send a verification message to the first terminal device, determine that the new network connection with the first terminal device is unsuccessful if the first terminal device does not return a verification response message, and determine that the new network connection with the first terminal device is successful if the first terminal device returns a verification response message.
S402: and if the new network connection with the first terminal equipment is unsuccessful, generating prompt information of abnormal network connection.
In this embodiment, the network connection abnormality may be that data transmission with the first terminal device is not possible, or that data transmission is erroneous, a serious delay, or the like.
In an embodiment of the present invention, a prompt indicating that the network connection is abnormal may be further sent to the first terminal device, so that a user of the first terminal device can timely obtain the prompt indicating that the network connection is abnormal, and subsequent reconfiguration of the first terminal device for network connection is facilitated.
As can be seen from the above description, by detecting a new network connection with the first terminal device, the validity of the new network connection is guaranteed.
In one embodiment of the invention, the method further comprises:
if existing network connection exists, network configuration parameters in the existing network connection are obtained;
acquiring the identity of a second terminal device correspondingly connected with the existing network connection according to the network configuration parameters in the existing network connection;
sending connection verification information to the second terminal equipment according to the identity;
and if the verification response information of the second terminal equipment is not received within a preset time period, disconnecting the existing network connection with the second terminal equipment.
In this embodiment, the preset time period may be set according to the requirement of the user.
As can be seen from the above description, by detecting whether the verification response information of the second terminal device is received within a preset time period, the network connection with the second terminal device is determined, and it is ensured that the robot is under the control of the valid terminal device.
In one embodiment of the present invention, the robot includes a network connection module, and the network connection module includes one or more of a module USB module, a Zigbee module, an infrared module, a bluetooth module, a near field communication NFC module, or a radio frequency identification RFID module.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 5 is a block diagram of a device of a robot connection network according to an embodiment of the present invention, which corresponds to the method of a robot connection network according to the above embodiment. For convenience of explanation, only portions related to the embodiments of the present invention are shown. Referring to fig. 5, the apparatus includes: a network connection detection module 501, a network configuration parameter acquisition module 502 and a network connection establishment module 503.
A network connection detection module 501, configured to detect whether there is an existing network connection;
a network configuration parameter obtaining module 502, configured to obtain a network configuration parameter of the first terminal device if there is no existing network connection;
a network connection establishing module 503, configured to establish a new network connection with the first terminal device according to the network configuration parameter.
As can be seen from the above description, by detecting whether there is an existing network connection, and if there is no existing network connection, acquiring a network configuration parameter of the first terminal device, and establishing a new network connection with the first terminal device according to the network configuration parameter, the embodiment of the present invention directly establishes a new network connection with the first terminal device by acquiring the network configuration parameter of the first terminal device, thereby omitting a process for manually connecting and configuring a network, making the operation of the robot for connecting to the network simpler and more convenient, and improving the connection efficiency.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the foregoing embodiment, the network configuration parameter obtaining module 502 includes:
a network connection request sending unit 5021, configured to send a network connection request to the first terminal device, where the network connection request includes device parameters of the robot, and the device parameters are used to instruct the first terminal device to generate network configuration parameters matched with the robot;
a network configuration parameter receiving unit 5022, configured to receive the network configuration parameter returned by the first terminal device.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the foregoing embodiment, the network configuration parameter obtaining module 502 further includes:
a network configuration request receiving unit 5023, configured to receive a network configuration request sent by the first terminal device;
a device parameter sending unit 5024, configured to send a device parameter to the first terminal device according to the network configuration request, where the device parameter is used to instruct the first terminal device to generate a network configuration parameter matching with the robot;
a network configuration parameter receiving unit 5025, configured to receive the network configuration parameter returned by the first terminal device.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the above embodiment, the apparatus further includes:
the connection detection module 501 is further configured to detect whether a new network connection with the first terminal device is successful;
a prompt information generating module 504, configured to generate a prompt information about abnormal network connection if the new network connection with the first terminal device is unsuccessful.
Referring to fig. 5, in an embodiment of the present invention, on the basis of the above embodiment, the apparatus further includes:
the network configuration parameter obtaining module 502 is further configured to obtain a network configuration parameter in an existing network connection if the existing network connection exists;
an identity obtaining module 505, configured to obtain, according to the network configuration parameter in the existing network connection, an identity of a second terminal device connected to the existing network connection correspondingly;
a connection verification information sending module 506, configured to send connection verification information to the second terminal device according to the identity;
a network connection disconnection module 507, configured to disconnect an existing network connection with the second terminal device if the verification response information of the second terminal device is not received within a preset time period.
In an embodiment of the present invention, on the basis of the above embodiment, the robot includes a network connection module, and the network connection module includes one or more of a USB module, a Zigbee module, an infrared module, a bluetooth module, a near field communication NFC module, and a radio frequency identification RFID module.
Referring to fig. 6, fig. 6 is a schematic block diagram of a terminal device of a robot connection network according to an embodiment of the present invention. The terminal 600 in the present embodiment shown in fig. 6 may include: one or more processors 601, one or more input devices 602, one or more output devices 603, and one or more memories 604. The processor 601, the input device 602, the output device 603 and the memory 604 are communicated with each other via a communication bus 605. The memory 604 is used to store a computer program comprising program instructions. Processor 601 is operative to execute program instructions stored in memory 604. Wherein the processor 601 is configured to call the program instructions to perform the following functions of operating the modules/units in the above-mentioned device embodiments, such as the functions of the modules 501 to 507 shown in fig. 5.
It should be understood that in the embodiment of the present invention, the Processor 601 may be a Central Processing Unit (CPU), and the Processor may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 602 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 603 may include a display (LCD, etc.), a speaker, etc.
The memory 604 may include both read-only memory and random access memory, and provides instructions and data to the processor 601. A portion of the memory 604 may also include non-volatile random access memory. For example, the memory 604 may also store device type information.
In specific implementation, the processor 601, the input device 602, and the output device 603 described in this embodiment of the present invention may execute the implementation manners described in the first embodiment and the second embodiment of the service request method provided in this embodiment of the present invention, and may also execute the implementation manner of the terminal described in this embodiment of the present invention, which is not described again here.
In another embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program, where the computer program includes program instructions, where the program instructions implement all or part of the procedures in the method of the above embodiments when executed by a processor, and may also be implemented by a computer program instructing associated hardware, where the computer program may be stored in a computer-readable storage medium, and where the computer program can implement the steps of the above method embodiments when executed by a processor. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The computer readable storage medium may be an internal storage unit of the terminal according to any of the foregoing embodiments, for example, a hard disk or a memory of the terminal. The computer readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk provided on the terminal, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working process of the terminal and the unit described above may refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed terminal and method can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, 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 through some interfaces, devices or units, and may also be an electrical, mechanical or other form of connection.
The 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 of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.