Disclosure of Invention
An object of the embodiments of the present application is to provide a device control method, apparatus, system and electronic device, so as to solve the problem that a user cannot respond in time because the user is not near a certain device.
The specific technical scheme is as follows:
in a first aspect, a device control method is provided, the method including:
when an interaction request sent by any associated device in a preset area is received, detecting the target position of a target object in the preset area;
determining a first candidate device based on the target position in the plurality of associated devices, and determining a hardware resource corresponding to the first candidate device;
in the first candidate device, determining a target device and a target resource corresponding to the target device based on the interaction request and a hardware resource corresponding to the first candidate device, wherein the target resource is used for realizing a function corresponding to the interaction request;
and responding the interaction request by using the target equipment and the target resource corresponding to the target equipment.
Optionally, the determining, in the first candidate device, a target device and a target resource corresponding to the target device based on the interaction request and a hardware resource corresponding to the first candidate device includes:
determining a target function corresponding to the interactive request;
determining candidate resources corresponding to the target function in the hardware resources corresponding to the first candidate device;
determining the first candidate device corresponding to the candidate resource as a second candidate device;
and determining the target equipment in the second candidate equipment, and taking the candidate resource corresponding to the target equipment as the target resource.
Optionally, the determining the target device in the second candidate device includes:
for each second candidate device, determining the number of times of calling of the candidate resource corresponding to the second candidate device;
and determining the second candidate device with the largest number of times of calling as the target device.
Optionally, the determining the target device in the second candidate device includes:
for each of the second candidate devices, determining a distance of the second candidate device from the target location;
determining the second candidate device closest in distance as the target device.
Optionally, the determining the target device in the second candidate device includes:
for each second candidate device, generating selection information corresponding to the second candidate device;
determining display equipment in the associated equipment, and displaying the selection information by using the display equipment;
and when determining information corresponding to the selection information returned by the display equipment is received, determining the second candidate equipment corresponding to the determining information as the target equipment.
Optionally, the determining, among the plurality of associated devices, a first candidate device based on the target location includes:
determining a target area corresponding to the target position in the preset area;
for a plurality of the associated devices, determining a first device location at which the associated device is located;
and determining the associated equipment with the first equipment position in the target area as the first candidate equipment.
Optionally, the detecting a target position where the target object is located in the preset region includes:
determining detection equipment in a plurality of associated equipment corresponding to the preset area;
for each detection device, acquiring a picture shot by the detection device;
determining a picture with the target object as a target picture, and determining detection equipment corresponding to the target picture as target detection equipment;
determining a second device position where the target detection device is located, and determining a relative position of the target object with respect to the target detection device based on the target screen;
determining the target location at which the target object is located based on the second device location and the relative location.
In a second aspect, there is provided an apparatus for controlling a device, the apparatus comprising:
the detection module is used for detecting the target position of a target object in a preset area when an interaction request sent by any associated equipment in the preset area is received;
a first determining module, configured to determine, in the plurality of associated devices, a first candidate device based on the target location, and determine a hardware resource corresponding to the first candidate device;
a second determining module, configured to determine, in the first candidate device, a target device and a target resource corresponding to the target device based on the interaction request and a hardware resource corresponding to the first candidate device, where the target resource is used to implement a function corresponding to the interaction request;
and the response module is used for responding the interaction request by utilizing the target equipment and the target resource corresponding to the target equipment.
Optionally, the second determining module is specifically configured to:
determining a target function corresponding to the interactive request;
determining candidate resources corresponding to the target function in the hardware resources corresponding to the first candidate device;
determining the first candidate device corresponding to the candidate resource as a second candidate device;
and determining the target equipment in the second candidate equipment, and taking the candidate resource corresponding to the target equipment as the target resource.
Optionally, the second determining module is further configured to:
for each second candidate device, determining the number of times of calling of the candidate resource corresponding to the second candidate device;
and determining the second candidate device with the largest number of times of calling as the target device.
Optionally, the second determining module is further configured to:
for each of the second candidate devices, determining a distance of the second candidate device from the target location;
determining the second candidate device closest in distance as the target device.
Optionally, the second determining module is further configured to:
for each second candidate device, generating selection information corresponding to the second candidate device;
determining display equipment in the associated equipment, and displaying the selection information by using the display equipment;
and when determining information corresponding to the selection information returned by the display equipment is received, determining the second candidate equipment corresponding to the determining information as the target equipment.
Optionally, the first determining module is specifically configured to:
determining a target area corresponding to the target position in the preset area;
for a plurality of the associated devices, determining a first device location at which the associated device is located;
and determining the associated equipment with the first equipment position in the target area as the first candidate equipment.
Optionally, the detection module is specifically configured to:
determining detection equipment in a plurality of associated equipment corresponding to the preset area;
for each detection device, acquiring a picture shot by the detection device;
determining a picture with the target object as a target picture, and determining detection equipment corresponding to the target picture as target detection equipment;
determining a second device position where the target detection device is located, and determining a relative position of the target object with respect to the target detection device based on the target screen;
determining the target location at which the target object is located based on the second device location and the relative location.
In a third aspect, there is provided a plant control system, the system comprising: a control device and a plurality of associated devices,
a plurality of the associated devices for sending an interaction request to the control apparatus;
the control device is used for detecting the target position of a target object in a preset area when receiving an interaction request sent by any associated equipment in the preset area; determining a first candidate device based on the target position in the plurality of associated devices, and determining a hardware resource corresponding to the first candidate device; in the first candidate device, determining a target device and a target resource corresponding to the target device based on the interaction request and a hardware resource corresponding to the first candidate device, wherein the target resource is used for realizing a function corresponding to the interaction request; and responding the interaction request by using the target equipment and the target resource corresponding to the target equipment.
In a fourth aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of the first aspect when executing a program stored in the memory.
In a fifth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when being executed by a processor, the computer program realizes the method steps of any one of the first aspect.
In a sixth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above described method of controlling a device.
The embodiment of the application has the following beneficial effects:
the embodiment of the application provides a device control method, a device, a system and an electronic device, wherein when an interaction request sent by any associated device in a preset area is received, a target position where a target object is located is detected in the preset area; then, in a plurality of associated devices, determining a first candidate device based on the target position, and determining a hardware resource corresponding to the first candidate device; then, in the first candidate device, determining a target device and a target resource corresponding to the target device based on the interaction request and a hardware resource corresponding to the first candidate device, wherein the target resource is used for realizing a function corresponding to the interaction request; and finally, responding the interaction request by using the target equipment and the target resource corresponding to the target equipment.
According to the method and the device, when the interaction request sent by the equipment is received, the target equipment and the corresponding target resource are determined according to the interaction request and the position of the target object, then the target resource corresponding to the target equipment is used for responding to the interaction request, so that the interaction request sent by any associated equipment in the preset area is responded through the associated equipment nearby the user, the user can conveniently receive and respond the interaction request in time, and the user experience is improved.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Because various intelligent devices are often distributed at different positions in a home, in the actual use process, the situation that a user cannot respond in time because the user is not near a certain device often occurs, and therefore the embodiment of the application provides the device control method.
The following will describe an apparatus control method provided in an embodiment of the present application in detail with reference to specific embodiments, as shown in fig. 1, the specific steps are as follows:
s101, when an interaction request sent by any one associated device in a preset area is received, detecting the target position of a target object in the preset area.
In this embodiment of the application, the preset area is within a coverage of a local area network, and the associated device may be an intelligent device interconnected through the local area network in the preset area, and specifically, device interconnection may be implemented based on a HIVE (data warehouse tool) project or a grand montage.
For example, when interconnection of devices is realized based on an HIVE project, device discovery is completed through an mdns (multicast DNS) protocol, communication with the devices can be performed after the IP of the devices is obtained, and the devices report hardware resources contained in the IP in the communication process, so that registration is completed, and interconnection of the hardware resources among the devices are realized. The hardware resources are used for implementing specific functions of the device, for example, the video playing hardware resources of a television can implement a function of playing video, and the audio playing hardware resources can implement a function of playing audio. As shown in fig. 2, the refrigerator, the range hood, the washing machine, and the mobile phone report hardware resources contained therein, and complete registration, thereby implementing interconnection.
The device control method provided by the embodiment of the application can be applied to the central control device in the preset area, and after the intelligent device and the central control device in the preset area are started, the intelligent device and the central control device are added into a home local area network to establish interconnection. As shown in fig. 3, the central control device may control associated devices (such as a mobile phone, a smart television, and a smart washing machine in fig. 3) in a preset area, and invoke hardware resources of the associated devices.
Further, the target object may be a user, and when the associated device needs to convey information to the target object or needs an operation of responding to the target object, an interaction request is sent to the central control device. For example, when the washing machine needs to remind the user of "washing is completed", or when a mobile phone calls, the washing machine may send an interaction request to the central control device, or may send an interaction request to the central control device when a response operation of the user is not received within a specified time.
Specifically, when the central control device receives an interaction request sent by any associated device in the preset area, the target position where the target object is located may be detected in the preset area.
S102, in the plurality of associated devices, determining a first candidate device based on the target position, and determining a hardware resource corresponding to the first candidate device.
In this embodiment of the present application, a first candidate device may be determined among a plurality of associated devices according to a target location, and further, a hardware resource included in the first candidate device may be determined.
As an embodiment, the associated device whose distance from the target position is less than a preset distance threshold may be determined as the first candidate device. By the scheme, the associated equipment near the user can be determined as the first candidate equipment, and the user can be ensured to perceive the state of the first candidate equipment.
As another embodiment, the first candidate device may be determined by:
step one, determining a target area corresponding to the target position in the preset area.
And step two, determining the position of the first equipment where the associated equipment is located aiming at the plurality of associated equipment.
And step three, determining the associated equipment with the first equipment position in the target area as the first candidate equipment.
In this embodiment, a target area corresponding to the target position may be determined in a preset area, a first device position where the associated device is located is determined for the plurality of associated devices, and the associated device whose first device position is located in the target area is determined as the first candidate device.
For example, the preset area is a home housing, the housing can be divided into a bedroom, a living room, a dining room, a kitchen and a bathroom according to the pattern, and when the target area corresponding to the target position where the user is located is determined to be the living room, the associated device located in the living room is determined to be the first candidate device. By the scheme, the associated equipment in the same area as the user can be determined as the first candidate equipment, and the user can be ensured to perceive the state of the first candidate equipment.
S103, in the first candidate device, determining a target device and a target resource corresponding to the target device based on the interaction request and a hardware resource corresponding to the first candidate device, wherein the target resource is used for realizing a function corresponding to the interaction request.
And S104, responding to the interaction request by using the target equipment and the target resource corresponding to the target equipment.
In the embodiment of the application, the target resource is used for realizing the function corresponding to the interactive request. Specifically, the target device and the target resource corresponding to the target device may be determined in the first candidate device based on the interaction request and the hardware resource corresponding to the first candidate device, and then the interaction request may be responded by using the target device and the target resource corresponding to the target device.
In the embodiment of the application, when the interaction request sent by the equipment is received, the target equipment and the corresponding target resource are determined according to the interaction request and the position of the target object, and then the target resource corresponding to the target equipment is used for responding to the interaction request, so that the interaction request sent by any associated equipment in a preset area is responded through the associated equipment nearby a user, the user can conveniently receive and respond to the interaction request in time, and the user experience is improved.
In another embodiment of the present application, as shown in fig. 4, the S103 may include the following steps:
s401, determining a target function corresponding to the interactive request.
S402, determining candidate resources corresponding to the target function in the hardware resources corresponding to the first candidate device.
S403, determining the first candidate device corresponding to the candidate resource as a second candidate device.
S404, determining the target device in the second candidate device, and taking the candidate resource corresponding to the target device as the target resource.
In the embodiment of the present application, first, a target function required for responding to an interactive request is determined, for example, if the content of the interactive request is a video call, the required target function is a video call function. Further, in the hardware resources corresponding to the first candidate device, candidate resources corresponding to the target function are determined, and the first candidate device corresponding to the candidate resources is determined as a second candidate device, where the candidate resources corresponding to the target function may be one or more, for example, the hardware resources corresponding to the video call function are a video playing resource, a video capturing resource, an audio playing resource, and an audio capturing resource.
Further, determining a target device in the second candidate devices, and taking a candidate resource corresponding to the target device as the target resource, where the target device may be one device or a combination of multiple devices, and for example, when a video call function is implemented, the target device may be implemented by using a mobile phone; it can also be realized by the combination of a television and a household camera: and the video and the audio sent by the opposite-end equipment are played by using the television, and the video and the audio of the user are collected by using the household camera.
By the scheme, the identified target equipment and the target resource corresponding to the target equipment can be ensured to realize the target function corresponding to the interactive request.
As an embodiment, one device may be randomly selected as the target device among the second candidate devices. The implementation method is simple and efficient, and complex calculation is not needed.
As an embodiment, the target device may also be determined by:
step one, aiming at each second candidate device, determining the calling times of the candidate resources corresponding to the second candidate device;
and step two, determining the second candidate device with the largest calling times as the target device.
In this embodiment, the number of times that each second candidate device calls the candidate resource included in the second candidate device is determined, and the second candidate device with the largest number of times of calling is determined as the target device. For example, the second candidate device includes a refrigerator and a range hood, and the candidate resource is a video playing resource, where the number of times of calling the playing resource of the refrigerator is 7, and the number of times of calling the playing resource of the range hood is 8, it is determined that the range hood is the target device and the playing resource of the range hood is the target resource. According to the scheme, the equipment and hardware resources commonly used by the user can be selected as the target equipment and the target resources, the use habit of the user is met, and the user experience is improved.
As an embodiment, the target device may also be determined by:
step one, aiming at each second candidate device, determining the distance between the second candidate device and the target position;
and step two, determining the second candidate device with the closest distance as the target device.
In this embodiment, the distance between each second candidate device and the target position where the user is located may be determined, and the second candidate device closest to the target position may be determined as the target device. Through the scheme, the device closest to the user can be determined as the target device, and the use by the user is facilitated.
As an embodiment, the target device may also be determined by:
step one, aiming at each second candidate device, generating selection information corresponding to the second candidate device;
step two, determining display equipment in the associated equipment, and displaying the selection information by using the display equipment;
and step three, when determining information corresponding to the selection information returned by the display equipment is received, determining the second candidate equipment corresponding to the determining information as the target equipment.
In this embodiment, selection information corresponding to each second candidate device may be generated, and a display device for displaying the selection information may be determined among the candidate devices, where a device having a display function and closest to the user may be used as the display device, and the display device may be a combination of one or more devices for displaying the selection information to the user and receiving the determination information input by the user for the selection information. And when receiving the determination information corresponding to the selection information returned by the display equipment, determining the second candidate equipment corresponding to the determination information as the target equipment. Through the scheme, the target equipment can be determined based on the selection of the user, so that the determined target equipment better meets the user intention, and the user experience is improved.
In another embodiment of the present application, as shown in fig. 5, the S101 may include the following steps:
s501, determining detection equipment in the plurality of associated equipment corresponding to the preset area.
And S502, acquiring a picture shot by the detection equipment aiming at each detection equipment.
S503, determining the picture with the target object as a target picture, and determining the detection device corresponding to the target picture as a target detection device.
S504, determining a second device position where the target detection device is located, and determining a relative position of the target object relative to the target detection device based on the target picture.
S505, determining the target position of the target object based on the second device position and the relative position.
In the embodiment of the application, among a plurality of associated devices corresponding to the preset area, a device with a detection function is determined as a detection device, for example, a camera with a video capture function. The method comprises the steps of acquiring pictures shot by each detection device, determining pictures with target objects as target pictures, and determining the detection devices with the target pictures as target detection devices. Then, a second device position where the target detection device is located is determined from the information at the time of device registration, and a relative position of the target object with respect to the target detection device is determined based on the target screen. Finally, a target position at which the target object is located is determined based on the second device position and the relative position.
Further, a plurality of detection devices may be controlled to perform detection simultaneously to increase the detection speed, or a plurality of detection devices may be controlled to perform detection sequentially, and when a target object is detected, the detection is stopped to reduce the amount of calculation in the detection process.
Further, the Detection device may determine the target Object using Object Detection (Object Detection), and thus determine the position of the target Object.
According to the scheme, the detection equipment with the detection function can be determined in the associated equipment, the detection equipment is further used for detecting the target position where the target object is located, the detection equipment does not need to be additionally arranged, the cost is reduced, in addition, the position of the target object can be determined according to the relative position of the target object and the target detection equipment, and the determination process is simple and efficient.
Optionally, taking the case that the mobile phone receives the wechat video request as an example, the embodiment of the present application further provides a processing flow of the device control method, as shown in fig. 6, and the specific steps are as follows.
S601, when receiving the WeChat video, the mobile phone sends a WeChat video call request to the central control equipment;
and S602, the central control equipment controls the equipment with the identification capability to identify the target, so that the position of the target object is determined.
S603, the central control equipment determines appropriate equipment to finish WeChat incoming call reminding according to the position of the user, and provides hardware resources of WeChat video call.
Through the scheme, the mobile phone terminal can receive the WeChat video call request through equipment near the user, and the user can respond in time conveniently.
Based on the same technical concept, an embodiment of the present application further provides an apparatus control device, as shown in fig. 7, the apparatus includes:
the detection module 701 is configured to detect a target position where a target object is located in a preset area when an interaction request sent by any associated device in the preset area is received;
a first determining module 702, configured to determine, in the plurality of associated devices, a first candidate device based on the target location, and determine a hardware resource corresponding to the first candidate device;
a second determining module 703, configured to determine, in the first candidate device, a target device and a target resource corresponding to the target device based on the interaction request and a hardware resource corresponding to the first candidate device, where the target resource is used to implement a function corresponding to the interaction request;
a response module 704, configured to respond to the interaction request by using the target device and the target resource corresponding to the target device.
Optionally, the second determining module is specifically configured to:
determining a target function corresponding to the interactive request;
determining candidate resources corresponding to the target function in the hardware resources corresponding to the first candidate device;
determining the first candidate device corresponding to the candidate resource as a second candidate device;
and determining the target equipment in the second candidate equipment, and taking the candidate resource corresponding to the target equipment as the target resource.
Optionally, the second determining module is further configured to:
for each second candidate device, determining the number of times of calling of the candidate resource corresponding to the second candidate device;
and determining the second candidate device with the largest number of times of calling as the target device.
Optionally, the second determining module is further configured to:
for each of the second candidate devices, determining a distance of the second candidate device from the target location;
determining the second candidate device closest in distance as the target device.
Optionally, the second determining module is further configured to:
for each second candidate device, generating selection information corresponding to the second candidate device;
determining display equipment in the associated equipment, and displaying the selection information by using the display equipment;
and when determining information corresponding to the selection information returned by the display equipment is received, determining the second candidate equipment corresponding to the determining information as the target equipment.
Optionally, the first determining module is specifically configured to:
determining a target area corresponding to the target position in the preset area;
for a plurality of the associated devices, determining a first device location at which the associated device is located;
and determining the associated equipment with the first equipment position in the target area as the first candidate equipment.
Optionally, the detection module is specifically configured to:
determining detection equipment in a plurality of associated equipment corresponding to the preset area;
for each detection device, acquiring a picture shot by the detection device;
determining a picture with the target object as a target picture, and determining detection equipment corresponding to the target picture as target detection equipment;
determining a second device position where the target detection device is located, and determining a relative position of the target object with respect to the target detection device based on the target screen;
determining the target location at which the target object is located based on the second device location and the relative location.
Based on the same technical concept, the embodiment of the present application further provides an electronic device, as shown in fig. 8, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, where the processor 111, the communication interface 112, and the memory 113 complete mutual communication through the communication bus 114,
a memory 113 for storing a computer program;
the processor 111, when executing the program stored in the memory 113, implements the following steps:
when an interaction request sent by any associated device in a preset area is received, detecting the target position of a target object in the preset area;
determining a first candidate device based on the target position in the plurality of associated devices, and determining a hardware resource corresponding to the first candidate device;
in the first candidate device, determining a target device and a target resource corresponding to the target device based on the interaction request and a hardware resource corresponding to the first candidate device, wherein the target resource is used for realizing a function corresponding to the interaction request;
and responding the interaction request by using the target equipment and the target resource corresponding to the target equipment.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also 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.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program realizes the steps of any one of the above-mentioned device control methods when executed by a processor.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described method of controlling a device.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, 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. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.