CN114630308A - Equipment instruction request method, equipment instruction execution system and electronic equipment - Google Patents

Equipment instruction request method, equipment instruction execution system and electronic equipment Download PDF

Info

Publication number
CN114630308A
CN114630308A CN202210281693.0A CN202210281693A CN114630308A CN 114630308 A CN114630308 A CN 114630308A CN 202210281693 A CN202210281693 A CN 202210281693A CN 114630308 A CN114630308 A CN 114630308A
Authority
CN
China
Prior art keywords
instruction
bluetooth
information
equipment
mobile terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210281693.0A
Other languages
Chinese (zh)
Inventor
唐伟雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Datong Heyi Technology Co ltd
Original Assignee
Guangzhou Datong Heyi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Datong Heyi Technology Co ltd filed Critical Guangzhou Datong Heyi Technology Co ltd
Priority to CN202210281693.0A priority Critical patent/CN114630308A/en
Publication of CN114630308A publication Critical patent/CN114630308A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/60Context-dependent security
    • H04W12/69Identity-dependent
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W60/00Affiliation to network, e.g. registration; Terminating affiliation with the network, e.g. de-registration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/80Wireless

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention relates to the technical field of information communication, and particularly discloses a device instruction request method, a device instruction execution system and electronic equipment, wherein the device instruction request method comprises the following steps: the server registers the Bluetooth equipment according to the equipment information; acquiring and verifying an account and a password of an equipment operator to generate an authorization Token; receiving a Bluetooth connection information acquisition request; acquiring a corresponding operable instruction set and equipment information through a unique identification code in the Bluetooth connection information acquisition request; receiving an instruction application request; finding out IoT configuration information of the Bluetooth device according to the unique identification code, and generating a unique instruction identification and an instruction timestamp; and sending the device instruction information to the IoT platform and sending the device instruction information to the mobile terminal through the asynchronous thread. The invention greatly increases the arrival rate of the equipment instruction information, and avoids the problem that the control of the equipment is influenced because of the instability of the communication link in the prior art, so that the control of the mobile terminal to the equipment is more immediate and reliable.

Description

Equipment instruction request method, equipment instruction execution system and electronic equipment
Technical Field
The present invention relates to the field of information communication technologies, and in particular, to a device instruction request method, a device instruction execution system, and an electronic device.
Background
Under the internet development, mobile internet explosive growth for our life and many custom produce huge change, IT is the progress of whole consumption internet that IT technique driven not only, will take place huge change in the industrial field also, mobile office, intelligent control become the thing that tentacle can reach, along with the development of 5G technique, more stable and quick data transmission reaches and makes "distance" no longer be the difficult point that hinders the development, in the future we probably rely on a cell-phone alright with control the operation and maintenance to whole mill.
The internet of things is the internet connected with objects, and comprises two layers of meanings: firstly, the internet of things is an extension and an extension of the internet, and the core and the foundation of the internet of things are still the internet; secondly, the user side of the internet of things comprises not only people but also articles, and the internet of things realizes information exchange and communication among people, articles and articles.
As for the mode of controlling the equipment by the mobile phone end, two modes exist in the prior art, one mode is that the server sends an instruction to the equipment through the internet of things (IoT) platform through the server end; and the other is that the mobile phone end transmits the instruction to the equipment through a Bluetooth channel. Generally, the IoT platform sends the instruction, and only when the network signal of the device is not good, the IoT platform tries to send the instruction through the bluetooth connection, as a supplementary scheme, in order to enhance the success rate of instruction sending. However, when the device is in the offline state of the IoT platform, the mobile phone still needs to obtain the state of the device through the server, and when the state is the offline state, the mobile phone requests the server for authorization to connect the bluetooth device. The flow link is long, and the response to the user is slow, so that the user experience is influenced. If the device is in a weak network state and the IoT platform is not completely offline, the IoT platform still tries to send an instruction to the device, but there may be a case that the instruction cannot reach the device at this time.
Therefore, it is necessary to design a reliable instruction request scheme to solve the above problems.
Disclosure of Invention
The invention provides a device instruction request method, a device instruction execution system and an electronic device, aiming at the technical problems in the prior art.
The invention provides a device instruction request method, which comprises the following steps:
the server acquires the equipment information of the Bluetooth equipment and registers the Bluetooth equipment according to the equipment information;
acquiring and verifying an account and a password of an equipment operator sent by the mobile terminal through a preset login interface, and if the verification is passed, generating an authorization Token and issuing the authorization Token to the mobile terminal;
receiving a Bluetooth connection information acquisition request; the Bluetooth connection information acquisition request is generated by the mobile terminal through the acquired unique identification code of the Bluetooth equipment needing to be operated and the authorization Token;
verifying the validity of the authorization Token in the Bluetooth connection information acquisition request, if the authorization Token is valid, acquiring a corresponding operable instruction set and equipment information through a unique identification code in the Bluetooth connection information acquisition request, and issuing the operable instruction set and the equipment information to the mobile terminal;
receiving an instruction application request; the instruction application request is generated for the mobile terminal according to the operable instruction set, the unique identification code and the authorization Token; the instruction application request comprises an instruction to be executed and instruction parameters;
verifying the validity of the authorization Token in the instruction application request, if the authorization Token is valid, finding out the IoT configuration information of the Bluetooth device according to the unique identification code, and generating a unique instruction identifier and an instruction timestamp;
sending the device instruction information to the IoT platform and the mobile terminal through the asynchronous thread; the device instruction information comprises a unique identification code, a unique instruction identification, an instruction time stamp, an instruction to be executed and an instruction parameter.
Further, the device information includes bluetooth name, mac address, IoT configuration information.
Furthermore, the unique identification code of the bluetooth device to be operated is the device DID.
The invention provides another device instruction request method, which comprises the following steps:
the mobile terminal calls a login interface preset by the server and sends an account and a password of an equipment operator to the server;
collecting authorized Token; the authorization Token is generated after the server verifies the account and the password of the equipment operator;
acquiring a unique identification code corresponding to the Bluetooth equipment needing to be operated, generating a Bluetooth connection information acquisition request through the unique identification code and an authorized Token, and sending the request to a server;
receiving an operable instruction set and device information; when the operable instruction set and the equipment information are used as the server to verify that the authorization Token in the Bluetooth connection information acquisition request is valid, the authorization Token is acquired through the unique identification code in the Bluetooth connection information acquisition request;
searching a near-field Bluetooth device, and connecting the near-field Bluetooth device with the Bluetooth device through device information;
generating an instruction application request according to the operable instruction set, the unique identification code and the authorized Token and sending the instruction application request to a server; the instruction application request comprises an instruction to be executed and instruction parameters;
receiving equipment instruction information; the device instruction information comprises a unique identification code, a unique instruction identification, an instruction timestamp, an instruction to be executed and an instruction parameter; the unique instruction identifier and the instruction timestamp are generated after the server verifies that the authorization Token in the instruction application request is valid, and finds out IoT configuration information of the Bluetooth device according to the unique identifier;
and forwarding the device instruction information to the Bluetooth device through the Bluetooth channel.
Further, acquiring the unique identification code corresponding to the bluetooth device to be operated includes:
the mobile terminal scans a unique identification code arranged on the Bluetooth equipment needing to be operated to obtain the code; or
The mobile terminal manually inputs and acquires the unique identification code arranged on the Bluetooth equipment needing to be operated.
Further, connecting with the bluetooth device through the device information includes:
and connecting with the Bluetooth equipment through the Bluetooth name and the mac address.
The invention also provides a device instruction execution system, which comprises a server, a mobile terminal and Bluetooth equipment, wherein:
the server is in wireless communication connection with the mobile terminal and is in communication connection with the Bluetooth device through an IoT platform; the server is used for acquiring the equipment information of the Bluetooth equipment and registering the Bluetooth equipment according to the equipment information; acquiring and verifying an account and a password of an equipment operator sent by the mobile terminal through a preset login interface, and if the verification is passed, generating an authorization Token and issuing the authorization Token to the mobile terminal; receiving a Bluetooth connection information acquisition request; verifying the validity of the authorization Token in the Bluetooth connection information acquisition request, if the authorization Token is valid, acquiring a corresponding operable instruction set and equipment information through a unique identification code in the Bluetooth connection information acquisition request, and issuing the operable instruction set and the equipment information to the mobile terminal; receiving an instruction application request; verifying the validity of the authorization Token in the instruction application request, if the authorization Token is valid, finding out the IoT configuration information of the Bluetooth device according to the unique identification code, and generating a unique instruction identifier and an instruction timestamp; sending device instruction information to an IoT platform and a mobile terminal through an asynchronous thread, wherein the device instruction information comprises a unique identification code, a unique instruction identification, an instruction timestamp, an instruction to be executed and an instruction parameter;
the mobile terminal is in wireless communication connection with the server and is in communication connection with the Bluetooth device through a Bluetooth channel; the mobile terminal is used for calling a login interface preset by the server and sending an equipment operator account and a password to the server; collecting authorized Token; acquiring a unique identification code corresponding to the Bluetooth equipment needing to be operated, generating a Bluetooth connection information acquisition request through the unique identification code and an authorized Token, and sending the request to a server; receiving an operable instruction set and device information; searching a near-field Bluetooth device, and connecting the near-field Bluetooth device with the Bluetooth device through device information; generating an instruction application request according to the operable instruction set, the unique identification code and the authorized Token and sending the instruction application request to a server, wherein the instruction application request comprises an instruction to be executed and an instruction parameter; receiving equipment instruction information; forwarding the device instruction information to the Bluetooth device through a Bluetooth channel;
the Bluetooth device is used for receiving the device instruction information issued by the IoT platform and receiving the device instruction information sent by the mobile terminal through the Bluetooth channel; the Bluetooth device is also used for checking whether the device instruction information is executed or not through the unique instruction identifier in the device instruction information, if so, discarding the device instruction information, and if not, checking the latest instruction timestamp recorded by the Bluetooth device; and judging whether the latest instruction timestamp is smaller than the instruction timestamp in the equipment instruction information, if so, executing the instruction to be executed in the equipment instruction information, recording the executed unique instruction identifier and the instruction timestamp, and if not, discarding the equipment instruction information.
Furthermore, when the Bluetooth device receives the device instruction information issued by the IoT platform, the device instruction information is acquired when the IoT platform is issued in an MQTT protocol mode.
Further, the mobile terminal is connected with the server through 4G or 5G signal communication.
The present invention also provides an electronic device comprising a memory and a processor, wherein,
a memory storing computer instructions;
and the processor is configured to execute the computer instructions to cause the electronic equipment to execute the equipment instruction request method.
According to the device instruction request method, the device instruction execution system and the electronic device, after the mobile terminal successfully generates the instruction application request, the server sends the device instruction information to the IoT platform and sends the device instruction information to the mobile terminal through the asynchronous thread, the Bluetooth device can receive the device instruction information through the IoT platform and also can obtain the device instruction information forwarded by the mobile terminal through the Bluetooth channel, the arrival rate of the device instruction information is greatly increased, the problem that the device control is influenced due to unstable communication links in the prior art is solved, and the control of the mobile terminal on the device is more instant and reliable; after the Bluetooth equipment receives the equipment instruction information, the Bluetooth equipment avoids repeated execution of the equipment instruction information by inquiring the execution record, the repeatability and the time sequence of the equipment instruction information are known by judging the size relationship between the latest instruction timestamp and the instruction timestamp in the equipment instruction information, the latest and unexecuted equipment instruction information is further executed, the executed unique instruction identification and the executed instruction timestamp are recorded and are used as the execution judgment basis of the subsequent equipment instruction information.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating steps of a method for requesting a device command according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a method for requesting a device command according to a second embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus instruction execution system according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating steps of a system for executing instructions on a device according to an embodiment of the present invention;
fig. 5 is a structural assembly diagram of an electronic device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
As shown in fig. 1, a device instruction request method according to an embodiment of the present invention is implemented by taking a server as an execution subject and including the following steps:
step S101: the server acquires the equipment information of the Bluetooth equipment and registers the Bluetooth equipment according to the equipment information.
In this embodiment, the device information of the bluetooth device at least includes a bluetooth name, a mac address, IoT configuration information, and the like. In the embodiment of the invention, the relevant Bluetooth equipment needs to be registered in the server before the equipment instruction request is carried out. The device information is maintained and managed by the server in a unified mode so as to ensure the safety and consistency of the device information.
Step S102: and acquiring and verifying the account and the password of the equipment operator sent by the mobile terminal through a preset login interface, and if the verification is passed, generating an authorization Token and issuing the authorization Token to the mobile terminal.
The account and the password of the equipment operator are sent to the server by the mobile terminal through calling a preset login interface of the server, the server verifies the received account and the password of the equipment operator, if the received account and the password of the equipment operator do not pass through the preset login interface, the verification is finished directly, if the received account and the password of the equipment operator pass through the preset login interface, an authorization Token is generated, and the authorization Token is issued to the mobile terminal. The step is to limit the mobile terminal to realize the subsequent steps only after the server passes the verification, thereby ensuring the information security.
Step S103: and receiving a Bluetooth connection information acquisition request.
The bluetooth connection information acquisition request in this embodiment is generated by the mobile terminal through the acquired unique identification code of the bluetooth device to be operated and the authorization Token. And when the mobile terminal receives the authorization Token, acquiring a unique identification code corresponding to the Bluetooth equipment needing to be operated, and generating a Bluetooth connection information acquisition request through the unique identification code and the authorization Token. In this embodiment, the unique identification code of the bluetooth device to be operated may be set as the device DID of the bluetooth device, and is the only identity information capable of representing the bluetooth device.
Step S104: and checking the validity of the authorization Token in the Bluetooth connection information acquisition request, if so, acquiring the corresponding operable instruction set and the equipment information through the unique identification code in the Bluetooth connection information acquisition request, and issuing the operable instruction set and the equipment information to the mobile terminal.
The server checks the validity of the authorization Token in the received Bluetooth connection information acquisition request, if the authorization Token is invalid, the operation of the method is ended, and if the authorization Token is valid, the corresponding operable instruction set and the device information are acquired through the unique identification code in the Bluetooth connection information acquisition request. After the server issues the operable instruction set and the device information to the mobile terminal, the mobile terminal receives the operable instruction set and the device information, searches for the near-field Bluetooth device, and establishes a Bluetooth communication channel between the mobile terminal and the Bluetooth device by pairing and connecting the device information (such as a Bluetooth name and a mac address) and the Bluetooth device.
Step S105: an instruction application request is received.
After the bluetooth connection is confirmed to be successful, the mobile terminal generates an instruction application request according to the operable instruction set, the unique identification code and the authorized Token and sends the instruction application request to the server, and the server executes step S105 to receive the instruction application request.
Step S106: and verifying the validity of the authorized Token in the instruction application request, if so, finding out the IoT configuration information of the Bluetooth device according to the unique identification code, and generating a unique instruction identifier and an instruction timestamp.
The method comprises the steps that firstly, the server verifies the validity of an authorized Token in an instruction application request, if the authorized Token is invalid, the operation of the method is finished, if the authorized Token is valid, IoT configuration information of the Bluetooth device is found according to a unique identification code, and a unique instruction identification and an instruction timestamp are generated.
Step S107: and sending the device instruction information to the IoT platform and the mobile terminal through the asynchronous thread.
The device instruction information in this step includes the unique identification code, the unique instruction identifier and the instruction timestamp generated in step S106, and the instruction application request includes the instruction to be executed and the instruction parameter. The server sends the device instruction information to the IoT platform through the asynchronous thread, the IoT platform sends the device instruction information to the corresponding Bluetooth device, and meanwhile, the server also sends the device instruction information to the mobile terminal.
The invention provides another device instruction request method, as shown in fig. 2, which takes a mobile terminal as an execution main body and is realized by the following steps:
step S201: and the mobile terminal calls a login interface preset by the server and sends an account and a password of the equipment operator to the server.
The server receives the account and the password of the equipment operator, verifies the account and the password of the equipment operator, directly ends the operation if the account and the password of the equipment operator do not pass through the password, generates an authorization Token if the account and the password of the equipment operator pass through the password, and issues the authorization Token to the mobile terminal.
Step S202: and collecting the authorized Token.
And the mobile terminal receives the authorization Token issued by the server.
Step S203: and acquiring a unique identification code corresponding to the Bluetooth equipment needing to be operated, generating a Bluetooth connection information acquisition request through the unique identification code and the authorized Token, and sending the request to the server.
In this embodiment, the obtaining, by the mobile terminal, the unique identification code corresponding to the bluetooth device to be operated may include:
the mobile terminal scans a unique identification code arranged on the Bluetooth equipment needing to be operated to obtain the code; or the mobile terminal manually inputs the unique identification code set on the Bluetooth equipment needing to be operated to obtain the unique identification code. Besides the two ways of code scanning acquisition and manual entry, the skilled person can also acquire the code by other ways, which are not limited herein. After the mobile terminal acquires the unique identification code corresponding to the Bluetooth device to be operated, a Bluetooth connection information acquisition request is generated through the unique identification code and the authorized Token, and then the Bluetooth connection information acquisition request is sent to the server.
Step S204: receiving an operable instruction set and device information; when the operable instruction set and the equipment information are used as the server to verify that the authorization Token in the Bluetooth connection information acquisition request is valid, the authorization Token is acquired through the unique identification code in the Bluetooth connection information acquisition request;
after receiving the Bluetooth connection information acquisition request, the server firstly checks the validity of the authorization Token in the Bluetooth connection information acquisition request, if the authorization Token is invalid, the operation of the method is ended, if the authorization Token is valid, the corresponding operable instruction set and the corresponding device information are acquired through the unique identification code in the Bluetooth connection information acquisition request, and then the operable instruction set and the device information are sent to the mobile terminal.
After receiving the operational instruction set and the device information, the mobile terminal performs step S205.
Step S205: searching a near-field Bluetooth device, and connecting the near-field Bluetooth device with the Bluetooth device through device information;
the mobile device searches for a bluetooth device in the near field, and establishes a connection with a corresponding bluetooth device through the device information received in step S204. The device information at least comprises a Bluetooth name and a mac address, and the mobile terminal is connected with the Bluetooth device through the Bluetooth name and the mac address. After the mobile terminal establishes a connection with the bluetooth device, step S206 is performed.
Step S206: and generating an instruction application request according to the operable instruction set and the unique identification code and the authorized Token and sending the instruction application request to the server.
The mobile terminal combines the unique identification code and the authorized Token according to the operable instruction set received in the step S204 to generate an instruction application request, wherein the instruction application request includes an instruction to be executed and an instruction parameter, and the mobile terminal sends the instruction application request to the server. Step S207 is then executed.
Step S207: and receiving equipment instruction information.
The mobile terminal receives equipment instruction information sent by the server, wherein the equipment instruction information comprises a unique identification code, a unique instruction identification, an instruction timestamp, an instruction to be executed and an instruction parameter. The unique instruction identifier and the instruction timestamp are generated after the server verifies that the authorized Token in the instruction application request is valid and finds out the IoT configuration information of the Bluetooth device according to the unique identifier.
Step S208: and forwarding the device instruction information to the Bluetooth device through the Bluetooth channel.
After receiving the device instruction information sent by the server, the mobile terminal forwards the device instruction information to the Bluetooth device connected with the mobile terminal through the Bluetooth channel.
The present invention also provides a device instruction execution system, as shown in fig. 3 and 4, the system includes a server 10, a mobile terminal 20, and a bluetooth device 30, wherein:
the server 10 is in wireless communication connection with the mobile terminal 20 and is in communication connection with the Bluetooth device 30 through an IoT platform; the server 10 is configured to obtain device information of the bluetooth device 30, and register the bluetooth device 30 according to the device information; acquiring and verifying the account and the password of the equipment operator sent by the mobile terminal 20 through a preset login interface, and if the verification is passed, generating an authorization Token and issuing the authorization Token to the mobile terminal 20; receiving a Bluetooth connection information acquisition request; verifying the validity of the authorization Token in the bluetooth connection information acquisition request, if the authorization Token is valid, acquiring a corresponding operable instruction set and equipment information through the unique identification code in the bluetooth connection information acquisition request, and issuing the operable instruction set and the equipment information to the mobile terminal 20; receiving an instruction application request; verifying the validity of the authorized Token in the instruction application request, if the authorized Token is valid, finding out the IoT configuration information of the Bluetooth device 30 according to the unique identification code, and generating a unique instruction identifier and an instruction timestamp; and sending the device instruction information to the IoT platform and the mobile terminal 20 through the asynchronous thread, wherein the device instruction information comprises a unique identification code, a unique instruction identification, an instruction timestamp, an instruction to be executed and an instruction parameter.
The mobile terminal 20 is in wireless communication connection with the server 10 and is in communication connection with the Bluetooth device 30 through a Bluetooth channel; the mobile terminal 20 is configured to call a login interface preset by the server 10, and send an account and a password of an equipment operator to the server 10; collecting authorized Token; acquiring a unique identification code corresponding to the bluetooth device 30 to be operated, generating a bluetooth connection information acquisition request through the unique identification code and an authorization Token, and sending the request to the server 10; receiving an operable instruction set and device information; searching the Bluetooth equipment 30 in the near field, and connecting with the Bluetooth equipment 30 through equipment information; generating an instruction application request according to the operable instruction set, the unique identification code and the authorized Token and sending the instruction application request to the server 10, wherein the instruction application request comprises an instruction to be executed and an instruction parameter; receiving equipment instruction information; the device command information is forwarded to the bluetooth device 30 via the bluetooth channel. The mobile terminal 20 in the present embodiment is connected to the server 10 by 4G or 5G signal communication.
The bluetooth device 30 is configured to receive device instruction information issued by the IoT platform and receive device instruction information sent by the mobile terminal 20 through a bluetooth channel; the bluetooth equipment is further used for checking whether the equipment instruction information is executed or not through the unique instruction identifier in the equipment instruction information, if so, discarding the equipment instruction information, and if not, checking the latest instruction timestamp recorded by the bluetooth equipment 30; and judging whether the latest instruction timestamp is smaller than the instruction timestamp in the equipment instruction information, if so, executing the instruction to be executed in the equipment instruction information, recording the executed unique instruction identifier and the instruction timestamp, and if not, discarding the equipment instruction information.
As shown in fig. 4, the device instruction execution system according to the embodiment of the present invention implements corresponding functions by the following steps:
step S301: the server acquires the equipment information of the Bluetooth equipment and registers the Bluetooth equipment according to the equipment information.
Step S302: and the mobile terminal calls a login interface preset by the server and sends an account and a password of the equipment operator to the server.
Step S303: and the server acquires and verifies the account and the password of the equipment operator, and if the verification is passed, an authorization Token is generated and issued to the mobile terminal.
Step S304: the mobile terminal receives the authorization Token.
Step S305: the mobile terminal acquires a unique identification code corresponding to the Bluetooth device to be operated, generates a Bluetooth connection information acquisition request through the unique identification code and the authorized Token and then sends the request to the server.
Step S306: and the server checks the validity of the authorization Token in the Bluetooth connection information acquisition request, and if the authorization Token is valid, acquires the corresponding operable instruction set and the equipment information through the unique identification code in the Bluetooth connection information acquisition request and transmits the operable instruction set and the equipment information to the mobile terminal.
Step S307: the mobile terminal receives the operational instruction set and the device information.
Step S308: the mobile terminal searches the Bluetooth equipment in the near field and is connected with the Bluetooth equipment through equipment information.
Step S309: and the mobile terminal generates an instruction application request according to the operable instruction set, the unique identification code and the authorized Token and sends the instruction application request to the server.
Step S310: the server receives the instruction application request.
Step S311: and the server verifies the validity of the authorized Token in the instruction application request, if the authorized Token is valid, finds out the IoT configuration information of the Bluetooth device according to the unique identification code, and generates a unique instruction identifier and an instruction timestamp.
Step S312: the server sends the device instruction information to the IoT platform and the mobile terminal through the asynchronous thread.
Step S313: and the mobile terminal receives the equipment instruction information.
Step S314: the mobile terminal forwards the device instruction information to the Bluetooth device through the Bluetooth channel.
Step S315: and the Bluetooth equipment receives the equipment instruction information issued by the IoT platform and receives the equipment instruction information sent by the mobile terminal through the Bluetooth channel.
In this step, when the bluetooth device receives the device instruction information issued by the IoT platform, the bluetooth device acquires the device instruction information when the IoT platform issues the device instruction information in the MQTT protocol mode.
Step S316: the Bluetooth equipment checks whether the equipment instruction information is executed or not through the unique instruction identification in the equipment instruction information; if yes, go to step S319; if not, step S317 is executed.
Step S317: checking the latest instruction timestamp recorded by the Bluetooth equipment, and judging whether the latest instruction timestamp is smaller than the instruction timestamp in the equipment instruction information; if yes, go to step S318; if not, go to step S319.
Step S318: and executing the instruction to be executed in the instruction information of the equipment, and recording the executed unique instruction identification and the instruction time stamp.
Step S319: and discarding the equipment instruction information.
For the above related steps performed by the server 10, the mobile terminal 20 and the bluetooth device 30, reference may be made to the description of the device instruction requesting method in the foregoing embodiments, and further description will not be provided herein.
The present invention also provides an electronic device 100, as shown in fig. 5, comprising a memory 101 and a processor 102, wherein,
a memory 101 storing computer instructions;
the processor 102 is configured to execute computer instructions to cause the electronic device to perform a first or second device instruction request method, which corresponds to fig. 1 or fig. 2.
The present invention also provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to execute the steps of the method for requesting device instructions according to the above-mentioned embodiments.
According to the device instruction request method, the device instruction execution system and the electronic device, after the mobile terminal successfully generates the instruction application request, the server sends the device instruction information to the IoT platform and the device instruction information to the mobile terminal through the asynchronous thread, the Bluetooth device can receive the device instruction information through the IoT platform and can also obtain the device instruction information forwarded by the mobile terminal through the Bluetooth channel, the arrival rate of the device instruction information is greatly increased, the problem that the control of the device is influenced due to the unstable communication link in the prior art is solved, and the control of the device by the mobile terminal is more immediate and reliable; after the Bluetooth equipment receives the equipment instruction information, the Bluetooth equipment avoids repeated execution of the equipment instruction information by inquiring the execution record, the repeatability and the time sequence of the equipment instruction information are known by judging the size relationship between the latest instruction timestamp and the instruction timestamp in the equipment instruction information, the latest and unexecuted equipment instruction information is further executed, the executed unique instruction identification and the executed instruction timestamp are recorded and are used as the execution judgment basis of the subsequent equipment instruction information.
The present invention has been further described with reference to specific embodiments, but it should be understood that the detailed description should not be construed as limiting the spirit and scope of the present invention, and various modifications made to the above-described embodiments by those of ordinary skill in the art after reading this specification are within the scope of the present invention.

Claims (10)

1. A method for requesting a device command, the method comprising:
the server acquires equipment information of the Bluetooth equipment and registers the Bluetooth equipment according to the equipment information;
acquiring and verifying an account and a password of an equipment operator sent by the mobile terminal through a preset login interface, and if the verification is passed, generating an authorization Token and issuing the authorization Token to the mobile terminal;
receiving a Bluetooth connection information acquisition request; the Bluetooth connection information acquisition request is generated by the mobile terminal through the acquired unique identification code of the Bluetooth equipment needing to be operated and the authorization Token;
verifying the validity of the authorization Token in the Bluetooth connection information acquisition request, if the authorization Token is valid, acquiring a corresponding operable instruction set and the equipment information through a unique identification code in the Bluetooth connection information acquisition request, and issuing the operable instruction set and the equipment information to a mobile terminal;
receiving an instruction application request; the instruction application request is generated by the mobile terminal according to the operable instruction set, the unique identification code and the authorized Token; the instruction application request comprises an instruction to be executed and instruction parameters;
verifying the validity of the authorization Token in the instruction application request, if the authorization Token is valid, finding out the IoT configuration information of the Bluetooth equipment according to the unique identification code, and generating a unique instruction identifier and an instruction timestamp;
sending the device instruction information to an IoT platform and the mobile terminal through an asynchronous thread; the device instruction information comprises the unique identification code, the unique instruction identification, an instruction time stamp, an instruction to be executed and an instruction parameter.
2. The device instruction request method of claim 1, wherein the device information comprises a bluetooth name, a mac address, IoT configuration information.
3. The device command request method of claim 1, wherein the unique identification code of the bluetooth device to be operated is a device DID.
4. A method for requesting a device command, the method comprising:
the mobile terminal calls a login interface preset by the server and sends an account and a password of an equipment operator to the server;
collecting authorized Token; the authorized Token is generated after the server verifies the account and the password of the equipment operator;
acquiring a unique identification code corresponding to the Bluetooth equipment needing to be operated, generating a Bluetooth connection information acquisition request through the unique identification code and the authorized Token, and sending the request to a server;
receiving an operational instruction set and the device information; when the operable instruction set and the device information are used by the server to verify that the authorization Token in the Bluetooth connection information acquisition request is valid, the unique identification code in the Bluetooth connection information acquisition request is acquired;
searching a near-field Bluetooth device, and connecting with the Bluetooth device through the device information;
generating an instruction application request according to the operable instruction set, the unique identification code and the authorized Token and sending the instruction application request to a server; the instruction application request comprises an instruction to be executed and instruction parameters;
receiving equipment instruction information; the device instruction information comprises the unique identification code, the unique instruction identification, an instruction timestamp, an instruction to be executed and an instruction parameter; the unique instruction identifier and the instruction timestamp are generated after the server verifies that the authorization Token in the instruction application request is valid and finds out the IoT configuration information of the Bluetooth device according to the unique identifier;
and forwarding the equipment instruction information to the Bluetooth equipment through a Bluetooth channel.
5. The device command requesting method of claim 4, wherein obtaining a unique identification code corresponding to the bluetooth device to be operated comprises:
the mobile terminal scans a unique identification code arranged on the Bluetooth equipment needing to be operated to obtain the code; or
The mobile terminal manually inputs and acquires the unique identification code arranged on the Bluetooth equipment needing to be operated.
6. The device instruction requesting method of claim 4, wherein connecting with the Bluetooth device through the device information comprises:
and connecting with the Bluetooth equipment through the Bluetooth name and the mac address.
7. An apparatus instruction execution system, comprising a server, a mobile terminal, and a bluetooth apparatus, wherein:
the server is in wireless communication connection with the mobile terminal and is in communication connection with the Bluetooth device through an IoT platform; the server is used for acquiring the equipment information of the Bluetooth equipment and registering the Bluetooth equipment according to the equipment information; acquiring and verifying an account and a password of an equipment operator sent by the mobile terminal through a preset login interface, and if the verification is passed, generating an authorization Token and issuing the authorization Token to the mobile terminal; receiving a Bluetooth connection information acquisition request; verifying the validity of the authorization Token in the Bluetooth connection information acquisition request, if the authorization Token is valid, acquiring a corresponding operable instruction set and the equipment information through a unique identification code in the Bluetooth connection information acquisition request, and issuing the operable instruction set and the equipment information to a mobile terminal; receiving an instruction application request; verifying the validity of the authorized Token in the instruction application request, if the authorized Token is valid, finding out the IoT configuration information of the Bluetooth device according to the unique identification code, and generating a unique instruction identifier and an instruction timestamp; sending device instruction information to an IoT platform and sending the device instruction information to a mobile terminal through an asynchronous thread, wherein the device instruction information comprises the unique identification code, the unique instruction identification, an instruction timestamp, an instruction to be executed and an instruction parameter;
the mobile terminal is in wireless communication connection with the server and is in communication connection with the Bluetooth equipment through a Bluetooth channel; the mobile terminal is used for calling a login interface preset by the server and sending an equipment operator account and a password to the server; collecting authorized Token; acquiring a unique identification code corresponding to a Bluetooth device to be operated, generating a Bluetooth connection information acquisition request through the unique identification code and the authorization Token, and sending the request to a server; receiving an operational instruction set and the device information; searching a near-field Bluetooth device, and connecting with the Bluetooth device through the device information; generating an instruction application request according to the operable instruction set, the unique identification code and the authorized Token and sending the instruction application request to a server, wherein the instruction application request comprises an instruction to be executed and an instruction parameter; receiving equipment instruction information; forwarding the device instruction information to Bluetooth equipment through a Bluetooth channel;
the Bluetooth device is used for receiving the device instruction information issued by an IoT platform and receiving the device instruction information sent by the mobile terminal through a Bluetooth channel; the Bluetooth device is also used for checking whether the device instruction information is executed or not through the unique instruction identifier in the device instruction information, if so, discarding the device instruction information, and if not, checking the latest instruction timestamp recorded by the Bluetooth device; and judging whether the latest instruction timestamp is smaller than the instruction timestamp in the equipment instruction information, if so, executing the instruction to be executed in the equipment instruction information, recording the executed unique instruction identifier and the instruction timestamp, and if not, discarding the equipment instruction information.
8. The device instruction execution system of claim 7, wherein the bluetooth device receives the device instruction information issued by the IoT platform and obtains the device instruction information when the IoT platform issues the device instruction information in an MQTT protocol manner.
9. The device instruction execution system of claim 7, wherein the mobile terminal is connected in 4G or 5G signal communication with the server.
10. An electronic device comprising a memory and a processor, wherein,
a memory storing computer instructions;
a processor configured to execute computer instructions to cause an electronic device to perform the device instruction request method of any of claims 4-6.
CN202210281693.0A 2022-03-21 2022-03-21 Equipment instruction request method, equipment instruction execution system and electronic equipment Pending CN114630308A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210281693.0A CN114630308A (en) 2022-03-21 2022-03-21 Equipment instruction request method, equipment instruction execution system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210281693.0A CN114630308A (en) 2022-03-21 2022-03-21 Equipment instruction request method, equipment instruction execution system and electronic equipment

Publications (1)

Publication Number Publication Date
CN114630308A true CN114630308A (en) 2022-06-14

Family

ID=81903373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210281693.0A Pending CN114630308A (en) 2022-03-21 2022-03-21 Equipment instruction request method, equipment instruction execution system and electronic equipment

Country Status (1)

Country Link
CN (1) CN114630308A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115696318A (en) * 2023-01-05 2023-02-03 中国电子科技集团公司第三十研究所 Secure communication device, secure authentication method, and secure communication method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115696318A (en) * 2023-01-05 2023-02-03 中国电子科技集团公司第三十研究所 Secure communication device, secure authentication method, and secure communication method
CN115696318B (en) * 2023-01-05 2023-05-09 中国电子科技集团公司第三十研究所 Secure communication device, secure authentication method, and secure communication method

Similar Documents

Publication Publication Date Title
CN105307108B (en) A kind of Internet of Things information exchange communication means and system
CN100486199C (en) Method of providing a centralised login and login server
KR100978818B1 (en) A method for authenticating a user in a terminal, an authentication system, a terminal, and an authorization device
CN1689314B (en) Method for application in wireless communication device and method for application for server
US8561143B2 (en) Proxy registration and authentication for personal electronic devices
JP4282237B2 (en) How to access the server computer
JP4512051B2 (en) Authentication vector generation apparatus, subscriber authentication module, mobile communication system, and authentication vector generation method
JPH09503895A (en) Method and apparatus for authenticating proof in a communication system
JP2017535122A (en) Sensor code verification processing method, apparatus, network platform device, and Internet gateway of things
RU2004118413A (en) METHOD FOR REGISTRATION AND ACTIVATION OF PKI FUNCTIONS
CN114630308A (en) Equipment instruction request method, equipment instruction execution system and electronic equipment
KR100679402B1 (en) Method and system for providing messenger service
JP3479270B2 (en) Portable communication terminal, mobile communication system using the same, and remote control method for communication function thereof
CN101568116B (en) Method for obtaining certificate state information and certificate state management system
US20110003588A1 (en) Wireless control system using an apparatus with a mobile phone
KR100822853B1 (en) Method for log-in service of mobile communication terminal, mobile communication system and mobile communication terminal for the same
CN109743329B (en) Account processing method and device
KR100998755B1 (en) Method and system for remotecontrolling car with feature code
CN110650057B (en) Method and system for configuring equipment through portable mobile terminal
JP2018005668A (en) Information process system
KR100218674B1 (en) Method of renewing call-history in the personal communication system
CN112532805A (en) Binding control method and system for image forming device and server
JP2008077217A (en) Communication system and its communication method
JP2002232420A (en) Radio communication equipment radio communication system and connection authenticating method
KR101203671B1 (en) Apparatus for work management using convergence QR code and method for the same

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