WO2017101079A1 - 一种基于无线通信模块的云接入方法和系统 - Google Patents

一种基于无线通信模块的云接入方法和系统 Download PDF

Info

Publication number
WO2017101079A1
WO2017101079A1 PCT/CN2015/097741 CN2015097741W WO2017101079A1 WO 2017101079 A1 WO2017101079 A1 WO 2017101079A1 CN 2015097741 W CN2015097741 W CN 2015097741W WO 2017101079 A1 WO2017101079 A1 WO 2017101079A1
Authority
WO
WIPO (PCT)
Prior art keywords
wireless communication
communication module
thread
data
message
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.)
Ceased
Application number
PCT/CN2015/097741
Other languages
English (en)
French (fr)
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.)
Midea Group Co Ltd
Original Assignee
Midea Group 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 Midea Group Co Ltd filed Critical Midea Group Co Ltd
Publication of WO2017101079A1 publication Critical patent/WO2017101079A1/zh
Priority to US16/008,052 priority Critical patent/US20180367647A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • 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/08Protocols for interworking; Protocol conversion
    • 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/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2807Exchanging configuration information on appliance services in a home automation network
    • H04L12/2809Exchanging configuration information on appliance services in a home automation network indicating that an appliance service is present in a home automation network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/283Processing of data at an internetworking point of a home automation network
    • 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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/10Flow control between communication endpoints
    • H04W28/14Flow control between communication endpoints using intermediate storage
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L2012/2847Home automation networks characterised by the type of home appliance used
    • H04L2012/285Generic home appliances, e.g. refrigerators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/302Route determination based on requested QoS
    • H04L45/306Route determination based on the nature of the carried application
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a cloud access method and system based on a wireless communication module.
  • cloud server is based on resource sharing to reduce costs and improve the efficiency of flexible expansion of IT infrastructure.
  • the construction of cloud servers is aimed at providing services to users on demand.
  • the cloud server carries a large number of important business systems and data, and different home appliances need to access the cloud server to provide related services to users.
  • the present invention aims to solve at least one of the technical problems in the related art to some extent.
  • an object of the present invention is to provide a cloud access method based on a wireless communication module, which can connect a home appliance with a corresponding cloud server, realize access of a home appliance and multiple cloud servers, and effectively improve wireless communication.
  • the cloud access effect of the module is to provide a cloud access method based on a wireless communication module, which can connect a home appliance with a corresponding cloud server, realize access of a home appliance and multiple cloud servers, and effectively improve wireless communication.
  • Another object of the present invention is to provide a cloud access system based on a wireless communication module.
  • a cloud access method based on a wireless communication module includes: receiving, by a wireless communication module, a first type of packet sent by a cloud server, and acquiring type information of the cloud server,
  • the wireless communication module is connected to a plurality of cloud servers; the wireless communication module invokes a corresponding conversion protocol according to the type information of the cloud server; and the wireless communication module sets the first according to the conversion protocol.
  • the type message is converted into a second type of message, and the second type of message is sent to the corresponding home appliance.
  • the wireless communication module receives the first type of packet sent by the cloud server, and acquires the type information of the cloud server, where the wireless communication module and the plurality of The cloud server is connected; the wireless communication module invokes the corresponding conversion protocol according to the type information of the cloud server; and the wireless communication module converts the first type of message into the second type of message according to the conversion protocol, and sends the second type of message to the
  • the corresponding home appliance can connect the home appliance with the corresponding cloud server, realize the access of the home appliance and the plurality of cloud servers, and effectively improve the cloud access effect based on the wireless communication module.
  • a cloud access system based on a wireless communication module includes: a wireless communication module, a cloud server and a home appliance that communicate with each other through the wireless communication module, wherein the wireless The communication module includes: a serial port data transceiving thread for communicating with the home appliance; and a network data transceiving thread, And communicating with the cloud server; the service logic thread is configured to exchange messages with the serial port data sending and receiving thread and the network data sending and receiving thread, to send and receive the serial port data sending and receiving thread and the network data sending and receiving thread.
  • the main thread is configured to control the serial port data sending and receiving thread, the network data sending and receiving thread, and the service logic thread; and applying an event callback submodule, wherein the main thread passes the application event callback
  • the module controls the business logic thread; and an application event message queue, configured to receive an event message and read by the main thread, wherein the event message includes an application event message and a WIFI callback event message; and the state machine event distribution process a sub-module, configured to distribute the event message to a corresponding state machine according to a mode attribute of the event message, where the mode attribute is any one of AP-Mode, STA-Mode, or System, and is read.
  • the cloud access system based on the wireless communication module proposed by the second aspect of the present invention exchanges messages with the serial port data sending and receiving thread and the network data sending and receiving thread through the service logic thread, and sends and receives the serial port data sending and receiving thread and the network data sending and receiving thread.
  • the message is controlled, and the main thread controls the serial port data sending and receiving thread, the network data sending and receiving thread and the business logic thread, can realize the coordinated operation of multiple threads, effectively improve the thread scheduling effect in the cloud server access process, and facilitate the late wireless communication module. Functional extension of the hardware system.
  • the mechanism controls the state of the wireless communication module to switch, and can realize the cooperative operation of the three state machines in the wireless communication module of the home appliance, thereby effectively improving the state management effect of the wireless communication module.
  • FIG. 1 is a schematic flowchart of a cloud access method based on a wireless communication module according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of hardware of a wireless communication module according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a message exchange process of a wireless communication module according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a cloud access method based on a wireless communication module according to another embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a wireless communication module according to another embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of a method for managing a state machine of a wireless communication module by a main thread according to another embodiment of the present invention.
  • FIG. 7 is a flow chart of a method for managing a state machine of a wireless communication module by a main thread according to another embodiment of the present invention.
  • FIG. 8 is a schematic diagram of state switching of a wireless communication module according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a cloud access system based on a wireless communication module according to another embodiment of the present invention.
  • the cloud access method based on a wireless communication module includes:
  • the wireless communication module receives the first type of the packet sent by the cloud server, and obtains the type information of the cloud server, where the wireless communication module is connected to the plurality of cloud servers.
  • cloud server is based on resource sharing to reduce costs while improving the efficiency of flexible expansion of IT infrastructure.
  • the construction of cloud servers is aimed at providing services to users on demand.
  • the cloud server carries a large number of important business systems and data.
  • different home appliances need to access the cloud server to provide related services to users. Therefore, there are many requirements and challenges for cloud server access. Therefore, it is necessary to realize convenient and efficient access of home appliances and multiple cloud servers.
  • the wireless communication module is specifically a wireless WIFI communication module.
  • the wireless WIFI communication module supports Wi-Fi technology for household appliances.
  • Household appliances such as air conditioners, refrigerators, and water heaters.
  • an Asymmetric Digital Subscriber Line (ADSL), a cell broadband, or the like in a user's home can connect to a wireless communication module by using a home Wi-Fi technology to implement wireless access of the mobile terminal.
  • ADSL Asymmetric Digital Subscriber Line
  • a cell broadband or the like in a user's home
  • a wireless communication module by using a home Wi-Fi technology to implement wireless access of the mobile terminal.
  • the user may also interconnect the home appliance with the corresponding cloud server by using the wireless communication module to implement resource sharing between the home appliance and the cloud server.
  • FIG. 2 is a schematic diagram of a hardware structure of a wireless communication module in an embodiment of the present invention
  • FIG. 2 is an example of a cloud and a millet cloud in which a cloud server is beautiful.
  • Figure 2 includes the M-Smart Software Development Kit (SDK) 21, the Huawei SDK 22, the vendor's underlying SDK 23, the US Cloud 24, and the Huawei Cloud 25.
  • the M-Smart SDK 21 is used to implement the processing logic of the business logic thread based on the M-Smart system
  • the Huawei SDK 22 is used to implement the protocol in the protocol conversion file xm_profile.c of Huawei Cloud 25, and the vendor underlying SDK 23 is used to implement the wireless communication module.
  • the underlying hardware logic, Midea Cloud 24 and Xiaomi Cloud 25 are used to provide cloud service resources.
  • the cloud server is a simple, efficient, secure and reliable computing service with flexible processing capabilities.
  • the cloud server is used to provide comprehensive Internet service capabilities to various Internet users.
  • Cloud servers such as Midea Cloud, Jingdong Cloud, Facebook Cloud, or Huawei Cloud.
  • the cloud server has intelligent cloud access, intelligent cloud storage, and intelligent information push.
  • the cloud server can push the resource to the home appliance, and the user can control the home appliance through the application program of the home appliance in the mobile terminal.
  • microwave ovens in the United States has newly developed cooking recipe resources.
  • Microwave oven manufacturers store the newly developed cooking recipe resources in the cloud cloud of intelligent cloud storage.
  • wireless communication module When users use the wireless communication module to interconnect the beautiful microwave oven with the beautiful cloud.
  • Midea Cloud will push the newly developed cooking recipe resources to the US microwave oven, so that users can control the US microwave oven to implement newly developed cooking recipe resources through the application of the microwave oven in the mobile terminal.
  • the message is a data unit exchanged and transmitted in the network, that is, a data block to be sent by the station at one time.
  • the message contains the complete data information to be sent, the length of which is inconsistent, the length is not limited and the length is variable.
  • the type information of the cloud server may be, for example, a cloud ID, and different cloud IDs may be used to identify different cloud servers.
  • the cloud ID may be set in a packet header of the first type of packet, which may be a packet header.
  • the reserved field in the present invention may also be set in other fields, which is not specifically limited in this embodiment of the present invention.
  • FIG. 3 it is a schematic diagram of a message exchange process of a wireless communication module according to an embodiment of the present invention. Including: serial data transmission and reception thread 31, business logic thread 32 based on M-Smart system, network data transmission and reception thread 33, serial data transmission and reception buffer 34, network data transmission and reception buffer 35, conversion protocol based on M-Smart system 36, cloud server 37 And household appliances 38.
  • the acquiring the type information of the cloud server specifically includes: the wireless communication module acquires Socket connection information connected to the cloud server; and the wireless communication module determines the type information according to the Socket connection information.
  • the network data sending and receiving thread in the wireless communication module acquires the first type of message sent by the cloud server to the home appliance
  • the network data sending and receiving thread creates a network sending and receiving data packet message queue
  • the first type report The text is added to the network transceiver packet message queue
  • the M-Smart system-based service logic thread in the wireless communication module is obtained from the network data transceiver buffer corresponding to the network transceiver packet message queue through the function interface of the protocol conversion file in the cloud server SDK.
  • the first type of packet and obtains the cloud ID in the header of the first type of packet.
  • the wireless communication module invokes a corresponding conversion protocol according to the type information of the cloud server.
  • the conversion protocol corresponding to the type information of the cloud server for example, the protocol in the protocol conversion file ali_profile.c of Facebook Cloud ali_sdk.c, the protocol in the protocol conversion file jd_profile.c of Jingdong cloud jd_sdk.c, Huaweiyun xm_sdk.c
  • the protocol converts the protocol in the file xm_profile.c, as well as the protocol in the beautiful cloud md_sdk.c protocol conversion file md_profile.c.
  • the wireless communication module converts the first type of message into the second type of message according to the conversion protocol, and sends the second type of message to the corresponding home appliance.
  • the wireless communication module performs protocol conversion on the first type of packet according to the cloud ID in the packet header of the first type of packet, and the corresponding conversion protocol, to obtain the second type of packet, and stores the second type of packet.
  • the serial data receiving and sending buffer triggers the application event callback sub-module to control the service logic thread based on the M-Smart system to deliver the second type of message to the home appliance through the serial data sending and receiving thread.
  • the method for accessing the cloud based on the wireless communication module includes: receiving, by the wireless communication module, a second type of packet sent by the home appliance, acquiring a destination address corresponding to the second type of packet, and determining a corresponding cloud server according to the target address.
  • Type information the wireless communication module invokes the corresponding conversion protocol according to the type information of the cloud server; and the wireless communication module converts the second type of message into the first type of message according to the conversion protocol, and sends the first type of message to the corresponding Cloud server.
  • the wireless communication module receives the first type of the packet sent by the cloud server, and obtains the type information of the cloud server, where the wireless communication module is connected to the plurality of cloud servers; and the wireless communication module is configured according to the type information of the cloud server. Calling the corresponding conversion protocol; and the wireless communication module converts the first type of message into the second type of message according to the conversion protocol, and sends the second type of message to the corresponding home appliance, enabling the home appliance and the corresponding cloud server
  • the connection realizes the access of the home appliance and the plurality of cloud servers, and effectively improves the cloud access effect based on the wireless communication module.
  • FIG. 4 is a schematic flowchart of a cloud access method based on a wireless communication module according to another embodiment of the present invention, where the cloud access method based on the wireless communication module includes:
  • the wireless communication module receives the second type of packet sent by the home appliance, obtains a destination address corresponding to the second type of packet, and determines type information of the corresponding cloud server according to the target address.
  • the destination address corresponding to the second type of packet identifies the cloud server, and the destination address may be set in the packet header of the second type of packet, which may be a reserved field in the packet header. It can be set in other fields, and the embodiment of the present invention does not specifically limit this.
  • the message exchange process is reported, for example, after the serial port data sending and receiving thread in the wireless communication module receives the second type of message sent by the home appliance, the serial port data sending and receiving thread creates a serial port transceiver data message queue, and The second type of message is added to the serial port transceiver data message queue, and the M-Smart system-based service logic thread in the wireless communication module sends and receives the data packet message queue corresponding to the serial port through the function interface of the protocol conversion file in the cloud server SDK.
  • the second type of packet is obtained in the data sending and receiving buffer, and the type information of the corresponding cloud server is determined according to the destination address in the packet header of the second type of packet.
  • the wireless communication module invokes a corresponding conversion protocol according to the type information of the cloud server.
  • the conversion protocol corresponding to the type information of the cloud server for example, the protocol in the protocol conversion file ali_profile.c of Facebook Cloud ali_sdk.c, the protocol in the protocol conversion file jd_profile.c of Jingdong cloud jd_sdk.c, Huaweiyun xm_sdk.c
  • the protocol converts the protocol in the file xm_profile.c, as well as the protocol in the beautiful cloud md_sdk.c protocol conversion file md_profile.c.
  • the wireless communication module converts the second type of packet into the first type of packet according to the conversion protocol, and sends the first type of packet to the corresponding cloud server.
  • the wireless communication module performs protocol conversion on the second type of packet according to the corresponding conversion protocol, and obtains the first type of packet, and stores the first type of packet in the network data transceiver buffer allocated by the cloud access system, and triggers the application.
  • the event callback sub-module controls the service logic thread based on the M-Smart system to report the first type of message to the cloud server through the network data sending and receiving thread.
  • the wireless communication module determines the type information of the corresponding cloud server according to the target address by receiving the second type of the packet sent by the home appliance and the destination address corresponding to the second type of the message, and the wireless communication module according to the cloud server.
  • the conversion protocol corresponding to the type information converts the second type of packet into the first type of packet, and sends the first type of packet to the corresponding cloud server, so that the home appliance can report the message to the corresponding cloud server, and implement the home appliance and the
  • the access of multiple cloud servers effectively improves the cloud access effect based on the wireless communication module.
  • FIG. 5 is a schematic structural diagram of a wireless communication module 50 according to another embodiment of the present invention.
  • the wireless communication module 50 includes a serial port data sending and receiving thread 51 for communicating with a home appliance, and a network data sending and receiving thread 52 for using a cloud server.
  • the service logic thread 53 is configured to exchange messages with the serial port data sending and receiving thread 51 and the network data sending and receiving thread 52 to control the messages sent and received by the serial port data sending and receiving thread 51 and the network data sending and receiving thread 52; and the main thread 54,
  • the main thread 54 is configured to control the serial port data sending and receiving thread 51, the network data sending and receiving thread 52, and the business logic thread 53;
  • the application event callback submodule 55 the main thread 54 controls the business logic thread 53 through the application event callback submodule 55;
  • the event message queue 56 is configured to receive an event message and is read by the main thread 54, wherein the event message includes an application event message and a WIFI callback event message;
  • the state machine 58 event distribution processing sub-module 57 is configured to use the mode according to the event message.
  • the attribute distributes the event message to the corresponding state machine 58, wherein the mode attribute is AP-Mode , the STA-Mode, or the System, reads the application event message and the WIFI callback event message in the application event message queue 56, and configures a state transition mechanism of the wireless communication module 50; the state machine 58 is configured to use the event message
  • the state transition mechanism controls the state of the wireless communication module 50 to switch.
  • the wireless communication module 50 includes a serial port data transceiving thread 51 for communicating with a home appliance.
  • the serial port is the serial interface, which is an extended interface using serial communication.
  • the serial communication method refers to a communication method in which each piece of data of one piece of information is transmitted in order by bit.
  • a thread is the smallest unit of program execution flow.
  • a standard thread consists of a thread ID, a current instruction pointer (PC), a register set, and a stack. Threads are suitable for file management or communication control in the server.
  • the wireless communication module 50 when the wireless communication module 50 receives the message sent by the home appliance, the message is processed in a serial communication manner to report the processed message to the cloud server.
  • the wireless communication module 50 further includes a network data transceiving thread 52 for communicating with the cloud server.
  • the wireless communication module 50 receives the message sent by the cloud server through the network data sending and receiving thread 52, The message is processed to deliver the processed message to the home appliance.
  • the wireless communication module 50 further includes a service logic thread 53 for performing message exchange with the serial port data transceiving thread 51 and the network data transceiving thread 52 for the serial port data transceiving thread 51 and the network data transceiving thread. 52 messages sent and received are controlled.
  • the service logic thread 53 in the embodiment of the present invention is a service logic thread 53 based on the M-Smart system.
  • the M-Smart system opens up the specific service content provided, and the M-Smart system opens the docking format for three Internet partners who use third-party cloud, use the US built-in cloud, and no cloud.
  • the service logic thread 53 exchanges messages with the serial port data transceiving thread 51 and the network data transceiving thread 52 through the M-Smart protocol.
  • the service logic thread 53 obtains the first type of message sent by the cloud server to the home appliance through the network data sending and receiving thread 52.
  • the service logic thread 53 acquires the type information of the cloud server, and converts the first type of message according to the type information.
  • the second type of message is sent by the service logic thread 53 to the home appliance through the serial port data receiving thread.
  • the message is a data unit exchanged and transmitted in the network, that is, a data block to be sent by the station at one time.
  • the message contains the complete data information to be sent, the length of which is inconsistent, the length is not limited and the length is variable.
  • the type information of the cloud server may be, for example, a cloud ID, and different cloud IDs may be used to identify different cloud servers.
  • the cloud ID may be set in a packet header of the first type of packet, which may be a packet header.
  • the reserved field in the present invention may also be set in other fields, which is not specifically limited in this embodiment of the present invention.
  • the acquiring the type information of the cloud server includes: the wireless communication module 50 acquires Socket connection information connected to the cloud server; and the wireless communication module 50 determines the type information according to the Socket connection information.
  • the network data sending and receiving thread 52 in the wireless communication module 50 acquires the first type of message sent by the cloud server to the home appliance
  • the network data sending and receiving thread 52 creates a network sending and receiving data packet message queue
  • the first A type of message is added to the network transceiver packet message queue
  • the M-Smart system-based service logic thread 53 in the wireless communication module 50 transmits and receives the network corresponding to the packet message queue from the network through the function interface of the protocol conversion file in the cloud server SDK.
  • the first type of packet is obtained in the data sending and receiving buffer, and the first type of packet is converted according to the cloud ID in the packet header of the first type of packet to obtain the second type of packet, and the second type of packet is stored.
  • the application event callback sub-module 55 is triggered to control the service logic thread 53 based on the M-Smart system to deliver the second type of message to the home appliance through the serial port data sending and receiving thread 51.
  • the protocol conversion file in the cloud server SDK for example, Facebook Cloud ali_sdk.c protocol conversion file ali_profile.c, Jingdong cloud jd_sdk.c protocol conversion file jd_profile.c, Huawei cloud xm_sdk.c protocol conversion file xm_profile.c
  • the wireless communication module 50 receives the second type of message sent by the home appliance, and obtains the destination address corresponding to the second type of message, and determines the type information of the corresponding cloud server according to the target address; the wireless communication module 50 is configured according to the cloud server.
  • the type information is used to invoke the corresponding conversion protocol; and the wireless communication module 50 converts the second type of message into the first type of message according to the conversion protocol, and sends the first type of message to the corresponding cloud server.
  • the destination address corresponding to the second type of packet identifies the cloud server, and the destination address may be set in the packet header of the second type of packet, which may be a reserved field in the packet header. It can be set in other fields, and the embodiment of the present invention does not specifically limit this.
  • the message exchange process is performed. For example, after the serial port data sending and receiving thread 51 in the wireless communication module 50 receives the second type of message sent by the home appliance, the serial port data sending and receiving thread 51 creates a serial port transceiver packet message queue, and the second type is The message is added to the serial port transceiver data message queue, and the M-Smart system-based service logic thread 53 in the wireless communication module 50 transmits and receives the serial port data corresponding to the data packet message queue from the serial port through the function interface of the protocol conversion file in the cloud server SDK.
  • the second type of packet is obtained in the sending and receiving buffer, and the second type of packet is protocol-converted according to the type information of the cloud server corresponding to the destination address in the packet header of the second type of packet, and the first type of packet is obtained.
  • a type of message is stored in the network data transceiver buffer allocated by the cloud access system, and the application event callback sub-module 55 is triggered to control the service logic thread 53 based on the M-Smart system to report the first type of message to the network data sending and receiving thread 52. To the cloud server.
  • the wireless communication module 50 further includes a main thread 54 for controlling the serial port data transceiving thread 51, the network data transceiving thread 52, and the service logic thread 53.
  • the wireless communication module 50 further includes an application event callback sub-module 55 that controls the business logic thread 53 via the application event callback sub-module 55.
  • the wireless communication module 50 further includes an application event message queue 56 for receiving an application event message generated by the service logic thread 53 for reading by the main thread 54.
  • the business logic thread 53 when the cloud server sends a message, or the home appliance reports the message, the business logic thread 53 generates a corresponding application event message, and the business logic thread 53 adds the application event message to the application event message queue 56 to make the main thread 54 read. Taking the application event message, and triggering the application event callback sub-module 55 to control the M-Smart system-based service logic thread 53 to report the first type of message to the cloud server through the network data sending and receiving thread 52, or trigger the application event callback sub-module
  • the service logic thread 53 based on the M-Smart system sends the second type of message to the home appliance through the serial port data sending and receiving thread 51.
  • the wireless communication module 50 further includes a state machine 58 event distribution processing sub-module 57 for distributing the event message to the corresponding state machine 58 according to the mode attribute of the event message, wherein the mode attribute is AP.
  • the application event message and the WIFI callback event message in the application event message queue 56 are read by any one of -Mode, STA-Mode, or System, and the state transition mechanism of the wireless communication module 50 is configured.
  • the wireless communication module 50 further includes a state machine 58 for The state transition mechanism controls the state of the wireless communication module 50 to switch.
  • main thread 54 is used to manage state machine 58 of wireless communication module 50.
  • the main thread 54 is configured to manage the state machine 58 of the wireless communication module 50, and specifically includes: the wireless communication module 50 receives the event message; and distributes the event message to the corresponding state machine 58 according to the mode attribute of the event message, wherein the mode attribute is Any one of AP-Mode, STA-Mode, or System; controlling the state of the wireless communication module 50 according to the event message and the state transition mechanism of the corresponding state machine 58 to switch.
  • FIG. 6 a flow embodiment of the main thread 54 managing the state machine 58 of the wireless communication module 50 is shown in the embodiment of FIG. 6 and FIG.
  • the wireless communication module 50 further includes a first serial port receiving data message queue 59, and the first serial port receiving data message queue 59 is configured to receive the message sent by the serial port data sending and receiving thread 51, and provide the message to the service.
  • the logical thread 53 reads the first serial port data receiving buffer 510, and the first serial port data receiving buffer 510 receives and buffers the data sent by the serial port data sending and receiving thread 51, and provides the data to the service logic thread 53 for reading;
  • the second serial port Receiving a data message queue 511 the second serial port receiving data message queue 511 is configured to receive the message sent by the service logic thread 53, and provide the message to the serial port data sending and receiving thread 51 for reading;
  • the second serial port data receiving buffer 512 the second The serial port data receiving buffer 512 is configured to buffer the data sent by the service logic thread 53 and provide the data to the serial port data sending and receiving thread 51 for reading.
  • the serial port data sending and receiving thread 51 in the wireless communication module 50 receives the second type of message sent by the home appliance
  • the serial port data sending and receiving thread 51 creates a first serial port receiving data message queue 59.
  • adding the second type of message to the first serial port receiving data message queue 59, and the M-Smart system-based service logic thread 53 in the wireless communication module 50 passes the function interface of the protocol conversion file in the cloud server SDK from the first serial port.
  • the first serial port data receiving buffer 510 corresponding to the received data message queue 59 obtains the second type of packet, and performs the second type of packet according to the type information of the cloud server corresponding to the destination address in the packet header of the second type of packet.
  • the protocol is converted to obtain the first type of message.
  • the M-Smart system-based service logic thread 53 in the wireless communication module 50 sends and receives the network data corresponding to the packet message queue from the network through the function interface of the protocol conversion file in the cloud server SDK.
  • the first type of packet is obtained in the sending and receiving buffer, and the first type of packet is protocol-converted according to the cloud ID in the packet header of the first type of packet, and the second type of packet is obtained, and the second type of packet is stored in the packet.
  • the second serial port allocated by the cloud access system receives the second serial port data receiving buffer 512 corresponding to the data message queue 511, and triggers the application event callback sub-module 55 to control the service logic thread 53 based on the M-Smart system to send the second type of message.
  • the serial data receiving and dispatching thread 51 is delivered to the home appliance.
  • the data of the first serial port data receiving buffer 510 and the second serial port data receiving buffer 512 are read, the data is deleted in the first serial port data receiving buffer 510 and the second serial port data receiving buffer 512.
  • the wireless communication module 50 further includes a first network received data message queue 513, and the first network received data message queue 513 is configured to receive the message sent by the network data transceiving thread 52 and provide the message to the service.
  • the logical thread 53 reads; the first network data receiving buffer 514 receives and caches the data sent by the network data sending and receiving thread 52, and provides the data to the business logic thread 53 for reading; the second network Receiving a data message queue 515, the second network receiving data message queue 515 is configured to receive the message sent by the service logic thread 53 and provide the message to the network data transceiving thread 52 for reading; and the second network data receiving buffer 516, the second The network data receiving buffer 516 receives and buffers the data sent by the business logic thread 53 and provides the data to the network data transceiving thread 52 for reading.
  • the service logic thread 53 stores the first type of message through the second network received data message queue 515 in the second network data receiving buffer 516 allocated by the cloud access system, and triggers
  • the application event callback sub-module 55 controls the M-Smart system-based service logic thread 53 to report the first type of message to the cloud server through the network data transceiver thread 52.
  • the first network receiving data message queue 513 in the wireless communication module 50 acquires the first type of message sent by the cloud server to the home appliance through the network data sending and receiving thread 52, and the network data.
  • the sending and receiving thread 52 creates a first network data receiving buffer 514, and adds a first type of message to the first network data receiving buffer 514, and provides the data to the business logic thread 53 for reading, so that the M-Smart system is based.
  • the service logic thread 53 delivers the second type of message to the home appliance through the serial port data sending and receiving thread 51.
  • the data of the first network data receiving buffer 514 and the second network data receiving buffer 516 are read, the data is deleted in the first network data receiving buffer 514 and the second network data receiving buffer 516.
  • the wireless communication module 50 further includes a WIFI event callback sub-module 517 for receiving a WIFI callback event, and adding a WIFI callback event to the application event message queue 56 after receiving the WIFI callback event.
  • the WIFI callback event is generated by the application.
  • the application is specifically an application in the wireless communication module 50.
  • the WIFI callback event is added to the application event message queue 56 for the main thread 54 to read.
  • the service logic thread exchanges messages with the serial port data sending and receiving thread and the network data sending and receiving thread, and controls the messages sent and received by the serial port data sending and receiving thread and the network data sending and receiving thread, and the main thread sends and receives threads and network data to the serial port.
  • the sending and receiving threads and the business logic thread control can realize the cooperative operation of multiple threads, effectively improve the thread scheduling effect in the cloud server access process, and facilitate the function expansion of the late wireless communication module hardware system.
  • Distributing the event message to the corresponding state machine according to the mode attribute of the event message, wherein the mode attribute is any one of AP-Mode, STA-Mode, or System and is converted according to the event message and the state of the corresponding state machine.
  • the mechanism controls the state of the wireless communication module to switch, and can realize the cooperative operation of three state machines in the wireless communication module of the household appliance. The line effectively improves the state management effect of the wireless communication module.
  • FIG. 6 is a schematic flowchart of a method for managing a state machine of a wireless communication module by a main thread according to another embodiment of the present invention.
  • the method for managing a state machine of a wireless communication module by the main thread includes:
  • the wireless communication module receives an event message.
  • the wireless communication module is specifically a wireless WIFI communication module.
  • the wireless WIFI communication module supports Wi-Fi technology for household appliances.
  • Household appliances such as air conditioners, refrigerators, and water heaters.
  • an Asymmetric Digital Subscriber Line (ADSL), a cell broadband, or the like in a user's home can connect to a wireless communication module by using a home Wi-Fi technology to implement wireless access of the mobile terminal.
  • the user can also interconnect the home appliance with the corresponding cloud server by using the wireless communication module to implement resource sharing between the home appliance and the cloud server.
  • the wireless communication module in current home appliances is typically used as a receiving end, i.e., relies on another network providing device (e.g., a wired network) to provide a network connection to the home appliance.
  • another network providing device e.g., a wired network
  • the user may want to use the wireless communication module to increase the range covered by the network signal; or, may also want to enable the wireless communication module to convert the wired network into a wireless network at the same time; or, may also want to make the wireless communication module as a wireless base station (AP) ) to connect the electronic devices to each other.
  • the wireless communication module in the home appliance of the related art can usually only provide one of the network forms or functions.
  • the event message includes an application event message and a WIFI callback event message
  • the wireless communication module receives the event message, including: the application event message queue receives the application event message generated by the service logic thread; and the WIFI event callback submodule receives the WIFI callback event message. After receiving the WIFI callback event message, the WIFI callback event message is added to the application event message queue.
  • the application event message is generated by the main thread in the wireless communication module by the application event callback submodule controlling the business logic thread, and the WIFI callback event message is generated by the application.
  • the application event message may be an actively generated event for the upper layer of the wireless communication module. For example, if the wireless communication module cancels the AP mode, an application event message of AF_EVT_AP_STOP is generated.
  • the WIFI callback event message may be an event of the WIFI bottom feedback of the wireless communication module. For example, if the AP mode of the wireless communication module is successfully enabled, a WIFI callback event message of AF_EVT_AP_STARTED_SUCCESS is generated.
  • the wireless communication module before receiving the event message, further includes: configuring a state transition mechanism of the wireless communication module.
  • S602 Distribute the event message to the corresponding state machine according to the mode attribute of the event message, where the mode attribute is any one of AP-Mode, STA-Mode, or System.
  • the state machine event distribution processing sub-module distributes the event message to the corresponding state machine according to the mode attribute of the event message, wherein the mode attribute is any one of AP-Mode, STA-Mode, or System.
  • the wireless communication module supports an access point (AP) working mode AP-Mode, and the AP-Mode application is wireless.
  • the wireless communication module can also support the workstation mode STA-Mode, or can be understood as a workstation in a grid, that is, the client.
  • the WIFI chip of a wireless communication module provides the STA-Mode function
  • the wireless communication module can be connected to another network.
  • the AP-Mode is provided for connection to the mobile terminal, and the STA-Mode is used to provide data uplink services of the network.
  • the system network state of the system in which the wireless communication module is located that is, the network connection state of the wireless communication module in the system and the network user may be described by the system state attribute, and the system state machine performs switching management between the system states.
  • the state machine includes an AP-Mode state machine, a STA-Mode state machine, and a System state machine, a mode attribute AP-Mode corresponding to an AP-Mode state machine, a mode attribute STA-Mode corresponding to an STA-Mode state machine, and a mode attribute System. Corresponds to the System state machine.
  • S603 Control the state of the wireless communication module to switch according to the event message and the state transition mechanism of the corresponding state machine.
  • the state of the wireless communication module includes three states: an established AP, an AP running, and an idle state in the AP-Mode state machine, and three connections, a connected state, and an idle state in the STA-Mode state machine; The network in the machine is not established, the network has been established, and the three states are initialized.
  • the state of the wireless communication module is controlled to be switched according to the event message and the state transition mechanism of the corresponding state machine, including: if the mode attribute of the event message is AP-Mode, the AP-Mode state machine is based on the event message and the AP- The state transition mechanism of the mode state machine controls the state of the wireless communication module to switch between establishing the AP, the AP running, and the idle state; if the mode attribute of the event message is STA-Mode, the STA-Mode state machine is The event message and the state transition mechanism of the STA-Mode state machine control the state of the wireless communication module to switch between three states: connected, connected, and idle; if the mode attribute of the event message is System, the System state machine is based on the event The message and state transition mechanism of the System state machine controls the state of the wireless communication module to switch between three states: network not established, network established, and initialized.
  • the event message is distributed to the corresponding state machine according to the mode attribute of the event message, where the mode attribute is any one of AP-Mode, STA-Mode, or System, and according to the event message and the corresponding
  • the state transition mechanism of the state machine controls the state of the wireless communication module to switch, and can realize the cooperative operation of the three state machines in the wireless communication module, thereby effectively improving the state management effect of the wireless communication module.
  • FIG. 7 is a schematic flowchart of a method for managing a state machine of a wireless communication module by a main thread according to another embodiment of the present invention.
  • the method for managing a state machine of a wireless communication module by the main thread includes:
  • S701 Configure a state transition mechanism of the wireless communication module.
  • the wireless communication module is specifically a wireless WIFI communication module.
  • the wireless WIFI communication module supports Wi-Fi technology for household appliances.
  • the state machine event distribution processing sub-module superimposes the state attributes of the AP-Mode state machine, the STA-Mode state machine, and the System state machine to configure a state transition mechanism of the wireless communication module.
  • the state attribute of the state machine is used to identify the state of the wireless communication module.
  • the built-in program in the wireless communication module can call the configured state attribute, so that the wireless communication module can switch between different states, and realize the cooperative operation of the three state machines in the wireless communication module.
  • the application event message queue receives an application event message generated by the business logic thread.
  • the application event message is generated by the main thread in the wireless communication module by the application event callback submodule controlling the business logic thread.
  • the application event message may be an actively generated event for the upper layer of the wireless communication module. For example, if the wireless communication module cancels the AP mode, an application event message of AF_EVT_AP_STOP is generated.
  • the WIFI event callback submodule receives the WIFI callback event message, and after receiving the WIFI callback event message, adds the WIFI callback event message to the application event message queue.
  • the WIFI callback event message may be an event of the WIFI bottom feedback of the wireless communication module. For example, if the AP mode of the wireless communication module is successfully enabled, a WIFI callback event message of AF_EVT_AP_STARTED_SUCCESS is generated.
  • S704 Read an application event message and a WIFI callback event message in the application event message queue.
  • the main event thread in the wireless communication module reads the application event message and the WIFI callback event message in the application event message queue through the state machine event distribution processing submodule.
  • S705 Distribute the event message to the corresponding state machine according to the mode attribute of the event message, where the mode attribute is any one of AP-Mode, STA-Mode, or System.
  • the state machine event distribution processing sub-module distributes the event message to the corresponding state machine according to the mode attribute of the event message, wherein the mode attribute is any one of AP-Mode, STA-Mode, or System.
  • the wireless communication module supports an access point (AP) working mode AP-Mode.
  • the AP-Mode application is added to the wireless local area network member device (ie, the client), that is, the network is downlink, and the wireless local area network WLAN is established in a wireless manner, which is equivalent to the WLAN.
  • Central equipment The wireless communication module can also support the workstation mode STA-Mode, or can be understood as a workstation in a grid, that is, the client.
  • the WIFI chip of a wireless communication module provides the STA-Mode function
  • the wireless communication module can be connected to another network.
  • the AP-Mode is provided for connection to the mobile terminal, and the STA-Mode is used to provide data uplink services of the network.
  • the system network state of the system in which the wireless communication module is located that is, the network connection state of the wireless communication module in the system and the network user may be described by the system state attribute, and the system state machine performs switching management between the system states.
  • the state machine includes an AP-Mode state machine, a STA-Mode state machine, and a System state machine, a mode attribute AP-Mode corresponding to an AP-Mode state machine, a mode attribute STA-Mode corresponding to an STA-Mode state machine, and a mode attribute System. Corresponds to the System state machine.
  • the logic of the code structure can be enhanced in the implementation of the underlying hardware of the wireless communication module, the complexity of the code development is reduced, and the function extension of the hardware system of the wireless communication module is facilitated.
  • S706 Control switching the state of the wireless communication module according to the event message and the state transition mechanism.
  • FIG. 8 it is a schematic diagram of state switching of a wireless communication module according to an embodiment of the present invention, which includes: an AP-Mode state machine 81, an STA-Mode state machine 82, a System state machine 83, and a state machine event distribution process.
  • Sub-module 84 application event message queue 85, AP-Mode state machine state switching flow 86, STA-Mode state machine state switching flow 87, and System state machine state switching flow 88.
  • the state of the wireless communication module can be controlled to switch according to the content of the event message and the state transition mechanism of the corresponding state machine.
  • an AF_EVT_AP_STOP application event message is generated, and the content of the AF_EVT_AP_STOP application event message is a cancel AP mode, when the wireless communication module is in an AP running state, and the wireless communication is performed.
  • the AP-Mode state machine controls the wireless communication module to switch from the state in which the AP is running to the idle state.
  • the built-in program in the wireless communication module can invoke the configured state attribute, so that the wireless communication module can switch between different states, according to the mode according to the event message.
  • the attribute distributes the event message to the corresponding state machine, wherein the mode attribute is any one of AP-Mode, STA-Mode, or System, and controls the wireless communication module according to the event message and the state transition mechanism of the corresponding state machine.
  • the state is switched, and the cooperative operation of the three state machines in the wireless communication module can be realized, thereby effectively improving the state management effect of the wireless communication module.
  • the logic of the code structure can be enhanced in the implementation of the underlying hardware of the wireless communication module, the complexity of the code development is reduced, and the function extension of the hardware system of the wireless communication module is facilitated.
  • FIG. 9 is a schematic structural diagram of a cloud access system based on a wireless communication module 91 according to another embodiment of the present invention.
  • the cloud access system 90 based on the wireless communication module 91 includes a wireless communication module 91 and communicates with each other through a wireless communication module 91.
  • the cloud server 92 and the home appliance 93 wherein the wireless communication module 91 includes: a serial port data transceiving thread for communicating with the home appliance 93; a network data transceiving thread for communicating with the cloud server 92; a business logic thread, It is used for message exchange with the serial data receiving and sending thread and the network data sending and receiving thread to control the serial port data sending and receiving thread and the network data sending and receiving thread to send and receive messages; and the main thread, the main thread is used for serial port data sending and receiving thread, network data receiving and sending The thread and the business logic thread control; the application event callback submodule, the main thread controls the business logic thread by applying the event callback submodule; and the application event message queue is used for receiving the event message and being read by the main thread, wherein the event message Including application event messages and WIFI callback event messages; a state event distribution processing sub-module, configured to distribute the event message to a corresponding state machine according to a mode attribute of the event message, where the mode attribute is AP-Mode
  • the cloud server 92 is based on resource sharing to reduce the cost and improve the efficiency of the flexible expansion of the IT infrastructure platform.
  • the construction of the cloud server 92 is intended to provide services to a large number of users on demand.
  • the cloud server 92 carries a large number of important service systems and data, and different home appliances 93 need to access the cloud server 92 to provide related services to users. Therefore, there are many requirements and challenges for the cloud server 92 to access.
  • the cloud access system based on the wireless communication module 91 includes a wireless communication module 91.
  • the implementation of the wireless communication module 91 is, for example, the embodiment of FIG. 5, and details are not described herein again.
  • the cloud access system based on the wireless communication module 91 further includes a cloud server 92 and a home appliance 93 that communicate with each other through the wireless communication module 91.
  • the cloud server 92 is a computing service that is simple, efficient, secure, and flexible in processing capability.
  • the cloud server 92 is used to provide various types of Internet users with services that provide comprehensive business capabilities.
  • the cloud server 92 is, for example, Midea Cloud, Jingdong Cloud, Facebook Cloud, or Xiaomi Cloud.
  • the cloud server 92 has the functions of intelligent cloud access, intelligent cloud storage, and intelligent information push.
  • the cloud server 92 can push the resource to the home appliance 93, and the user can perform the home appliance 93 through the application of the home appliance 93 in the mobile terminal. control.
  • microwave ovens in the United States has newly developed cooking recipe resources.
  • Microwave oven manufacturers store the newly developed cooking recipe resources in the cloud cloud of smart cloud storage.
  • users use the wireless communication module 91 to interconnect the US microwave oven with the beautiful cloud.
  • Midea Cloud will push the newly developed cooking recipe resources to the US microwave oven, so that users can control the beautiful microwave oven to implement the newly developed cooking recipe resources through the application of the microwave oven in the mobile terminal.
  • Household appliances 93 refer to various electrical and electronic appliances used in homes and the like.
  • the household appliance 93 is, for example, a television set, a refrigerator, or an air conditioner.
  • more and more household appliances 93 can realize intelligent operation, and the user can install the application program of the home appliance 93 in the mobile terminal, and control the home appliance 93 through the application program.
  • the user can also interconnect the home appliance 93 with the corresponding cloud server 92 by using the wireless communication module 91.
  • the user may access the home appliance 93 that needs to obtain the service system and data in the cloud server 92 to access the corresponding cloud server 92 through the wireless communication module 91 to implement sharing of resources in the cloud server 92.
  • the home appliance 93 that needs to acquire the business system and data in the cloud server 92 is a US air conditioner.
  • the US air conditioner needs to share the protocol matching resources from the US cloud server 92. Therefore, the US air conditioner is passed through the wireless communication mode.
  • Block 91 accesses the beautiful cloud to realize the sharing of the beautiful air conditioner with the beautiful cloud resources, or the beautiful air conditioner can be connected to the millet cloud through the wireless communication module 91 to realize the sharing of the beautiful air conditioner and the millet cloud resources. .
  • the service logic thread exchanges messages with the serial port data sending and receiving thread and the network data sending and receiving thread, and controls the messages sent and received by the serial port data sending and receiving thread and the network data sending and receiving thread, and the main thread sends and receives threads and network data to the serial port.
  • the sending and receiving threads and the business logic thread control can realize the cooperative operation of multiple threads, effectively improve the thread scheduling effect in the cloud server access process, and facilitate the function expansion of the late wireless communication module hardware system.
  • Distributing the event message to the corresponding state machine according to the mode attribute of the event message, wherein the mode attribute is any one of AP-Mode, STA-Mode, or System and is converted according to the event message and the state of the corresponding state machine.
  • the mechanism controls the state of the wireless communication module to switch, and can realize the cooperative operation of the three state machines in the wireless communication module of the home appliance, thereby effectively improving the state management effect of the wireless communication module.
  • each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明提出一种基于无线通信模块的云接入方法和系统,该基于无线通信模块的云接入方法包括无线通信模块接收云服务器发送的第一类型报文,并获取云服务器的类型信息,其中,无线通信模块与多个云服务器相连接;无线通信模块根据云服务器的类型信息调用对应的转换协议;以及无线通信模块根据转换协议将第一类型报文转换为第二类型报文,并将第二类型报文发送至对应的家用电器。通过本发明能够使家用电器与对应的云服务器连接,实现家用电器与多个云服务器的接入,有效提升基于无线通信模块的云接入效果。

Description

一种基于无线通信模块的云接入方法和系统 技术领域
本发明涉及通信技术领域,特别是指一种基于无线通信模块的云接入方法和系统。
背景技术
云服务器作为近年来的一种热门技术和发展趋势,其根本原理就是通过资源共享以达到降低成本的同时,提高IT基础平台弹性扩展的效率。目前云服务器的建设旨在为广大用户按需提供服务。云服务器承载了大量重要的业务系统及数据,同时不同的家用电器需要接入云服务器以给用户提供相关业务。
因此,有必要实现家用电器与多个云服务器便捷、高效地接入。
发明内容
本发明旨在至少在一定程度上解决相关技术中的技术问题之一。
为此,本发明的一个目的在于提出一种基于无线通信模块的云接入方法,能够使家用电器与对应的云服务器连接,实现家用电器与多个云服务器的接入,有效提升基于无线通信模块的云接入效果。
本发明的另一个目的在于提出一种基于无线通信模块的云接入系统。
为达到上述目的,本发明第一方面实施例提出的基于无线通信模块的云接入方法,包括:无线通信模块接收云服务器发送的第一类型报文,并获取所述云服务器的类型信息,其中,所述无线通信模块与多个云服务器相连接;所述无线通信模块根据所述云服务器的类型信息调用对应的转换协议;以及所述无线通信模块根据所述转换协议将所述第一类型报文转换为第二类型报文,并将所述第二类型报文发送至对应的家用电器。
本发明第一方面实施例提出的基于无线通信模块的云接入方法,无线通信模块通过接收云服务器发送的第一类型报文,并获取云服务器的类型信息,其中,无线通信模块与多个云服务器相连接;无线通信模块根据云服务器的类型信息调用对应的转换协议;以及无线通信模块根据转换协议将第一类型报文转换为第二类型报文,并将第二类型报文发送至对应的家用电器,能够使家用电器与对应的云服务器连接,实现家用电器与多个云服务器的接入,有效提升基于无线通信模块的云接入效果。
为达到上述目的,本发明第二方面实施例提出的基于无线通信模块的云接入系统,包括:无线通信模块、通过所述无线通信模块相互通信的云服务器和家用电器,其中,所述无线通信模块中包括:串口数据收发线程,用于与所述家用电器进行通信;网络数据收发线程,用 于与所述云服务器进行通信;业务逻辑线程,用于与所述串口数据收发线程、所述网络数据收发线程进行消息交换,以对所述串口数据收发线程和所述网络数据收发线程收发的消息进行控制;以及主线程,所述主线程用于对所述串口数据收发线程、网络数据收发线程和业务逻辑线程进行控制;应用事件回调子模块,所述主线程通过所述应用事件回调子模块控制所述业务逻辑线程;以及应用事件消息队列,用于接收事件消息,并供所述主线程读取,其中,所述事件消息包括应用事件消息和WIFI回调事件消息;状态机事件分发处理子模块,用于根据所述事件消息的模式属性将所述事件消息分发至对应的状态机,其中,所述模式属性为AP-Mode、STA-Mode,或者System中的任一种,读取所述应用事件消息队列中的所述应用事件消息和WIFI回调事件消息,配置所述无线通信模块的状态转换机制;状态机,用于根据所述事件消息和状态转换机制控制所述无线通信模块的状态进行切换。
本发明第二方面实施例提出的基于无线通信模块的云接入系统,通过业务逻辑线程与串口数据收发线程、网络数据收发线程进行消息交换,以对串口数据收发线程和网络数据收发线程收发的消息进行控制,主线程对串口数据收发线程、网络数据收发线程和业务逻辑线程进行控制,能够实现多个线程的协作运行,有效提升云服务器接入过程中的线程调度效果,便于后期无线通信模块硬件系统的功能扩展。通过根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种,并根据事件消息和对应的状态机的状态转换机制控制无线通信模块的状态进行切换,能够实现家用电器的无线通信模块中三种状态机的协作运行,有效提升无线通信模块的状态管理效果。
本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。
附图说明
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:
图1是本发明一实施例提出的基于无线通信模块的云接入方法的流程示意图;
图2是本发明实施例中无线通信模块的硬件结构示意图;
图3是本发明实施例中无线通信模块消息交换流程示意图;
图4是本发明另一实施例提出的基于无线通信模块的云接入方法的流程示意图;
图5是本发明另一实施例提出的无线通信模块的结构示意图;
图6是本发明另一实施例提出的主线程对无线通信模块的状态机进行管理的方法的流程示意图;
图7是本发明另一实施例提出的主线程对无线通信模块的状态机进行管理的方法的流程 示意图;
图8是本发明实施例中无线通信模块状态切换示意图;
图9是本发明另一实施例提出的基于无线通信模块的云接入系统的结构示意图。
具体实施方式
图1是本发明一实施例提出的基于无线通信模块的云接入方法的流程示意图,该基于无线通信模块的云接入方法包括:
S101:无线通信模块接收云服务器发送的第一类型报文,并获取云服务器的类型信息,其中,无线通信模块与多个云服务器相连接。
云服务器作为近年来的一种热门技术和发展趋势,其原理就是通过资源共享以达到降低成本的同时,提高IT基础平台弹性扩展的效率。目前云服务器的建设旨在为广大用户按需提供服务。云服务器承载了大量重要的业务系统及数据,同时不同的家用电器需要接入云服务器以给用户提供相关业务,因此云服务器接入存在着诸多需求和挑战。因此,有必要实现家用电器与多个云服务器便捷、高效地接入。
在本发明的实施例中,无线通信模块具体为无线WIFI通信模块。
其中,无线WIFI通信模块支持Wi-Fi技术,用于家用电器。
家用电器例如空调器、冰箱,以及热水器等。
例如,用户家里的非对称数字用户线路(Asymmetric Digital Subscriber Line,ADSL)、小区宽带等,可以通过使用家用Wi-Fi技术连接无线通信模块以实现移动终端的无线上网。
进一步,例如在本发明的实施例中,用户也可以通过使用无线通信模块将家用电器与对应的云服务器互联,以实现家用电器与云服务器的资源共享。
图2是本发明实施例中无线通信模块的硬件结构示意图,图2以云服务器为美的云和小米云示例。
图2中包括M-Smart软件开发工具包(Software Development Kit,SDK)21、小米SDK22、厂商底层SDK23、美的云24,以及小米云25。其中,M-Smart SDK21用于实现基于M-Smart系统的业务逻辑线程的处理逻辑,小米SDK22用于实现小米云25的协议转换文件xm_profile.c中的协议,厂商底层SDK23用于实现无线通信模块的底层硬件逻辑,美的云24和小米云25用于提供云服务资源。
其中,云服务器是一种简单高效、安全可靠、处理能力可弹性伸缩的计算服务。云服务器用于给各类互联网用户提供综合业务能力的服务。云服务器例如美的云、京东云、阿里云,或者小米云。
云服务器具有智能云接入、智能云存储,以及智能信息推送的功能。当用户通过使用无 线通信模块将家用电器与对应的云服务器互联后,云服务器可以将资源推送至家用电器,用户可以通过移动终端中家用电器的应用程序对家用电器进行控制。
例如,美的微波炉的使用功能有新开发的烹饪菜谱资源,微波炉厂商将该新开发的烹饪菜谱资源存储在美的云的智能云存储中,当用户通过使用无线通信模块将美的微波炉与美的云互联后,美的云会将该新开发的烹饪菜谱资源推送至美的微波炉,以使用户可以通过移动终端中美的微波炉的应用程序控制美的微波炉执行新开发的烹饪菜谱资源。
其中,报文是网络中交换与传输的数据单元,即站点一次性要发送的数据块。报文包含了将要发送的完整的数据信息,其长短不一致,长度不限且长度可变。通过不断地将数据封装成分组、包、帧来传输。
在本发明的实施例中,云服务器的类型信息可以例如云ID,不同的云ID标识不同的云服务器,该云ID可以设置在第一类型报文的报文头中,可以是报文头中的预留字段,也可以设置在其它字段,本发明实施例对此不进行具体限制。
具体地,如图3所示,为本发明实施例中无线通信模块消息交换流程示意图。包括:串口数据收发线程31、基于M-Smart系统的业务逻辑线程32、网络数据收发线程33、串口数据收发缓存34、网络数据收发缓存35、基于M-Smart系统的转换协议36、云服务器37,以及家用电器38。
可选地,获取云服务器的类型信息具体包括:无线通信模块获取与云服务器相连接的Socket连接信息;以及无线通信模块根据Socket连接信息确定类型信息。
下发消息交换流程例如,无线通信模块中的网络数据收发线程获取到云服务器发送至家用电器的第一类型报文后,网络数据收发线程创建网络收发数据包消息队列,并将第一类型报文添加至网络收发数据包消息队列,无线通信模块中的基于M-Smart系统的业务逻辑线程通过云服务器SDK中协议转换文件的函数接口从网络收发数据包消息队列对应的网络数据收发缓存中获取第一类型报文,并获取第一类型报文的报文头中的云ID。
S102:无线通信模块根据云服务器的类型信息调用对应的转换协议。
其中,与云服务器的类型信息对应的转换协议例如阿里云ali_sdk.c的协议转换文件ali_profile.c中的协议、京东云jd_sdk.c的协议转换文件jd_profile.c中的协议、小米云xm_sdk.c的协议转换文件xm_profile.c中的协议,以及美的云md_sdk.c的协议转换文件md_profile.c中的协议。
S103:无线通信模块根据转换协议将第一类型报文转换为第二类型报文,并将第二类型报文发送至对应的家用电器。
例如,无线通信模块根据第一类型报文的报文头中的云ID,以及对应的转换协议,对第一类型报文进行协议转换,得到第二类型报文,将第二类型报文存储在云接入系统分配的 串口数据收发缓存中,并触发应用事件回调子模块控制基于M-Smart系统的业务逻辑线程将第二类型报文通过串口数据收发线程下发至家用电器。
可选地,该基于无线通信模块的云接入方法包括:无线通信模块接收家用电器发送的第二类型报文,并获取第二类型报文对应的目的地址,以及根据目标地址确定对应云服务器的类型信息;无线通信模块根据云服务器的类型信息调用对应的转换协议;以及无线通信模块根据转换协议将第二类型报文转换为第一类型报文,并将第一类型报文发送至对应的云服务器。
本实施例中,无线通信模块通过接收云服务器发送的第一类型报文,并获取云服务器的类型信息,其中,无线通信模块与多个云服务器相连接;无线通信模块根据云服务器的类型信息调用对应的转换协议;以及无线通信模块根据转换协议将第一类型报文转换为第二类型报文,并将第二类型报文发送至对应的家用电器,能够使家用电器与对应的云服务器连接,实现家用电器与多个云服务器的接入,有效提升基于无线通信模块的云接入效果。
图4是本发明另一实施例提出的基于无线通信模块的云接入方法的流程示意图,该基于无线通信模块的云接入方法包括:
S401:无线通信模块接收家用电器发送的第二类型报文,并获取第二类型报文对应的目的地址,以及根据目标地址确定对应云服务器的类型信息。
在本发明的实施例中,第二类型报文对应的目的地址标识云服务器,该目的地址可以设置在第二类型报文的报文头中,可以是报文头中的预留字段,也可以设置在其它字段,本发明实施例对此不进行具体限制。
具体地,如图3所示,上报消息交换流程例如,无线通信模块中的串口数据收发线程接收家用电器发送的第二类型报文后,串口数据收发线程创建串口收发数据包消息队列,并将第二类型报文添加至串口收发数据包消息队列中,无线通信模块中的基于M-Smart系统的业务逻辑线程通过云服务器SDK中协议转换文件的函数接口从串口收发数据包消息队列对应的串口数据收发缓存中获取第二类型报文,以及,根据第二类型报文的报文头中目的地址确定对应的云服务器的类型信息。
S402:无线通信模块根据云服务器的类型信息调用对应的转换协议。
其中,与云服务器的类型信息对应的转换协议例如阿里云ali_sdk.c的协议转换文件ali_profile.c中的协议、京东云jd_sdk.c的协议转换文件jd_profile.c中的协议、小米云xm_sdk.c的协议转换文件xm_profile.c中的协议,以及美的云md_sdk.c的协议转换文件md_profile.c中的协议。
S403:无线通信模块根据转换协议将第二类型报文转换为第一类型报文,并将第一类型报文发送至对应的云服务器。
例如,无线通信模块根据对应的转换协议对第二类型报文进行协议转换,得到第一类型报文,将第一类型报文存储在云接入系统分配的网络数据收发缓存中,并触发应用事件回调子模块控制基于M-Smart系统的业务逻辑线程将第一类型报文通过网络数据收发线程上报至云服务器。
本实施例中,无线通信模块通过接收家用电器发送的第二类型报文和第二类型报文对应的目的地址,根据目标地址确定对应云服务器的类型信息;以及无线通信模块根据与云服务器的类型信息对应的转换协议将第二类型报文转换为第一类型报文,并将第一类型报文发送至对应的云服务器,能够使家用电器向对应的云服务器上报消息,实现家用电器与多个云服务器的接入,有效提升基于无线通信模块的云接入效果。
图5是本发明另一实施例提出的无线通信模块50的结构示意图,该无线通信模块50包括串口数据收发线程51,用于与家用电器进行通信;网络数据收发线程52,用于与云服务器进行通信;业务逻辑线程53,用于与串口数据收发线程51、网络数据收发线程52进行消息交换,以对串口数据收发线程51和网络数据收发线程52收发的消息进行控制;以及主线程54,主线程54用于对串口数据收发线程51、网络数据收发线程52和业务逻辑线程53进行控制;应用事件回调子模块55,主线程54通过应用事件回调子模块55控制业务逻辑线程53;以及应用事件消息队列56,用于接收事件消息,并供主线程54读取,其中,事件消息包括应用事件消息和WIFI回调事件消息;状态机58事件分发处理子模块57,用于根据事件消息的模式属性将事件消息分发至对应的状态机58,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种,读取应用事件消息队列56中的应用事件消息和WIFI回调事件消息,配置无线通信模块50的状态转换机制;状态机58,用于根据事件消息和状态转换机制控制无线通信模块50的状态进行切换。
在本发明的一个实施例中,无线通信模块50包括串口数据收发线程51,用于与家用电器进行通信。
串口即串行接口,是采用串行通信方式的扩展接口。其中,串行通信方式是指一条信息的各位数据被逐位按顺序传送的通讯方式。
线程是程序执行流的最小单元,一个标准的线程由线程ID,当前指令指针(PC),寄存器集合和堆栈组成。线程适用于服务器中的文件管理或者通信控制。
例如,当无线通信模块50接收到家用电器发送的报文时,对该报文以串行通信方式进行处理,以将处理后的报文上报至云服务器。
在本发明的一个实施例中,无线通信模块50还包括网络数据收发线程52,用于与云服务器进行通信。
例如,当无线通信模块50通过网络数据收发线程52接收到云服务器发送的报文时,对 该报文进行处理,以将处理后的报文下发至家用电器。
在本发明的一个实施例中,无线通信模块50还包括业务逻辑线程53,用于与串口数据收发线程51、网络数据收发线程52进行消息交换,以对串口数据收发线程51和网络数据收发线程52收发的消息进行控制。
其中,本发明实施例中的业务逻辑线程53为基于M-Smart系统的业务逻辑线程53。M-Smart系统开放具体提供的服务内容,M-Smart系统针对使用第三方云、使用美的内建云、没有云的三种互联网合作者开放对接形式。
具体地,业务逻辑线程53通过M-Smart协议与串口数据收发线程51、网络数据收发线程52进行消息交换。
可选地,业务逻辑线程53通过网络数据收发线程52获取云服务器发送至家用电器的第一类型报文;业务逻辑线程53获取云服务器的类型信息,并根据类型信息将第一类型报文转换为第二类型报文;业务逻辑线程53通过串口数据接收线程将第二类型报文发送至家用电器。
其中,报文是网络中交换与传输的数据单元,即站点一次性要发送的数据块。报文包含了将要发送的完整的数据信息,其长短不一致,长度不限且长度可变。通过不断地将数据封装成分组、包、帧来传输。
在本发明的实施例中,云服务器的类型信息可以例如云ID,不同的云ID标识不同的云服务器,该云ID可以设置在第一类型报文的报文头中,可以是报文头中的预留字段,也可以设置在其它字段,本发明实施例对此不进行具体限制。
可选地,获取云服务器的类型信息,具体包括:无线通信模块50获取与云服务器相连接的Socket连接信息;以及无线通信模块50根据Socket连接信息确定类型信息。
下发消息交换流程例如,无线通信模块50中的网络数据收发线程52获取到云服务器发送至家用电器的第一类型报文后,网络数据收发线程52创建网络收发数据包消息队列,并将第一类型报文添加至网络收发数据包消息队列,无线通信模块50中的基于M-Smart系统的业务逻辑线程53通过云服务器SDK中协议转换文件的函数接口从网络收发数据包消息队列对应的网络数据收发缓存中获取第一类型报文,根据第一类型报文的报文头中的云ID,对第一类型报文进行协议转换,得到第二类型报文,将第二类型报文存储在云接入系统分配的串口数据收发缓存中,并触发应用事件回调子模块55控制基于M-Smart系统的业务逻辑线程53将第二类型报文通过串口数据收发线程51下发至家用电器。其中,云服务器SDK中的协议转换文件例如,阿里云ali_sdk.c的协议转换文件ali_profile.c、京东云jd_sdk.c的协议转换文件jd_profile.c、小米云xm_sdk.c的协议转换文件xm_profile.c,以及美的云md_sdk.c的协议转换文件md_profile.c。
可选地,无线通信模块50接收家用电器发送的第二类型报文,并获取第二类型报文对应的目的地址,以及根据目标地址确定对应云服务器的类型信息;无线通信模块50根据云服务器的类型信息调用对应的转换协议;以及无线通信模块50根据转换协议将第二类型报文转换为第一类型报文,并将第一类型报文发送至对应的云服务器。
在本发明的实施例中,第二类型报文对应的目的地址标识云服务器,该目的地址可以设置在第二类型报文的报文头中,可以是报文头中的预留字段,也可以设置在其它字段,本发明实施例对此不进行具体限制。
具体地,上报消息交换流程例如,无线通信模块50中的串口数据收发线程51接收家用电器发送的第二类型报文后,串口数据收发线程51创建串口收发数据包消息队列,并将第二类型报文添加至串口收发数据包消息队列中,无线通信模块50中的基于M-Smart系统的业务逻辑线程53通过云服务器SDK中协议转换文件的函数接口从串口收发数据包消息队列对应的串口数据收发缓存中获取第二类型报文,根据第二类型报文的报文头中目的地址对应的云服务器的类型信息,对第二类型报文进行协议转换,得到第一类型报文,将第一类型报文存储在云接入系统分配的网络数据收发缓存中,并触发应用事件回调子模块55控制基于M-Smart系统的业务逻辑线程53将第一类型报文通过网络数据收发线程52上报至云服务器。
在本发明的一个实施例中,无线通信模块50还包括主线程54,主线程54用于对串口数据收发线程51、网络数据收发线程52和业务逻辑线程53进行控制。
在本发明的一个实施例中,无线通信模块50还包括应用事件回调子模块55,主线程54通过应用事件回调子模块55控制业务逻辑线程53。
在本发明的一个实施例中,无线通信模块50还包括应用事件消息队列56,用于接收业务逻辑线程53生成的应用事件消息,并供主线程54读取。
例如,当云服务器下发消息,或者家用电器上报消息时,业务逻辑线程53生成对应的应用事件消息,业务逻辑线程53将应用事件消息添加至应用事件消息队列56中,以使主线程54读取该应用事件消息,并触发应用事件回调子模块55控制基于M-Smart系统的业务逻辑线程53将第一类型报文通过网络数据收发线程52上报至云服务器,或者,触发应用事件回调子模块55控制基于M-Smart系统的业务逻辑线程53将第二类型报文通过串口数据收发线程51下发至家用电器。
在本发明的一个实施例中,无线通信模块50还包括状态机58事件分发处理子模块57,用于根据事件消息的模式属性将事件消息分发至对应的状态机58,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种,读取应用事件消息队列56中的应用事件消息和WIFI回调事件消息,配置无线通信模块50的状态转换机制。
在本发明的一个实施例中,无线通信模块50还包括状态机58,用于根据事件消息和状 态转换机制控制无线通信模块50的状态进行切换。
可选地,主线程54用于对无线通信模块50的状态机58进行管理。
主线程54用于对无线通信模块50的状态机58进行管理,具体包括:无线通信模块50接收事件消息;根据事件消息的模式属性将事件消息分发至对应的状态机58,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种;根据事件消息和对应的状态机58的状态转换机制控制无线通信模块50的状态进行切换。
可选地,主线程54对无线通信模块50的状态机58进行管理的流程实施例详见图6和图7实施例。
在本发明的一个实施例中,无线通信模块50还包括第一串口接收数据消息队列59,第一串口接收数据消息队列59用于接收串口数据收发线程51发送的消息,并将消息提供给业务逻辑线程53进行读取;第一串口数据接收缓存510,第一串口数据接收缓存510接收并缓存串口数据收发线程51发送的数据,并将数据提供给业务逻辑线程53进行读取;第二串口接收数据消息队列511,第二串口接收数据消息队列511用于接收业务逻辑线程53发送的消息,并将消息提供给串口数据收发线程51进行读取;以及第二串口数据接收缓存512,第二串口数据接收缓存512用于缓存业务逻辑线程53发送的数据,并将数据提供给串口数据收发线程51进行读取。
具体地,在家用电器上报消息的过程中,无线通信模块50中的串口数据收发线程51接收家用电器发送的第二类型报文后,串口数据收发线程51创建第一串口接收数据消息队列59,并将第二类型报文添加至第一串口接收数据消息队列59中,无线通信模块50中的基于M-Smart系统的业务逻辑线程53通过云服务器SDK中协议转换文件的函数接口从第一串口接收数据消息队列59对应的第一串口数据接收缓存510中获取第二类型报文,根据第二类型报文的报文头中目的地址对应的云服务器的类型信息,对第二类型报文进行协议转换,得到第一类型报文。
进一步,在云服务器下发消息的过程中,无线通信模块50中的基于M-Smart系统的业务逻辑线程53通过云服务器SDK中协议转换文件的函数接口从网络收发数据包消息队列对应的网络数据收发缓存中获取第一类型报文,根据第一类型报文的报文头中的云ID,对第一类型报文进行协议转换,得到第二类型报文,将第二类型报文存储在云接入系统分配的第二串口接收数据消息队列511对应的第二串口数据接收缓存512中,并触发应用事件回调子模块55控制基于M-Smart系统的业务逻辑线程53将第二类型报文通过串口数据收发线程51下发至家用电器。
可选地,在第一串口数据接收缓存510和第二串口数据接收缓存512的数据被读取之后,将数据在第一串口数据接收缓存510和第二串口数据接收缓存512中删除。
在本发明的一个实施例中,无线通信模块50还包括第一网络接收数据消息队列513,第一网络接收数据消息队列513用于接收网络数据收发线程52发送的消息,并将消息提供给业务逻辑线程53进行读取;第一网络数据接收缓存514,第一网络数据接收缓存514接收并缓存网络数据收发线程52发送的数据,并将数据提供给业务逻辑线程53进行读取;第二网络接收数据消息队列515,第二网络接收数据消息队列515用于接收业务逻辑线程53发送的消息,并将消息提供给网络数据收发线程52进行读取;以及第二网络数据接收缓存516,第二网络数据接收缓存516接收并缓存业务逻辑线程53发送的数据,并将数据提供给网络数据收发线程52进行读取。
具体地,在家用电器上报消息的过程中,业务逻辑线程53将第一类型报文通过第二网络接收数据消息队列515存储在云接入系统分配的第二网络数据接收缓存516中,并触发应用事件回调子模块55控制基于M-Smart系统的业务逻辑线程53将第一类型报文通过网络数据收发线程52上报至云服务器。
进一步,在云服务器下发消息的过程中,无线通信模块50中的第一网络接收数据消息队列513获取到云服务器通过网络数据收发线程52发送至家用电器的第一类型报文后,网络数据收发线程52创建第一网络数据接收缓存514,并将第一类型报文添加至第一网络数据接收缓存514,并将数据提供给业务逻辑线程53进行读取,以使基于M-Smart系统的业务逻辑线程53将第二类型报文通过串口数据收发线程51下发至家用电器。
可选地,在第一网络数据接收缓存514和第二网络数据接收缓存516的数据被读取之后,将数据在第一网络数据接收缓存514和第二网络数据接收缓存516中删除。
在本发明的一个实施例中,无线通信模块50还包括WIFI事件回调子模块517,用于接收WIFI回调事件,并在接收到WIFI回调事件之后,将WIFI回调事件添加至应用事件消息队列56。
其中,WIFI回调事件由应用程序产生。应用程序具体为无线通信模块50中的应用程序。
例如,当WIFI事件回调子模块517接收到WIFI回调事件之后,将WIFI回调事件添加至应用事件消息队列56,供主线程54读取。
本实施例中,通过业务逻辑线程与串口数据收发线程、网络数据收发线程进行消息交换,以对串口数据收发线程和网络数据收发线程收发的消息进行控制,主线程对串口数据收发线程、网络数据收发线程和业务逻辑线程进行控制,能够实现多个线程的协作运行,有效提升云服务器接入过程中的线程调度效果,便于后期无线通信模块硬件系统的功能扩展。通过根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种,并根据事件消息和对应的状态机的状态转换机制控制无线通信模块的状态进行切换,能够实现家用电器的无线通信模块中三种状态机的协作运 行,有效提升无线通信模块的状态管理效果。
图6是本发明另一实施例提出的主线程对无线通信模块的状态机进行管理的方法的流程示意图,该主线程对无线通信模块的状态机进行管理的方法包括:
S601:无线通信模块接收事件消息。
在本发明的实施例中,无线通信模块具体为无线WIFI通信模块。
其中,无线WIFI通信模块支持Wi-Fi技术,用于家用电器。
家用电器例如空调器、冰箱,以及热水器等。
例如,用户家里的非对称数字用户线路(Asymmetric Digital Subscriber Line,ADSL)、小区宽带等,可以通过使用家用Wi-Fi技术连接无线通信模块以实现移动终端的无线上网。进一步,用户也可以通过使用无线通信模块将家用电器与对应的云服务器互联,以实现家用电器与云服务器的资源共享。
目前的家用电器中的无线通信模块通常是作为接收端使用,即须依赖另一网络提供装置(例如,有线网络)来提供网络连接给家用电器。然而,使用者可能会想利用无线通信模块增加网络信号涵盖的范围;或者,也可能想同时使无线通信模块将有线网络转变成无线网络;或者,也可能想使无线通信模块作为无线基站(AP),来使电子装置互相连接。相关技术中的家用电器中的无线通信模块通常只能提供其中一种网络形态或功能。
可选地,事件消息包括应用事件消息和WIFI回调事件消息,无线通信模块接收事件消息,包括:应用事件消息队列接收业务逻辑线程生成的应用事件消息;WIFI事件回调子模块接收WIFI回调事件消息,并在接收到WIFI回调事件消息之后,将WIFI回调事件消息添加至应用事件消息队列。
其中,应用事件消息由无线通信模块中的主线程通过应用事件回调子模块控制业务逻辑线程生成,WIFI回调事件消息由应用程序产生。
具体地,应用事件消息可以为无线通信模块的上层应用主动产生的事件,例如,无线通信模块取消AP模式,则会产生AF_EVT_AP_STOP的应用事件消息。
WIFI回调事件消息可以为无线通信模块的WIFI底层反馈的事件,例如,无线通信模块的AP模式开启成功,则会产生AF_EVT_AP_STARTED_SUCCESS的WIFI回调事件消息。
可选地,无线通信模块接收事件消息之前,还包括:配置无线通信模块的状态转换机制。
S602:根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种。
具体地,由状态机事件分发处理子模块根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种。
无线通信模块支持热点(Access Point,AP)工作模式AP-Mode,AP-Mode应用在无线 局域网成员设备(即客户端)的加入,即网络下行,提供以无线方式组建无线局域网WLAN,相当WLAN的中心设备。无线通信模块也可以支持工作站模式STA-Mode,也可以理解为某个网格中的一个工作站即客户端。当一个无线通信模块的WIFI芯片提供STA-Mode功能时,无线通信模块就可以连到另外的一个网络当中。AP-Mode提供给移动终端等连接,STA-Mode用于提供网络的数据上行服务。另外,无线通信模块所在系统的系统网络状态,即无线通信模块在所在系统中与网络使用者的网络连接状态,可以由系统状态属性进行描述,对应由System状态机进行系统状态间的切换管理。
其中,状态机包括AP-Mode状态机、STA-Mode状态机,以及System状态机,模式属性AP-Mode对应AP-Mode状态机、模式属性STA-Mode对应STA-Mode状态机,以及模式属性System对应System状态机。
S603:根据事件消息和对应的状态机的状态转换机制控制无线通信模块的状态进行切换。
其中,无线通信模块的状态包括AP-Mode状态机中的建立AP中、AP运行中、以及空闲三种状态,STA-Mode状态机中的连接中、已连接、以及空闲三种状态;System状态机中的网络未建立、网络已建立、以及初始化三种状态。
可选地,根据事件消息和对应的状态机的状态转换机制控制无线通信模块的状态进行切换,包括:如果事件消息的模式属性为AP-Mode,则AP-Mode状态机根据事件消息和AP-Mode状态机的状态转换机制控制无线通信模块的状态在建立AP中、AP运行中、以及空闲三种状态之间进行切换;如果事件消息的模式属性为STA-Mode,则STA-Mode状态机根据事件消息和STA-Mode状态机的状态转换机制控制无线通信模块的状态在连接中、已连接、以及空闲三种状态之间进行切换;如果事件消息的模式属性为System,则System状态机根据事件消息和System状态机的状态转换机制控制无线通信模块的状态在网络未建立、网络已建立、以及初始化三种状态之间进行切换。
本实施例中,通过根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种,并根据事件消息和对应的状态机的状态转换机制控制无线通信模块的状态进行切换,能够实现无线通信模块中三种状态机的协作运行,有效提升无线通信模块的状态管理效果。
图7是本发明另一实施例提出的主线程对无线通信模块的状态机进行管理的方法的流程示意图,该主线程对无线通信模块的状态机进行管理的方法包括:
S701:配置无线通信模块的状态转换机制。
无线通信模块具体为无线WIFI通信模块。
其中,无线WIFI通信模块支持Wi-Fi技术,用于家用电器。
具体地,通过状态机事件分发处理子模块将AP-Mode状态机、STA-Mode状态机,以及System状态机的状态属性叠加,以配置无线通信模块的状态转换机制。
其中,状态机的状态属性用于标识无线通信模块的状态。
通过本步骤,可以使无线通信模块中的内置程序调用配置好的状态属性,使无线通信模块能在不同的状态间进行切换,实现无线通信模块中三种状态机的协作运行。
S702:应用事件消息队列接收业务逻辑线程生成的应用事件消息。
其中,应用事件消息由无线通信模块中的主线程通过应用事件回调子模块控制业务逻辑线程生成。
具体地,应用事件消息可以为无线通信模块的上层应用主动产生的事件,例如,无线通信模块取消AP模式,则会产生AF_EVT_AP_STOP的应用事件消息。
S703:WIFI事件回调子模块接收WIFI回调事件消息,并在接收到WIFI回调事件消息之后,将WIFI回调事件消息添加至应用事件消息队列。
WIFI回调事件消息可以为无线通信模块的WIFI底层反馈的事件,例如,无线通信模块的AP模式开启成功,则会产生AF_EVT_AP_STARTED_SUCCESS的WIFI回调事件消息。
S704:读取应用事件消息队列中的应用事件消息和WIFI回调事件消息。
具体地,由无线通信模块中的主线程通过状态机事件分发处理子模块读取应用事件消息队列中的应用事件消息和WIFI回调事件消息。
S705:根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种。
具体地,由状态机事件分发处理子模块根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种。
无线通信模块支持热点(Access Point,AP)工作模式AP-Mode,AP-Mode应用在无线局域网成员设备(即客户端)的加入,即网络下行,提供以无线方式组建无线局域网WLAN,相当WLAN的中心设备。无线通信模块也可以支持工作站模式STA-Mode,也可以理解为某个网格中的一个工作站即客户端。当一个无线通信模块的WIFI芯片提供STA-Mode功能时,无线通信模块就可以连到另外的一个网络当中。AP-Mode提供给移动终端等连接,STA-Mode用于提供网络的数据上行服务。另外,无线通信模块所在系统的系统网络状态,即无线通信模块在所在系统中与网络使用者的网络连接状态,可以由系统状态属性进行描述,对应由System状态机进行系统状态间的切换管理。
其中,状态机包括AP-Mode状态机、STA-Mode状态机,以及System状态机,模式属性AP-Mode对应AP-Mode状态机、模式属性STA-Mode对应STA-Mode状态机,以及模式属性System对应System状态机。
通过将事件消息分发至对应的状态机分别进行状态管理,在无线通信模块底层硬件实现方面可以增强代码结构的逻辑性,降低代码开发的复杂性,便于后期无线通信模块硬件系统的功能扩展。
S706:根据事件消息和状态转换机制控制无线通信模块的状态进行切换。
具体地,如图8所示,为本发明实施例中无线通信模块状态切换示意图,其中,包括:AP-Mode状态机81、STA-Mode状态机82、System状态机83、状态机事件分发处理子模块84、应用事件消息队列85、AP-Mode状态机状态切换流程86、STA-Mode状态机状态切换流程87,以及System状态机状态切换流程88。
可以根据事件消息的内容和对应的状态机的状态转换机制控制无线通信模块的状态进行切换。
例如,如图8所示,无线通信模块取消AP模式,则会产生AF_EVT_AP_STOP应用事件消息,该AF_EVT_AP_STOP应用事件消息的内容为取消AP模式,当无线通信模块处在AP运行中的状态,且无线通信模块的主线程读取到该AF_EVT_AP_STOP应用事件消息时,AP-Mode状态机控制无线通信模块由AP运行中的状态切换至空闲的状态。
本实施例中,通过配置无线通信模块的状态转换机制,可以使无线通信模块中的内置程序调用配置好的状态属性,使无线通信模块能在不同的状态间进行切换,通过根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种,并根据事件消息和对应的状态机的状态转换机制控制无线通信模块的状态进行切换,能够实现无线通信模块中三种状态机的协作运行,有效提升无线通信模块的状态管理效果。通过将事件消息分发至对应的状态机分别进行状态管理,在无线通信模块底层硬件实现方面可以增强代码结构的逻辑性,降低代码开发的复杂性,便于后期无线通信模块硬件系统的功能扩展。
图9是本发明另一实施例提出的基于无线通信模块91的云接入系统的结构示意图,该基于无线通信模块91的云接入系统90包括无线通信模块91、通过无线通信模块91相互通信的云服务器92和家用电器93,其中,无线通信模块91中包括:串口数据收发线程,用于与家用电器93进行通信;网络数据收发线程,用于与云服务器92进行通信;业务逻辑线程,用于与串口数据收发线程、网络数据收发线程进行消息交换,以对串口数据收发线程和网络数据收发线程收发的消息进行控制;以及主线程,主线程用于对串口数据收发线程、网络数据收发线程和业务逻辑线程进行控制;应用事件回调子模块,主线程通过应用事件回调子模块控制业务逻辑线程;以及应用事件消息队列,用于接收事件消息,并供主线程读取,其中,事件消息包括应用事件消息和WIFI回调事件消息;状态机事件分发处理子模块,用于根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、 STA-Mode,或者System中的任一种,读取应用事件消息队列中的应用事件消息和WIFI回调事件消息,配置无线通信模块91的状态转换机制;状态机,用于根据事件消息和状态转换机制控制无线通信模块91的状态进行切换。
云服务器92作为近年来的一种热门技术和发展趋势,其原理就是通过资源共享以达到降低成本的同时,提高IT基础平台弹性扩展的效率。目前云服务器92的建设旨在为广大用户按需提供服务。云服务器92承载了大量重要的业务系统及数据,同时不同的家用电器93需要接入云服务器92以给用户提供相关业务,因此云服务器92接入存在着诸多需求和挑战。
在本发明的一个实施例中,该基于无线通信模块91的云接入系统包括无线通信模块91。
其中,无线通信模块91的实施例如图5实施例,在此不再赘述。
在本发明的一个实施例中,该基于无线通信模块91的云接入系统还包括通过无线通信模块91相互通信的云服务器92和家用电器93。
其中,云服务器92是一种简单高效、安全可靠、处理能力可弹性伸缩的计算服务。云服务器92用于给各类互联网用户提供综合业务能力的服务。云服务器92例如美的云、京东云、阿里云,或者小米云。
云服务器92具有智能云接入、智能云存储,以及智能信息推送的功能。当用户通过使用无线通信模块91将家用电器93与对应的云服务器92互联后,云服务器92可以将资源推送至家用电器93,用户可以通过移动终端中家用电器93的应用程序对家用电器93进行控制。
例如,美的微波炉的使用功能有新开发的烹饪菜谱资源,微波炉厂商将该新开发的烹饪菜谱资源存储在美的云的智能云存储中,当用户通过使用无线通信模块91将美的微波炉与美的云互联后,美的云会将该新开发的烹饪菜谱资源推送至美的微波炉,以使用户可以通过移动终端中美的微波炉的应用程序控制美的微波炉执行新开发的烹饪菜谱资源。
家用电器93指在家庭及类似场所中使用的各种电气和电子器具。家用电器93例如电视机、电冰箱,或者空调器等。
随着智能家居技术的不断进步和用户生活水平的提高,越来越多的家用电器93能够实现智能化运转,用户可以在移动终端中安装家用电器93的应用程序,通过应用程序控制家用电器93进行工作,用户也可以通过使用无线通信模块91将家用电器93与对应的云服务器92互联。
具体地,用户可以将需要获取云服务器92中的业务系统和数据的家用电器93通过无线通信模块91接入对应的云服务器92,以实现云服务器92中资源的共享。
例如,需要获取云服务器92中的业务系统和数据的家用电器93为美的空调器,美的空调器需要从美的云服务器92中共享协议匹配的资源,因此,将美的空调器通过无线通信模 块91接入美的云,以实现美的空调器与美的云中资源的共享,或者,也可以将美的空调器通过无线通信模块91接入小米云,以实现美的空调器与小米云中资源的共享。
本实施例中,通过业务逻辑线程与串口数据收发线程、网络数据收发线程进行消息交换,以对串口数据收发线程和网络数据收发线程收发的消息进行控制,主线程对串口数据收发线程、网络数据收发线程和业务逻辑线程进行控制,能够实现多个线程的协作运行,有效提升云服务器接入过程中的线程调度效果,便于后期无线通信模块硬件系统的功能扩展。通过根据事件消息的模式属性将事件消息分发至对应的状态机,其中,模式属性为AP-Mode、STA-Mode,或者System中的任一种,并根据事件消息和对应的状态机的状态转换机制控制无线通信模块的状态进行切换,能够实现家用电器的无线通信模块中三种状态机的协作运行,有效提升无线通信模块的状态管理效果。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (27)

  1. 一种基于无线通信模块的云接入方法,所述无线通信模块用于家用电器,其特征在于,包括以下步骤:
    无线通信模块接收云服务器发送的第一类型报文,并获取所述云服务器的类型信息,其中,所述无线通信模块与多个云服务器相连接;
    所述无线通信模块根据所述云服务器的类型信息调用对应的转换协议;以及
    所述无线通信模块根据所述转换协议将所述第一类型报文转换为第二类型报文,并将所述第二类型报文发送至对应的家用电器。
  2. 如权利要求1所述的基于无线通信模块的云接入方法,其特征在于,所述获取所述云服务器的类型信息具体包括:
    所述无线通信模块获取与所述云服务器相连接的Socket连接信息;以及
    所述无线通信模块根据所述Socket连接信息确定所述类型信息。
  3. 如权利要求1所述的基于无线通信模块的云接入方法,其特征在于,还包括:
    无线通信模块接收家用电器发送的第二类型报文,并获取所述第二类型报文对应的目的地址,以及根据所述目标地址确定对应云服务器的类型信息;
    所述无线通信模块根据所述云服务器的类型信息调用对应的转换协议;以及
    所述无线通信模块根据所述转换协议将所述第二类型报文转换为第一类型报文,并将所述第一类型报文发送至对应的云服务器。
  4. 如权利要求1-3任一项所述的基于无线通信模块的云接入方法,其特征在于,所述无线通信模块中包括:
    串口数据收发线程,用于与所述家用电器进行通信;
    网络数据收发线程,用于与所述云服务器进行通信;
    业务逻辑线程,用于与所述串口数据收发线程、所述网络数据收发线程进行消息交换,以对所述串口数据收发线程和所述网络数据收发线程收发的消息进行控制;以及
    主线程,所述主线程用于对所述串口数据收发线程、网络数据收发线程和业务逻辑线程进行控制。
  5. 如权利要求4所述的基于无线通信模块的云接入方法,其特征在于,所述无线通信模块中还包括:
    第一串口接收数据消息队列,所述第一串口接收数据消息队列用于接收所述串口数据收发线程发送的消息,并将所述消息提供给所述业务逻辑线程进行读取;
    第一串口数据接收缓存,所述第一串口数据接收缓存接收并缓存所述串口数据收发线程发送的数据,并将所述数据提供给所述业务逻辑线程进行读取;
    第二串口接收数据消息队列,所述第二串口接收数据消息队列用于接收所述业务逻辑线程发送的消息,并将所述消息提供给所述串口数据收发线程进行读取;以及
    第二串口数据接收缓存,所述第二串口数据接收缓存接收并缓存所述业务逻辑线程发送的数据,并将所述数据提供给所述串口数据收发线程进行读取。
  6. 如权利要求5所述的基于无线通信模块的云接入方法,其特征在于,在所述第一串口数据接收缓存和第二串口数据接收缓存的数据被读取之后,将所述数据在所述第一串口数据接收缓存和第二串口数据接收缓存中删除。
  7. 如权利要求4所述的基于无线通信模块的云接入方法,其特征在于,所述无线通信模块中还包括:
    第一网络接收数据消息队列,所述第一网络接收数据消息队列用于接收所述网络数据收发线程发送的消息,并将所述消息提供给所述业务逻辑线程进行读取;
    第一网络数据接收缓存,所述第一网络数据接收缓存接收并缓存所述网络数据收发线程发送的数据,并将所述数据提供给所述业务逻辑线程进行读取;
    第二网络接收数据消息队列,所述第二网络接收数据消息队列用于接收所述业务逻辑线程发送的消息,并将所述消息提供给所述网络数据收发线程进行读取;以及
    第二网络数据接收缓存,所述第二网络数据接收缓存接收并缓存所述业务逻辑线程发送的数据,并将所述数据提供给所述网络数据收发线程进行读取。
  8. 如权利要求7所述的基于无线通信模块的云接入方法,其特征在于,在所述第一网络数据接收缓存和第二网络数据接收缓存的数据被读取之后,将所述数据在所述第一网络数据接收缓存和第二网络数据接收缓存中删除。
  9. 如权利要求4所述的基于无线通信模块的云接入方法,其特征在于,所述无线通信模块中还包括:
    应用事件回调子模块,所述主线程通过所述应用事件回调子模块控制所述业务逻辑线程;以及
    应用事件消息队列,用于接收所述业务逻辑线程生成的应用事件消息,并供所述主线程读取。
  10. 如权利要求4所述的基于无线通信模块的云接入方法,其特征在于,所述无线通信模块中还包括:
    WIFI事件回调子模块,用于接收WIFI回调事件,并在接收到所述WIFI回调事件之后,将所述WIFI回调事件添加至所述应用事件消息队列。
  11. 如权利要求10所述的基于无线通信模块的云接入方法,其特征在于,所述WIFI回调事件由应用程序产生。
  12. 如权利要求1所述的基于无线通信模块的云接入方法,其特征在于,所述主线程用于对所述无线通信模块的状态机进行管理。
  13. 如权利要求12所述的基于无线通信模块的云接入方法,其特征在于,所述主线程用于对所述无线通信模块的状态机进行管理,具体包括:
    所述无线通信模块接收事件消息;
    根据所述事件消息的模式属性将所述事件消息分发至对应的状态机,其中,所述模式属性为AP-Mode、STA-Mode,或者System中的任一种;
    根据所述事件消息和所述对应的状态机的状态转换机制控制所述无线通信模块的状态进行切换。
  14. 如权利要求13所述的基于无线通信模块的云接入方法,其特征在于,所述无线通信模块接收事件消息之前,还包括:
    配置所述无线通信模块的状态转换机制。
  15. 如权利要求14所述的基于无线通信模块的云接入方法,其特征在于,所述状态机包括AP-Mode状态机、STA-Mode状态机,以及System状态机,所述模式属性AP-Mode对应AP-Mode状态机、所述模式属性STA-Mode对应STA-Mode状态机,以及所述模式属性System对应System状态机。
  16. 如权利要求14所述的基于无线通信模块的云接入方法,其特征在于,所述配置所述无线通信模块的状态转换机制,包括:
    将所述AP-Mode状态机、所述STA-Mode状态机,以及所述System状态机的状态属性叠加,以配置所述无线通信模块的状态转换机制。
  17. 如权利要求13所述的基于无线通信模块的云接入方法,其特征在于,所述无线通信模块的状态包括AP-Mode状态机中的建立AP中、AP运行中、以及空闲三种状态,STA-Mode状态机中的连接中、已连接、以及空闲三种状态;System状态机中的网络未建立、网络已建立、以及初始化三种状态。
  18. 如权利要求17所述的基于无线通信模块的云接入方法,其特征在于,所述根据所述事件消息和所述对应的状态机的状态转换机制控制所述无线通信模块的状态进行切换,包括:
    如果所述事件消息的模式属性为AP-Mode,则AP-Mode状态机根据所述事件消息和所述AP-Mode状态机的状态转换机制控制所述无线通信模块的状态在建立AP中、AP运行中、以及空闲三种状态之间进行切换;
    如果所述事件消息的模式属性为STA-Mode,则STA-Mode状态机根据所述事件消息和所述STA-Mode状态机的状态转换机制控制所述无线通信模块的状态在连接中、已连接、以及 空闲三种状态之间进行切换;
    如果所述事件消息的模式属性为System,则System状态机根据所述事件消息和所述System状态机的状态转换机制控制所述无线通信模块的状态在网络未建立、网络已建立、以及初始化三种状态之间进行切换。
  19. 如权利要求13所述的基于无线通信模块的云接入方法,其特征在于,所述事件消息包括应用事件消息和WIFI回调事件消息,所述无线通信模块接收事件消息,包括:
    所述应用事件消息队列接收所述业务逻辑线程生成的应用事件消息;
    所述WIFI事件回调子模块接收所述WIFI回调事件消息,并在接收到所述WIFI回调事件消息之后,将所述WIFI回调事件消息添加至所述应用事件消息队列。
  20. 如权利要求19所述的基于无线通信模块的云接入方法,其特征在于,还包括:
    读取所述应用事件消息队列中的所述应用事件消息和所述WIFI回调事件消息。
  21. 一种基于无线通信模块的云接入系统,所述无线通信模块用于家用电器,其特征在于,包括无线通信模块、通过所述无线通信模块相互通信的云服务器和家用电器,其中,所述无线通信模块中包括:
    串口数据收发线程,用于与所述家用电器进行通信;
    网络数据收发线程,用于与所述云服务器进行通信;
    业务逻辑线程,用于与所述串口数据收发线程、所述网络数据收发线程进行消息交换,以对所述串口数据收发线程和所述网络数据收发线程收发的消息进行控制;
    主线程,所述主线程用于对所述串口数据收发线程、网络数据收发线程和业务逻辑线程进行控制;
    应用事件回调子模块,所述主线程通过所述应用事件回调子模块控制所述业务逻辑线程;以及
    应用事件消息队列,用于接收事件消息,并供所述主线程读取,其中,所述事件消息包括应用事件消息和WIFI回调事件消息;
    状态机事件分发处理子模块,用于根据所述事件消息的模式属性将所述事件消息分发至对应的状态机,其中,所述模式属性为AP-Mode、STA-Mode,或者System中的任一种,读取所述应用事件消息队列中的所述应用事件消息和WIFI回调事件消息,配置所述无线通信模块的状态转换机制;
    状态机,用于根据所述事件消息和状态转换机制控制所述无线通信模块的状态进行切换。
  22. 如权利要求21所述的基于无线通信模块的云接入系统,其特征在于,所述无线通信模块中还包括:
    第一串口接收数据消息队列,所述第一串口接收数据消息队列用于接收所述串口数据收发线程发送的消息,并将所述消息提供给所述业务逻辑线程进行读取;
    第一串口数据接收缓存,所述第一串口数据接收缓存接收并缓存所述串口数据收发线程发送的数据,并将所述数据提供给所述业务逻辑线程进行读取;
    第二串口接收数据消息队列,所述第二串口接收数据消息队列用于接收所述业务逻辑线程发送的消息,并将所述消息提供给所述串口数据收发线程进行读取;以及
    第二串口数据接收缓存,所述第二串口数据接收缓存接收并缓存所述业务逻辑线程发送的数据,并将所述数据提供给所述串口数据收发线程进行读取。
  23. 如权利要求22所述的基于无线通信模块的云接入系统,其特征在于,在所述第一串口数据接收缓存和第二串口数据接收缓存的数据被读取之后,将所述数据在所述第一串口数据接收缓存和第二串口数据接收缓存中删除。
  24. 如权利要求21所述的基于无线通信模块的云接入系统,其特征在于,所述无线通信模块中还包括:
    第一网络接收数据消息队列,所述第一网络接收数据消息队列用于接收所述网络数据收发线程发送的消息,并将所述消息提供给所述业务逻辑线程进行读取;
    第一网络数据接收缓存,所述第一网络数据接收缓存接收并缓存所述网络数据收发线程发送的数据,并将所述数据提供给所述业务逻辑线程进行读取;
    第二网络接收数据消息队列,所述第二网络接收数据消息队列用于接收所述业务逻辑线程发送的消息,并将所述消息提供给所述网络数据收发线程进行读取;以及
    第二网络数据接收缓存,所述第二网络数据接收缓存接收并缓存所述业务逻辑线程发送的数据,并将所述数据提供给所述网络数据收发线程进行读取。
  25. 如权利要求24所述的基于无线通信模块的云接入系统,其特征在于,在所述第一网络数据接收缓存和第二网络数据接收缓存的数据被读取之后,将所述数据在所述第一网络数据接收缓存和第二网络数据接收缓存中删除。
  26. 如权利要求21所述的基于无线通信模块的云接入系统,其特征在于,所述无线通信模块中还包括:
    WIFI事件回调子模块,用于接收WIFI回调事件,并在接收到所述WIFI回调事件之后,将所述WIFI回调事件添加至所述应用事件消息队列。
  27. 如权利要求26所述的基于无线通信模块的云接入系统,其特征在于,所述WIFI回调事件由应用程序产生。
PCT/CN2015/097741 2015-12-14 2015-12-17 一种基于无线通信模块的云接入方法和系统 Ceased WO2017101079A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/008,052 US20180367647A1 (en) 2015-12-14 2018-06-14 Wireless communication module based cloud access method and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510932085.1A CN105791377B (zh) 2015-12-14 2015-12-14 基于无线通信模块的云接入系统和方法
CN201510932085.1 2015-12-14

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/008,052 Continuation US20180367647A1 (en) 2015-12-14 2018-06-14 Wireless communication module based cloud access method and system

Publications (1)

Publication Number Publication Date
WO2017101079A1 true WO2017101079A1 (zh) 2017-06-22

Family

ID=56389945

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/097741 Ceased WO2017101079A1 (zh) 2015-12-14 2015-12-17 一种基于无线通信模块的云接入方法和系统

Country Status (3)

Country Link
US (1) US20180367647A1 (zh)
CN (1) CN105791377B (zh)
WO (1) WO2017101079A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106808608A (zh) * 2016-12-31 2017-06-09 重庆安特管业有限公司 一种智能切割机
CN107517146A (zh) * 2017-08-31 2017-12-26 广东美的制冷设备有限公司 身份类型标识的配置系统和配置方法及移动终端
CN114116153A (zh) * 2020-08-31 2022-03-01 华为技术有限公司 基于代理服务的设备调用方法、电子设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140156028A1 (en) * 2012-11-30 2014-06-05 General Electric Company Cloud-based bi-directional messaging system for home appliance control
CN103916464A (zh) * 2014-03-19 2014-07-09 广东志高空调有限公司 一种基于Wi-Fi通信方式的双模云空调系统
CN104243616A (zh) * 2014-10-10 2014-12-24 广东志高空调有限公司 一种基于Wi-Fi通信的云空调系统
CN204404559U (zh) * 2015-01-18 2015-06-17 李俊楠 一种基于Wi-Fi通信的云热水器系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981440B (zh) * 2012-11-02 2014-10-29 武汉理工大学 基于SaaS的智能设备监控管理系统
US9444899B2 (en) * 2012-12-26 2016-09-13 Microsoft Technology Licensing, Llc Use of internet information services logging to collect user information in an asynchronous manner
CN203965907U (zh) * 2014-06-24 2014-11-26 北车大连电力牵引研发中心有限公司 轨道交通通信系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140156028A1 (en) * 2012-11-30 2014-06-05 General Electric Company Cloud-based bi-directional messaging system for home appliance control
CN103916464A (zh) * 2014-03-19 2014-07-09 广东志高空调有限公司 一种基于Wi-Fi通信方式的双模云空调系统
CN104243616A (zh) * 2014-10-10 2014-12-24 广东志高空调有限公司 一种基于Wi-Fi通信的云空调系统
CN204404559U (zh) * 2015-01-18 2015-06-17 李俊楠 一种基于Wi-Fi通信的云热水器系统

Also Published As

Publication number Publication date
CN105791377A (zh) 2016-07-20
US20180367647A1 (en) 2018-12-20
CN105791377B (zh) 2017-05-24

Similar Documents

Publication Publication Date Title
CN111200878B (zh) 信息传输方法及其装置
US11528239B2 (en) Time-sensitive networking communication method and apparatus for configuring virtual switching node
US11128486B2 (en) Smart refrigerator-based networking and control method and system, and smart refrigerator
CN107426797B (zh) 用于接入网侧的切片管控系统和方法
WO2020103834A1 (zh) 时延敏感网络通信方法及其装置
CN105871992B (zh) 基于无线通信模块的云接入系统和方法
CN110740149B (zh) 通信方法和装置
TW201813354A (zh) 無線通訊系統的資源分配方法及其設備和系統
WO2015051704A1 (zh) 移动终端多apn网络并发系统及其联网方法
CN105871991B (zh) 基于无线通信模块的云接入系统和方法
CN104410982B (zh) 一种无线异构网络中终端聚合与重构方法
CN103856374A (zh) 一种数据传输方法、终端及家庭互联系统
WO2020034861A1 (zh) 通信方法和装置
CN105871993B (zh) 基于无线通信模块的云接入方法和系统
WO2020164522A1 (zh) 数据传输控制方法及相关产品
WO2017101079A1 (zh) 一种基于无线通信模块的云接入方法和系统
WO2011137621A1 (zh) 管理分布式基站的方法和装置
CN105578505B (zh) 无线通信模块的状态管理方法和无线通信模块
WO2024067062A1 (zh) 数据传输方法和相关产品
CN105429900B (zh) 一种带宽提速的方法、装置及系统
WO2012151803A1 (zh) 一种虚拟终端系统及实现方法
CN105245376A (zh) 基于sdn的住宅小区网络控制系统
CN114500133A (zh) 一种家电设备及家电设备的入网方法
CN112994996B (zh) 家庭网络共享方法、mec服务器、计算机设备及介质
CN113890834B (zh) MEC系统与DPoH系统的通信方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15910551

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15910551

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03/12/2018)

122 Ep: pct application non-entry in european phase

Ref document number: 15910551

Country of ref document: EP

Kind code of ref document: A1