CN111277505B - Multi-terminal joint control method, device, equipment and storage medium based on local area network - Google Patents
Multi-terminal joint control method, device, equipment and storage medium based on local area network Download PDFInfo
- Publication number
- CN111277505B CN111277505B CN202010033335.9A CN202010033335A CN111277505B CN 111277505 B CN111277505 B CN 111277505B CN 202010033335 A CN202010033335 A CN 202010033335A CN 111277505 B CN111277505 B CN 111277505B
- Authority
- CN
- China
- Prior art keywords
- terminal
- controlled terminal
- target
- address
- identification information
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention discloses a multi-terminal joint control method, a multi-terminal joint control device, a multi-terminal joint control equipment and a storage medium based on a local area network, wherein the method comprises the steps of analyzing a terminal control instruction to determine identification information of a target controlled terminal and the target control instruction if the terminal control instruction initiated by a user is detected; acquiring a corresponding IP address and effective port information from a preset database according to the determined identification information of the target controlled terminal; and sending the target control instruction, the acquired IP address of the target controlled terminal and the effective port information to a routing end in a local area network, so that the routing end sends the target control instruction to the corresponding target controlled terminal according to the acquired IP address of the target controlled terminal and the effective port information, and realizes the control of the target controlled terminal. According to the invention, more flexible and convenient interconnection control among different terminals can be realized, more function operations are satisfied, and the use experience of a user is improved.
Description
Technical Field
The invention relates to the technical field of electronics, in particular to a multi-terminal joint control method, a multi-terminal joint control device, multi-terminal joint control equipment and a storage medium based on a local area network.
Background
At present, the popularity of smart televisions on the market is nearly saturated, the coverage of home broadband networks is quite mature, and mobile communication devices (such as mobile phones and the like) are also widely popularized. Based on the current terminal use environment, the external environment for realizing multi-terminal connection communication in the local area network is mature, so that the control mode aiming at large household appliances such as an intelligent television can be completely realized through a network communication mode, and the control mode is more flexible compared with the control mode of a traditional entity remote controller. Applications such as remote control assistants and the like in the application market transmit data to each other through multiple terminals based on internet communication, so that related operation functions are realized, but the applications are basically third-party applications, so that the compatibility of a terminal system is limited; in addition, due to the self-protection mechanism of the Android system, the function operations which can be performed by the non-system-level application are limited, and many functions and operations cannot be realized.
Disclosure of Invention
The embodiment of the invention provides a multi-terminal joint control method, a multi-terminal joint control device, a multi-terminal joint control equipment and a storage medium based on a local area network, which can realize more flexible and convenient interconnection control among different terminals, meet more functional operations and improve the use experience of users.
In a first aspect, an embodiment of the present invention provides a multi-terminal joint control method based on a local area network, where the method includes:
if a terminal control instruction initiated by a user is detected, analyzing the terminal control instruction to determine the identification information of a target controlled terminal and the target control instruction;
acquiring corresponding IP addresses and effective port information from a preset database according to the determined identification information of the target controlled terminal, wherein the preset database comprises at least one IP address, each IP address is correspondingly associated with corresponding effective port information, and different IP addresses are associated with different identification information;
and sending the target control instruction, the acquired IP address of the target controlled terminal and the effective port information to a routing end in a local area network, so that the routing end sends the target control instruction to the corresponding target controlled terminal according to the acquired IP address of the target controlled terminal and the effective port information, and realizes the control of the target controlled terminal.
In a second aspect, an embodiment of the present invention further provides a multi-terminal joint control device based on a local area network, where the device includes:
the instruction analysis unit is used for analyzing the terminal control instruction to determine the identification information of the target controlled terminal and the target control instruction if the terminal control instruction initiated by the user is detected;
the acquiring unit is used for acquiring corresponding IP addresses and effective port information from a preset database according to the determined identification information of the target controlled terminal, wherein the preset database comprises at least one IP address, each IP address is correspondingly associated with corresponding effective port information, and different IP addresses are associated with different identification information;
and the processing unit is used for sending the target control instruction, the acquired IP address of the target controlled terminal and the effective port information to a routing end in a local area network, so that the routing end sends the target control instruction to the corresponding target controlled terminal according to the acquired IP address of the target controlled terminal and the effective port information, and the control of the target controlled terminal is realized.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can implement the above method when being executed by a processor.
The method of the embodiment of the invention can realize more flexible and convenient interconnection control among different terminals, meet more functional operations and improve the use experience of users.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a multi-terminal joint control method based on a local area network according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a multi-terminal joint control method based on a local area network according to another embodiment of the present invention;
fig. 3 is a schematic sub-flow chart of a multi-terminal joint control method based on a local area network according to another embodiment of the present invention;
fig. 4 is a schematic block diagram of a multi-terminal joint control device based on a local area network according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of a multi-terminal joint control device based on a local area network according to another embodiment of the present invention;
fig. 6 is a schematic block diagram of an obtaining unit of a multi-terminal joint control device based on a local area network according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
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 the specification of the present invention 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.
Referring to fig. 1, fig. 1 is a schematic flowchart of a multi-terminal joint control method based on a local area network according to an embodiment of the present invention. The method can be operated in terminals such as smart phones (such as Android phones, IOS phones and the like), tablet computers, notebook computers, smart devices and the like. The terminal is shown in fig. 1 by a series, and the steps of the method include steps S101 to S103.
Step S101, if a terminal control instruction initiated by a user is detected, the terminal control instruction is analyzed to determine the identification information of a target controlled terminal and the target control instruction.
In this embodiment, a user can initiate a target control instruction to a target controlled terminal through a control terminal, and the control terminal can control other terminals located in the same local area network as the control terminal after detecting the terminal control instruction initiated by the user. Specifically, a TCP standard communication protocol and a routing end in a local area network are adopted to realize the forwarding of control instructions, establish a connection channel, realize the transmission and the reception of various types of data packets and the like, namely, the joint control among a plurality of terminals in the same local area network is effectively realized. The local area network communication technology is a communication mode with wide application, high efficiency and low power consumption, and is particularly suitable for intercommunication with multiple terminals in a network in a small range.
For example, if the control terminal is a mobile terminal, such as a smart phone, and the controlled terminal is a smart television, the user can realize interconnection control between the mobile terminal and the smart television through a local area network networking communication technology, that is, the operation control mode is more flexible and convenient, the limitation of one-to-one matching between the smart television and an entity remote controller can be solved without an external internet, and the connection control between multiple terminals is directly realized through the local area network.
Generally, a user can initiate a terminal control instruction through a control terminal, where the terminal control instruction includes identification information of a target controlled terminal and a target control instruction, the identification information of the target controlled terminal refers to identification information of the controlled terminal, and generally, the identification information may be a name of the corresponding controlled terminal, or information such as a model; the target control instruction is a command for controlling the corresponding controlled terminal by the user, for example, a control instruction for starting up, changing channels, shutting down or adjusting volume is sent to the smart television in the same local area network through the smart phone.
Step S102, acquiring corresponding IP addresses and effective port information from a preset database according to the determined identification information of the target controlled terminal, wherein the preset database comprises at least one IP address, each IP address is correspondingly associated with corresponding effective port information, and different IP addresses are associated with different identification information.
In this embodiment, the preset database stores the pre-stored IP addresses and valid port information of different controlled terminals. In the local area network, a controlled terminal is usually provided with an IP address, and each controlled terminal is associated with an identification information, so in order to determine the IP address of each controlled terminal, different identification information is usually associated with different IP addresses. Generally, the identification information and the valid port information of the corresponding target controlled terminal can be determined from a preset database through the determined identification information of the target controlled terminal.
In general, the controlled terminal may include a plurality of port information, and when the control instruction needs to be sent, it needs to determine valid port information of a target controlled terminal, so as to implement accurate sending of the control instruction, where the valid port information may be one of the plurality of port information of the controlled terminal, and is not limited in this embodiment.
Step S103, the target control instruction, the acquired IP address of the target controlled terminal and the effective port information are sent to a routing end in a local area network, so that the routing end sends the target control instruction to the corresponding target controlled terminal according to the acquired IP address of the target controlled terminal and the effective port information, and the target controlled terminal is controlled.
In this embodiment, after the control terminal sends the target control instruction, the acquired IP address of the target controlled terminal, and the effective port information to the routing end in the local area network, the router can find the target controlled terminal according to the IP address, and send the target control instruction to the target controlled terminal through the effective port information of the corresponding target controlled terminal, so that the target controlled terminal realizes corresponding functional operation according to the target control instruction, that is, the control terminal controls the target controlled terminal located in the same local area network as the target controlled terminal.
In an embodiment, the method further comprises the steps of:
and step S104, if the controlled feedback information forwarded by the target controlled terminal through the router is not received within a second preset time threshold, displaying a prompt box for the user to select whether to initiate the terminal control instruction again.
In this embodiment, in order to further control the target controlled terminal, after the target controlled terminal executes the target control instruction, a corresponding controlled feedback message may be generated, and the controlled feedback message may be forwarded to the control terminal through the router, so that the user can know the control condition of the control terminal conveniently. If the terminal does not receive the controlled feedback information forwarded by the target controlled terminal through the router within the second preset time threshold, it indicates that a state that the control terminal and the target controlled terminal are not intercommunicated, that is, a signal disconnection state may exist at this time, and at this time, a prompt box may be displayed for the user to select whether to initiate the terminal control instruction again, so as to further initiate control on the target controlled terminal.
In summary, the embodiment of the present invention provides a multi-terminal joint control method based on a local area network. The method of the embodiment of the invention can realize more flexible and convenient interconnection control among different terminals, meet more functional operations and improve the use experience of users.
Referring to fig. 2, fig. 2 is a schematic flowchart of a multi-terminal joint control method based on a local area network according to another embodiment of the present invention. The steps of the method include steps S201a to S203. The related explanations and detailed descriptions of the steps similar to steps S101-S103 in the above embodiment are not repeated herein, and the following detailed descriptions are the added steps in this embodiment.
Step S201a, sending a detection packet to a controlled terminal in the local area network through a routing end in the local area network every a preset time range, so that the controlled terminal generates a response packet, where the response packet includes an IP address and port information of the controlled terminal.
In this embodiment, since only terminals in the same lan can implement communication interconnection and control, in order to ensure that the terminals can implement joint control, the control terminal needs to send a detection packet to a controlled terminal in the lan at intervals of a preset time range. The preset time range may be set according to a requirement of a user, for example, may be any one of 2min, 3min, or 4min, and is not limited in this embodiment. In addition, other terminals than the control terminal, which are located in the local area network where the control terminal is located, may also be used as the controlled terminals. After the controlled terminal receives the detection data packet distributed by the router in the local area network where the controlled terminal is located, a corresponding response data packet can be generated. The response packet may include an IP address of the controlled terminal and port information, where the IP address of the controlled terminal refers to a unique address of the controlled terminal in the local area network, and the IP address is used to determine the location of the controlled terminal, and the port information refers to a related port of the controlled terminal. For example, for 192.168.0.1:8899, the IP address is 192.168.0.1, and the port information is 8899, through which the sending of the command to the controlled terminal can be realized.
Step S201b, it is determined whether a response packet forwarded by the controlled terminal through the routing end is detected within a first preset time threshold.
In this embodiment, in order to determine that the detection packet sent by the control terminal is received by the controlled terminal, it needs to be determined whether a response packet forwarded by the controlled terminal through the routing end is detected within a first preset time threshold. The first preset time threshold may be set according to a requirement of a user, for example, the first preset time threshold may be 2min, may also be 3min, and may also be 4min, which is not limited in this embodiment.
Meanwhile, if the response packet forwarded by the controlled terminal through the routing end is not detected within the first preset time threshold, it indicates that the controlled terminal is not turned on or is not in the local area network, so it may choose to return to the step S201a for reconnection.
Step S201c, if a response packet forwarded by the controlled terminal through the routing end is detected within a first preset time threshold, parsing the response packet to obtain identification information of the controlled terminal and IP address and port information associated with the identification information.
In this embodiment, if the control terminal detects a response packet forwarded by the controlled terminal through the routing terminal within the first preset time threshold, it indicates that the control terminal and the controlled terminal at this time are located in the same local area network, and joint control may be implemented. After receiving the response data packet, the control terminal can parse the response data packet, so as to obtain the identification information of the controlled terminal and the IP address and the port information associated with the identification information, so as to perform subsequent operations.
Step S201d, storing the acquired identification information of the controlled terminal and the IP address and port information associated with the identification information into a preset database, so as to establish joint control with the controlled terminal.
In this embodiment, the number of the controlled terminals may be set according to an actual situation, so that in order to facilitate a user to select a controlled terminal to be controlled, the acquired identification information of the controlled terminal, and the IP address and the port information associated with the identification information may be stored in a preset database, so as to facilitate an effect of implementing an associated control between the control terminal and the controlled terminal.
Step S201, if a terminal control instruction initiated by a user is detected, the terminal control instruction is analyzed to determine the identification information of the target controlled terminal and the target control instruction.
Step S202, acquiring corresponding IP addresses and effective port information from a preset database according to the determined identification information of the target controlled terminal, wherein the preset database comprises at least one IP address, each IP address is correspondingly associated with corresponding effective port information, and different IP addresses are associated with different identification information.
In one embodiment, as shown in fig. 3, the step S202 includes:
step S301, obtaining the corresponding IP address from the preset database according to the determined identification information of the target controlled terminal.
In this embodiment, the control terminal can obtain the IP address associated with the determined target controlled terminal from the preset database according to the determined identification information of the target controlled terminal, where the preset database usually includes the IP address of the controlled terminal, and since the controlled terminal may be multiple, the IP address at this time may also be multiple.
Step S302, obtaining corresponding port information according to the IP address.
In this embodiment, since the IP address is provided with a plurality of corresponding port information, that is, each controlled terminal is provided with a plurality of port information, in order to prevent the joint control between the controlled terminal and the control terminal from being affected, it is usually selected to select and use valid port information from the port information to implement the transmission of data such as instructions. Therefore, the control terminal can obtain the corresponding port information according to the IP address so as to execute the following steps.
Step S303, selecting one of the port information from the port information as valid port information according to a preset random selection rule.
In this embodiment, the control terminal may select one of the port information as the valid port information from the port information according to a preset random selection rule, where the preset random selection rule may be a random selection function rand (), and of course, the specific implementation is not limited in this embodiment.
In an embodiment, step S301 of the method further includes the following steps:
step S301a, it is determined whether the preset database includes the identification information of the determined target controlled terminal.
In this embodiment, since there may be a situation that data is cleared in the preset database of the control terminal, before acquiring the IP address corresponding to the determined target controlled terminal from the preset database according to the determined identification information of the target controlled terminal, it is further required to determine whether the preset database includes the determined identification information of the target controlled terminal. If the preset database does not include the identification information of the determined target controlled terminal, the step S201a is returned, that is, the interconnection between the control terminal and the controlled terminal is reestablished. If the preset database includes the determined identification information of the target controlled terminal, the step S301 is executed.
Step S203, sending the target control instruction, the acquired IP address of the target controlled terminal, and the effective port information to a routing end in a local area network, so that the routing end sends the target control instruction to a corresponding target controlled terminal according to the acquired IP address of the target controlled terminal and the effective port information, and implements control of the target controlled terminal.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
Referring to fig. 4, in response to the above-mentioned multi-terminal joint control method based on the local area network, an embodiment of the present invention further provides a multi-terminal joint control apparatus based on the local area network, where the apparatus 100 includes: instruction parsing unit 101, acquisition unit 102, and processing unit 103.
The instruction parsing unit 101 is configured to, if a terminal control instruction initiated by a user is detected, parse the terminal control instruction to determine identification information of a target controlled terminal and the target control instruction.
In this embodiment, a user can initiate a target control instruction to a target controlled terminal through a control terminal, and the control terminal can control other terminals located in the same local area network as the control terminal after detecting the terminal control instruction initiated by the user. Specifically, a TCP standard communication protocol and a routing end in a local area network are adopted to realize the forwarding of control instructions, establish a connection channel, realize the transmission and the reception of various types of data packets and the like, namely, the joint control among a plurality of terminals in the same local area network is effectively realized. The local area network communication technology is a communication mode with wide application, high efficiency and low power consumption, and is particularly suitable for intercommunication with multiple terminals in a network in a small range.
For example, if the control terminal is a mobile terminal, such as a smart phone, and the controlled terminal is a smart television, the user can realize interconnection control between the mobile terminal and the smart television through a local area network networking communication technology, that is, the operation control mode is more flexible and convenient, the limitation of one-to-one matching between the smart television and an entity remote controller can be solved without an external internet, and the connection control between multiple terminals is directly realized through the local area network.
Generally, a user can initiate a terminal control instruction through a control terminal, where the terminal control instruction includes identification information of a target controlled terminal and a target control instruction, the identification information of the target controlled terminal refers to identification information of the controlled terminal, and generally, the identification information may be a name of the corresponding controlled terminal, or information such as a model; the target control instruction is a command for controlling the corresponding controlled terminal by the user, for example, a control instruction for starting up, changing channels, shutting down or adjusting volume is sent to the smart television in the same local area network through the smart phone.
The obtaining unit 102 is configured to obtain corresponding IP addresses and valid port information from a preset database according to the determined identification information of the target controlled terminal, where the preset database includes at least one IP address, each IP address is associated with corresponding valid port information correspondingly, and different IP addresses are associated with different identification information.
In this embodiment, the preset database stores the pre-stored IP addresses and valid port information of different controlled terminals. In the local area network, a controlled terminal is usually provided with an IP address, and each controlled terminal is associated with an identification information, so in order to determine the IP address of each controlled terminal, different identification information is usually associated with different IP addresses. Generally, the identification information and the valid port information of the corresponding target controlled terminal can be determined from a preset database through the determined identification information of the target controlled terminal.
In general, the controlled terminal may include a plurality of port information, and when the control instruction needs to be sent, it needs to determine valid port information of a target controlled terminal, so as to implement accurate sending of the control instruction, where the valid port information may be one of the plurality of port information of the controlled terminal, and is not limited in this embodiment.
The processing unit 103 is configured to send the target control instruction, the acquired IP address of the target controlled terminal, and the effective port information to a routing end in a local area network, so that the routing end sends the target control instruction to a corresponding target controlled terminal according to the acquired IP address of the target controlled terminal and the effective port information, and controls the target controlled terminal.
In this embodiment, after the control terminal sends the target control instruction, the acquired IP address of the target controlled terminal, and the effective port information to the routing end in the local area network, the router can find the target controlled terminal according to the IP address, and send the target control instruction to the target controlled terminal through the effective port information of the corresponding target controlled terminal, so that the target controlled terminal realizes corresponding functional operation according to the target control instruction, that is, the control terminal controls the target controlled terminal located in the same local area network as the target controlled terminal.
In an embodiment, the apparatus 100 further comprises the following units:
and the display unit 104 is configured to display a prompt box for the user to select whether to initiate the terminal control instruction again if the controlled feedback information forwarded by the target controlled terminal through the router is not received within the second preset time threshold.
In this embodiment, in order to further control the target controlled terminal, after the target controlled terminal executes the target control instruction, a corresponding controlled feedback message may be generated, and the controlled feedback message may be forwarded to the control terminal through the router, so that the user can know the control condition of the control terminal conveniently. If the terminal does not receive the controlled feedback information forwarded by the target controlled terminal through the router within the second preset time threshold, it indicates that a state that the control terminal and the target controlled terminal are not intercommunicated, that is, a signal disconnection state may exist at this time, and at this time, a prompt box may be displayed for the user to select whether to initiate the terminal control instruction again, so as to further initiate control on the target controlled terminal.
Referring to fig. 5, in response to the above-mentioned multi-terminal joint control method based on the local area network, another embodiment of the present invention further provides a multi-terminal joint control apparatus based on the local area network, where the apparatus 200 includes: a detection unit 201a, a judgment unit 201b, a packet analysis unit 201c, a storage unit 201d, an instruction analysis unit 201, an acquisition unit 202, and a processing unit 203.
The detecting unit 201a is configured to send a detection packet to a controlled terminal in the local area network through a routing end in the local area network every preset time range, so that the controlled terminal generates a response packet, where the response packet includes an IP address and port information of the controlled terminal.
In this embodiment, since only terminals in the same lan can implement communication interconnection and control, in order to ensure that the terminals can implement joint control, the control terminal needs to send a detection packet to a controlled terminal in the lan at intervals of a preset time range. The preset time range may be set according to a requirement of a user, for example, may be any one of 2min, 3min, or 4min, and is not limited in this embodiment. In addition, other terminals than the control terminal, which are located in the local area network where the control terminal is located, may also be used as the controlled terminals. After the controlled terminal receives the detection data packet distributed by the router in the local area network where the controlled terminal is located, a corresponding response data packet can be generated. The response packet may include an IP address of the controlled terminal and port information, where the IP address of the controlled terminal refers to a unique address of the controlled terminal in the local area network, and the IP address is used to determine the location of the controlled terminal, and the port information refers to a related port of the controlled terminal. For example, for 192.168.0.1:8899, the IP address is 192.168.0.1, and the port information is 8899, through which the sending of the command to the controlled terminal can be realized.
The first determining unit 201b is configured to determine whether a response packet forwarded by the controlled terminal through the routing end is detected within a first preset time threshold.
In this embodiment, in order to determine that the detection packet sent by the control terminal is received by the controlled terminal, it needs to be determined whether a response packet forwarded by the controlled terminal through the routing end is detected within a first preset time threshold. The first preset time threshold may be set according to a requirement of a user, for example, the first preset time threshold may be 2min, may also be 3min, and may also be 4min, which is not limited in this embodiment.
Meanwhile, if the response packet forwarded by the controlled terminal through the routing end is not detected within the first preset time threshold, it indicates that the controlled terminal may not be turned on or is not in the local area network, so that the controlled terminal may choose to return to the detecting unit 201a for reconnection.
A packet parsing unit 201c, configured to, if a response packet forwarded by the controlled terminal through the routing end is detected within a first preset time threshold, parse the response packet to obtain identification information of the controlled terminal and IP address and port information associated with the identification information.
In this embodiment, if the control terminal detects a response packet forwarded by the controlled terminal through the routing terminal within the first preset time threshold, it indicates that the control terminal and the controlled terminal at this time are located in the same local area network, and joint control may be implemented. After receiving the response data packet, the control terminal can parse the response data packet, so as to obtain the identification information of the controlled terminal and the IP address and the port information associated with the identification information, so as to perform subsequent operations.
The storage unit 201d is configured to store the acquired identification information of the controlled terminal and the IP address and the port information associated with the identification information into a preset database, so as to establish joint control with the controlled terminal.
In this embodiment, the number of the controlled terminals may be set according to an actual situation, so that in order to facilitate a user to select a controlled terminal to be controlled, the acquired identification information of the controlled terminal, and the IP address and the port information associated with the identification information may be stored in a preset database, so as to facilitate an effect of implementing an associated control between the control terminal and the controlled terminal.
The instruction parsing unit 201 is configured to, if a terminal control instruction initiated by a user is detected, parse the terminal control instruction to determine identification information of a target controlled terminal and the target control instruction.
An obtaining unit 202, configured to obtain corresponding IP addresses and valid port information from a preset database according to the determined identification information of the target controlled terminal, where the preset database includes at least one IP address, each IP address is associated with corresponding valid port information correspondingly, and different IP addresses are associated with different identification information.
In an embodiment, as shown in fig. 6, the obtaining unit 202 includes an address obtaining unit 301, a port obtaining unit 302, and a port selecting unit 303.
An address obtaining unit 301, configured to obtain an IP address corresponding to the determined target controlled terminal from a preset database according to the determined identification information of the target controlled terminal.
In this embodiment, the control terminal can obtain the IP address associated with the determined target controlled terminal from the preset database according to the determined identification information of the target controlled terminal, where the preset database usually includes the IP address of the controlled terminal, and since the controlled terminal may be multiple, the IP address at this time may also be multiple.
A port obtaining unit 302, configured to obtain corresponding port information according to the IP address.
In this embodiment, since the IP address is provided with a plurality of corresponding port information, that is, each controlled terminal is provided with a plurality of port information, in order to prevent the joint control between the controlled terminal and the control terminal from being affected, it is usually selected to select and use valid port information from the port information to implement the transmission of data such as instructions. The control terminal can obtain the corresponding port information according to the IP address so as to execute the following units.
The port selecting unit 303 is configured to select one of the port information as valid port information according to a preset random selection rule.
In this embodiment, the control terminal may select one of the port information as the valid port information from the port information according to a preset random selection rule, where the preset random selection rule may be a random selection function rand (), and of course, the specific implementation is not limited in this embodiment.
In an embodiment, the address obtaining unit 301 further includes the following units:
a second judging unit 301a, configured to judge whether the preset database includes the identification information of the determined target controlled terminal.
In this embodiment, since there may be a situation that data is cleared in the preset database of the control terminal, before acquiring the IP address corresponding to the determined target controlled terminal from the preset database according to the determined identification information of the target controlled terminal, it is further required to determine whether the preset database includes the determined identification information of the target controlled terminal. If the preset database does not include the identification information of the determined target controlled terminal, the detection unit 201a is returned, that is, the interconnection between the control terminal and the controlled terminal is reestablished. If the preset database includes the identification information of the determined target controlled terminal, the address obtaining unit 301 is executed.
The processing unit 203 is configured to send the target control instruction, the acquired IP address of the target controlled terminal, and the effective port information to a routing end in a local area network, so that the routing end sends the target control instruction to a corresponding target controlled terminal according to the acquired IP address of the target controlled terminal and the effective port information, and controls the target controlled terminal.
It should be noted that, as can be clearly understood by those skilled in the art, for the specific implementation process of the multi-terminal joint control device 100 based on the local area network and each unit, reference may be made to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
As can be seen from the above description, in terms of hardware implementation, the instruction analysis unit 101, the obtaining unit 102, the processing unit 103, and the like may be embedded in a multi-terminal integrated control device based on a local area network in a hardware form or may be independent from the multi-terminal integrated control device based on a local area network in a software form, so that the processor invokes and executes operations corresponding to the above respective units. The processor can be a Central Processing Unit (CPU), a microprocessor, a singlechip and the like.
The multi-terminal joint control device based on the local area network can be implemented in the form of a computer program, and the computer program can be run on a computer device as shown in fig. 7.
FIG. 7 is a schematic diagram of a computer device according to the present invention. The device can be a terminal, wherein the terminal can be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant and a wearable device. Referring to fig. 7, the computer device 400 includes a processor 402, a memory, an internal memory 404, and a network interface 405 connected by a system bus 401, wherein the memory may include a nonvolatile storage medium 403 and the internal memory 404.
The non-volatile storage medium 403 may store an operating system 4031 and a computer program 4032, which when executed, may cause the processor 402 to perform a method of local area network-based multi-terminal joint control.
The processor 402 is used to provide computing and control capabilities that support the operation of the overall computer device 400.
The internal memory 404 provides an environment for running the computer program 4032 in the non-volatile storage medium 403, and when the computer program 4032 is executed by the processor 402, the processor 402 can be enabled to execute a local area network-based multi-terminal joint control method.
The network interface 405 is used for network communication with other devices. Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing device 400 to which the disclosed aspects apply, as a particular computing device 400 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The processor 402 is configured to run the computer program 4032 stored in the memory, so as to implement the steps in the local area network-based multi-terminal joint control method.
It should be understood that in the embodiment of the present Application, the Processor 402 may be a Central Processing Unit (CPU), and the Processor 402 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, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program that, when executed by a processor, causes the processor to execute the steps of the local area network-based multi-terminal cooperative control method. The storage medium is an entity and non-transitory storage medium, and may be various entity storage media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
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 implementation. 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.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. 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, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
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.
Claims (7)
1. A multi-terminal joint control method based on a local area network is characterized by comprising the following steps:
if a terminal control instruction initiated by a user is detected, analyzing the terminal control instruction to determine the identification information of a target controlled terminal and the target control instruction;
acquiring corresponding IP addresses and effective port information from a preset database according to the determined identification information of the target controlled terminal, wherein the preset database comprises at least one IP address, each IP address is correspondingly associated with corresponding effective port information, and different IP addresses are associated with different identification information;
sending the target control instruction, the acquired IP address of the target controlled terminal and the effective port information to a routing end in a local area network, so that the routing end sends the target control instruction to the corresponding target controlled terminal according to the acquired IP address of the target controlled terminal and the effective port information, and realizes the control of the target controlled terminal;
if the controlled feedback information forwarded by the target controlled terminal through the router is not received within a second preset time threshold, displaying a prompt box for a user to select whether to initiate a terminal control instruction again;
the step of acquiring the corresponding IP address and the valid port information from the preset database according to the determined identification information of the target controlled terminal includes:
acquiring an IP address corresponding to the determined identification information of the target controlled terminal from a preset database;
acquiring corresponding port information according to the IP address;
selecting one port information from the port information as effective port information according to a preset random selection rule;
before the step of analyzing the terminal control instruction to determine the identification information of the target controlled terminal and the target control instruction, the method further includes:
sending a detection data packet to a controlled terminal in a local area network through a routing end in the local area network every a preset time range so that the controlled terminal generates a response data packet, wherein the response data packet comprises an IP address and port information of the controlled terminal;
judging whether a response data packet forwarded by the controlled terminal through the routing terminal is detected within a first preset time threshold value;
if a response data packet forwarded by the controlled terminal through the routing terminal is detected within a first preset time threshold, analyzing the response data packet to acquire identification information of the controlled terminal and IP address and port information associated with the identification information;
and storing the acquired identification information of the controlled terminal and the IP address and the port information associated with the identification information into a preset database so as to establish joint control with the controlled terminal.
2. The local area network-based multi-terminal joint control method according to claim 1, wherein the method further comprises:
if the response data packet forwarded by the controlled terminal through the routing end is not detected within a first preset time threshold, returning to the step of sending a detection data packet to the controlled terminal in the local area network through the routing end in the local area network every other preset time range so as to enable the controlled terminal to generate the response data packet;
the control terminal is a mobile terminal, and the controlled terminal is an intelligent television.
3. The multi-terminal joint control method based on the local area network as claimed in claim 1, wherein before the step of obtaining the corresponding IP address and the valid port information from the preset database according to the determined identification information of the target controlled terminal, the method further comprises:
judging whether the preset database comprises the identification information of the determined target controlled terminal;
and if the preset database does not include the identification information of the determined target controlled terminal, returning to the step of sending a detection data packet to the controlled terminal in the local area network through the routing end in the local area network every other preset time range so that the controlled terminal generates a response data packet.
4. The local area network-based multi-terminal joint control method according to claim 3, wherein the method further comprises:
and if the preset database comprises the identification information of the determined target controlled terminal, executing the step of acquiring the corresponding IP address and the effective port information from the preset database according to the identification information of the determined target controlled terminal.
5. A multi-terminal joint control device based on a local area network is characterized in that the device comprises:
the instruction analysis unit is used for analyzing the terminal control instruction to determine the identification information of the target controlled terminal and the target control instruction if the terminal control instruction initiated by the user is detected;
the acquiring unit is used for acquiring corresponding IP addresses and effective port information from a preset database according to the determined identification information of the target controlled terminal, wherein the preset database comprises at least one IP address, each IP address is correspondingly associated with corresponding effective port information, and different IP addresses are associated with different identification information;
the processing unit is used for sending the target control instruction, the acquired IP address and the effective port information of the target controlled terminal to a routing end in a local area network, so that the routing end sends the target control instruction to the corresponding target controlled terminal according to the acquired IP address and the effective port information of the target controlled terminal and realizes the control of the target controlled terminal;
the display unit is used for displaying a prompt box for a user to select whether to initiate a terminal control instruction again or not if the controlled feedback information forwarded by the target controlled terminal through the router is not received within a second preset time threshold;
the step of acquiring the corresponding IP address and the valid port information from the preset database according to the determined identification information of the target controlled terminal includes:
acquiring an IP address corresponding to the determined identification information of the target controlled terminal from a preset database;
acquiring corresponding port information according to the IP address;
selecting one port information from the port information as effective port information according to a preset random selection rule;
before the step of analyzing the terminal control instruction to determine the identification information of the target controlled terminal and the target control instruction, the method further includes:
sending a detection data packet to a controlled terminal in a local area network through a routing end in the local area network every a preset time range so that the controlled terminal generates a response data packet, wherein the response data packet comprises an IP address and port information of the controlled terminal;
judging whether a response data packet forwarded by the controlled terminal through the routing terminal is detected within a first preset time threshold value;
if a response data packet forwarded by the controlled terminal through the routing terminal is detected within a first preset time threshold, analyzing the response data packet to acquire identification information of the controlled terminal and IP address and port information associated with the identification information;
and storing the acquired identification information of the controlled terminal and the IP address and the port information associated with the identification information into a preset database so as to establish joint control with the controlled terminal.
6. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the steps of the method according to any of claims 1-4 when the computer program is executed.
7. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, realizes the steps of the method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010033335.9A CN111277505B (en) | 2020-01-13 | 2020-01-13 | Multi-terminal joint control method, device, equipment and storage medium based on local area network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010033335.9A CN111277505B (en) | 2020-01-13 | 2020-01-13 | Multi-terminal joint control method, device, equipment and storage medium based on local area network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111277505A CN111277505A (en) | 2020-06-12 |
CN111277505B true CN111277505B (en) | 2021-08-03 |
Family
ID=71001888
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010033335.9A Active CN111277505B (en) | 2020-01-13 | 2020-01-13 | Multi-terminal joint control method, device, equipment and storage medium based on local area network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111277505B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114258037B (en) * | 2020-09-22 | 2024-04-12 | 华为技术有限公司 | Network control method and device and electronic equipment |
CN113556409A (en) * | 2021-06-04 | 2021-10-26 | 深圳市高川自动化技术有限公司 | IP address retrieving method, system, terminal and storage medium |
CN113873684B (en) * | 2021-09-13 | 2024-10-22 | Oppo广东移动通信有限公司 | Connection establishment method and device based on local area network, terminal equipment and storage medium |
CN114356448A (en) * | 2021-12-28 | 2022-04-15 | 北京光启元数字科技有限公司 | Object control method, device, equipment and medium |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
FI20001311A (en) * | 2000-05-31 | 2001-12-01 | Nokia Corp | Wireless local area network |
JP2009267638A (en) * | 2008-04-23 | 2009-11-12 | Nippon Telegr & Teleph Corp <Ntt> | Terminal authentication/access authentication method, and authentication system |
JP2013055467A (en) * | 2011-09-02 | 2013-03-21 | Nec Casio Mobile Communications Ltd | Gateway, control device, terminal control system and method |
CN102915627A (en) * | 2012-09-25 | 2013-02-06 | 金同磊 | Method, system and household electrical appliance controller for controlling traditional household electrical appliances |
CN103019197B (en) * | 2012-12-03 | 2014-10-29 | 海信集团有限公司 | Method and system for conducting long-range control on intelligent terminal device |
CN103685733B (en) * | 2013-11-18 | 2017-01-25 | 华为终端有限公司 | Remote control method and terminal |
CN105450483A (en) * | 2014-08-21 | 2016-03-30 | 宇龙计算机通信科技(深圳)有限公司 | Method for controlling smart household devices by using mobile terminal and correlative equipment |
CN104503378B (en) * | 2014-11-05 | 2018-01-30 | 广州艾若博机器人科技有限公司 | A kind of robot and the method for controlling household electrical appliances based on the robot |
CN104808557B (en) * | 2015-04-24 | 2020-02-04 | 深圳市彩易生活科技有限公司 | Intelligent control method, system and related equipment |
CN106487988A (en) * | 2015-08-25 | 2017-03-08 | 中兴通讯股份有限公司 | A kind of method and system realizing terminal control |
CN105204662A (en) * | 2015-10-29 | 2015-12-30 | 广州辉远电子技术有限公司 | Method for controlling display of multi terminals |
CN105472430B (en) * | 2015-11-20 | 2019-06-14 | 青岛海信电器股份有限公司 | Method, equipment and the system of mobile terminal jingle bell are controlled by smart television |
CN106453073A (en) * | 2016-09-30 | 2017-02-22 | 北京小米移动软件有限公司 | Information transmission method and apparatus |
CN106603807B (en) * | 2016-10-11 | 2020-04-21 | 潍坊创高信息科技有限公司 | Method for controlling controlled equipment by mobile terminal, mobile terminal and controlled equipment |
CN107666592A (en) * | 2017-08-18 | 2018-02-06 | 深圳市艾特智能科技有限公司 | Camera head monitor method, system, storage medium and computer equipment |
CN109521683B (en) * | 2018-11-02 | 2022-11-11 | 广东美的制冷设备有限公司 | Control method, remote controller and control terminal of household electrical appliance in local area network |
CN109799722A (en) * | 2019-02-18 | 2019-05-24 | 珠海格力电器股份有限公司 | Control method, device and system of intelligent home system, storage medium and equipment |
-
2020
- 2020-01-13 CN CN202010033335.9A patent/CN111277505B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN111277505A (en) | 2020-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111277505B (en) | Multi-terminal joint control method, device, equipment and storage medium based on local area network | |
CN110831112B (en) | Network connection method, intelligent household equipment, intelligent gateway and electronic equipment | |
US11758399B2 (en) | Wireless local area network configuration using probe request frame having authentication information | |
US20170272502A1 (en) | Method, Mobile Device and System for Transmitting Files | |
CN110636483A (en) | Network distribution method and system | |
CN102571996B (en) | IP (Internet Protocol) address assignment method, IP address assignment device and network system | |
KR20130082073A (en) | Methods and systems for wi-fi setup and configuration | |
US10863559B2 (en) | Method and apparatus for communicating in a wireless communication network | |
US11876667B2 (en) | Broadband watchdog | |
CN112596406A (en) | Control method and device of intelligent equipment, control panel and storage medium | |
WO2021212906A1 (en) | Network port allocation method and apparatus, electronic device, and computer-usable medium | |
CN103856374A (en) | Data transmission method, terminal and home interconnected system | |
WO2018053894A1 (en) | Internet-of-things access point handover method and device based on transmission rate | |
US20140241271A1 (en) | Apparatus and method for providing a wireless communication in a portable terminal | |
JP5551805B2 (en) | Method and apparatus for accessing the Internet | |
CN105827443A (en) | Network device discovery method and device | |
CN105721189A (en) | Network port configuration method and device for network equipment | |
US10116739B2 (en) | Method for enabling point-to-point transmission and network connecting device | |
CN112333062A (en) | Control method and control device for household equipment and computer readable storage medium | |
EP3340729A1 (en) | Communication system, communication device and communication device management method | |
EP3229446B1 (en) | Application interaction method, device and terminal | |
CN107708183B (en) | Decoding algorithm determination method, device, terminal and storage medium | |
CN112953794B (en) | Network detection method, device, equipment and storage medium of router | |
US11343170B2 (en) | Repeater for packet transmitting in mesh network | |
GB2617760A (en) | Screen protection method, receiving end, source end, and screen projection system |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |