CN112950844A - Intelligent vending machine control method, control platform and system - Google Patents

Intelligent vending machine control method, control platform and system Download PDF

Info

Publication number
CN112950844A
CN112950844A CN202110471804.XA CN202110471804A CN112950844A CN 112950844 A CN112950844 A CN 112950844A CN 202110471804 A CN202110471804 A CN 202110471804A CN 112950844 A CN112950844 A CN 112950844A
Authority
CN
China
Prior art keywords
vending machine
intelligent vending
control
mqtt
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110471804.XA
Other languages
Chinese (zh)
Other versions
CN112950844B (en
Inventor
刘小成
陈峰峰
李昱兵
张德春
李光辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Hongmei Intelligent Technology Co Ltd
Original Assignee
Sichuan Hongmei Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Hongmei Intelligent Technology Co Ltd filed Critical Sichuan Hongmei Intelligent Technology Co Ltd
Priority to CN202110471804.XA priority Critical patent/CN112950844B/en
Publication of CN112950844A publication Critical patent/CN112950844A/en
Application granted granted Critical
Publication of CN112950844B publication Critical patent/CN112950844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • 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/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Control Of Vending Devices And Auxiliary Devices For Vending Devices (AREA)

Abstract

The invention provides a control method, a control platform and a system of an intelligent vending machine, wherein the method comprises the following steps: receiving a control request of a user for the intelligent vending machine; the control request comprises control information of the intelligent vending machine; randomly determining a secret key of the intelligent vending machine according to a one-machine one-secret mechanism; wherein, different intelligent vending machines conforming to one machine and one secret mechanism correspond to different secret keys; encrypting the control information of the intelligent vending machine according to the secret key to obtain a control instruction for controlling the intelligent vending machine; acquiring MQTT key information corresponding to the intelligent vending machine; the system comprises a control platform, a server and a server, wherein MQTT key information used for realizing MQTT communication connection of an intelligent vending machine and the server is stored in the control platform; sending the MQTT key information to the intelligent vending machine so as to enable the intelligent vending machine to establish MQTT communication connection with the server; and sending a control instruction to the server so that the intelligent vending machine receives the control instruction based on the MQTT communication connection. The scheme can improve the use experience of the user.

Description

Intelligent vending machine control method, control platform and system
Technical Field
The invention relates to the technical field of intelligent control, in particular to a control method, a control platform and a system of an intelligent vending machine.
Background
With the development of unmanned retail business, intelligent terminals typified by vending machines have become more and more popular. However, most of the existing intelligent vending machines acquire control instructions based on transmission modes such as an HTTPS protocol or a socket protocol, the protocol overhead is high, the stability is poor, the security is low, the response time is slow, and the user experience is poor.
Chinese patent application publication No. CN111343289A discloses a message push method and system based on MQTT protocol, which adopts the message push method based on MQTT protocol to realize connection between MQTT client module and MQTT service module by using dynamic connection information, and to perform filtering control on message content, thereby ensuring the security of message push process. However, when the MQTT is in an offline state, effective processing cannot be performed, and the stability is poor, so that the user experience is poor.
Disclosure of Invention
The invention provides a control method, a control platform and a system of an intelligent vending machine, which can improve the use experience of a user.
In a first aspect, an embodiment of the present invention provides an intelligent vending machine control method, which is applied to a control platform, and includes:
receiving a control request of a user for the intelligent vending machine; the control request comprises control information of the intelligent vending machine;
randomly determining a secret key of the intelligent vending machine according to a one-secret mechanism; wherein, different intelligent vending machines conforming to one machine and one secret mechanism correspond to different secret keys;
encrypting the control information of the intelligent vending machine according to the secret key to obtain a control instruction for controlling the intelligent vending machine;
acquiring MQTT key information corresponding to the intelligent vending machine; the system comprises a control platform, a server and a plurality of intelligent vending machines, wherein MQTT key information used for realizing MQTT communication connection between the intelligent vending machines and the server is stored in the control platform, and different intelligent vending machines correspond to different MQTT key information;
sending the MQTT key information to the intelligent vending machine so that the intelligent vending machine and the server establish MQTT communication connection;
sending the control instructions to the server to cause the smart vending machine to receive the control instructions based on the MQTT communication connection.
Optionally, after the determining the key of the smart vending machine according to a one-secret mechanism, before the obtaining MQTT key information corresponding to the smart vending machine, the method further includes:
sending an MQTT registration request to the server; the MQTT registration request is used for establishing MQTT communication connection between the intelligent vending machine and the server;
receiving registration success information returned by the server according to the MQTT registration request; the information of successful registration comprises MQTT key information corresponding to the intelligent vending machine;
acquiring configuration information corresponding to the intelligent vending machine;
and correspondingly storing the configuration information of the intelligent vending machine and the MQTT key information.
Optionally, after the obtaining of the MQTT key information corresponding to the smart vending machine and before the sending of the control instruction to the server, the method further includes:
sending the configuration information to the intelligent vending machine;
receiving current state information returned by the intelligent vending machine according to the configuration information; the current state information comprises the state of MQTT communication connection established between the intelligent vending machine and the server;
judging whether the MQTT communication connection state is an offline state;
if so, returning offline state information to the intelligent vending machine so that the intelligent vending machine establishes the MQTT communication connection with the server;
if not, returning online state information to the intelligent vending machine, and receiving the current state information returned by the intelligent vending machine according to the configuration information.
Optionally, before the smart vending machine receives the control instruction based on the MQTT communication connection, further comprising:
sending the key to the smart vendor; the intelligent vending machine is used for decrypting the control command through the secret key so that the intelligent vending machine operates according to the control information included in the decrypted control command.
In a second aspect, an embodiment of the present invention further provides a control platform, including:
the receiving module is used for receiving a control request of a user for the intelligent vending machine; the control request comprises control information of the intelligent vending machine;
the key determining module is used for randomly determining the key of the intelligent vending machine according to a one-secret mechanism; wherein, different intelligent vending machines conforming to one machine and one secret mechanism correspond to different secret keys;
the encryption module is used for encrypting the control information of the intelligent vending machine received by the receiving module according to the key determined by the key determining module to obtain a control instruction for controlling the intelligent vending machine;
the acquisition module is used for acquiring MQTT key information corresponding to the intelligent vending machine; the system comprises a control platform, a server and a plurality of intelligent vending machines, wherein MQTT key information used for realizing MQTT communication connection between the intelligent vending machines and the server is stored in the control platform, and different intelligent vending machines correspond to different MQTT key information;
the first sending module is used for sending the MQTT key information acquired by the acquiring module to the intelligent vending machine so as to enable the intelligent vending machine to establish MQTT communication connection with the server;
a second sending module, configured to send the control instruction obtained by the encryption module to the server, so that the smart vending machine receives the control instruction based on the MQTT communication connection.
In a third aspect, an embodiment of the present invention further provides an intelligent vending machine control system, including: at least one control platform, a server and at least one intelligent vending machine provided by the second aspect or any possible implementation manner of the second aspect;
the server is used for establishing MQTT communication connection with at least one intelligent vending machine, receiving a control instruction sent by the control platform and sending the control instruction to the corresponding intelligent vending machine through the MQTT communication connection;
and the control platform is used for sending the MQTT key information to the intelligent vending machine and realizing the remote control of the intelligent vending machine through the control instruction.
Optionally, the intelligent vending machine is further configured to send a subscription request to the server through the established MQTT communication connection, so as to receive a control instruction corresponding to the intelligent vending machine, which is returned by the server according to the subscription request; wherein the subscription request is used for representing the subscription of the intelligent vending machine to the control instruction.
Optionally, the system further comprises: a service platform;
the intelligent vending machine is further used for receiving the key determined by the control platform, decrypting the received control instruction corresponding to the intelligent vending machine according to the key, and determining control information included in the decrypted control instruction;
the service platform is used for sending the service information to the intelligent vending machine when the control information included in the decrypted control instruction needs the corresponding service information, so that the control platform can complete the control of the intelligent vending machine; at least two types of service information are stored in the service platform.
In a fourth aspect, the present invention further provides a control platform, including: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine-readable program to execute the intelligent vending machine control method provided by the first aspect or any possible implementation manner of the first aspect.
In a fifth aspect, the present invention further provides a computer-readable medium, on which computer instructions are stored, and when executed by a processor, the computer instructions cause the processor to execute the intelligent vending machine control method provided in the first aspect or any possible implementation manner of the first aspect.
It can be known from the above solutions that, in the control method, the control platform, and the system for an intelligent vending machine provided in the embodiments of the present invention, the method is applied to the control platform, after receiving control information of a user on the intelligent vending machine, a key of the intelligent vending machine is randomly determined according to a one-machine-one-secret mechanism, the control information is encrypted by using the key to obtain an encrypted control instruction, and the control instruction is sent to a server connected to the intelligent vending machine, so that the intelligent vending machine receives the control instruction. The intelligent vending machine establishes MQTT communication connection with the server according to the MQTT key information which is acquired from the control platform and corresponds to the intelligent vending machine. Therefore, the control information is encrypted by the key randomly determined by the one-machine one-secret mechanism, and the control information can be prevented from being maliciously tampered after being intercepted due to the randomness of the key, so that the safety of the MQTT message pushing mechanism is ensured, the control information can be reliably and efficiently transmitted to the intelligent vending machine through the MQTT protocol, and the use experience of a user is improved. Meanwhile, through MQTT communication connection, a subscription mechanism between the intelligent vending machine and the server can be established, so that the control instruction is sent to the intelligent vending machine based on the subscription mechanism when the server receives the control instruction, thereby realizing publish/subscribe message transmission, ensuring that the transmission of the control instruction is more reliable and simpler, being beneficial to the intelligent vending machine to receive the control instruction immediately, and further improving the use experience of users.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of a method for controlling an intelligent vending machine according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a device where a control platform is located according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a control platform provided in one embodiment of the present invention;
FIG. 4 is a schematic diagram of an intelligent vending machine control system according to one embodiment of the present invention;
fig. 5 is a flowchart of another intelligent vending machine control method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As described in the background art, in the prior art, most of the smart vending machines adopt a polling method based on an HTTPS protocol, that is, the smart vending machines need to send query requests regularly to poll and acquire control commands, the control platform cannot actively push the control commands to the smart vending machines, and for HTTPS, HTTPS connection needs to be reestablished for each message, which may cause significant overhead, and automatic recovery may not be performed when a connection is disconnected, resulting in poor stability.
For the intelligent vending machine, the control instruction is sent according to the user requirement, and the control instruction is not sent to the intelligent vending machine all the time, so that the polling mechanism is inevitably adopted, the power consumption is increased, and the resource consumption is increased. However, the mode of sending the control instruction only when the user needs the mode is in accordance with a publish/subscribe mechanism, so that the connection between the mobile terminal and the intelligent vending machine can be established by adopting an MQTT protocol based on publish/subscribe; meanwhile, in order to improve the safety of the control instruction in the transmission process, a fixed secret key is not adopted, and a one-secret random secret key determination mode is adopted.
The foregoing is the concept provided by the present invention, and specific implementations of the concept provided by the present invention are described below.
As shown in fig. 1, an embodiment of the present invention provides a method for controlling an intelligent vending machine, which is applied to a control platform, and the method may include the following steps:
step 101: receiving a control request of a user for the intelligent vending machine; the control request comprises control information of the intelligent vending machine;
step 102: randomly determining a secret key of the intelligent vending machine according to a one-machine one-secret mechanism; wherein, different intelligent vending machines conforming to one machine and one secret mechanism correspond to different secret keys;
step 103: encrypting the control information of the intelligent vending machine according to the secret key to obtain a control instruction for controlling the intelligent vending machine;
step 104: acquiring MQTT key information corresponding to the intelligent vending machine; the system comprises a control platform, a server and a plurality of intelligent vending machines, wherein MQTT key information used for realizing MQTT communication connection between the intelligent vending machines and the server is stored in the control platform, and different intelligent vending machines correspond to different MQTT key information;
step 105: sending the MQTT key information to the intelligent vending machine so as to enable the intelligent vending machine to establish MQTT communication connection with the server;
step 106: and sending control instructions to the server to enable the intelligent vending machine to receive the control instructions based on the MQTT communication connection.
According to the intelligent vending machine control method provided by the embodiment of the invention, after the control information of the user on the intelligent vending machine is received, the key of the intelligent vending machine is randomly determined according to a one-machine one-secret mechanism, the control information is encrypted by using the key to obtain the encrypted control instruction, and the control instruction is sent to the server connected with the intelligent vending machine, so that the intelligent vending machine receives the control instruction. The intelligent vending machine establishes MQTT communication connection with the server according to the MQTT key information which is acquired from the control platform and corresponds to the intelligent vending machine. Therefore, the control information is encrypted by the key randomly determined by the one-machine one-secret mechanism, and the control information can be prevented from being maliciously tampered after being intercepted due to the randomness of the key, so that the safety of the MQTT message pushing mechanism is ensured, the control information can be reliably and efficiently transmitted to the intelligent vending machine through the MQTT protocol, and the use experience of a user is improved. Meanwhile, through MQTT communication connection, a subscription mechanism between the intelligent vending machine and the server can be established, so that the control instruction is sent to the intelligent vending machine based on the subscription mechanism when the server receives the control instruction, thereby realizing publish/subscribe message transmission, ensuring that the transmission of the control instruction is more reliable and simpler, being beneficial to the intelligent vending machine to receive the control instruction immediately, and further improving the use experience of users.
It should be noted that MQTT (message queue telemetry transport) is a message protocol based on a publish/subscribe paradigm under the ISO standard. It works on the TCP/IP suite, a publish/subscribe messaging protocol designed for remote devices with poor hardware performance and in case of poor network conditions, for which it requires a messaging middleware, i.e. a server.
In the embodiment of the invention, the intelligent vending machine and the server communicate based on the MQTT protocol, so that the communication cost is very low, the heavy cost caused by reestablishing HTTPS connection for each new request message is avoided, the tolerance to an unstable network is higher, and the automatic recovery from the faults such as disconnection can be realized, but the HTTPS needs the client to retry encoding to reestablish the connection, so that the connection mode in the embodiment is more stable. Meanwhile, the operation cost of the MQTT is relatively low, the simplicity of the MQTT is beneficial to realizing the MQTT on an additional client with little effort, one-to-many message issuing can be provided, application program coupling is released, remote control is realized, and therefore better use experience can be brought to users.
In the embodiment of the present invention, step 102 is based on a one-secret mechanism, which can ensure that different smart vendors connected to the control platform correspond to different secret keys. Specifically, after the smart vending machine is powered on, a communication connection based on an HTTPS protocol may be established with the control platform, and based on the communication connection, a randomly generated one-secret key may be sent to the smart vending machine. Therefore, different from the prior art that one type of intelligent vending machine corresponds to the same secret key, the method can generate one secret dynamic secret key for the intelligent vending machine, each intelligent vending machine has the unique secret key, the safety of the secret key is improved, the control information is encrypted through the secret key, and the safety of the control information in the transmission process is further improved.
It should be noted that the validity period of the key is the whole process from powering on the smart vending machine to powering off the smart vending machine, that is, the whole process of connecting the smart vending machine and the control platform.
Optionally, on the basis of the method for controlling a smart vending machine shown in fig. 1, after determining the key of the smart vending machine according to a one-secret mechanism in step 102, before acquiring MQTT key information of the corresponding smart vending machine in step 104, further comprising:
sending an MQTT registration request to a server; the MQTT registration request is used for establishing MQTT communication connection between the intelligent vending machine and the server;
receiving registration success information returned by the server according to the MQTT registration request; the information of successful registration comprises MQTT key information corresponding to the intelligent vending machine;
acquiring configuration information corresponding to the intelligent vending machine;
and correspondingly storing the configuration information of the intelligent vending machine and the MQTT key information.
In the embodiment of the invention, for the intelligent vending machine which is powered on for the first time, after the corresponding key is obtained according to a one-machine one-secret mechanism, the MQTT registration request is firstly sent to the server, and after the successful registration information including the MQTT key information returned by the server according to the MQTT registration request is received, the MQTT key information and the obtained configuration information corresponding to the intelligent vending machine are correspondingly stored. Therefore, when the intelligent vending machine is powered on again subsequently, after the corresponding dynamic key is obtained according to the one-machine one-secret mechanism, the MQTT registration request does not need to be repeated, the step 104 can be directly executed to obtain the corresponding MQTT key information and the corresponding configuration information, the response time is prolonged, and the use experience of the user can be improved.
Specifically, identification information contained in the intelligent vending machine is acquired, and an MQTT registration request is sent to the server through a Connect message carrying the identification information of the intelligent vending machine. Therefore, the server identifies the intelligent vending machine through the identification information to generate unique MQTT key information corresponding to the intelligent vending machine, and connection between the intelligent vending machine and the server is established.
It should be noted that the configuration information includes, but is not limited to, basic configuration information such as heartbeat time and status of the smart vending machine.
Optionally, on the basis of the intelligent vending machine control method shown in fig. 1, after acquiring MQTT key information of the corresponding intelligent vending machine in step 104, before sending a control instruction to the server in step 106, the method further includes:
sending the configuration information to the intelligent vending machine;
receiving current state information returned by the intelligent vending machine according to the configuration information; the current state information comprises the state of MQTT communication connection established between the intelligent vending machine and the server;
judging whether the MQTT communication connection state is an offline state;
if so, returning offline state information to the intelligent vending machine so that the intelligent vending machine establishes MQTT communication connection with the server;
if not, returning the on-line state information to the intelligent vending machine, and receiving the current state information returned by the intelligent vending machine according to the configuration information.
In the embodiment of the invention, in order to avoid the situation that the control instruction after the MQTT communication connection is offline cannot be issued to the intelligent vending machine, the state of the MQTT communication connection can be detected in real time through an HTTPS protocol, so that when the MQTT communication connection is in an offline state, feedback is timely made to the intelligent vending machine, and the intelligent vending machine can reestablish the MQTT communication connection with the server. In particular, the amount of the solvent to be used,
sending the configuration information to the intelligent vending machine, returning current state information in real time by the intelligent vending machine according to the configuration information based on an HTTPS protocol, judging whether the state of MQTT communication connection established between the intelligent vending machine and the server in the state information is an offline state, and returning the offline state information to the intelligent vending machine when the current MQTT communication connection is the offline state so that the intelligent vending machine can establish MQTT communication connection with the server again according to the MQTT key information acquired in the step 105; and when the current MQTT communication connection is in an online state, returning online state information to the intelligent vending machine, and continuously receiving the current state information returned by the intelligent vending machine according to the configuration information.
It should be noted that, in the embodiment of the present invention, the intelligent vending machine and the control platform establish a communication connection through an HTTPS protocol, where MQTT key information, configuration information, current state information, and returned offline state information and online state information are transmitted based on the HTTPS protocol. Therefore, an offline mechanism can be constructed based on the HTTPS protocol, the MQTT protocol is only used for transmitting the control command, the state of MQTT communication connection can be monitored in real time through the division and cooperation of the two protocols, and the MQTT communication connection is reestablished in time when the MQTT communication connection is in an offline state, so that the instant and reliable transmission of the control command is ensured, and the use experience of a user is improved.
In the embodiment of the present invention, the step 106 of sending the control command to the server is implemented by calling an interface of the server.
Optionally, on the basis of the intelligent vending machine control method shown in fig. 1, before the intelligent vending machine receives the control instruction based on the MQTT communication connection in step 106, the method further includes:
sending the key to the smart vending machine; the intelligent vending machine is used for decrypting the control command through the key so that the intelligent vending machine operates according to the control information included in the decrypted control command.
In the embodiment of the present invention, in order to ensure that the smart vending machine can acquire the control information in the encrypted control instruction, it is necessary to send the randomly acquired key to the smart vending machine through the HTTPS protocol, so that the smart vending machine decrypts the control instruction according to the key to acquire the control information, so as to operate according to the control information.
In the embodiment of the invention, after the intelligent vending machine operates according to the control information, a control result is returned in real time according to the heartbeat time included in the configuration information, wherein the control result is used for representing the state of the intelligent vending machine after the intelligent vending machine completes the operation of the control information, so that the control platform can monitor the state of the intelligent vending machine in real time and remotely.
As shown in fig. 2 and 3, the embodiment of the present invention provides a control platform. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. From a hardware level, as shown in fig. 2, a hardware structure diagram of a device in which a control platform is located according to an embodiment of the present invention is provided, where the device in the embodiment may generally include other hardware, such as a forwarding chip responsible for processing a packet, in addition to the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 2. Taking a software implementation as an example, as shown in fig. 3, as a logical apparatus, the apparatus is formed by reading, by a CPU of a device in which the apparatus is located, corresponding computer program instructions in a non-volatile memory into a memory for execution. As shown in fig. 3, an embodiment of the present invention provides a control platform, including:
a receiving module 301, configured to receive a control request of a user for an intelligent vending machine; the control request comprises control information of the intelligent vending machine;
a key determining module 302, configured to randomly determine a key of the smart vending machine according to a one-secret mechanism; wherein, different intelligent vending machines conforming to one machine and one secret mechanism correspond to different secret keys;
an encryption module 303, configured to encrypt the control information of the smart vending machine received by the receiving module according to the key determined by the key determining module 302, so as to obtain a control instruction for controlling the smart vending machine;
an obtaining module 304, configured to obtain MQTT key information of a corresponding intelligent vending machine; the system comprises a control platform, a server and a plurality of intelligent vending machines, wherein MQTT key information used for realizing MQTT communication connection between the intelligent vending machines and the server is stored in the control platform, and different intelligent vending machines correspond to different MQTT key information;
a first sending module 305, configured to send the MQTT key information acquired by the acquiring module 304 to the intelligent vending machine, so that the intelligent vending machine establishes MQTT communication connection with the server;
a second sending module 306, configured to send the control instruction obtained by the encryption module 303 to the server, so that the smart vending machine receives the control instruction based on the MQTT communication connection.
Optionally, on the basis of the control platform shown in fig. 3, the control platform further includes a registration module, where the registration module is configured to perform the following operations:
sending an MQTT registration request to a server; the MQTT registration request is used for establishing MQTT communication connection between the intelligent vending machine and the server;
receiving registration success information returned by the server according to the MQTT registration request; the information of successful registration comprises MQTT key information corresponding to the intelligent vending machine;
acquiring configuration information corresponding to the intelligent vending machine;
and correspondingly storing the configuration information of the intelligent vending machine and the MQTT key information.
Optionally, on the basis of the control platform shown in fig. 3, the control platform further includes a listening module, where the listening module is configured to perform the following operations:
sending the configuration information to the intelligent vending machine;
receiving current state information returned by the intelligent vending machine according to the configuration information; the current state information comprises the state of MQTT communication connection established between the intelligent vending machine and the server;
judging whether the MQTT communication connection state is an offline state;
if so, returning offline state information to the intelligent vending machine so that the intelligent vending machine establishes MQTT communication connection with the server;
if not, returning the on-line state information to the intelligent vending machine, and receiving the current state information returned by the intelligent vending machine according to the configuration information.
Alternatively, on the basis of the control platform shown in figure 3,
a first sending module 305, further configured to send the key to the smart vending machine; the intelligent vending machine is used for decrypting the control command through the key so that the intelligent vending machine operates according to the control information included in the decrypted control command.
It should be noted that the first sending module implements communication between the smart vending machine and the control platform based on the HTTPS protocol.
It is to be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation to the control platform. In other embodiments of the invention, the control platform may include more or fewer components than illustrated, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, firmware, or a combination of firmware and hardware.
Because the content of information interaction, execution process, and the like among the modules in the device is based on the same concept as the method embodiment of the present invention, specific content can be referred to the description in the method embodiment of the present invention, and is not described herein again.
As shown in fig. 4, one embodiment of the present invention provides an intelligent vending machine control system, including: the control platform 401, the server 402 and the at least one intelligent vending machine 403 provided by any of the above embodiments;
the server 402 is used for establishing MQTT communication connection with at least one intelligent vending machine 403, receiving a control instruction sent by the control platform 401, and sending the control instruction to the corresponding intelligent vending machine 403 through the MQTT communication connection;
and the control platform 401 is configured to send MQTT key information to the intelligent vending machine 403, and implement remote control on the intelligent vending machine 403 through a control instruction.
Alternatively, on the basis of an intelligent vending machine control system as shown in FIG. 4,
the intelligent vending machine 403 is further configured to send a subscription request to the server 402 through the established MQTT communication connection, so as to receive a control instruction, returned by the server 402 according to the subscription request, of the corresponding intelligent vending machine 403; wherein the subscription request is used to characterize the subscription of the smart vending machine 403 to the control instructions.
In the embodiment of the invention, the intelligent vending machine can send a subscription request to the server, the second subscription request is used for representing the subscription of the control instruction of the intelligent vending machine, and after the server receives the control instruction sent by the control platform, the server actively sends the control instruction information to the corresponding intelligent vending machine according to the subscription request. Therefore, the intelligent vending machine can acquire the control instruction in real time, operation can be performed conveniently and timely according to the control instruction, and use experience of a user is improved.
Optionally, on the basis of an intelligent vending machine control system as shown in fig. 4, the system further comprises: a service platform;
the intelligent vending machine is also used for receiving the key determined by the control platform, decrypting the received control instruction of the corresponding intelligent vending machine according to the key and determining the control information contained in the decrypted control instruction;
the service platform is used for sending the service information to the intelligent vending machine when the control information included in the decrypted control instruction needs the corresponding service information so that the control platform can complete the control of the intelligent vending machine; at least two types of service information are stored in the service platform.
It should be noted that at least two types of service information are stored in the service platform, where the service information includes, but is not limited to, advertisement information, price lists, lighting information, and the like. Control information includes, but is not limited to, opening doors, closing doors, updating advertisements, updating price lists, and the like.
In the embodiment of the invention, after the intelligent vending machine decrypts the control instruction according to the key, the intelligent vending machine further analyzes the control information included in the control instruction to judge whether the control information needs the corresponding service information, if the control information needs the corresponding service information, the corresponding service information is obtained from a service information platform, so as to complete the corresponding control operation according to the service information and the control information; if the control information does not need the corresponding service information, the corresponding control operation can be directly completed according to the control information.
In the embodiment of the invention, because the MQTT protocol provides a lightweight message transmission protocol, the control instruction can only carry the relevant service information identifier required to be acquired, and cannot transmit specific service information, so that the problem of insufficient expansion of the MQTT self functional architecture can be expanded through the service platform by storing various service information required by the control instruction through the service platform, the updating of the advertisement information and the price list played by the intelligent vending machine is realized, and the use experience of a user is further improved.
The intelligent vending machine control system provided by the embodiment of the invention comprises a control platform, a server and at least one intelligent vending machine, wherein the server is in MQTT communication connection with the at least one intelligent vending machine, after the control platform receives control information of a user on the intelligent vending machine, the control platform randomly determines a secret key of the intelligent vending machine according to a one-machine one-secret mechanism, sends the secret key to the intelligent vending machine, encrypts the control information by using the secret key to obtain a control instruction, and sends the control instruction to the server. The intelligent vending machine acquires MQTT key information required for establishing MQTT communication connection with the server from the control platform, communication connection between the intelligent vending machine and the server is achieved, the intelligent vending machine acquires a control instruction from the server based on the MQTT communication connection, and operates according to the control information in the control instruction, and therefore remote control of the control platform on the intelligent vending machine is achieved. Therefore, the intelligent vending machine is remotely controlled through the intelligent vending machine control system based on the MQTT in a cross-domain mode, and the transmission of the release/subscription type control instruction is realized through the MQTT protocol which is low in cost and low in cost, simple, feasible and stable, instant communication is realized, and the cost is reduced; meanwhile, the stability of MQTT connection is ensured based on an offline mechanism, the safety of an MQTT message transmission mechanism is improved based on a one-machine-one-secret mechanism on the basis, the functions of a control platform are expanded based on a service platform, and the use experience of a user is further improved.
The following describes the intelligent vending machine control method provided by the embodiment of the present invention in further detail with reference to the intelligent vending machine control system shown in fig. 5, and as shown in fig. 5, the method may include the following steps:
step 501: the control platform receives a control request of a user.
Specifically, a control request of a user for the intelligent vending machine is received; and the control request comprises control information of the intelligent vending machine.
Step 502: and the control platform determines the key of the intelligent vending machine to obtain the control instruction.
Specifically, a secret key of the intelligent vending machine is randomly determined according to a one-machine one-secret mechanism, control information of the intelligent vending machine is encrypted according to the secret key to obtain a control instruction for controlling the intelligent vending machine, and the secret key is sent to the intelligent vending machine based on an HTTPS protocol; the intelligent vending machine is used for decrypting the control command through the secret key so that the intelligent vending machine operates according to the control information included in the decrypted control command.
Step 503: and the control platform acquires MQTT key information of the intelligent vending machine.
Specifically, an MQTT registration request is sent to a server; the MQTT registration request is used for establishing MQTT communication connection between the intelligent vending machine and the server;
receiving registration success information returned by the server according to the MQTT registration request; the information of successful registration comprises MQTT key information corresponding to the intelligent vending machine;
acquiring configuration information corresponding to the intelligent vending machine;
correspondingly storing the configuration information of the intelligent vending machine and the MQTT key information; wherein, different intelligent vending machines correspond to have different MQTT key information.
Step 504: and the intelligent vending machine establishes MQTT communication connection with the server.
Specifically, the intelligent vending machine receives MQTT key information sent by the control platform based on an HTTPS protocol, and establishes MQTT communication connection with the server according to the MQTT key information.
Step 505: and the control platform determines the state of the MQTT communication connection established between the intelligent vending machine and the server.
Specifically, configuration information is sent to the intelligent vending machine;
receiving current state information returned by the intelligent vending machine according to the configuration information; the current state information comprises the state of MQTT communication connection established between the intelligent vending machine and the server;
judging whether the MQTT communication connection state is an offline state;
if so, returning offline state information to the intelligent vending machine so that the intelligent vending machine establishes MQTT communication connection with the server;
if not, returning the on-line state information to the intelligent vending machine, and receiving the current state information returned by the intelligent vending machine according to the configuration information.
Step 506: and the intelligent vending machine receives the control instruction.
Specifically, the control platform sends a control instruction to the server by calling an interface of the server;
the intelligent vending machine is also used for sending a subscription request to the server through the established MQTT communication connection so as to receive a control instruction, which is returned by the server according to the subscription request, of the corresponding intelligent vending machine after the server receives the control instruction; wherein the subscription request is used for representing the subscription of the intelligent vending machine to the control instruction.
Step 507: and the intelligent vending machine acquires the service information from the service platform and returns a control result to the control platform.
Specifically, the intelligent vending machine is further configured to decrypt the received control instruction of the corresponding intelligent vending machine according to the key received in step 502, determine control information included in the decrypted control instruction, and obtain, when it is determined that the control information needs corresponding service information, the service information from the service platform based on an HTTPS protocol, so that the control platform completes control of the intelligent vending machine; the service platform stores at least two types of service information; for example, if the control information is advertisement information for updating the intelligent vending machine, the corresponding advertisement information needs to be acquired from the service platform;
after the intelligent vending machine operates according to the control information, a control result is returned in real time according to the heartbeat time included in the configuration information, wherein the control result is used for representing the state of the intelligent vending machine after the control information operation is executed, so that the control platform can monitor the state of the intelligent vending machine in real time and remotely.
The present invention also provides a computer readable medium storing instructions for causing a machine to perform the intelligent vending machine control method as described herein. Specifically, a system or an apparatus equipped with a storage medium on which firmware program codes that realize the functions of any of the above-described embodiments are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.
Further, it should be clear that the functions of any one of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform a part or all of the actual operations based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion module to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. The intelligent vending machine control method is applied to a control platform and comprises the following steps:
receiving a control request of a user for the intelligent vending machine; the control request comprises control information of the intelligent vending machine;
randomly determining a secret key of the intelligent vending machine according to a one-secret mechanism; wherein, different intelligent vending machines conforming to one machine and one secret mechanism correspond to different secret keys;
encrypting the control information of the intelligent vending machine according to the secret key to obtain a control instruction for controlling the intelligent vending machine;
acquiring MQTT key information corresponding to the intelligent vending machine; the system comprises a control platform, a server and a plurality of intelligent vending machines, wherein MQTT key information used for realizing MQTT communication connection between the intelligent vending machines and the server is stored in the control platform, and different intelligent vending machines correspond to different MQTT key information;
sending the MQTT key information to the intelligent vending machine so that the intelligent vending machine and the server establish MQTT communication connection;
sending the control instructions to the server to cause the smart vending machine to receive the control instructions based on the MQTT communication connection.
2. The method of claim 1, wherein after said determining the key of the smart vendor according to a one-secret mechanism, prior to said obtaining MQTT key information corresponding to the smart vendor, further comprising:
sending an MQTT registration request to the server; the MQTT registration request is used for establishing MQTT communication connection between the intelligent vending machine and the server;
receiving registration success information returned by the server according to the MQTT registration request; the information of successful registration comprises MQTT key information corresponding to the intelligent vending machine;
acquiring configuration information corresponding to the intelligent vending machine;
and correspondingly storing the configuration information of the intelligent vending machine and the MQTT key information.
3. The method of claim 2, wherein after the obtaining MQTT key information corresponding to the smart vending machine, before the sending the control instruction to the server, further comprising:
sending the configuration information to the intelligent vending machine;
receiving current state information returned by the intelligent vending machine according to the configuration information; the current state information comprises the state of MQTT communication connection established between the intelligent vending machine and the server;
judging whether the MQTT communication connection state is an offline state;
if so, returning offline state information to the intelligent vending machine so that the intelligent vending machine establishes the MQTT communication connection with the server;
if not, returning online state information to the intelligent vending machine, and receiving the current state information returned by the intelligent vending machine according to the configuration information.
4. The method of any of claims 1 to 3, wherein prior to the smart vending machine receiving the control instructions based on the MQTT communication connection, further comprising:
sending the key to the smart vendor; the intelligent vending machine is used for decrypting the control command through the secret key so that the intelligent vending machine operates according to the control information included in the decrypted control command.
5. Control platform, its characterized in that includes:
the receiving module is used for receiving a control request of a user for the intelligent vending machine; the control request comprises control information of the intelligent vending machine;
the key determining module is used for randomly determining the key of the intelligent vending machine according to a one-secret mechanism; wherein, different intelligent vending machines conforming to one machine and one secret mechanism correspond to different secret keys;
the encryption module is used for encrypting the control information of the intelligent vending machine received by the receiving module according to the key determined by the key determining module to obtain a control instruction for controlling the intelligent vending machine;
the acquisition module is used for acquiring MQTT key information corresponding to the intelligent vending machine; the system comprises a control platform, a server and a plurality of intelligent vending machines, wherein MQTT key information used for realizing MQTT communication connection between the intelligent vending machines and the server is stored in the control platform, and different intelligent vending machines correspond to different MQTT key information;
the first sending module is used for sending the MQTT key information acquired by the acquiring module to the intelligent vending machine so as to enable the intelligent vending machine to establish MQTT communication connection with the server;
a second sending module, configured to send the control instruction obtained by the encryption module to the server, so that the smart vending machine receives the control instruction based on the MQTT communication connection.
6. Intelligence vending machine control system, its characterized in that includes: the control platform, server, and at least one smart vending machine recited in claim 5;
the server is used for establishing MQTT communication connection with at least one intelligent vending machine, receiving a control instruction sent by the control platform and sending the control instruction to the corresponding intelligent vending machine through the MQTT communication connection;
and the control platform is used for sending the MQTT key information to the intelligent vending machine and realizing the remote control of the intelligent vending machine through the control instruction.
7. The system of claim 6,
the intelligent vending machine is further used for sending a subscription request to the server through the established MQTT communication connection so as to receive a control instruction corresponding to the intelligent vending machine, which is returned by the server according to the subscription request; wherein the subscription request is used for representing the subscription of the intelligent vending machine to the control instruction.
8. The system of claim 6 or 7, further comprising: a service platform;
the intelligent vending machine is further used for receiving the key determined by the control platform, decrypting the received control instruction corresponding to the intelligent vending machine according to the key, and determining control information included in the decrypted control instruction;
the service platform is used for sending the service information to the intelligent vending machine when the control information included in the decrypted control instruction needs the corresponding service information, so that the control platform can complete the control of the intelligent vending machine; at least two types of service information are stored in the service platform.
9. Control platform, its characterized in that includes: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor, configured to invoke the machine readable program to perform the intelligent vending machine control method of any of claims 1-4.
10. Computer readable medium, characterized in that it has stored thereon computer instructions which, when executed by a processor, cause said processor to execute the intelligent vending machine control method according to any of claims 1 to 4.
CN202110471804.XA 2021-04-29 2021-04-29 Intelligent vending machine control method, control platform and system Active CN112950844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110471804.XA CN112950844B (en) 2021-04-29 2021-04-29 Intelligent vending machine control method, control platform and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110471804.XA CN112950844B (en) 2021-04-29 2021-04-29 Intelligent vending machine control method, control platform and system

Publications (2)

Publication Number Publication Date
CN112950844A true CN112950844A (en) 2021-06-11
CN112950844B CN112950844B (en) 2022-04-19

Family

ID=76233653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110471804.XA Active CN112950844B (en) 2021-04-29 2021-04-29 Intelligent vending machine control method, control platform and system

Country Status (1)

Country Link
CN (1) CN112950844B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114283573A (en) * 2021-12-22 2022-04-05 珠海格力电器股份有限公司 Equipment control method and device, electronic equipment and storage medium
CN114650615A (en) * 2022-03-28 2022-06-21 百富计算机技术(深圳)有限公司 Control method and device of intelligent sales terminal, terminal equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN207742719U (en) * 2018-01-25 2018-08-17 广州八优动漫科技有限公司 A kind of network-type coin control device
CN108846952A (en) * 2018-05-31 2018-11-20 深圳友宝科斯科技有限公司 Automatic vending machine long-range control method, device, storage medium and system
CN109544789A (en) * 2019-01-23 2019-03-29 小雨科技(上海)有限公司 A kind of automatic concurrent shipment system
CN109587178A (en) * 2019-01-23 2019-04-05 四川虹美智能科技有限公司 A kind of intelligent appliance encryption control system and method based on MQTT
WO2020125839A1 (en) * 2018-12-18 2020-06-25 GRID INVENT gGmbH Electronic element and electrically controlled display element
CN111818155A (en) * 2020-07-07 2020-10-23 腾讯科技(深圳)有限公司 Equipment control method and device based on Internet of things and computer program product
CN111885134A (en) * 2020-07-14 2020-11-03 上海趣致网络科技股份有限公司 Remote control system and method for vending machine
CN111899413A (en) * 2020-07-27 2020-11-06 合肥美的智能科技有限公司 Vending method of retail equipment, retail equipment and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN207742719U (en) * 2018-01-25 2018-08-17 广州八优动漫科技有限公司 A kind of network-type coin control device
CN108846952A (en) * 2018-05-31 2018-11-20 深圳友宝科斯科技有限公司 Automatic vending machine long-range control method, device, storage medium and system
WO2020125839A1 (en) * 2018-12-18 2020-06-25 GRID INVENT gGmbH Electronic element and electrically controlled display element
CN109544789A (en) * 2019-01-23 2019-03-29 小雨科技(上海)有限公司 A kind of automatic concurrent shipment system
CN109587178A (en) * 2019-01-23 2019-04-05 四川虹美智能科技有限公司 A kind of intelligent appliance encryption control system and method based on MQTT
CN111818155A (en) * 2020-07-07 2020-10-23 腾讯科技(深圳)有限公司 Equipment control method and device based on Internet of things and computer program product
CN111885134A (en) * 2020-07-14 2020-11-03 上海趣致网络科技股份有限公司 Remote control system and method for vending machine
CN111899413A (en) * 2020-07-27 2020-11-06 合肥美的智能科技有限公司 Vending method of retail equipment, retail equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114283573A (en) * 2021-12-22 2022-04-05 珠海格力电器股份有限公司 Equipment control method and device, electronic equipment and storage medium
CN114650615A (en) * 2022-03-28 2022-06-21 百富计算机技术(深圳)有限公司 Control method and device of intelligent sales terminal, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN112950844B (en) 2022-04-19

Similar Documents

Publication Publication Date Title
CN112950844B (en) Intelligent vending machine control method, control platform and system
CN100527690C (en) System and method for controlling infomation processing apparatus
CN111314366B (en) MQTT protocol-based secure login system and method
JP2006135791A (en) Authentication method and system, and information processing method and device
US20160073443A1 (en) Method and apparatus for energy-optimized data transmission using the opc ua protocol in radio networks
CN113162973B (en) IP access method and device of SSL VPN
US8166298B2 (en) Downloadable conditional access system and method of session control for secured 2-way communication between authentication server and host device in downloadable conditional access system
WO2020043006A1 (en) Terminal connection restoration method and apparatus
CN115550041A (en) Data transmission method and device, computer equipment and storage medium
CN103856938A (en) Encryption and decryption method, system and device
US20070071242A1 (en) Communication system, common key control apparatus, and general communication apparatus
CA3052849C (en) Payment control method and device, electronic device, and storage medium
WO2020223932A1 (en) Offline payment method and apparatus, electronic device, and storage medium
CN106028466B (en) Terminal, processing equipment, processing system and processing method
CN104660484A (en) Data transmission method and device used for instant communication client side
CN104885094A (en) Device monitoring using multiple servers optimized for different types of communications
WO2023045676A1 (en) Task processing method and gateway, computer readable storage medium, and electronic device
CN115348333B (en) Data transmission method, system and equipment based on UDP double-end communication interaction
CN113012323A (en) Intelligent vending machine door lock control method, intelligent vending machine and system
CN112689016B (en) Intelligent device control method, device and storage medium
CN116016633A (en) Communication establishment method and system
CN110034927B (en) Communication method and device
KR101357180B1 (en) Method and System for Relaying Contents by Using Messenger Service
CN113099511B (en) Network configuration method, device, equipment and system
CN115529340B (en) Data management method of VPX chassis CHMC module based on soft bus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant