CN110602804A - Data exchange method, device and storage medium based on AP direct connection - Google Patents
- ️Fri Dec 20 2019
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
An embodiment of the present invention provides a data exchange method based on AP direct connection, and fig. 1 is a schematic diagram illustrating an implementation flow of data exchange based on AP direct connection in an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101, the household appliance obtains uploading request information sent by a first user terminal through a first path, and stores the uploading request information.
Here, the WiFI module of the WiFI module in the home appliance device obtains the upload request information sent by the first user terminal through the first path, and stores the upload request information in the storage module of the WiFI module in the home appliance device.
The household appliances can be an intelligent electric cooker, an intelligent refrigerator, an intelligent pressure cooker and the like; the first user terminal is used for controlling the household appliance, and the first user terminal can be a mobile phone, a computer, a tablet computer and the like of a user. The upload request information at least includes: sharing data and a first key; the first path is a path through which the household appliance is connected with the first user terminal point to point through a wireless Access Point (AP) of the household appliance. The shared data is the equipment which is uploaded to the household electrical appliance equipment by the first user terminal through a first path and is used for sharing or exchanging with other user terminals; for example, the household appliance is an intelligent electric rice cooker, the first user terminal is a mobile phone, and the uploading request information sent by the first user terminal may be understood as that the mobile phone sends a user-defined menu or the like (shared data) to the intelligent electric rice cooker through the first route for sharing with other mobile phones.
And step S102, the household appliance acquires the acquisition request information sent by the second user terminal through a second path.
Here, the WiFI module of the WiFI module in the home appliance device acquires the acquisition request information sent by the second user terminal through the second path. The second user terminal may be a user's cell phone, computer, tablet computer, etc. The obtaining request information is used for obtaining shared data sent by the first user terminal; the obtaining request information at least comprises: a second key; the second path is a path through which the home appliance is connected with the second user terminal point to point through its own AP. For example, the second mobile phone (the second user terminal) sends the acquisition request information for acquiring the shared menu uploaded by the first mobile phone to the smart electric cooker (the household appliance).
Step S103, if the first key matches the second key, the home appliance device sends the shared data to the second user terminal through the second path.
Here, whether the first key matches the second key is determined by a controller of the WiFi module in the home appliance. And the controller of the WiFi module in the household appliance equipment controls the WiFi module to send the shared data to the second user terminal through the second path. For example, the shared data is a user-defined menu uploaded by the first user terminal, and when the first key is matched with the second key, the home appliance device sends the user-defined menu to the second user terminal.
In the embodiment of the invention, firstly, the household appliance equipment acquires the uploading request information sent by a first user terminal through a first path and stores the uploading request information; wherein the upload request information at least includes: sharing data and a first key; the first path is a path for point-to-point connection between the household appliance and the first user terminal through a wireless Access Point (AP) of the household appliance; then, the household appliance equipment acquires acquisition request information sent by the second user terminal through a second path; the obtaining request information is used for obtaining shared data sent by the first user terminal; the obtaining request information at least comprises: a second key; the second path is a path for point-to-point connection between the household appliance and the second user terminal through the AP of the household appliance; finally, if the first secret key is matched with the second secret key, the household appliance equipment sends the shared data to the second user terminal through the second path; so, two user terminals that do not all connect the internet carry out point-to-point connection through the AP of tame electric installation, form AP and directly link the route, and then two user terminals directly link the route through this AP and upload and acquire data, and then make two user terminals, under the condition that does not need the internet, accomplish data exchange.
In another embodiment, before step S101, that is, "the home appliance device obtains the upload request information sent by the first user terminal through the first path, and stores the upload request information", the method further includes:
and step S11, the household appliance receives first AP direct connection request information sent by a first user terminal.
Here, the first AP direct connection request information at least includes: first identification information and a third key; the first identification information may be information that can uniquely identify the home appliance, such as a physical address and a serial number of the home appliance.
Step S12, if the first identification information and the third key satisfy a first preset condition, the home appliance device connects with the first user terminal point-to-point through its own wireless access point AP to obtain a first path.
Step S13, the home appliance receives second AP direct connection request information sent by the second user terminal; wherein the second AP direct connection request information at least includes: second identification information and a fourth key.
Step S14, if the second identification information and the fourth key satisfy a second preset condition, the home appliance device connects with the second user terminal point-to-point through its own AP to obtain a second path.
An embodiment of the present invention provides a data exchange method based on AP direct connection, and fig. 2 is a schematic diagram of an implementation flow of data exchange based on AP direct connection according to another embodiment of the present invention, as shown in fig. 2, the method includes the following steps:
step S201, the first user terminal sends a first AP direct connection request message to the home appliance device.
Here, the first user terminal sends first AP direct connection request information to the home appliance device without networking; the first user terminal sends first AP direct connection request information to a WiFi module in the household appliance device through a channel (such as an STA channel) except the AP channel. The first AP direct connection request information at least includes: first identification information and a third key.
Step S202, if the first identification information and the third secret key meet a first preset condition, the household appliance is connected with the first user terminal in a point-to-point mode through the AP of the household appliance, and a first path is obtained.
Step S203, the second user terminal sends second AP direct connection request information to the home appliance device.
Here, the second user terminal sends second AP direct connection request information to the home appliance device without networking; the second AP direct connection request information at least includes: second identification information and a fourth key.
Step S204, if the second identification information and the fourth secret key meet a second preset condition, the household appliance is connected with the second user terminal in a point-to-point mode through the AP of the household appliance, and a second path is obtained. The third identification information is the same as or different from the second identification information; the third identification information and the second identification information include at least one of: the physical address of the home appliance, the serial number of the home appliance, and the like.
In step S205, the first user terminal sends the upload request information to the home appliance device through the first path.
Here, the upload request information includes at least: the shared data and the first key.
In step S206, the home appliance receives the upload request information, and calculates the number of bytes of the upload request information.
Here, the calculating the number of bytes of the upload request information may be understood as: and the household appliance calculates the byte number of the shared data contained in the uploading request information.
Step S207, if the number of bytes that can be stored in the current storage space of the home appliance is greater than or equal to the number of bytes of the upload request information, storing the upload request information in the storage space.
Here, the current self storage space is a storage space of a storage module of the WiFi module of the home appliance.
And step S208, the second user terminal sends the acquisition request information to the household appliance equipment through the second path.
Here, the acquisition request information includes at least: a second key.
Step S209, if the first key matches the second key, the home appliance device sends the shared data to the second user terminal through the second path.
In this embodiment, through the AP direct-connected connection of household electrical appliances and user terminal to make household electrical appliances and user terminal upload and acquire data at AP direct-connected connection, and then realized on AP direct-connected's route, two user terminals that do not connect with the internet accomplish data exchange, satisfied user terminal under the condition that does not have the router, need data exchange's demand, promoted user experience and felt.
In other embodiments, after step S206, that is, "the home appliance receives the upload request information and calculates the number of bytes of the upload request information", the method further includes:
if the number of bytes which can be stored in the current self storage space is smaller than the number of bytes of the uploading request information, the household appliance equipment sends rejection information to the first user terminal; the rejection information is used for indicating that the household appliance refuses to receive the uploading request information sent by the first user terminal through the first path.
In other embodiments, in step S208, after the second user terminal sends the obtaining request information to the home appliance device through the second path, the method further includes:
and if the first secret key is not matched with the second secret key, the household appliance continuously stores the shared data in the storage space.
An embodiment of the present invention provides a data exchange method based on AP direct connection, and fig. 3 is a schematic diagram of a system structure according to an embodiment of the present invention, and as shown in fig. 3, the system 300 includes three parts: thing networking household electrical appliances 301, WiFI module 302 and user control terminal 303, wherein:
the internet of things household appliance 301 is used for communicating with the user control terminal 303 through the WiFI module 302; the household appliances of the Internet of things can be an intelligent electric cooker, an intelligent refrigerator, an intelligent microwave oven and the like.
The WiFI module 302 includes: controller 321, WiFI module 322, and storage module 323, wherein:
the controller 321 is configured to embed an AP software control module, and after the AP software control module is started, the WiFi module 322 will establish an AP channel. The WiFI module 302 is one module in the internet of things appliance 301.
The controller 321 is further configured to verify the validity of the identity of the user control terminal 303, and if the identity of the user control terminal is legal, control the WiFi module 322 to establish a direct connection with the user control terminal through an AP channel.
Here, the verifying the validity of the identity of the user control terminal 303 is to determine whether AP direct connection request information (including the first AP direct connection request information and the second AP direct connection request information) sent by the user control terminal 303 meets a first preset condition (or a second preset condition). Correspondingly, if the AP direct connection request information (first AP direct connection request information) sent by the user control terminal 303 meets a first preset condition (or second AP direct connection request information sent by other user control terminals meets a second preset condition), it is determined that the identity of the user control terminal 303 has validity.
The controller 321 is further configured to verify whether the ue has the validity of acquiring data for exchange sent by other ues.
Here, the validity of the data for exchange is verified, that is, whether the fourth key in the acquisition request information sent by the user control terminal for acquiring the data for exchange sent by the other user control terminal matches the third key in the upload request information is determined. Correspondingly, if the fourth key in the acquisition request information is matched with the third key in the uploading request information, the user control terminal is determined to have the legality of acquiring the data which are sent by other user control terminals and used for exchanging.
The controller 321 is further configured to temporarily store data for exchange, which is received by the WiFi module 322 and sent by the user control terminal, in a storage space of the WiFi module 322, and if the fourth key in the acquisition request information matches the third key in the upload request information, load the data for exchange, which is temporarily stored in the storage space of the WiFi module 322.
Here, the loading of the data for exchange to the WiFi module 322 is to send the data for exchange uploaded by the user control terminal to another user control terminal, so as to implement data exchange between different user control terminals in an AP direct connection manner. The data for exchange (i.e., shared data) may be contents of a custom menu homemade by a user for an intelligent home appliance (e.g., an intelligent rice cooker).
The WiFi module 322 is configured to perform wireless direct connection bidirectional communication with the user control terminal that has established direct connection through an AP channel, to obtain a path, that is, a first path, directly connected to an AP of the user control terminal (that is, a first user terminal or a second user terminal).
The storage module 323 is configured to temporarily store data sent by the ue to the WiFi module 322 via the first path, where the data is ready to be exchanged with another ue (e.g., a second ue).
The user control terminal 303 is configured to send an AP direct connection request, that is, first AP direct connection request information or second AP direct connection request information, to the WiFi module 322 through another channel (for example, an STA channel); the user control terminal 303 may be an electronic device such as a smart phone, a computer, or a tablet computer with a WiFi function. The user control terminal 303 may be one or more user control terminals, and as shown in fig. 3, the user control terminal 303 may include a user control terminal 1, a user control terminal 2, and a user control terminal 3.
The user control terminal 303, further configured to send data for exchange (i.e., shared data) to the WiFi module 322 through the first path; or, for obtaining the data for exchange from the WiFi module 322 through the second path.
Generally, when two user terminals controlling the household electrical appliance are not connected to the internet, data exchange between the two terminals cannot be realized through the network, but in the embodiment of the present invention, the two user terminals are directly connected to the AP of the household electrical appliance, and data exchange can be completed through the AP direct connection path, as shown in fig. 4A, both the mobile phone 42 and the mobile phone 43 are used for controlling the electric rice cooker 41, and both the mobile phone 42 and the mobile phone 43 are in a state of not being connected to the internet. Under the condition that the mobile phone 42 and the mobile phone 43 are not connected with the internet, the data exchange can be completed through the following steps:
in the first step, the mobile phone 42 (first user terminal) and the mobile phone 43 (second user terminal) respectively send the first AP direct connection request message and the second AP direct connection request message to the electric cooker 41 (home appliance).
In the second step, the electric cooker 41 determines whether the first AP direct connection request information and the second AP direct connection request information satisfy a preset condition. If the first AP direct connection request message and the second AP direct connection request message both satisfy the preset condition, the electric cooker 41 and the mobile phone 42 and the mobile phone 43 establish AP direct connection with the electric cooker through the AP of the electric cooker 41, and obtain a first path and a second path, respectively.
And thirdly, the mobile phone 42 sends the request information to the electric rice cooker 41 through the first path, and the request information is used for uploading the request information which is shared by other mobile phones and contains the user-defined menu (as displayed in an area 44, the user-defined menu comprises fried green vegetables, steamed eggs and the like).
And fourthly, if the byte number of the storage space of the electric cooker is more than or equal to the byte number of the uploaded request information, the electric cooker 41 stores the self-set menu uploaded by the mobile phone 42 in the electric cooker 41.
Fifthly, if the user of the mobile phone 43 wishes to obtain the menu information uploaded by the mobile phone 42, the mobile phone 43 sends an obtaining request message to the electric rice cooker 41 through the second path.
Sixthly, the electric rice cooker 41 judges whether the first key in the uploading request information sent by the mobile phone 42 is matched with the second key in the acquisition request sent by the mobile phone 43, if the first key is matched with the second key, the electric rice cooker 41 sends the self-defined menu uploaded by the mobile phone 42 to the mobile phone 43, and therefore data exchange can be completed even if the mobile phone 42 and the mobile phone 43 are not networked.
Fig. 4B is a schematic diagram of a flow of implementing data exchange based on AP direct connection according to an embodiment of the present invention, and as shown in fig. 4B, the method includes the following steps:
in step S401, the user powers on the home appliance.
Here, the internet of things household appliance is connected with the WiFi module, and the internet of things household appliance is powered on, namely, the WiFi module supplies power.
Step S402, the controller of the WiFi module in the household appliance loads the AP software control module to enable the WiFi module to load the AP channel.
In step S403, the first user control terminal sends the first AP direct connection request information to the WiFi module in the home appliance device through a channel (e.g., an STA channel) other than the AP channel.
Here, the first user terminal sends the first AP direct connection request information to the WiFi module in the home appliance device through a channel (e.g., an STA channel) other than the AP channel without connecting to the internet. As shown in fig. 4A, when both the mobile phone 42 and the mobile phone 43 are unable to connect to the internet, the mobile phone 42 and the mobile phone 43 respectively request the first AP direct connection request information and the second AP direct connection request information from the electric cooker 41.
The first user control terminal (i.e., the first user terminal) may be an electronic device such as a smartphone, a computer, or a tablet computer with a WiFi function; the first AP direct connection request at least comprises: identification information (i.e. first identification information) and a third key of the home device; the identification information may be any information capable of uniquely identifying the home appliance, such as a physical address, a serial number, and the like of the home appliance.
And S404, the household appliance judges whether the AP direct connection request information meets a preset condition or not.
Here, if the AP direct connection request information satisfies a preset condition, the method proceeds to step S405; if the AP direct connection request information does not satisfy the preset condition, step S441 is performed, that is, the household appliance controls the WiFi module to not establish a direct connection with the first user control terminal. The preset condition can be any information capable of uniquely identifying the WiFi module and a preset decryption algorithm. And when the identification information of the household appliance in the first AP direct connection request is the same as the set identification information of the household appliance and the third secret key is matched with a preset decryption algorithm, determining that the first AP direct connection request meets a preset condition. As shown in fig. 4A, the electric cooker 41 determines whether the first AP direct connection request information and the second AP direct connection request information satisfy the preset condition.
Step S405, the household appliance control WiFi module establishes direct connection with the first user control terminal through the AP channel to obtain a first path.
Here, the first path may be understood as a direct connection path established between the mobile phone 42 and the electric cooker 41 in fig. 4A.
Step S406, the first user control terminal sends the upload request information to the household electrical appliance through the first path.
Here, the first user control terminal sends upload request information to a WiFi module of the household appliance through the first path; as shown in fig. 4A, the mobile phone 42 transmits to the electric cooker 41 upload request information including a user-customized menu for sharing with other mobile phones.
Here, the upload request information includes at least: the shared data and the first key. The upload request information may be data uploaded by the first user control terminal (e.g., a mobile phone of a user) for sharing with other user control terminals, such as a customized menu of the smart rice cooker.
Step S407, the home appliance determines whether the size of the current storage space of the home appliance can store the shared data.
Here, if the current own storage space can store the shared data, the step S408 is entered; if the current own storage space cannot store the shared data, the process proceeds to step S409.
Step S408, the controller of the home appliance temporarily stores the shared data in the current storage space of the home appliance.
Here, the sharing data is temporarily stored in the current storage space, and it can be understood that, in fig. 4A, the electric cooker 41 stores the self-defined menu uploaded by the mobile phone 42 in the electric cooker 41.
Step S409, the WiFi module of the household appliance sends rejection information to the first user control terminal.
Here, the rejection information is used to indicate that the WiFi module rejects to receive the upload request information sent by the first user control terminal through the first path.
And step S410, the second user control terminal sends the acquisition request information to the WiFi module of the household appliance through the second path.
Here, in step S410, before the second user control terminal sends the acquisition request information to the WiFi module through the second path, the controller controls the WiFi module to establish a direct connection with the second user control terminal through the AP channel, so as to obtain the second path. As shown in fig. 4A, the second path is a path established by the direct AP connection between the rice cooker 41 and the mobile phone 43.
The obtaining request information at least comprises: a second key. For example, the obtaining request information may be a user-defined menu sent by the second user control terminal (i.e. an electronic device such as a mobile phone) for obtaining the intelligent electric cooker uploaded by the first user control terminal.
In step S411, the controller of the WiFi module in the home appliance determines whether the first key is matched with the second key.
Here, if the first key matches the second key, step S412 is entered; if the first key does not match the second key, the process proceeds to step S413. As shown in fig. 4A, the electric cooker 41 determines whether the first key in the upload request message sent by the mobile phone 42 matches the second key in the acquisition request sent by the mobile phone 43, and if the first key matches the second key, the electric cooker 41 sends the custom menu uploaded by the mobile phone 42 to the mobile phone 43.
Step S412, the home appliance loads the shared data temporarily stored in the current storage space of the home appliance to the WiFi module, and sends the shared data to the second user control terminal through the WiFi module.
In step S413, the home device still stores the shared data in its current storage space.
Here, the saving the shared data in the current own storage space is: storing the shared data in a storage module in a WiFi module of the household appliance; and after the second user control terminal receives the shared data uploaded by the first user control terminal, the data exchange between the first user control terminal and the second user control terminal based on the AP direct connection is realized.
Fig. 5 is a schematic structural diagram of a home appliance device based on AP-direct connection data exchange according to an embodiment of the present invention, and as shown in fig. 5, the home appliance device 500 at least includes: a processor 501 and a storage medium 502 configured to store executable instructions, wherein:
the processor 501 is configured to execute stored executable instructions for implementing the following steps:
the household appliance equipment acquires upload request information sent by a first user terminal through a first path and stores the upload request information; wherein the upload request information at least includes: sharing data and a first key; the first path is a path for point-to-point connection between the household appliance and the first user terminal through a wireless Access Point (AP) of the household appliance;
the household appliance equipment acquires acquisition request information sent by the second user terminal through a second path; the obtaining request information is used for obtaining shared data sent by the first user terminal; the obtaining request information at least comprises: a second key; the second path is a path for point-to-point connection between the household appliance and the second user terminal through the AP of the household appliance;
and if the first secret key is matched with the second secret key, the household appliance equipment sends the shared data to the second user terminal through the second path.
It should be noted that the above description of the server and terminal embodiments is similar to the description of the method embodiments, and has similar beneficial effects to the method embodiments. For technical details not disclosed in the embodiments of the server and the terminal of the present invention, reference is made to the description of the embodiments of the method of the present invention for understanding.
It should be noted that, in the embodiment of the present invention, if the above-mentioned AP direct connection-based data exchange method is implemented in the form of a software functional module, and is sold or used as an independent product, the method may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computing device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present invention provides a computer storage medium, where a computer-executable instruction is stored in the computer storage medium, and the computer-executable instruction is configured to execute the AP direct connection-based data exchange method or the AP direct connection-based data exchange method on the device side provided in the other embodiments of the present invention.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method described in the embodiments of the present invention.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.