WO2022105365A1 - Device control method and system, electronic device, and storage medium - Google Patents

Device control method and system, electronic device, and storage medium Download PDF

Info

Publication number
WO2022105365A1
WO2022105365A1 PCT/CN2021/116150 CN2021116150W WO2022105365A1 WO 2022105365 A1 WO2022105365 A1 WO 2022105365A1 CN 2021116150 W CN2021116150 W CN 2021116150W WO 2022105365 A1 WO2022105365 A1 WO 2022105365A1
Authority
WO
WIPO (PCT)
Prior art keywords
offline
code
service request
verification
user terminal
Prior art date
Application number
PCT/CN2021/116150
Other languages
French (fr)
Chinese (zh)
Inventor
张铭
宋德超
王沅召
周晓泽
葛春光
Original Assignee
珠海格力电器股份有限公司
珠海联云科技有限公司
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 珠海格力电器股份有限公司, 珠海联云科技有限公司 filed Critical 珠海格力电器股份有限公司
Publication of WO2022105365A1 publication Critical patent/WO2022105365A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/45Structures or tools for the administration of authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0645Rental transactions; Leasing transactions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2133Verifying human interaction, e.g., Captcha
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Definitions

  • the present application relates to the field of computers, and in particular, to a device control method and system, an electronic device, and a storage medium.
  • rental equipment is used more and more in collective environments such as schools and classrooms.
  • the user wants to use the rental equipment, the user sends an online service request to the server through the user terminal, and the server responds to the service request and controls the opening of the rental equipment.
  • the user terminal is offline, the user terminal will not be able to request the server to control turning on the rental device.
  • the present application provides a device control method and system, an electronic device, and a storage medium to solve the problem that the user terminal cannot request the server to control the opening of the rental device when the user terminal is offline.
  • the present application provides a method for device control, applied to the device, including:
  • the offline service request includes offline verification data corresponding to a first offline code, and the first offline code is associated with the device and the user terminal;
  • the user terminal is verified, and after the verification is passed, the device is controlled.
  • the offline verification data includes a timestamp, a first verification code generated using the first offline code and the timestamp, and a terminal identification of the user terminal.
  • the time difference is less than or equal to a preset time threshold, the first verification code is verified, and when the verification is passed, the device is controlled.
  • the first verification code is verified, and when the verification is passed, the control of the device is performed, including:
  • a second verification code corresponding to the second offline code and the timestamp is generated, wherein the second offline code is stored in the device and is the same as the first verification code. 1. Identify the corresponding offline code;
  • the control of the device is performed.
  • the user terminal is verified by using the offline verification data, and after the verification is passed, the control of the device is performed, including:
  • the controlling of the device is performed.
  • obtaining the offline service request from the user terminal includes:
  • performing control of the device includes:
  • the verification request includes the terminal identifier, and the verification request is used to request to verify whether the usage limit of the user terminal is lower than a preset limit;
  • a shutdown instruction sent by the server is received, and a shutdown service is performed according to the shutdown instruction, wherein the shutdown instruction is an instruction sent by the server after verifying that the usage limit is lower than the preset limit.
  • the method before acquiring the offline service request from the user terminal, the method further includes:
  • the first identifier and the second offline code sent by the server are received.
  • after performing the control of the device it further includes:
  • deletion instruction sent by the server, where the deletion instruction is used to instruct deletion of the terminal identifier and the first offline code
  • the present application provides a method for device control, applied to a server, including:
  • a first offline code corresponding to the terminal identification and the device identification is generated, and the first offline code is sent to the user terminal.
  • the method further includes:
  • the usage limit corresponding to the terminal identifier is verified, and when the usage limit is lower than a preset limit, a shutdown instruction is sent to the device corresponding to the device identifier.
  • the method before generating the first offline code corresponding to the terminal identifier and the device identifier, the method further includes:
  • the method further includes:
  • the present application provides a method for device control, applied to a user terminal, including:
  • the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request control of the device;
  • the offline service request is sent to the device.
  • the method before generating the offline service request, the method further includes:
  • the online service request carries the terminal identification of the user terminal and the device identification of the device;
  • the first offline code sent by the server is received, where the first offline code corresponds to the terminal identification and the device identification.
  • the offline verification data includes a timestamp, a first verification code generated by using the first offline code and the timestamp, and a terminal identifier of the user terminal;
  • the offline server request is generated according to the timestamp, the first offline code, and the first verification code.
  • the present application provides a system for device control, including:
  • a user terminal configured to generate an offline service request and send the offline service request to the device, where the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request to control the device;
  • an online service request is generated, and the online service request is sent to the server, where the online service request carries the terminal identification of the user terminal and the device identification of the device;
  • the first offline code of
  • the device is used to obtain the offline service request; use the offline verification data to verify the user terminal, and after the verification is passed, execute the control of the device;
  • the server is configured to receive the online service request; generate the first offline code corresponding to the terminal identification and the device identification, and send the first offline code to the user terminal.
  • the present application provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
  • the memory for storing computer programs
  • the processor is configured to execute the program stored in the memory to implement any of the methods described above.
  • the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, any one of the methods described above is implemented.
  • the device can receive an offline service request from a user terminal, and after verifying the user terminal by using the offline service request, Perform control of the device, such as controlling the device to self-start. Therefore, even if the user terminal is offline, the user terminal may request to turn on the device based on the offline service request.
  • FIG. 1 is a schematic structural diagram of a system for device control in an embodiment of the application
  • FIG. 2 is a schematic flowchart of a method for device control in an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a method for device control in another embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for device control in another embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method for device control in another embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a method for device control in another embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an apparatus for device control in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an apparatus for device control in another embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an apparatus for device control in another embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 1 it is a schematic diagram of a system architecture of a system for device control according to an embodiment of the application.
  • the system for device control includes: a user terminal 101 , a device 102 and a server 103 .
  • the user terminal 101 is used to generate an offline service request and send the offline service request to the device 102.
  • the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request the control device 102; after generating the offline service request Before, generate an online service request, send the online service request to the server 103, the online service request carries the terminal identification of the user terminal 101 and the device identification of the device 102; and receive the first offline code sent by the server 103.
  • the device 102 is used for acquiring an offline service request; using the offline verification data, the user terminal 101 is verified, and after the verification is passed, the device 102 is controlled.
  • the server 103 is used for online service request; generates a first offline code corresponding to the terminal identification and the device identification, and sends the first offline code to the user terminal 101 .
  • the following describes the device control method from the device side, the server side, and the user terminal side, respectively.
  • the device control method is described from the device side. As shown in FIG. 2 , the device control method can be applied to the device 102 shown in FIG. 1 , and the method can include the following steps:
  • Step 201 acquiring an offline service request from the user terminal 101 .
  • obtaining the offline service request from the user terminal 101 may be implemented in any of the following manners.
  • the light flickering signal sent by the user terminal 101 is acquired, and the offline service request is extracted from the light flickering signal.
  • a photosensitive element is installed on the device 102 , and the photosensitive element can capture the light flashing signal sent by the user terminal 101 .
  • a light flickering curve corresponding to the light flickering signal can be generated, then the light flickering law can be determined according to the light flickering curve, and finally the service request corresponding to the light flickering law can be regarded as the offline service request.
  • the user terminal 101 and the device 102 may predetermine the mapping relationship between the light flickering law and the service request.
  • the Bluetooth data transmitted by the user terminal 101 through Bluetooth communication is received, and the offline service request is extracted from the Bluetooth data.
  • the device 102 before the device 102 receives the offline service request sent by the user terminal 101, it needs to establish Bluetooth communication with the user terminal 101 in advance. Specifically, the device 102 establishes a Bluetooth communication connection with the user terminal 101 according to the Bluetooth request of the user terminal 101, and receives the offline service request sent by the user terminal 101 through the established Bluetooth communication.
  • the infrared signal sent by the user terminal 101 is acquired, and the offline service request is obtained by extracting the infrared signal.
  • the device 102 and the user terminal 101 may pre-agreed the correspondence between the infrared signal and the service request. After the device 102 detects and obtains the infrared signal, it obtains offline information from the infrared signal according to the pre-agreed correspondence. Request for service.
  • the offline service request includes offline verification data corresponding to the first offline code, and the first offline code is associated with the device 102 and the user terminal 101 .
  • Step 202 verify the user terminal 101 by using the offline verification data, and execute the control of the device 102 after the verification is passed.
  • the offline verification data may include a timestamp, a first verification code generated by using the first offline code and the timestamp, and a terminal identifier of the user terminal 101 .
  • the timestamp may be the current moment when the first verification code is generated, that is, the first verification code is generated by using the current moment and the first offline code.
  • a hash algorithm can be performed on the timestamp and the offline code to obtain the verification code. Therefore, when generating the first verification code, a hash algorithm may be performed on the timestamp and the first offline code to generate the first verification code.
  • the hashing algorithm includes, but is not limited to, the MD5 message digest algorithm.
  • this embodiment provides the following two implementation manners for verifying the user terminal 101 .
  • the first implementation manner may include the following steps.
  • Step 301 Determine whether there is a first identifier that is the same as the terminal identifier in the offline verification data, and if so, go to step 302.
  • the first identifier is the terminal identifier stored in the device 102 .
  • Step 302 Obtain the receiving time for receiving the offline service request.
  • the verification device 102 In order to prevent the device from being illegally controlled due to the theft of the terminal identification, after the verification device 102 has the same first identification as the terminal identification in the offline verification data, continue to verify the offline verification data by receiving the reception time of the offline service request. timestamp.
  • Step 303 Determine the time difference between the time stamp and the receiving time.
  • Step 304 determine whether the time difference is less than or equal to the preset time threshold, and if so, perform step 305 .
  • Step 305 Generate a second verification code corresponding to the second offline code and the timestamp.
  • the second offline code is the offline code stored in the device 102 and corresponding to the first identifier.
  • Step 306 determine whether the second verification code is the same as the first verification code, and if so, go to step 307 .
  • the first offline code and the timestamp after both the terminal identifier and the timestamp in the offline verification data are verified, the first offline verification data is also verified. offline code.
  • Step 307 Execute control of the device.
  • verification failure information is sent to the user terminal.
  • the verification failure information may carry the reasons for verification identification, such as insufficient usage quota.
  • the preset time threshold may be set according to an empirical value.
  • This embodiment implements the process of verifying the offline service request of the user terminal 101 when the first identifier and the second offline code are stored in the device 102 .
  • the second implementation manner may include the following steps.
  • Step 401 acquiring the device identifier of the device 102 .
  • Step 402 Generate a third offline code corresponding to the terminal identifier and the device identifier.
  • the third offline code may be generated through an offline code generation algorithm pre-determined with the server.
  • the offline code generation algorithm includes, but is not limited to, a random character string generation algorithm, a hash algorithm, and the like.
  • the hashing algorithm includes but is not limited to the MD5 message digest algorithm.
  • Step 403 Generate a third verification code corresponding to the third offline code and the timestamp in the offline verification data.
  • the algorithm for generating the third verification code is the same as the algorithm for generating the first verification code.
  • Step 404 When the third verification code is the same as the first verification code, perform control of the device 102.
  • This embodiment implements the process of verifying the offline service request of the user terminal 101 when the device 102 and the server 103 pre-agreed with an offline code generation algorithm.
  • executing the control over the device 102 may include executing a startup service, that is, after the user terminal 101 is authenticated by using the offline verification data, the device 102 executes the startup service to complete self-startup.
  • the device 102 itself may not have a database and the processing capability of the device 102 itself is limited, after the device 102 executes the startup service, it may further request the server 103 to re-verify the usage quota of the device 102 .
  • the device 102 may send a verification request to the server 103 for verifying whether the usage limit of the user terminal 101 is lower than the preset limit, the verification request includes the terminal identifier; and receive the server 103 verifying that the usage limit is lower than the preset limit
  • the usage limit may be the balance of the account corresponding to the terminal identifier.
  • the device 102 may also delete the terminal identifier and the first offline code according to the deletion instruction sent by the server 103 .
  • the device 102 can receive the offline service request from the user terminal 101, and after the user terminal 101 is verified by the offline service request, execute control of the device 102, such as controlling the device 102 to start up. Therefore, even if the user terminal 101 cannot connect to the Internet, the user terminal 101 can request to turn on the device based on the offline service request.
  • the method for controlling the device 102 is described from the server side. As shown in FIG. 5 , it can be applied to the server 103 shown in FIG. 1 , and the method may include the following steps:
  • Step 501 receiving an online service request from the user terminal 101 .
  • the online service request carries the terminal identifier and device identifier of the user terminal 101 .
  • the server 103 may receive online service requests through 4G network, WIFI and other communication methods.
  • Step 502 Generate a first offline code corresponding to the terminal identification and the device identification, and send the first offline code to the user terminal 101 .
  • the first offline code may be generated based on an offline code generation algorithm.
  • the offline code generation algorithm includes, but is not limited to, a random character string generation algorithm, a hash algorithm, and the like.
  • the online service request can also be used to request to control (eg, activate) the device 102 corresponding to the device identification. Therefore, after receiving the online service request from the user terminal 101, it can also send a control (such as activation) instructions to control (eg activate) the device 102 .
  • the server 103 may also verify the usage limit corresponding to the terminal identifier before sending the startup instruction to the device 102 based on the online service request, and determine that the usage limit is not lower than the preset limit.
  • the server 103 may also verify the usage limit of the user terminal 101 based on the verification request alone. Specifically, the server 103 receives the verification request to verify the usage limit corresponding to the terminal identifier 101, and when the usage limit is lower than the preset limit At the time, a shutdown instruction is sent to the device 102, wherein the verification request includes the terminal identification.
  • a measure may be to update the offline code stored in the server 103 regularly. Specifically, before generating the first offline code, it is possible to judge whether there is a historical offline code corresponding to the terminal identification and the device identification, and if so, obtain the survival duration of the historical offline code, and when it is determined that the survival duration is greater than the preset duration, The first offline code is generated.
  • the server 103 may forcibly delete the first offline code periodically, specifically, after the first offline code is generated , the server 103 obtains the storage duration of the first offline code, and when the storage duration is greater than the preset storage duration, sends a deletion instruction to the device 102 and deletes the first offline code, and the deletion instruction is used to instruct the deletion of the terminal identifier and the first offline code.
  • the preset storage duration is not less than the preset survival duration.
  • both the preset storage duration and the preset generation duration can be preset by the user.
  • the method for controlling the device 102 is described from the user terminal side. As shown in FIG. 6 , it can be applied to the user terminal 101 shown in FIG. 1 , and the method may include the following steps:
  • Step 601 Generate an offline service request.
  • Step 602 sending an offline service request to the device 102 .
  • the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request the control device 102 .
  • the offline verification data may include a timestamp, a first verification code generated using the first offline code and the timestamp, and a terminal identification of the user terminal 101 .
  • the offline service request when the offline service request is generated, the timestamp and the first offline code are obtained, and the first verification code is generated by using the timestamp and the first offline code, and the offline verification code is further generated according to the timestamp, the first offline code and the first verification code. server request.
  • the user terminal 101 may request the server 103 to allocate the first offline code through the online service request. Specifically, the user terminal 101 generates an online service request carrying the terminal identification and the device identification, sends the online service request to the server 103 , and receives the first offline code sent by the server 103 .
  • the user terminal 101 may send an online service request to the server 103 through a 4G network, WIFI and other communication methods.
  • the online service request and the offline service request do not conflict with each other, that is, when the user terminal 101 can request to control the device 102 through an online service request, or can request to control the device 102 through an offline service request,
  • the user may randomly select a request method to request control of the device 102 .
  • sending the offline service request to the device 102 may be implemented in any of the following ways:
  • offline verification data is included in the light flashing signal, Bluetooth data and infrared signal.
  • Offline code [The server uses the terminal ID and device ID to generate a random string of preset size]
  • the offline code here includes the first offline code and the second offline code involved in the above embodiments.
  • the verification code generation algorithm can be:
  • Verification code take hash algorithm (timestamp + offline code)
  • the verification code here includes the first verification code and the second verification code involved in the above embodiments.
  • the offline code generation algorithm can be:
  • Offline code take hash algorithm (equipment ID + S string + terminal ID) + S string
  • the offline code here includes the first offline code and the third offline code involved in the above embodiments.
  • the verification code generation algorithm can be:
  • Verification code take hash algorithm (timestamp + offline code) + S string
  • the verification code here includes the first verification code and the third verification code involved in the above embodiments.
  • an embodiment of the present application further provides a device control device, which is applied to the device 102, as shown in FIG. 7, including:
  • an obtaining unit 701 configured to obtain an offline service request from the user terminal 101, where the offline service request includes offline verification data corresponding to a first offline code, and the first offline code is associated with the device 102 and the user terminal 101;
  • the verification unit 702 is configured to use the offline verification data to verify the user terminal 101, and after the verification is passed, execute the control of the device 102.
  • an embodiment of the present application also provides an apparatus for device control, which is applied to the server 103, as shown in FIG. 8, including:
  • a receiving unit 801 configured to receive an online service request from the user terminal 101, where the online service request carries the terminal identification and device identification of the user terminal 101;
  • the first generating unit 802 is configured to generate a first offline code corresponding to the terminal identification and the device identification, and send the first offline code to the user terminal 101 .
  • an embodiment of the present application also provides an apparatus for device control, which is applied to a user terminal, as shown in FIG. 9 , including:
  • the second generating unit 901 is configured to generate an offline service request, the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request the control device 102;
  • the sending unit 902 is configured to send an offline service request to the device 102 .
  • an embodiment of the present application also provides an electronic device.
  • the electronic device mainly includes: a processor 1001 , a communication interface 1002 , a memory 1003 and a communication bus 1004 , wherein the processor 1001 , The communication interface 1002 and the memory 1003 communicate with each other through the communication bus 1004 .
  • the memory 1003 stores a program executable by the processor 1001, and the processor 1001 executes the program stored in the memory 1003 to implement the device control method provided in any of the above method embodiments.
  • the communication bus 1004 mentioned in the above electronic equipment may be a Peripheral Component Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (EISA for short) bus or the like.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus 1004 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is shown in Figure 10, but it does not mean that there is only one bus or one type of bus.
  • the communication interface 1002 is used for communication between the above-mentioned electronic device and other devices.
  • the memory 1003 may include random access memory (Random Access Memory, RAM for short), or may include non-volatile memory (non-volatile memory), such as at least one disk memory. In some embodiments, the memory may also be at least one storage device located remotely from the aforementioned processor 1001 .
  • RAM Random Access Memory
  • non-volatile memory such as at least one disk memory.
  • the memory may also be at least one storage device located remotely from the aforementioned processor 1001 .
  • the above-mentioned processor 1001 may be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc., and may also be a digital signal processor (Digital Signal Processing, referred to as DSP) ), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a computer-readable storage medium is also provided, where a computer program is stored in the computer-readable storage medium, and when the computer program is run on a computer, the computer is made to execute the above-mentioned embodiments.
  • the described method of device control is also provided.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer can be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, from a website site, computer, server, or data center via wired (e.g., Coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, microwave, etc.) means to transmit to another website site, computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated.
  • the available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes, etc.), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.

Abstract

A device control method and system, an electronic device, and a storage medium. The device control method comprises: acquiring an offline service request from a user terminal, wherein the offline service request comprises offline verification data corresponding to a first offline code, and the first offline code is associated with a device and the user terminal; and verifying the user terminal by using the offline verification data, and after the verification is passed, executing control over the device, for example, controlling the device to self-start. By means of the solution of the present application, even if a user terminal cannot connect to a network, the user terminal can also request to start a device on the basis of an offline service request.

Description

设备控制的方法及系统、电子设备、及存储介质Device control method and system, electronic device, and storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2020年11月17日提交中国专利局,申请号为202011284751.2,申请名称为“设备控制的方法、系统、设备及存储介质”的中国专利申请的优先权,在此将其全文引入作为参考。This application claims the priority of the Chinese patent application filed on November 17, 2020 with the application number 202011284751.2 and the application title is "Method, System, Equipment and Storage Medium for Device Control", which is incorporated herein in its entirety. Reference.
技术领域technical field
本申请涉及计算机领域,尤其涉及一种设备控制的方法及系统、电子设备、及存储介质。The present application relates to the field of computers, and in particular, to a device control method and system, an electronic device, and a storage medium.
背景技术Background technique
当前,租赁设备在学校、教室等集体环境中使用的越来越多,当用户想使用租赁设备时,用户通过用户终端向服务器发送在线服务请求,服务器响应服务请求,控制开启租赁设备。然而,当用户终端离线时,用户终端将无法请求服务器控制开启租赁设备。Currently, rental equipment is used more and more in collective environments such as schools and classrooms. When a user wants to use the rental equipment, the user sends an online service request to the server through the user terminal, and the server responds to the service request and controls the opening of the rental equipment. However, when the user terminal is offline, the user terminal will not be able to request the server to control turning on the rental device.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种设备控制的方法及系统、电子设备、及存储介质,用以解决用户终端离线时,用户终端将无法请求服务器控制开启租赁设备的问题。The present application provides a device control method and system, an electronic device, and a storage medium to solve the problem that the user terminal cannot request the server to control the opening of the rental device when the user terminal is offline.
第一方面,本申请提供一种设备控制的方法,应用于设备,包括:In a first aspect, the present application provides a method for device control, applied to the device, including:
获取来自于用户终端的离线服务请求,所述离线服务请求包括与第一离线码对应的离线验证数据,所述第一离线码与所述设备以及所述用户终端关联;acquiring an offline service request from a user terminal, where the offline service request includes offline verification data corresponding to a first offline code, and the first offline code is associated with the device and the user terminal;
利用所述离线验证数据,对所述用户终端进行验证,并在验证通过后,执行对所述设备的控制。Using the offline verification data, the user terminal is verified, and after the verification is passed, the device is controlled.
在一些实施例中,所述离线验证数据包括时间戳、采用所述第一离线码和所述时间戳生成的第一验证码、和所述用户终端的终端标识。In some embodiments, the offline verification data includes a timestamp, a first verification code generated using the first offline code and the timestamp, and a terminal identification of the user terminal.
在一些实施例中,判断是否存在与所述离线验证数据中的所述终端标识相同的第一标识,如果是,获取接收所述离线服务请求的接收时间,其中,所述第一标识为所述设备中存储的终端标识;In some embodiments, determine whether there is a first identifier that is the same as the terminal identifier in the offline verification data, and if so, acquire the receiving time for receiving the offline service request, where the first identifier is the the terminal identifier stored in the device;
确定所述时间戳与所述接收时间的时间差;determining the time difference between the timestamp and the reception time;
当所述时间差小于或等于预设时间阈值时,对所述第一验证码进行验证,并当验证通过后,执行对所述设备的控制。When the time difference is less than or equal to a preset time threshold, the first verification code is verified, and when the verification is passed, the device is controlled.
在一些实施例中,当所述时间差小于或等于预设时间阈值时,对所述第一验证码进行验证,并当验证通过后,执行对所述设备的控制,包括:In some embodiments, when the time difference is less than or equal to a preset time threshold, the first verification code is verified, and when the verification is passed, the control of the device is performed, including:
当所述时间差小于或等于预设时间阈值时,生成与第二离线码和所述时间戳对应的第二验证码,其中,所述第二离线码为所述设备中存储的与所述第一标识相对应的离线码;When the time difference is less than or equal to a preset time threshold, a second verification code corresponding to the second offline code and the timestamp is generated, wherein the second offline code is stored in the device and is the same as the first verification code. 1. Identify the corresponding offline code;
确定所述第二验证码与所述第一验证码相同时,执行对所述设备的控制。When it is determined that the second verification code is the same as the first verification code, the control of the device is performed.
在一些实施例中,利用所述离线验证数据,对所述用户终端进行验证,并在验证通过后,执行对所述设备的控制,包括:In some embodiments, the user terminal is verified by using the offline verification data, and after the verification is passed, the control of the device is performed, including:
获取所述设备的设备标识;obtain the device identification of the device;
生成与所述终端标识和所述设备标识对应的第三离线码;generating a third offline code corresponding to the terminal identification and the device identification;
生成与所述第三离线码和所述离线验证数据中的所述时间戳对应的第三验证码;generating a third verification code corresponding to the third offline code and the timestamp in the offline verification data;
当所述第三验证码与所述第一验证码相同时,执行所述对所述设备的控制。When the third verification code is the same as the first verification code, the controlling of the device is performed.
在一些实施例中,获取来自于用户终端的离线服务请求,包括:In some embodiments, obtaining the offline service request from the user terminal includes:
获取所述用户终端发出的灯光闪烁信号,从所述灯光闪烁信号中提取获得所述离线服务请求;或者Obtain the light flickering signal sent by the user terminal, and extract the offline service request from the light flickering signal; or
接收所述用户终端通过蓝牙通信传输的蓝牙数据,从所述蓝牙数据中提取获得所述离线服务请求;或者Receive the Bluetooth data transmitted by the user terminal through Bluetooth communication, and extract the offline service request from the Bluetooth data; or
获取所述用户终端发出的红外信号,从所述红外信号中提取获得所述离线服务请求。Obtain the infrared signal sent by the user terminal, and extract the offline service request from the infrared signal.
在一些实施例中,执行对所述设备的控制,包括:In some embodiments, performing control of the device includes:
执行启动服务;Execute the startup service;
执行启动服务之后,还包括:After executing the startup service, it also includes:
向服务器发送验证请求,所述验证请求包括所述终端标识,所述验证请求用于请求验证所述用户终端的使用额度是否低于预设额度;sending a verification request to the server, where the verification request includes the terminal identifier, and the verification request is used to request to verify whether the usage limit of the user terminal is lower than a preset limit;
接收所述服务器发送的关机指令,并根据所述关机指令执行关机服务,其中,所述关机指令为所述服务器在验证所述使用额度低于所述预设额度后发送的指令。A shutdown instruction sent by the server is received, and a shutdown service is performed according to the shutdown instruction, wherein the shutdown instruction is an instruction sent by the server after verifying that the usage limit is lower than the preset limit.
在一些实施例中,获取来自于用户终端的离线服务请求之前,还包括:In some embodiments, before acquiring the offline service request from the user terminal, the method further includes:
接收服务器发送的所述第一标识和所述第二离线码。The first identifier and the second offline code sent by the server are received.
在一些实施例中,执行对所述设备的控制之后,还包括:In some embodiments, after performing the control of the device, it further includes:
接收所述服务器发送的删除指令,所述删除指令用于指示删除所述终端标识和所述第一离线码;receiving a deletion instruction sent by the server, where the deletion instruction is used to instruct deletion of the terminal identifier and the first offline code;
删除所述终端标识和所述第一离线码。Delete the terminal identification and the first offline code.
第二方面,本申请提供一种设备控制的方法,应用于服务器,包括:In a second aspect, the present application provides a method for device control, applied to a server, including:
接收来自于用户终端的在线服务请求,所述在线服务请求中携带所述用户终端的终端标识和设备标识;receiving an online service request from a user terminal, where the online service request carries the terminal identification and device identification of the user terminal;
生成与所述终端标识和所述设备标识对应的第一离线码,并向所述用户终端发送所述第一离线码。A first offline code corresponding to the terminal identification and the device identification is generated, and the first offline code is sent to the user terminal.
在一些实施例中,向所述用户终端发送所述第一离线码之后,还包括:In some embodiments, after sending the first offline code to the user terminal, the method further includes:
接收验证请求,所述验证请求包括所述终端标识;receiving a verification request, where the verification request includes the terminal identifier;
验证所述终端标识对应的使用额度,并在所述使用额度低于预设额度时,向所述设备标识对应的设备发送关机指令。The usage limit corresponding to the terminal identifier is verified, and when the usage limit is lower than a preset limit, a shutdown instruction is sent to the device corresponding to the device identifier.
在一些实施例中,生成与所述终端标识和所述设备标识对应的第一离线码之前,还包括:In some embodiments, before generating the first offline code corresponding to the terminal identifier and the device identifier, the method further includes:
判断所述服务器中是否存储有对应于所述终端标识和所述设备标识的历史离线码;如果有,获取所述历史离线码的生存时长,当所述生存时长大于预设生存时长时,生成所述第一离线码。Determine whether there is a historical offline code corresponding to the terminal identification and the device identification stored in the server; if so, obtain the survival time of the historical offline code, and when the survival time is greater than the preset survival time, generate the first offline code.
在一些实施例中,生成与所述终端标识和所述设备标识对应的第一离线码之后,还包括:In some embodiments, after generating the first offline code corresponding to the terminal identifier and the device identifier, the method further includes:
获取所述第一离线码的存储时长;obtaining the storage duration of the first offline code;
判断所述存储时长是否大于预设存储时长,如果是,向所述设备发送删除指令,并删除所述第一离线码,其中,所述删除指令用于指示删除所述终端标识和所述第一离线码。Determine whether the storage duration is greater than the preset storage duration, and if so, send a deletion instruction to the device and delete the first offline code, wherein the deletion instruction is used to instruct deletion of the terminal identifier and the first offline code. An offline code.
第三方面,本申请提供一种设备控制的方法,应用于用户终端,包括:In a third aspect, the present application provides a method for device control, applied to a user terminal, including:
生成离线服务请求,所述离线服务请求包括与第一离线码对应的离线验证数据,所述离线服务请求用于请求控制所述设备;generating an offline service request, where the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request control of the device;
向设备发送所述离线服务请求。The offline service request is sent to the device.
在一些实施例中,生成离线服务请求之前,还包括:In some embodiments, before generating the offline service request, the method further includes:
生成在线服务请求,并向服务器发送所述在线服务请求,所述在线服务请求携带有所述用户终端的终端标识和所述设备的设备标识;generating an online service request, and sending the online service request to the server, where the online service request carries the terminal identification of the user terminal and the device identification of the device;
接收所述服务器发送的所述第一离线码,所述第一离线码与所述终端标识和所述设备标识相对应。The first offline code sent by the server is received, where the first offline code corresponds to the terminal identification and the device identification.
在一些实施例中,所述离线验证数据包括时间戳、采用所述第一离线码和所述时间戳生成的第一验证码、和所述用户终端的终端标识;In some embodiments, the offline verification data includes a timestamp, a first verification code generated by using the first offline code and the timestamp, and a terminal identifier of the user terminal;
生成离线服务请求,包括:Generate offline service requests, including:
获取所述时间戳和所述第一离线码,并采用所述时间戳和所述第一离线码生成所述第一验证码;acquiring the timestamp and the first offline code, and generating the first verification code using the timestamp and the first offline code;
根据所述时间戳、所述第一离线码以及所述第一验证码,生成所述离线服务器请求。The offline server request is generated according to the timestamp, the first offline code, and the first verification code.
第四方面,本申请提供一种设备控制的系统,包括:In a fourth aspect, the present application provides a system for device control, including:
用户终端,用于生成离线服务请求,并向设备发送所述离线服务请求,所述离线服务请求包括与第一离线码对应的离线验证数据,所述离线服务请求用于请求控制所述设备;在生成所述离线服务请求前,生成在线服务请求,向服务器发送所述在线服务请求,所述在线服务请求中携带所述用户终端的终端标识和所述设备的设备标识;接收所述服务器发送的所述第一离线码;a user terminal, configured to generate an offline service request and send the offline service request to the device, where the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request to control the device; Before generating the offline service request, an online service request is generated, and the online service request is sent to the server, where the online service request carries the terminal identification of the user terminal and the device identification of the device; The first offline code of ;
所述设备,用于获取所述离线服务请求;利用所述离线验证数据,对所述用户终端进行验证,并在验证通过后,执行对所述设备的控制;The device is used to obtain the offline service request; use the offline verification data to verify the user terminal, and after the verification is passed, execute the control of the device;
所述服务器,用于接收所述在线服务请求;生成与所述终端标识和所述设备标识对应的所述第一离线码,并向所述用户终端发送所述第一离线码。The server is configured to receive the online service request; generate the first offline code corresponding to the terminal identification and the device identification, and send the first offline code to the user terminal.
第五方面,本申请提供一种电子设备,包括:处理器、通信接口、存储器和通信总线,其中,处理器、通信接口和存储器通过通信总线完成相互间的通信;In a fifth aspect, the present application provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
所述存储器,用于存储计算机程序;the memory for storing computer programs;
所述处理器,用于执行所述存储器中所存储的程序,实现上述任一项所述的方法。The processor is configured to execute the program stored in the memory to implement any of the methods described above.
第六方面,本申请提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法。In a sixth aspect, the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, any one of the methods described above is implemented.
本申请实施例提供的上述技术方案与相关技术相比具有如下优点:本实施例提供的技术方案,设备可以接收用户终端的离线服务请求,并在利用离线服务请求对用户终端进行 验证通过后,执行对所述设备的控制,如控制设备自启动。因此,即使用户终端离线,基于离线服务请求,用户终端也可以请求开启设备。Compared with the related art, the above technical solutions provided by the embodiments of the present application have the following advantages: in the technical solutions provided by the present embodiments, the device can receive an offline service request from a user terminal, and after verifying the user terminal by using the offline service request, Perform control of the device, such as controlling the device to self-start. Therefore, even if the user terminal is offline, the user terminal may request to turn on the device based on the offline service request.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. In other words, on the premise of no creative labor, other drawings can also be obtained from these drawings.
图1为本申请一实施例中设备控制的系统的结构示意图;1 is a schematic structural diagram of a system for device control in an embodiment of the application;
图2为本申请一实施例中设备控制的方法的流程示意图;2 is a schematic flowchart of a method for device control in an embodiment of the present application;
图3为本申请另一实施例中设备控制的方法的流程示意图;3 is a schematic flowchart of a method for device control in another embodiment of the present application;
图4为本申请另一实施例中设备控制的方法的流程示意图;4 is a schematic flowchart of a method for device control in another embodiment of the present application;
图5为本申请另一实施例中设备控制的方法的流程示意图;5 is a schematic flowchart of a method for device control in another embodiment of the present application;
图6为本申请另一实施例中设备控制的方法的流程示意图;6 is a schematic flowchart of a method for device control in another embodiment of the present application;
图7为本申请一实施例中设备控制的装置的结构示意图;7 is a schematic structural diagram of an apparatus for device control in an embodiment of the present application;
图8为本申请另一实施例中设备控制的装置的结构示意图;8 is a schematic structural diagram of an apparatus for device control in another embodiment of the present application;
图9为本申请另一实施例中设备控制的装置的结构示意图;9 is a schematic structural diagram of an apparatus for device control in another embodiment of the present application;
图10为本申请一实施例中电子设备的结构示意图。FIG. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of this application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present application.
参见图1,为本申请一实施例示出的一种设备控制的系统的系统架构示意图。Referring to FIG. 1 , it is a schematic diagram of a system architecture of a system for device control according to an embodiment of the application.
设备控制的系统包括:用户终端101、设备102以及服务器103。The system for device control includes: a user terminal 101 , a device 102 and a server 103 .
用户终端101,用于生成离线服务请求,并向设备102发送离线服务请求,离线服务 请求包括与第一离线码对应的离线验证数据,离线服务请求用于请求控制设备102;在生成离线服务请求前,生成在线服务请求,向服务器103发送在线服务请求,在线服务请求中携带用户终端101的终端标识和设备102的设备标识;接收服务器103发送的第一离线码。The user terminal 101 is used to generate an offline service request and send the offline service request to the device 102. The offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request the control device 102; after generating the offline service request Before, generate an online service request, send the online service request to the server 103, the online service request carries the terminal identification of the user terminal 101 and the device identification of the device 102; and receive the first offline code sent by the server 103.
设备102,用于获取离线服务请求;利用离线验证数据,对用户终端101进行验证,并在验证通过后,执行对设备102的控制。The device 102 is used for acquiring an offline service request; using the offline verification data, the user terminal 101 is verified, and after the verification is passed, the device 102 is controlled.
服务器103,用于在线服务请求;生成与终端标识和设备标识对应的第一离线码,并向用户终端101发送第一离线码。The server 103 is used for online service request; generates a first offline code corresponding to the terminal identification and the device identification, and sends the first offline code to the user terminal 101 .
基于图1所示的设备控制的系统,以下分别从设备侧、服务器侧、以及用户终端侧对设备控制的方法进行描述。Based on the device control system shown in FIG. 1 , the following describes the device control method from the device side, the server side, and the user terminal side, respectively.
首先从设备侧对设备控制的方法进行描述,如图2所示,所述设备控制的方法可以应用于图1所示的设备102,该方法可以包括以下步骤:First, the device control method is described from the device side. As shown in FIG. 2 , the device control method can be applied to the device 102 shown in FIG. 1 , and the method can include the following steps:
步骤201、获取来自于用户终端101的离线服务请求。 Step 201 , acquiring an offline service request from the user terminal 101 .
在一些实施例中,获取来自于用户终端101的离线服务请求时,可以通过以下任一种方式实现。In some embodiments, obtaining the offline service request from the user terminal 101 may be implemented in any of the following manners.
第一种实现方式,获取用户终端101发出的灯光闪烁信号,从灯光闪烁信号中提取离线服务请求。In the first implementation manner, the light flickering signal sent by the user terminal 101 is acquired, and the offline service request is extracted from the light flickering signal.
在第一种实现方式中,设备102上安装有感光元件,感光元件可以捕获用户终端101发出的灯光闪烁信号。In the first implementation manner, a photosensitive element is installed on the device 102 , and the photosensitive element can capture the light flashing signal sent by the user terminal 101 .
在从灯光闪烁信号中提取离线服务请求时,首先可以生成与灯光闪烁信号对应的灯光闪烁曲线,然后根据灯光闪烁曲线确定灯光闪烁规律,最后将与灯光闪烁规律对应的服务请求作为离线服务请求。When extracting the offline service request from the light flickering signal, firstly, a light flickering curve corresponding to the light flickering signal can be generated, then the light flickering law can be determined according to the light flickering curve, and finally the service request corresponding to the light flickering law can be regarded as the offline service request.
实际应用中,用户终端101和设备102可以预先约定灯光闪烁规律与服务请求的映射关系。In practical applications, the user terminal 101 and the device 102 may predetermine the mapping relationship between the light flickering law and the service request.
第二种实现方式,接收用户终端101通过蓝牙通信传输的蓝牙数据,从蓝牙数据中提取离线服务请求。In the second implementation manner, the Bluetooth data transmitted by the user terminal 101 through Bluetooth communication is received, and the offline service request is extracted from the Bluetooth data.
在第二种实现方式中,设备102接收用户终端101发送的离线服务请求之前,需要预先建立与用户终端101之间的蓝牙通信。具体地,设备102根据用户终端101的蓝牙请求, 与用户终端101建立蓝牙通信连接,并通过建立的蓝牙通信接收用户终端101所发送的离线服务请求。In the second implementation manner, before the device 102 receives the offline service request sent by the user terminal 101, it needs to establish Bluetooth communication with the user terminal 101 in advance. Specifically, the device 102 establishes a Bluetooth communication connection with the user terminal 101 according to the Bluetooth request of the user terminal 101, and receives the offline service request sent by the user terminal 101 through the established Bluetooth communication.
第三种实现方式,获取用户终端101发出的红外信号,从红外信号中提取获得离线服务请求。In a third implementation manner, the infrared signal sent by the user terminal 101 is acquired, and the offline service request is obtained by extracting the infrared signal.
在第三种实现方式中,设备102和用户终端101可以预先约定红外信号与服务请求之间的对应关系,当设备102检测获得红外信号后,根据预先约定的对应关系,从红外信号中获得离线服务请求。In a third implementation manner, the device 102 and the user terminal 101 may pre-agreed the correspondence between the infrared signal and the service request. After the device 102 detects and obtains the infrared signal, it obtains offline information from the infrared signal according to the pre-agreed correspondence. Request for service.
本实施例中,离线服务请求包括与第一离线码对应的离线验证数据,第一离线码与设备102以及用户终端101关联。In this embodiment, the offline service request includes offline verification data corresponding to the first offline code, and the first offline code is associated with the device 102 and the user terminal 101 .
步骤202、利用离线验证数据,对用户终端101进行验证,并在验证通过后,执行对设备102的控制。 Step 202 , verify the user terminal 101 by using the offline verification data, and execute the control of the device 102 after the verification is passed.
本实施例中,离线验证数据可以包括时间戳、采用第一离线码和时间戳生成的第一验证码、和用户终端101的终端标识。In this embodiment, the offline verification data may include a timestamp, a first verification code generated by using the first offline code and the timestamp, and a terminal identifier of the user terminal 101 .
实际应用中,时间戳可以为生成第一验证码的当前时刻,即利用当前时刻和第一离线码生成第一验证码。In practical applications, the timestamp may be the current moment when the first verification code is generated, that is, the first verification code is generated by using the current moment and the first offline code.
一种可选实施方式,可以对时间戳和离线码取散列算法,以得到验证码。因此,在生成第一验证码时,可以对时间戳和第一离线码取散列算法,以生成第一验证码。In an optional implementation manner, a hash algorithm can be performed on the timestamp and the offline code to obtain the verification code. Therefore, when generating the first verification code, a hash algorithm may be performed on the timestamp and the first offline code to generate the first verification code.
在一些实施例中,取散列算法包括但不限于MD5信息摘要算法。In some embodiments, the hashing algorithm includes, but is not limited to, the MD5 message digest algorithm.
基于上述离线验证数据,本实施例提供以下两种对用户终端101进行验证的实现方式。Based on the above offline verification data, this embodiment provides the following two implementation manners for verifying the user terminal 101 .
第一种实现方式,具体地,如图3所示,可以包括以下步骤。The first implementation manner, specifically, as shown in FIG. 3 , may include the following steps.
步骤301、判断是否存在与离线验证数据中的终端标识相同的第一标识,若是执行步骤302。Step 301: Determine whether there is a first identifier that is the same as the terminal identifier in the offline verification data, and if so, go to step 302.
其中,第一标识为设备102中存储的终端标识。The first identifier is the terminal identifier stored in the device 102 .
步骤302、获取接收离线服务请求的接收时间。Step 302: Obtain the receiving time for receiving the offline service request.
为了避免终端标识被盗取导致设备被非法控制,在验证设备102中存在与离线验证数据中的终端标识相同的第一标识后,继续通过接收离线服务请求的接收时间,验证离线验证数据中的时间戳。In order to prevent the device from being illegally controlled due to the theft of the terminal identification, after the verification device 102 has the same first identification as the terminal identification in the offline verification data, continue to verify the offline verification data by receiving the reception time of the offline service request. timestamp.
步骤303、确定时间戳与接收时间的时间差。Step 303: Determine the time difference between the time stamp and the receiving time.
步骤304、判断时间差是否小于或等于预设时间阈值,若是执行步骤305。 Step 304 , determine whether the time difference is less than or equal to the preset time threshold, and if so, perform step 305 .
步骤305、生成与第二离线码和时间戳对应的第二验证码。Step 305: Generate a second verification code corresponding to the second offline code and the timestamp.
其中,第二离线码为设备102中存储的与第一标识相对应的离线码。The second offline code is the offline code stored in the device 102 and corresponding to the first identifier.
步骤306、判断第二验证码与第一验证码是否相同,若是,执行步骤307。 Step 306 , determine whether the second verification code is the same as the first verification code, and if so, go to step 307 .
为了避免终端标识、第一离线码以及时间戳均被盗取,导致的设备102被非法控制,在对离线验证数据中终端标识和时间戳均验证通过以后,还验证离线验证数据中的第一离线码。In order to prevent the device 102 from being illegally controlled due to theft of the terminal identifier, the first offline code and the timestamp, after both the terminal identifier and the timestamp in the offline verification data are verified, the first offline verification data is also verified. offline code.
步骤307、执行对设备的控制。Step 307: Execute control of the device.
其中,当不存在与离线验证数据中的终端标识相同的第一标识时,或时间差大于预设时间阈值时,或第二验证码与第一验证码不同时,向用户终端发送验证失败信息。Wherein, when there is no first identifier identical to the terminal identifier in the offline verification data, or when the time difference is greater than a preset time threshold, or when the second verification code is different from the first verification code, verification failure information is sent to the user terminal.
实际应用中,验证失败信息可以携带验证识别的原因,如使用额度不足等。In practical applications, the verification failure information may carry the reasons for verification identification, such as insufficient usage quota.
本实施例中,预设时间阈值可以根据经验值设定。In this embodiment, the preset time threshold may be set according to an empirical value.
本实施例实现的是,当设备102中存储有第一标识和第二离线码时,对用户终端101的离线服务请求进行验证的过程。This embodiment implements the process of verifying the offline service request of the user terminal 101 when the first identifier and the second offline code are stored in the device 102 .
第二种实现方式,如图4所示,可以包括以下步骤。The second implementation manner, as shown in FIG. 4 , may include the following steps.
步骤401、获取设备102的设备标识。 Step 401 , acquiring the device identifier of the device 102 .
步骤402、生成与终端标识和设备标识对应的第三离线码。Step 402: Generate a third offline code corresponding to the terminal identifier and the device identifier.
在一些实施例中,可以通过与服务器预先预定的离线码生成算法,生成第三离线码。In some embodiments, the third offline code may be generated through an offline code generation algorithm pre-determined with the server.
本实施例中,离线码生成算法包括但不限于随机字符串的生成算法,或取散列算法等。In this embodiment, the offline code generation algorithm includes, but is not limited to, a random character string generation algorithm, a hash algorithm, and the like.
实际应用中,取散列算法包括但不限于MD5信息摘要算法。In practical applications, the hashing algorithm includes but is not limited to the MD5 message digest algorithm.
步骤403、生成与第三离线码和离线验证数据中的时间戳对应的第三验证码。Step 403: Generate a third verification code corresponding to the third offline code and the timestamp in the offline verification data.
在一些实施例中,生成第三验证码的算法与生成第一验证码的算法相同。In some embodiments, the algorithm for generating the third verification code is the same as the algorithm for generating the first verification code.
步骤404、当第三验证码与第一验证码相同时,执行对设备102的控制。Step 404: When the third verification code is the same as the first verification code, perform control of the device 102.
本实施例实现的是,当设备102与服务器103预先约定有离线码生成算法时,对用户终端101的离线服务请求进行验证的过程。This embodiment implements the process of verifying the offline service request of the user terminal 101 when the device 102 and the server 103 pre-agreed with an offline code generation algorithm.
在一些实施例中,执行对设备102的控制,可以包括执行启动服务,即利用离线验证数据对用户终端101进行验证通过后,设备102执行启动服务,以完成自启动。In some embodiments, executing the control over the device 102 may include executing a startup service, that is, after the user terminal 101 is authenticated by using the offline verification data, the device 102 executes the startup service to complete self-startup.
考虑到设备102本身可能不带有数据库,且设备102本身的处理能力有限,设备102 执行启动服务之后,还可以进一步请求服务器103对设备102的使用额度进行再次验证。Considering that the device 102 itself may not have a database and the processing capability of the device 102 itself is limited, after the device 102 executes the startup service, it may further request the server 103 to re-verify the usage quota of the device 102 .
在一些实施例中,设备102可以向服务器103发送用于验证用户终端101的使用额度是否低于预设额度的验证请求,验证请求包括终端标识;并接收服务器103在验证使用额度低于预设额度后发送的关机指令,并根据关机指令执行关机服务。In some embodiments, the device 102 may send a verification request to the server 103 for verifying whether the usage limit of the user terminal 101 is lower than the preset limit, the verification request includes the terminal identifier; and receive the server 103 verifying that the usage limit is lower than the preset limit The shutdown command sent after the quota is exceeded, and the shutdown service is performed according to the shutdown command.
实际应用中,使用额度可以为与终端标识对应的账户的余额。In practical applications, the usage limit may be the balance of the account corresponding to the terminal identifier.
本实施例中,设备102还可以根据服务器103发送的删除指令,删除终端标识和第一离线码。In this embodiment, the device 102 may also delete the terminal identifier and the first offline code according to the deletion instruction sent by the server 103 .
本实施例提供的技术方案,设备102可以接收用户终端101的离线服务请求,并在利用离线服务请求对用户终端101进行验证通过后,执行对设备102的控制,如控制设备102自启动。因此,即使用户终端101无法联网,基于离线服务请求,用户终端101也可以请求开启设备。In the technical solution provided in this embodiment, the device 102 can receive the offline service request from the user terminal 101, and after the user terminal 101 is verified by the offline service request, execute control of the device 102, such as controlling the device 102 to start up. Therefore, even if the user terminal 101 cannot connect to the Internet, the user terminal 101 can request to turn on the device based on the offline service request.
至此完成设备侧对设备102控制的方法的描述。So far, the description of the method for controlling the device 102 by the device side is completed.
其次从服务器侧对设备102控制的方法进行描述,如图5所示,可以应用于图1所示的服务器103,该方法可以包括以下步骤:Next, the method for controlling the device 102 is described from the server side. As shown in FIG. 5 , it can be applied to the server 103 shown in FIG. 1 , and the method may include the following steps:
步骤501、接收来自于用户终端101的在线服务请求。 Step 501 , receiving an online service request from the user terminal 101 .
在线服务请求中携带用户终端101的终端标识和设备标识。The online service request carries the terminal identifier and device identifier of the user terminal 101 .
实际应用中,服务器103可以通过4G网络、WIFI等通信方式接收在线服务请求。In practical applications, the server 103 may receive online service requests through 4G network, WIFI and other communication methods.
步骤502、生成与终端标识和设备标识对应的第一离线码,并向用户终端101发送第一离线码。Step 502 : Generate a first offline code corresponding to the terminal identification and the device identification, and send the first offline code to the user terminal 101 .
本实施例中,可以基于离线码生成算法生成第一离线码。In this embodiment, the first offline code may be generated based on an offline code generation algorithm.
本实施例中,离线码生成算法包括但不限于随机字符串的生成算法,或取散列算法等。In this embodiment, the offline code generation algorithm includes, but is not limited to, a random character string generation algorithm, a hash algorithm, and the like.
在一些实施例中,在线服务请求还可以用于请求控制(如启动)对应于设备标识的设备102,因此,在接收来自于用户终端101的在线服务请求后,还可以向设备102发送控制(如启动)指令,以控制(如启动)设备102。In some embodiments, the online service request can also be used to request to control (eg, activate) the device 102 corresponding to the device identification. Therefore, after receiving the online service request from the user terminal 101, it can also send a control ( such as activation) instructions to control (eg activate) the device 102 .
在一些实施例中,服务器103基于在线服务请求,向设备102发送启动指令之前,还可以验证与终端标识对应的使用额度,并确定使用额度不低于预设额度。In some embodiments, the server 103 may also verify the usage limit corresponding to the terminal identifier before sending the startup instruction to the device 102 based on the online service request, and determine that the usage limit is not lower than the preset limit.
在一些实施例中,服务器103还可以单独基于验证请求验证用户终端101的使用额度,具体地,服务器103接收验证请求,以验证终端标识101对应的使用额度,并在使用额度 低于预设额度时,向设备102发送关机指令,其中验证请求中包括终端标识。In some embodiments, the server 103 may also verify the usage limit of the user terminal 101 based on the verification request alone. Specifically, the server 103 receives the verification request to verify the usage limit corresponding to the terminal identifier 101, and when the usage limit is lower than the preset limit At the time, a shutdown instruction is sent to the device 102, wherein the verification request includes the terminal identification.
在一些实施例中,为了降低离线码被盗取使用的风险,一种措施,可以对服务器103中存储的离线码定时更新。具体地,可以在生成第一离线码之前,判断是否存储有对应于终端标识和设备标识的历史离线码,如果有,获取历史离线码的生存时长,并在确定生存时长大于预设时长时,才生成第一离线码。In some embodiments, in order to reduce the risk of the offline code being stolen and used, a measure may be to update the offline code stored in the server 103 regularly. Specifically, before generating the first offline code, it is possible to judge whether there is a historical offline code corresponding to the terminal identification and the device identification, and if so, obtain the survival duration of the historical offline code, and when it is determined that the survival duration is greater than the preset duration, The first offline code is generated.
在一些实施例中,另一种措施,考虑到用户终端101存在长时间不请求更新第一离线码的可能,服务器103可以定时强制删除第一离线码,具体地,在生成第一离线码之后,服务器103获取第一离线码的存储时长,并当存储时长大于预设存储时长时,向设备102发送删除指令,并删除第一离线码,删除指令用于指示删除终端标识和第一离线码。In some embodiments, another measure, considering the possibility that the user terminal 101 does not request to update the first offline code for a long time, the server 103 may forcibly delete the first offline code periodically, specifically, after the first offline code is generated , the server 103 obtains the storage duration of the first offline code, and when the storage duration is greater than the preset storage duration, sends a deletion instruction to the device 102 and deletes the first offline code, and the deletion instruction is used to instruct the deletion of the terminal identifier and the first offline code. .
其中,预设存储时长不小于预设生存时长。Wherein, the preset storage duration is not less than the preset survival duration.
实际应用中,预设存储时长和预设生成时长均可以由用户预先设定。In practical applications, both the preset storage duration and the preset generation duration can be preset by the user.
至此完成服务器侧对设备102控制的方法的描述。So far, the description of the method for controlling the device 102 on the server side is completed.
最后从用户终端侧对设备102控制的方法进行描述,如图6所示,可以应用于图1所示的用户终端101,该方法可以包括以下步骤:Finally, the method for controlling the device 102 is described from the user terminal side. As shown in FIG. 6 , it can be applied to the user terminal 101 shown in FIG. 1 , and the method may include the following steps:
步骤601、生成离线服务请求。Step 601: Generate an offline service request.
步骤602、向设备102发送离线服务请求。 Step 602 , sending an offline service request to the device 102 .
其中,离线服务请求包括与第一离线码对应的离线验证数据,离线服务请求用于请求控制设备102。The offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request the control device 102 .
在一些实施例中,离线验证数据可以包括时间戳、采用第一离线码和时间戳生成的第一验证码、和用户终端101的终端标识。In some embodiments, the offline verification data may include a timestamp, a first verification code generated using the first offline code and the timestamp, and a terminal identification of the user terminal 101 .
相应地,生成离线服务请求时,获取时间戳和第一离线码,并采用时间戳和第一离线码生成第一验证码,进一步根据时间戳、第一离线码以及第一验证码,生成离线服务器请求。Correspondingly, when the offline service request is generated, the timestamp and the first offline code are obtained, and the first verification code is generated by using the timestamp and the first offline code, and the offline verification code is further generated according to the timestamp, the first offline code and the first verification code. server request.
在一些实施例中,在生成离线服务请求前,用户终端101可以通过在线服务请求向服务器103请求分配第一离线码。具体地,用户终端101生成携带有终端标识和设备标识的在线服务请求,并向服务器103发送在线服务请求,并接收服务器103发送的第一离线码。In some embodiments, before generating the offline service request, the user terminal 101 may request the server 103 to allocate the first offline code through the online service request. Specifically, the user terminal 101 generates an online service request carrying the terminal identification and the device identification, sends the online service request to the server 103 , and receives the first offline code sent by the server 103 .
实际应用中,用户终端101可以通过4G网络、WIFI等通信方式向服务器103发送在线服务请求。In practical applications, the user terminal 101 may send an online service request to the server 103 through a 4G network, WIFI and other communication methods.
需要说明的是,本实施例中,在线服务请求与离线服务请求并不相互冲突,即当用户终端101既可以通过在线服务请求请求控制设备102,也可以通过离线服务请求请求控制设备102时,用户可以随机选择一种请求方式,以请求控制设备102。It should be noted that, in this embodiment, the online service request and the offline service request do not conflict with each other, that is, when the user terminal 101 can request to control the device 102 through an online service request, or can request to control the device 102 through an offline service request, The user may randomly select a request method to request control of the device 102 .
在一些实施例中,本实施例中,向设备102发送离线服务请求可以通过以下任一种方式实现:In some embodiments, in this embodiment, sending the offline service request to the device 102 may be implemented in any of the following ways:
发出灯光闪烁信号;emit light flashing signal;
通过与设备102建立的蓝牙通信发送蓝牙数据;send Bluetooth data through Bluetooth communication established with device 102;
发出红外信号。Send out an infrared signal.
其中,灯光闪烁信号、蓝牙数据和红外信号中包括离线验证数据。Among them, offline verification data is included in the light flashing signal, Bluetooth data and infrared signal.
至此完成用户终端侧对设备控制的方法的描述。This completes the description of the method for device control by the user terminal side.
以下举例说明本申请实施例中涉及到的离线码的生成算法以及验证码的生成算法:The following examples illustrate the generation algorithm of the offline code and the generation algorithm of the verification code involved in the embodiment of the present application:
第一种实现方式,以设备侧的本地验证为图3的方式进行举例:For the first implementation, take the local authentication on the device side as an example as shown in Figure 3:
(1)假定离线码的生成算法可以为:(1) It is assumed that the generation algorithm of the offline code can be:
离线码=【服务器利用终端标识和设备标识生成预设大小的随机字符串】Offline code = [The server uses the terminal ID and device ID to generate a random string of preset size]
此处的离线码包括上述实施例中涉及到的第一离线码和第二离线码。The offline code here includes the first offline code and the second offline code involved in the above embodiments.
(2)验证码生成算法可以为:(2) The verification code generation algorithm can be:
验证码=取散列算法(时间戳+离线码)Verification code = take hash algorithm (timestamp + offline code)
此处的验证码包括上述实施例中涉及到的第一验证码和第二验证码。The verification code here includes the first verification code and the second verification code involved in the above embodiments.
第二种实现方式,以设备侧的本地验证为图4的方式进行举例:For the second implementation, take the local authentication on the device side as an example in Figure 4:
(1)离线码生成算法可以为:(1) The offline code generation algorithm can be:
离线码=取散列算法(设备标识+S字符串+终端标识)+S字符串Offline code = take hash algorithm (equipment ID + S string + terminal ID) + S string
S字符串=生成时间戳+随机字符串S string = generation timestamp + random string
此处的离线码包括上述实施例中涉及到的第一离线码和第三离线码。The offline code here includes the first offline code and the third offline code involved in the above embodiments.
(2)验证码生成算法可以为:(2) The verification code generation algorithm can be:
验证码=取散列算法(时间戳+离线码)+S字符串Verification code = take hash algorithm (timestamp + offline code) + S string
此处的验证码包括上述实施例中涉及到的第一验证码和第三验证码。The verification code here includes the first verification code and the third verification code involved in the above embodiments.
基于相同的申请构思,本申请实施例还提供一种设备控制的装置,应用于设备102,如图7所示,包括:Based on the same application concept, an embodiment of the present application further provides a device control device, which is applied to the device 102, as shown in FIG. 7, including:
获取单元701,用于获取来自于用户终端101的离线服务请求,离线服务请求包括与第一离线码对应的离线验证数据,第一离线码与设备102以及用户终端101关联;an obtaining unit 701, configured to obtain an offline service request from the user terminal 101, where the offline service request includes offline verification data corresponding to a first offline code, and the first offline code is associated with the device 102 and the user terminal 101;
验证单元702,用于利用离线验证数据,对用户终端101进行验证,并在验证通过后,执行对设备102的控制。The verification unit 702 is configured to use the offline verification data to verify the user terminal 101, and after the verification is passed, execute the control of the device 102.
基于相同的申请构思,本申请实施例还提供一种设备控制的装置,应用于服务器103,如图8所示,包括:Based on the same application concept, an embodiment of the present application also provides an apparatus for device control, which is applied to the server 103, as shown in FIG. 8, including:
接收单元801,用于接收来自于用户终端101的在线服务请求,在线服务请求中携带用户终端101的终端标识和设备标识;a receiving unit 801, configured to receive an online service request from the user terminal 101, where the online service request carries the terminal identification and device identification of the user terminal 101;
第一生成单元802,用于生成与终端标识和设备标识对应的第一离线码,并向用户终端101发送第一离线码。The first generating unit 802 is configured to generate a first offline code corresponding to the terminal identification and the device identification, and send the first offline code to the user terminal 101 .
基于相同的申请构思,本申请实施例还提供一种设备控制的装置,应用于用户终端,如图9所示,包括:Based on the same application concept, an embodiment of the present application also provides an apparatus for device control, which is applied to a user terminal, as shown in FIG. 9 , including:
第二生成单元901,用于生成离线服务请求,离线服务请求包括与第一离线码对应的离线验证数据,离线服务请求用于请求控制设备102;The second generating unit 901 is configured to generate an offline service request, the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request the control device 102;
发送单元902,用于向设备102发送离线服务请求。The sending unit 902 is configured to send an offline service request to the device 102 .
基于同一构思,本申请实施例中还提供了一种电子设备,如图10所示,该电子设备主要包括:处理器1001、通信接口1002、存储器1003和通信总线1004,其中,处理器1001、通信接口1002和存储器1003通过通信总线1004完成相互间的通信。其中,存储器1003中存储有可被处理器1001执行的程序,处理器1001执行存储器1003中存储的程序,实现以上任意方法实施例中提供的设备控制的方法。Based on the same concept, an embodiment of the present application also provides an electronic device. As shown in FIG. 10 , the electronic device mainly includes: a processor 1001 , a communication interface 1002 , a memory 1003 and a communication bus 1004 , wherein the processor 1001 , The communication interface 1002 and the memory 1003 communicate with each other through the communication bus 1004 . The memory 1003 stores a program executable by the processor 1001, and the processor 1001 executes the program stored in the memory 1003 to implement the device control method provided in any of the above method embodiments.
上述电子设备中提到的通信总线1004可以是外设部件互连标准(Peripheral Component Interconnect,简称PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,简称EISA)总线等。该通信总线1004可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线 或一种类型的总线。The communication bus 1004 mentioned in the above electronic equipment may be a Peripheral Component Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (EISA for short) bus or the like. The communication bus 1004 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is shown in Figure 10, but it does not mean that there is only one bus or one type of bus.
通信接口1002用于上述电子设备与其他设备之间的通信。The communication interface 1002 is used for communication between the above-mentioned electronic device and other devices.
存储器1003可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。在一些实施例中,存储器还可以是至少一个位于远离前述处理器1001的存储装置。The memory 1003 may include random access memory (Random Access Memory, RAM for short), or may include non-volatile memory (non-volatile memory), such as at least one disk memory. In some embodiments, the memory may also be at least one storage device located remotely from the aforementioned processor 1001 .
上述的处理器1001可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等,还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor 1001 may be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc., and may also be a digital signal processor (Digital Signal Processing, referred to as DSP) ), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
在本申请的又一实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当该计算机程序在计算机上运行时,使得计算机执行上述实施例中所描述设备控制的方法。In yet another embodiment of the present application, a computer-readable storage medium is also provided, where a computer program is stored in the computer-readable storage medium, and when the computer program is run on a computer, the computer is made to execute the above-mentioned embodiments. The described method of device control.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。该计算机可以时通用计算机、专用计算机、计算机网络或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、微波等)方式向另外一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如软盘、硬盘、磁带等)、光介质(例如DVD)或者半导体介质(例如固态硬盘)等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, from a website site, computer, server, or data center via wired (e.g., Coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, microwave, etc.) means to transmit to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes, etc.), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅 包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as "first" and "second" etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these There is no such actual relationship or sequence between entities or operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
以上所述仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。The above descriptions are only specific embodiments of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, this application is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims (19)

  1. 一种设备控制的方法,其特征在于,应用于设备,包括:A method for equipment control, characterized in that, applied to equipment, comprising:
    获取来自于用户终端的离线服务请求,所述离线服务请求包括与第一离线码对应的离线验证数据,所述第一离线码与所述设备以及所述用户终端关联;acquiring an offline service request from a user terminal, where the offline service request includes offline verification data corresponding to a first offline code, and the first offline code is associated with the device and the user terminal;
    利用所述离线验证数据,对所述用户终端进行验证,并在验证通过后,执行对所述设备的控制。Using the offline verification data, the user terminal is verified, and after the verification is passed, the device is controlled.
  2. 根据权利要求1所述的方法,其特征在于,所述离线验证数据包括时间戳、采用所述第一离线码和所述时间戳生成的第一验证码、和所述用户终端的终端标识。The method according to claim 1, wherein the offline verification data includes a timestamp, a first verification code generated by using the first offline code and the timestamp, and a terminal identifier of the user terminal.
  3. 根据权利要求2所述的方法,其特征在于,利用所述离线验证数据,对所述用户终端进行验证,并在验证通过后,执行对所述设备的控制,包括:The method according to claim 2, wherein the user terminal is verified by using the offline verification data, and after the verification is passed, the control of the device is performed, comprising:
    判断是否存在与所述离线验证数据中的所述终端标识相同的第一标识,如果是,获取接收所述离线服务请求的接收时间,其中,所述第一标识为所述设备中存储的终端标识;Determine whether there is a first identifier that is the same as the terminal identifier in the offline verification data, and if so, obtain the reception time for receiving the offline service request, where the first identifier is the terminal stored in the device identification;
    确定所述时间戳与所述接收时间的时间差;determining the time difference between the timestamp and the reception time;
    当所述时间差小于或等于预设时间阈值时,对所述第一验证码进行验证,并当验证通过后,执行对所述设备的控制。When the time difference is less than or equal to a preset time threshold, the first verification code is verified, and when the verification is passed, the device is controlled.
  4. 根据权利要求3所述的方法,其特征在于,当所述时间差小于或等于预设时间阈值时,对所述第一验证码进行验证,并当验证通过后,执行对所述设备的控制,包括:The method according to claim 3, wherein when the time difference is less than or equal to a preset time threshold, the first verification code is verified, and after the verification is passed, the control of the device is performed, include:
    当所述时间差小于或等于预设时间阈值时,生成与第二离线码和所述时间戳对应的第二验证码,其中,所述第二离线码为所述设备中存储的与所述第一标识相对应的离线码;When the time difference is less than or equal to a preset time threshold, a second verification code corresponding to the second offline code and the timestamp is generated, wherein the second offline code is stored in the device and is the same as the first verification code. 1. Identify the corresponding offline code;
    确定所述第二验证码与所述第一验证码相同时,执行对所述设备的控制。When it is determined that the second verification code is the same as the first verification code, the control of the device is performed.
  5. 根据权利要求2所述的方法,其特征在于,利用所述离线验证数据,对所述用户终端进行验证,并在验证通过后,执行对所述设备的控制,包括:The method according to claim 2, wherein the user terminal is verified by using the offline verification data, and after the verification is passed, the control of the device is performed, comprising:
    获取所述设备的设备标识;obtain the device identification of the device;
    生成与所述终端标识和所述设备标识对应的第三离线码;generating a third offline code corresponding to the terminal identification and the device identification;
    生成与所述第三离线码和所述离线验证数据中的所述时间戳对应的第三验证码;generating a third verification code corresponding to the third offline code and the timestamp in the offline verification data;
    当所述第三验证码与所述第一验证码相同时,执行所述对所述设备的控制。When the third verification code is the same as the first verification code, the controlling of the device is performed.
  6. 根据权利要求1所述的方法,其特征在于,获取来自于用户终端的离线服务请求,包括:The method according to claim 1, wherein obtaining an offline service request from a user terminal comprises:
    获取所述用户终端发出的灯光闪烁信号,从所述灯光闪烁信号中提取所述离线服务请求;或者Obtain the light flickering signal sent by the user terminal, and extract the offline service request from the light flickering signal; or
    接收所述用户终端通过蓝牙通信传输的蓝牙数据,从所述蓝牙数据中提取所述离线服务请求;或者Receive the Bluetooth data transmitted by the user terminal through Bluetooth communication, and extract the offline service request from the Bluetooth data; or
    获取所述用户终端发出的红外信号,从所述红外信号中提取获得所述离线服务请求。Obtain the infrared signal sent by the user terminal, and extract the offline service request from the infrared signal.
  7. 根据权利要求2所述的方法,其特征在于,执行对所述设备的控制,包括:The method of claim 2, wherein performing the control of the device comprises:
    执行启动服务;Execute the startup service;
    执行启动服务之后,还包括:After executing the startup service, it also includes:
    向服务器发送验证请求,所述验证请求包括所述终端标识,所述验证请求用于请求验证所述用户终端的使用额度是否低于预设额度;sending a verification request to the server, where the verification request includes the terminal identifier, and the verification request is used to request to verify whether the usage limit of the user terminal is lower than a preset limit;
    接收所述服务器发送的关机指令,并根据所述关机指令执行关机服务,其中,所述关机指令为所述服务器在验证所述使用额度低于所述预设额度后发送的指令。A shutdown instruction sent by the server is received, and a shutdown service is performed according to the shutdown instruction, wherein the shutdown instruction is an instruction sent by the server after verifying that the usage limit is lower than the preset limit.
  8. 根据权利要求4所述的方法,其特征在于,获取来自于用户终端的离线服务请求之前,还包括:The method according to claim 4, wherein before acquiring the offline service request from the user terminal, the method further comprises:
    接收服务器发送的所述第一标识和所述第二离线码。The first identifier and the second offline code sent by the server are received.
  9. 根据权利要求8所述的方法,其特征在于,执行对所述设备的控制之后,还包括:The method according to claim 8, characterized in that, after controlling the device, the method further comprises:
    接收所述服务器发送的删除指令,所述删除指令用于指示删除所述终端标识和所述第一离线码;receiving a deletion instruction sent by the server, where the deletion instruction is used to instruct deletion of the terminal identifier and the first offline code;
    删除所述终端标识和所述第一离线码。Delete the terminal identification and the first offline code.
  10. 一种设备控制的方法,其特征在于,应用于服务器,包括:A method for device control, characterized in that, applied to a server, comprising:
    接收来自于用户终端的在线服务请求,所述在线服务请求中携带所述用户终端的终端标识和设备标识;receiving an online service request from a user terminal, where the online service request carries the terminal identification and device identification of the user terminal;
    生成与所述终端标识和所述设备标识对应的第一离线码,并向所述用户终端发送所述第一离线码。A first offline code corresponding to the terminal identification and the device identification is generated, and the first offline code is sent to the user terminal.
  11. 根据权利要求10所述的方法,其特征在于,向所述用户终端发送所述第一离线码之后,还包括:The method according to claim 10, wherein after sending the first offline code to the user terminal, the method further comprises:
    接收验证请求,所述验证请求包括所述终端标识;receiving a verification request, where the verification request includes the terminal identifier;
    验证所述终端标识对应的使用额度,并在所述使用额度低于预设额度时,向所述设备 标识对应的设备发送关机指令。Verifying the usage quota corresponding to the terminal identifier, and sending a shutdown instruction to the device corresponding to the device identifier when the usage quota is lower than the preset quota.
  12. 根据权利要求10所述的方法,其特征在于,生成与所述终端标识和所述设备标识对应的第一离线码之前,还包括:The method according to claim 10, wherein before generating the first offline code corresponding to the terminal identifier and the device identifier, the method further comprises:
    判断所述服务器中是否存储有对应于所述终端标识和所述设备标识的历史离线码,;如果有,获取所述历史离线码的生存时长,当所述生存时长大于预设生存时长时,生成所述第一离线码。Determine whether the server has stored the historical offline code corresponding to the terminal identification and the device identification; if so, obtain the survival time of the historical offline code, and when the survival time is greater than the preset survival time, The first offline code is generated.
  13. 根据权利要求11所述的方法,其特征在于,生成与所述终端标识和所述设备标识对应的第一离线码之后,还包括:The method according to claim 11, wherein after generating the first offline code corresponding to the terminal identifier and the device identifier, the method further comprises:
    获取所述第一离线码的存储时长;obtaining the storage duration of the first offline code;
    判断所述存储时长是否大于预设存储时长,如果是,向所述设备发送删除指令,并删除所述第一离线码,其中,所述删除指令用于指示删除所述终端标识和所述第一离线码。Determine whether the storage duration is greater than the preset storage duration, and if so, send a deletion instruction to the device and delete the first offline code, wherein the deletion instruction is used to instruct deletion of the terminal identifier and the first offline code. An offline code.
  14. 一种设备控制的方法,其特征在于,应用于用户终端,包括:A method for device control, characterized in that, applied to a user terminal, comprising:
    生成离线服务请求,所述离线服务请求包括与第一离线码对应的离线验证数据,所述离线服务请求用于请求控制所述设备;generating an offline service request, where the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request control of the device;
    向设备发送所述离线服务请求。The offline service request is sent to the device.
  15. 根据权利要求14所述的方法,其特征在于,生成离线服务请求之前,还包括:The method according to claim 14, wherein before generating the offline service request, the method further comprises:
    生成在线服务请求,并向服务器发送所述在线服务请求,所述在线服务请求中携带有所述用户终端的终端标识和所述设备的设备标识;generating an online service request, and sending the online service request to the server, where the online service request carries the terminal identification of the user terminal and the device identification of the device;
    接收所述服务器发送的所述第一离线码,所述第一离线码与所述终端标识和所述设备标识相对应。The first offline code sent by the server is received, where the first offline code corresponds to the terminal identification and the device identification.
  16. 根据权利要求14所述的方法,其特征在于,所述离线验证数据包括时间戳、采用所述第一离线码和所述时间戳生成的第一验证码、和所述用户终端的终端标识;The method according to claim 14, wherein the offline verification data comprises a timestamp, a first verification code generated by using the first offline code and the timestamp, and a terminal identifier of the user terminal;
    生成离线服务请求,包括:Generate offline service requests, including:
    获取所述时间戳和所述第一离线码,并采用所述时间戳和所述第一离线码生成所述第一验证码;acquiring the timestamp and the first offline code, and generating the first verification code using the timestamp and the first offline code;
    根据所述时间戳、所述第一离线码以及所述第一验证码,生成所述离线服务器请求。The offline server request is generated according to the timestamp, the first offline code, and the first verification code.
  17. 一种设备控制的系统,其特征在于,包括:A system for equipment control, comprising:
    用户终端,用于生成离线服务请求,并向设备发送所述离线服务请求,所述离线服务 请求包括与第一离线码对应的离线验证数据,所述离线服务请求用于请求控制所述设备;在生成所述离线服务请求前,生成在线服务请求,向服务器发送所述在线服务请求,所述在线服务请求中携带所述用户终端的终端标识和所述设备的设备标识;接收所述服务器发送的所述第一离线码;a user terminal, configured to generate an offline service request and send the offline service request to the device, where the offline service request includes offline verification data corresponding to the first offline code, and the offline service request is used to request to control the device; Before generating the offline service request, an online service request is generated, and the online service request is sent to the server, where the online service request carries the terminal identification of the user terminal and the device identification of the device; The first offline code of ;
    所述设备,用于获取所述离线服务请求;利用所述离线验证数据,对所述用户终端进行验证,并在验证通过后,执行对所述设备的控制;The device is used to obtain the offline service request; use the offline verification data to verify the user terminal, and after the verification is passed, execute the control of the device;
    所述服务器,用于接收所述在线服务请求;生成与所述终端标识和所述设备标识对应的所述第一离线码,并向所述用户终端发送所述第一离线码。The server is configured to receive the online service request; generate the first offline code corresponding to the terminal identification and the device identification, and send the first offline code to the user terminal.
  18. 一种电子设备,其特征在于,包括:处理器、通信接口、存储器和通信总线,其中,处理器、通信接口和存储器通过通信总线完成相互间的通信;An electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
    所述存储器,用于存储计算机程序;the memory for storing computer programs;
    所述处理器,用于执行所述存储器中所存储的程序,实现权利要求1-16任一项所述的方法。The processor is configured to execute the program stored in the memory to implement the method of any one of claims 1-16.
  19. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-16任一项所述的方法。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the method of any one of claims 1-16 is implemented.
PCT/CN2021/116150 2020-11-17 2021-09-02 Device control method and system, electronic device, and storage medium WO2022105365A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011284751.2A CN112437071B (en) 2020-11-17 2020-11-17 Method, system, device and storage medium for controlling device
CN202011284751.2 2020-11-17

Publications (1)

Publication Number Publication Date
WO2022105365A1 true WO2022105365A1 (en) 2022-05-27

Family

ID=74700294

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/116150 WO2022105365A1 (en) 2020-11-17 2021-09-02 Device control method and system, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN112437071B (en)
WO (1) WO2022105365A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112437071B (en) * 2020-11-17 2023-05-16 珠海格力电器股份有限公司 Method, system, device and storage medium for controlling device
CN115604390A (en) * 2021-07-07 2023-01-13 云丁网络技术(北京)有限公司(Cn) Offline control method and device for intelligent equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170097617A1 (en) * 2015-10-01 2017-04-06 Invensys Systems, Inc. Multi-core device with separate redundancy schemes in a process control system
CN107508822A (en) * 2017-09-06 2017-12-22 迈普通信技术股份有限公司 Access control method and device
CN108053527A (en) * 2017-12-11 2018-05-18 上海众人网络安全技术有限公司 A kind of control method of intelligent door lock, apparatus and system
CN110912911A (en) * 2019-11-29 2020-03-24 宁波奥克斯电气股份有限公司 Air conditioning equipment authority control method, user equipment and control system
CN111800456A (en) * 2020-05-14 2020-10-20 深圳海翼智新科技有限公司 Method, device and system for remotely controlling offline equipment and computer storage medium
CN112437071A (en) * 2020-11-17 2021-03-02 珠海格力电器股份有限公司 Method, system, device and storage medium for device control

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106506573B (en) * 2015-09-07 2019-05-31 韩岗 Intelligent home furnishing control method and system
CN105357262B (en) * 2015-09-29 2019-07-23 小米科技有限责任公司 Apparatus control method and device
EP3441945A1 (en) * 2017-08-07 2019-02-13 Skidata Ag Method for operating an access control system comprising a server, at least one access control device and at least one point-of-sale terminal for access rights for the area covered by the access control system
CN110071908B (en) * 2019-03-13 2021-09-21 浙江大华技术股份有限公司 Terminal binding method and device, computer equipment and storage medium
CN111030812A (en) * 2019-12-16 2020-04-17 Oppo广东移动通信有限公司 Token verification method, device, storage medium and server
CN111506632A (en) * 2020-04-23 2020-08-07 腾讯科技(深圳)有限公司 Data processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170097617A1 (en) * 2015-10-01 2017-04-06 Invensys Systems, Inc. Multi-core device with separate redundancy schemes in a process control system
CN107508822A (en) * 2017-09-06 2017-12-22 迈普通信技术股份有限公司 Access control method and device
CN108053527A (en) * 2017-12-11 2018-05-18 上海众人网络安全技术有限公司 A kind of control method of intelligent door lock, apparatus and system
CN110912911A (en) * 2019-11-29 2020-03-24 宁波奥克斯电气股份有限公司 Air conditioning equipment authority control method, user equipment and control system
CN111800456A (en) * 2020-05-14 2020-10-20 深圳海翼智新科技有限公司 Method, device and system for remotely controlling offline equipment and computer storage medium
CN112437071A (en) * 2020-11-17 2021-03-02 珠海格力电器股份有限公司 Method, system, device and storage medium for device control

Also Published As

Publication number Publication date
CN112437071A (en) 2021-03-02
CN112437071B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
US10135811B2 (en) Using temporary credentials in guest mode
US11303449B2 (en) User device validation at an application server
CN110647735B (en) Proximity unlocking and locking operations for electronic devices
JP6386069B2 (en) Connection management method, apparatus, electronic equipment, program, and recording medium
US11522720B1 (en) Dynamic object creation and certificate management
WO2022105365A1 (en) Device control method and system, electronic device, and storage medium
CN112822222B (en) Login verification method, automatic login verification method, server and client
WO2018161807A1 (en) User identity verification method and apparatus
US9052861B1 (en) Secure connections between a proxy server and a base station device
WO2020011194A1 (en) Wireless connection method and device
KR101620254B1 (en) Method and apparatus for controlling access
CN108289074B (en) User account login method and device
WO2018133767A1 (en) Call control method, terminal apparatus, and data storage medium
WO2019062090A1 (en) Method and apparatus for controlling service device to perform service operation, device, and medium
WO2018214794A1 (en) Connection method and device
WO2019037581A1 (en) Method and device for carrying out wireless connection pre-authorization for user equipment
US11843671B1 (en) Apparatuses, computer-implemented methods, and computer program products for improved multi-user channel management
CN107294910B (en) Login method and server
CN110519764B (en) Security verification method, system, computer device and medium of communication device
WO2018036220A1 (en) Authority authentication method and system for accessing wireless device
US9129283B1 (en) Accessing confidential data securely using a trusted network of mobile devices
WO2017136979A1 (en) Implementation method, apparatus and system for remote access
CN109460647B (en) Multi-device secure login method
US20160088328A1 (en) Password protected stream receivers
WO2023009929A1 (en) Certificate revocation at datacenters as a service

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21893516

Country of ref document: EP

Kind code of ref document: A1