Method and device for simultaneously accessing multiple networks, storage medium, and electronic device
By creating a Wi-Fi device shadow in the shadow pool of the mobile terminal, a single WIFI module can access multiple Wi-Fi hotspots at the same time, which solves the problems of high cost, large space occupation and low data transmission efficiency in the existing technology, and improves the efficiency of data transmission. Stability and efficiency of data transmission.
Patent Information
- Application Number
- CN202210828368.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-13
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-07-13
AI Technical Summary
When existing mobile terminals such as mobile phones are connected to multiple Wi-Fi networks at the same time, the cost is high, the motherboard space is occupied, and there is crosstalk, resulting in low data transmission efficiency and stability.
Detect the list of accessible wireless fidelity Wi-Fi hotspots through the WIFI module, select at least two target Wi-Fi hotspots, create a device shadow in the shadow pool of the user terminal, and use the shadow pool to access multiple Wi-Fi at the same time Hotspot enables a single WIFI module to access multiple networks at the same time.
It improves data transmission efficiency and stability of terminal data transmission, reduces cost and space occupation, and avoids crosstalk problems.
Smart Images

Figure CN115396987B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a method and device for simultaneously accessing multiple networks, a storage medium, and an electronic device. Background Art
[0002] In the related technology, mobile terminals such as mobile phones generally have Wi-Fi (Wireless Fidelity) Internet access function, so Wi-Fi speed is crucial to the user experience, and there are many factors that affect the Wi-Fi speed, such as the bandwidth of the WAN port, the power of the router, the signal strength, etc.
[0003] In the related art, in order to make the mobile phone's WIFI signal better, users are generally asked to get as close to the router as possible, or choose a router with greater power and penetration ability. However, this also limits the use environment and cost of Wi-Fi. In some cases, the mobile phone can access two routers at the same time by setting up two Wi-Fi modules, but setting up two Wi-Fi modules affects the cost of the mobile phone and the motherboard space. Since the two Wi-Fi modules communicate with the router in their own frequency bands, it also brings crosstalk to the mobile phone communication, and wastes wireless communication resources and hardware resources.
[0004] With respect to the above-mentioned problems existing in the related technologies, no effective solutions have been found so far. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for simultaneously accessing multiple networks, a storage medium, and an electronic device.
[0006] According to one aspect of an embodiment of the present invention, a method for simultaneously accessing multiple networks is provided, comprising: using a WIFI module to detect a list of accessible wireless fidelity WIFI hotspots; selecting at least two target WIFI hotspots, wherein the WIFI hotspot list includes the target WIFI hotspots; creating device shadows of the at least two target WIFI hotspots in a shadow pool of a user terminal, wherein the shadow pool is connected to the WIFI module; and using the shadow pool to simultaneously access the at least two target WIFI hotspots.
[0007] According to another aspect of an embodiment of the present invention, a device for simultaneously accessing multiple networks is provided, including: a detection module, used to use a WIFI module to detect a list of accessible wireless fidelity WIFI hotspots; a selection module, used to select at least two target WIFI hotspots, wherein the WIFI hotspot list includes the target WIFI hotspots; a creation module, used to create device shadows of the at least two target WIFI hotspots in a shadow pool of a user terminal, wherein the shadow pool is connected to the WIFI module; and an access module, used to use the shadow pool to simultaneously access the at least two target WIFI hotspots.
[0008] According to another aspect of an embodiment of the present invention, a storage medium is further provided. The storage medium includes a stored program. When the program is run, the above steps are executed.
[0009] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.
[0010] The embodiment of the present invention also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0011] Through the present invention, a WIFI module is used to detect an accessible wireless fidelity WIFI hotspot list, and at least two target WIFI hotspots are selected, wherein the WIFI hotspot list includes the target WIFI hotspot, and device shadows of at least two target WIFI hotspots are created in a shadow pool of a user terminal, wherein the shadow pool is connected to the WIFI module, and the shadow pool is used to simultaneously access two target WIFI hotspots. By creating device shadows of at least two target WIFI hotspots in the shadow pool, and simultaneously accessing at least two target WIFI hotspots using the shadow pool, it is achieved that a single WIFI module is used on the user terminal to simultaneously access multiple WIFI hotspots, and the technical problem that the WIFI module of the user terminal can only access one WIFI hotspot in the related art is solved, the data transmission efficiency is improved, and the stability of terminal data transmission is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0013] Figure 1 is a hardware structure block diagram of a mobile phone according to an embodiment of the present invention;
[0014] Figure 2 is a flow chart of a method for simultaneously accessing multiple networks according to an embodiment of the present invention;
[0015] Figure 3 is a schematic diagram of selecting a target WIFI hotspot based on a moving trajectory according to an embodiment of the present invention;
[0016] Figure 4 is an interaction diagram of a user terminal using DHCP to access a router according to an embodiment of the present invention;
[0017] Figure 5 is a structural block diagram of a device for simultaneously accessing multiple networks according to an embodiment of the present invention;
[0018] Figure 6 It is a structural block diagram of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] Example 1
[0022] The method embodiment provided in the first embodiment of the present invention can be executed in a wireless network card, a mobile phone, a tablet, a WIFI chip, a processor or a similar computing device. Taking running on a mobile phone as an example, Figure 1 FIG. 1 is a hardware structure diagram of a mobile phone according to an embodiment of the present invention. Figure 1 As shown, the mobile phone may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the mobile phone may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the mobile phone. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0023] The memory 104 can be used to store mobile phone programs, for example, software programs and modules of application software, such as a mobile phone program corresponding to a method for simultaneously accessing multiple networks in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the mobile phone program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile phone via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile phone. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0025] In this embodiment, a method for simultaneously accessing multiple networks is provided. Figure 2 is a flow chart of a method for simultaneously accessing multiple networks according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0026] Step S202, using the WIFI module to detect a list of accessible wireless fidelity WIFI hotspots;
[0027] In this embodiment, the WIFI module detects all channels by wireless detection, and can search for nearby accessible WIFI hotspots to form a WIFI hotspot list.
[0028] Step S204, selecting at least two target WIFI hotspots, wherein the WIFI hotspot list includes the target WIFI hotspots;
[0029] In this embodiment, two or more target WIFI hotspots may be selected as WIFI hotspots to be accessed by the user terminal.
[0030] Step S206, creating device shadows of at least two target WIFI hotspots in the shadow pool of the user terminal, wherein the shadow pool is connected to the WIFI module;
[0031] The WiFi module of this embodiment is applied in the transmission layer of the Internet of Things, and is a set of integrated WiFi chips, code programs, and basic circuits. The function of this module is to convert the serial port or TTL level into an embedded module that meets the WiFi wireless network communication standard, with built-in wireless network protocol IEEE802.11b.gn and other protocol stacks and TCP / IP protocol stacks. The serial port WiFi module provides parameters for setting the working channel. Under the condition that the channel of the target network is known, the working channel of the module can be directly specified, thereby achieving the purpose of accelerating the networking speed.
[0032] The user terminal of this embodiment can be configured with one WIFI module or multiple WIFI modules. When multiple WIFI modules are configured, they can be WIFI modules of different frequency bands, such as 2.4GHz (2.4GHz-2.4835GHz) and 5GHz (5.170GHz-5.850GHz). One of the WIFI modules can be used to access two WIFI hotspots at the same time. When the user terminal is configured with only one WIFI module, in order to realize data interaction between the WIFI module and at least two routers at the same time, after connecting to the router, the channels of multiple target WIFI hotspots can be unified, or the WIFI module can perform channel time-division switching when exchanging data with routers of different channels, and the number of time-division channels is the same as the number of accessed WIFI hotspots.
[0033] Step S208: Use the shadow pool to access at least two target WIFI hotspots simultaneously.
[0034] Through the shadow pool, the WIFI module of the user terminal can be controlled to access two or more target WIFI hotspots at the same time, and exchange data with multiple routers.
[0035] Through the above steps, a WIFI module is used to detect an accessible wireless fidelity WIFI hotspot list, and at least two target WIFI hotspots are selected, wherein the WIFI hotspot list includes the target WIFI hotspot, and device shadows of at least two target WIFI hotspots are created in a shadow pool of the user terminal, wherein the shadow pool is connected to the WIFI module, and the shadow pool is used to simultaneously access two target WIFI hotspots. By creating device shadows of at least two target WIFI hotspots in the shadow pool, and simultaneously accessing at least two target WIFI hotspots using the shadow pool, it is achieved that a single WIFI module is used on the user terminal to simultaneously access multiple WIFI hotspots, which solves the technical problem in the related art that the WIFI module of the user terminal can only access one WIFI hotspot, improves the data transmission efficiency, and improves the stability of terminal data transmission.
[0036] In one implementation scenario of the embodiment, selecting at least two target WIFI hotspots includes: responding to a user selection instruction of a WIFI hotspot, selecting a first target WIFI hotspot in a WIFI hotspot list; scanning the WIFI hotspot list, reading the signal strength value of each WIFI hotspot in the WIFI hotspot list, and selecting a second target WIFI hotspot with the highest signal strength value in the WIFI hotspot list.
[0037] In this implementation scenario, the user first manually selects a desired WIFI hotspot, and then automatically selects a WIFI hotspot with the highest signal strength value based on the signal strength. In some examples, a second target WIFI hotspot with the best signal stability can also be selected from the WIFI hotspot list. The signal stability of this embodiment can be obtained by weighted calculation using parameters such as SNR (SIGNAL NOISERATIO), RSRP (Reference Signal Receiving Power), and RSRQ (Reference Signal Receiving Quality), thereby improving the stability of the WIFI of the user terminal.
[0038] In another implementation scenario of the embodiment, selecting at least two target WIFI hotspots includes:
[0039] S11, detecting hotspot access instructions;
[0040] S12, creating a spatial coordinate system, locating the terminal coordinate position of the user terminal in the spatial coordinate system, and locating the hotspot coordinate position of each WIFI hotspot in the WIFI hotspot list in the spatial coordinate system;
[0041] S13: Select a third target WIFI hotspot and a fourth target WIFI hotspot in the WIFI hotspot list according to the terminal coordinate position and the hotspot coordinate position.
[0042] In one example, selecting a third target WIFI hotspot and a fourth target WIFI hotspot in a WIFI hotspot list according to a terminal coordinate position and a hotspot coordinate position includes: obtaining a historical movement trajectory of a user terminal; extending the historical movement trajectory to generate a target movement trajectory of the user terminal; taking the terminal coordinate position as a segmentation point of the target movement trajectory, dividing the WIFI hotspot list into a first WIFI hotspot area and a second WIFI hotspot area along a direction perpendicular to the target movement trajectory, wherein the first WIFI hotspot area is distributed in a to-be-residence area of the target movement trajectory, and the second WIFI hotspot area is distributed in a historical residence area of the target movement trajectory; selecting a third target WIFI hotspot in the first WIFI hotspot area, and selecting a fourth target WIFI hotspot in the second WIFI hotspot area.
[0043] Figure 3 The present invention is a schematic diagram of selecting a target WIFI hotspot based on a moving trajectory according to an embodiment of the present invention. The square points represent WIFI hotspots in a first WIFI hotspot area, and the circular points represent WIFI hotspots in a second WIFI hotspot area. By selecting WIFI hotspots distributed in two WIFI hotspot areas, at least one WIFI hotspot can be connected to the mobile terminal when the user terminal is constantly stationary and changes position, thereby ensuring a continuous connection between the WIFI hotspot and the mobile terminal.
[0044] In another example, selecting a third target WIFI hotspot and a fourth target WIFI hotspot in a WIFI hotspot list according to the terminal coordinate position and the hotspot coordinate position includes: selecting a WIFI hotspot list with the terminal coordinate position as the center position and the initial length as the circle selection radius; counting the number of WIFI hotspots in the circled area, and if the number of hotspots is less than a preset threshold, continuing to perform the following steps until the number of hotspots in the circled area reaches the preset threshold or the circle selection radius reaches the maximum radius, and obtaining a maximum circled area: increasing the initial length according to a preset step size, and continuing to circle the WIFI hotspot list with the adjusted circle selection radius, and counting the number of WIFI hotspots in the current circled area; calculating the Euclidean distance between each pair of WIFI hotspots in the maximum circled area; and determining a pair of WIFI hotspots with the largest Euclidean distance as the third target WIFI hotspot and the fourth target WIFI hotspot.
[0045] In this embodiment, the maximum radius is less than the radio frequency radius of the WIFI module of the user terminal, and the preset threshold is greater than or equal to 3. By calculating the Euclidean distance between each pair of WIFI hotspots and selecting a pair of WIFI hotspots with the largest Euclidean distance, the dispersion of WIFI hotspots can be improved, and then two WIFI hotspots that are as dispersed as possible are selected in the WIFI hotspot list, thereby improving the stability of the WIFI signal when the user terminal moves.
[0046] In some scenarios, the user carries the user terminal and moves in real time, and the list of WIFI hotspots detected by the WIFI module will also be updated in real time. In this case, the third target WIFI hotspot and the fourth target WIFI hotspot can also be updated according to the real-time coordinate position of the user terminal and the real-time updated WIFI hotspot list. After selecting the third target WIFI hotspot and the fourth target WIFI hotspot in the WIFI hotspot list according to the terminal coordinate position and the hotspot coordinate position, it also includes: monitoring the motion state of the user terminal; if the user terminal is in a moving state, updating the terminal coordinate position of the user terminal and updating the WIFI hotspot list; updating the third target WIFI hotspot and the fourth target WIFI hotspot in the updated WIFI hotspot list based on the updated terminal coordinate position.
[0047] In one implementation of the present embodiment, at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and creating device shadows of at least two target WIFI hotspots in the shadow pool of the user terminal includes: obtaining first attribute information of the first WIFI hotspot, and obtaining second attribute information of the second WIFI hotspot; using the first attribute information and the second attribute information to respectively create a first device shadow and a second device shadow in the shadow pool of the user terminal; creating a first process and a second process for the first device shadow and the second device shadow, respectively; determining the main process running in the shadow pool on the user terminal, and configuring the first process and the second process as sub-processes of the main process, respectively.
[0048] Optionally, the device attribute may be a device type, a regional location, a network topology attribute, etc. When creating a shadow template of a device shadow (a first device shadow and a second device shadow), multiple virtual attributes are configured in the shadow template, which may be configured in desired and reported, and each attribute field is used to carry the unpacked routing data.
[0049] In some examples, at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and using a shadow pool to simultaneously access the two target WIFI hotspots includes: constructing a first virtual Dynamic Host Configuration Protocol DHCP module and a second virtual DHCP module in the shadow pool, and assigning a first virtual MAC address and a second virtual MAC address to the first virtual DHCP module and the second virtual DHCP module, respectively; binding the first virtual DHCP module to a first device shadow in the shadow pool, and binding the second virtual DHCP module to a second device shadow in the shadow pool, wherein the first device shadow corresponds to the first WIFI hotspot and the second device shadow corresponds to the second WIFI hotspot; sending a first DHCP discovery message and a second DHCP discovery message to a first router corresponding to the first WIFI hotspot and a second router corresponding to the second WIFI hotspot, respectively, wherein the first DHCP discovery message carries the first virtual MAC address and the second DHCP discovery message carries the second virtual MAC address; receiving a first routing address returned by the first router based on the first DHCP discovery message, and receiving a second routing address returned by the second router based on the second DHCP discovery message; controlling the first device shadow to access the first router using the first routing address, and controlling the second device shadow to access the second router simultaneously using the second routing address.
[0050] Optionally, after the router sends the DHCP discover message, it receives a DHCP offer message (DHCPoffer) returned by the router. The DHCP offer message carries the IP address information, subnet mask information, and routing addresses such as the DNS (Domain Name System) server assigned by the router. Then, the user terminal continues to use the above routing address to send a DHCP selection message (DHCP Request) to the router. Finally, the router returns a DHCP confirmation message (DHCPACK) to the user terminal, and the access is completed. Since this embodiment virtualizes two DHCP modules in a user terminal, there are two MAC addresses, corresponding to the first router and the second router respectively. Finally, the user terminal obtains the first routing address and the second routing address corresponding to the two routers, and can access the first router and the second router at the same time. Figure 4 It is an interaction diagram of a user terminal using DHCP to access a router according to an embodiment of the present invention.
[0051] Optionally, at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot. After simultaneously accessing the two target WIFI hotspots using the shadow pool, the method further includes: configuring the first router as the first entity device of the first device shadow, and configuring the second router as the second entity device of the second device shadow, wherein the first router corresponds to the first WIFI hotspot and the second router corresponds to the second WIFI hotspot; issuing a real-time synchronization policy to the first device shadow and the first entity device, and issuing a real-time synchronization policy to the second device shadow and the second entity device; obtaining a first uplink message and a second uplink message of the user terminal (the uplink message is a message sent from the user terminal to the router, and the downlink message is a message sent from the router to the user terminal); issuing the first uplink message and the second uplink message to the first device shadow and the second device shadow, respectively, so that the first device shadow synchronizes the first uplink message to the first router, and the second device shadow synchronizes the second uplink message to the second router; receiving a first downlink message synchronized by the first device shadow from the first router, and receiving a second downlink message synchronized by the second device shadow from the second router.
[0052] In this embodiment, in order to ensure that the data transmitted by the two WIFI hotspots will not be confused, a data pool is configured in the shadow pool. When the user terminal sends the first uplink message and the second uplink message, a message identifier is configured for the first uplink message and the second uplink message, such as "service 1" and "service 2". The message identifier exists in the data pool. The shadow pool synchronizes the first uplink message to the first router through the shadow of the first device, and synchronizes the second uplink message to the second router through the shadow of the second device. When the first router receives the response message to the first uplink message, that is, the first downlink message, the message identifier is added to the first downlink message. All downlink messages are synchronized to the data pool. The data pool matches and searches through the message identifier, finds the first downlink message of "service 1" and forwards it to the application that sends the first uplink message.
[0053] In this embodiment, the device shadow (such as the first device shadow and the second device shadow) maintains a long connection with the physical device (such as the first physical device and the second physical device). When the device shadow transmits keep-alive messages between the corresponding physical devices, the cycle time of the keep-alive messages can be staggered. For example, the first device shadow sends a first keep-alive message to the first physical device at time t0+nT, and the second device shadow sends a second keep-alive message to the second physical device at time t1+nT, wherein the difference between t1 and t0 is less than T, and n is an integer corresponding to the nth sending cycle, such as T=2S, t1=1S, and t0=0S, which can ensure that the same user terminal establishes a long connection and keeps it alive with two routers at the same time.
[0054] In one example, at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and using a shadow pool to simultaneously access the two target WIFI hotspots includes: determining a first target process of a first target program and a second target process of a second target program currently executing data transmission on a user terminal; constructing a first data channel between the first target process and a first subprocess of a main process of the shadow pool, and constructing a second data channel between the second target process and a second subprocess of the main process of the shadow pool, the main process includes a first subprocess and a second subprocess, the first subprocess corresponds to a first WIFI hotspot, and the second subprocess corresponds to a second WIFI hotspot.
[0055] Since the shadow pool is the main process, when the user terminal needs to transmit data with the router, the shadow pool creates multiple sub-processes and randomly distributes or matches them based on the tasks (corresponding to the target program) to build a data channel between the target process and the sub-process.
[0056] In general, when a user terminal transmits data with a single router, if the signal strength of the WIFI hotspot is lower than a first preset threshold (such as -50dBm), the user terminal cannot guarantee normal decoding and will automatically discard or delete low-quality data packets. However, using the solution of this embodiment, the user terminal transmits data with multiple routers. If the first WIFI hotspot and the second WIFI hotspot transmit data packets of the same task, when it is determined that the signal strengths of the first WIFI hotspot and the second WIFI hotspot are both lower than the first preset threshold, the first data packet transmitted by the first WIFI hotspot and the second data packet transmitted by the second WIFI hotspot can be fused and then decoded to improve the quality of data transmission and reduce the packet loss rate. If the signal strength of the first WIFI hotspot is higher than the first preset threshold and the signal strength of the second WIFI hotspot is lower than the first preset threshold, the second data packet transmitted by the second WIFI hotspot can be directly discarded to reduce the pressure on the decoding chip. In order to improve the data transmission efficiency of dual WIFI and ensure the success rate of data transmission, in this embodiment, when the signal heights of the first WIFI hotspot and the second WIFI hotspot are both higher than the second preset threshold, the shadow pool allocates data packets of different tasks to the first WIFI hotspot and the second WIFI hotspot, such as respectively allocating "WeChat" and "Tik Tok". The first WIFI hotspot transmits data packets of "WeChat", and the second WIFI hotspot transmits data packets of "Tik Tok". When the signal heights of the first WIFI hotspot and the second WIFI hotspot are both lower than the second preset threshold, the shadow pool allocates data packets of the same task to the first WIFI hotspot and the second WIFI hotspot.
[0057] In another example, at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and using a shadow pool to simultaneously access the two target WIFI hotspots includes: determining a target process of a target program currently executing data transmission on a user terminal; building a data channel between the target process and a main process of the shadow pool, the main process including a first sub-process and a second sub-process, the first sub-process corresponding to the first WIFI hotspot, and the second sub-process corresponding to the second WIFI hotspot.
[0058] In this example, two WIFI hotspots are responsible for transmitting data for the same target program.
[0059] In one implementation, dual wifi access and data transmission are implemented through TDLS (Tunneled Direct Link Setup).
[0060] After selecting at least two target WIFI hotspots, the method further includes: establishing a TDLS session between the first router and the second router with the user terminal as the access node; sending configuration instructions to the first router and the second router, wherein the configuration instructions are used to indicate that the first router is a TDLS master node; obtaining a third uplink message to be sent by the user terminal, sending the third uplink message and a TDLS coordination instruction to the first router, wherein the TDLS coordination instruction is used to instruct the first router to synchronize the third uplink message to the second router; receiving a third downlink message uploaded by the first router, wherein the third downlink message includes a first message obtained by the first router from the first network server and a second message obtained by the second router from the second network server.
[0061] In one example, establishing a TDLS session between a first router and a second router with a user terminal as an access node includes: sending a channel direct link establishment TDLS request to the first router; receiving a TDLS discovery request returned by the first router based on the TDLS request; forwarding the TDLS discovery request to the second router; receiving a TDLS establishment response fed back by the second router based on the TDLS discovery request; forwarding the TDLS establishment response to the first router; receiving a TDLS establishment request returned by the first router based on the TDLS establishment response; forwarding the TDLS establishment request to the second router; receiving a TDLS establishment confirmation fed back by the second router based on the TDLS establishment request, and determining that a TDLS session has been established between the first router and the second router.
[0062] Optionally, the TDLS master node can also be configured as a second router. When selecting the TDLS master node, it can be selected based on the distance between each wifi node and the user terminal. The router closest to the user terminal is selected from the first router and the second router as the TDLS master node.
[0063] After receiving the third uplink message, the TDLS master node (first router) synchronizes it to the TDLS slave node (second router) through the TDLS session. If the third uplink message includes multiple service requests, the multiple service requests can be split and some of the service requests can be synchronized to the second router. The first router itself processes the remaining service requests, thereby improving the service processing capability. After obtaining the service data, the second router sends it to the first router through the TDLS session synchronization. The first router locally integrates the service data obtained by the second router and the service data obtained by itself, and then uploads it to the user terminal, thereby ensuring the consistency of the service requests when multiple routers process service requests at the same time and preventing data confusion.
[0064] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0065] Example 2
[0066] In the present embodiment, a device for simultaneously accessing multiple networks is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0067] Figure 5 is a structural block diagram of a device for simultaneously accessing multiple networks according to an embodiment of the present invention, such as Figure 5 As shown, the device includes: a detection module 50, a selection module 52, a creation module 54, and an access module 56, wherein:
[0068] A detection module 50, used to detect a list of accessible wireless fidelity WIFI hotspots using a WIFI module;
[0069] A selection module 52, configured to select at least two target WIFI hotspots, wherein the WIFI hotspot list includes the target WIFI hotspots;
[0070] A creation module 54, configured to create device shadows of the at least two target WIFI hotspots in a shadow pool of a user terminal, wherein the shadow pool is connected to the WIFI module;
[0071] The access module 56 is used to use the shadow pool to simultaneously access the at least two target WIFI hotspots.
[0072] Optionally, the selection module includes: a detection unit, used to detect a hotspot access instruction; a positioning unit, used to create a spatial coordinate system, locate the terminal coordinate position of the user terminal in the spatial coordinate system, and locate the hotspot coordinate position of each WIFI hotspot in the WIFI hotspot list in the spatial coordinate system; a selection unit, used to select a third target WIFI hotspot and a fourth target WIFI hotspot in the WIFI hotspot list according to the terminal coordinate position and the hotspot coordinate position.
[0073] Optionally, the selection unit includes: an acquisition subunit, used to acquire a historical movement trajectory of the user terminal; a generation subunit, used to extend the historical movement trajectory and generate a target movement trajectory of the user terminal; a division subunit, used to divide the WIFI hotspot list into a first WIFI hotspot area and a second WIFI hotspot area along a direction perpendicular to the target movement trajectory with the terminal coordinate position as the division point of the target movement trajectory, wherein the first WIFI hotspot area is distributed in a to-be-residence area of the target movement trajectory, and the second WIFI hotspot area is distributed in a historical residence area of the target movement trajectory; a selection subunit, used to select a third target WIFI hotspot in the first WIFI hotspot area, and select a fourth target WIFI hotspot in the second WIFI hotspot area.
[0074] Optionally, the selection unit includes: a selection subunit, used to select the WIFI hotspot list with the terminal coordinate position as the center position and the initial length as the selection radius; a processing subunit, used to count the number of WIFI hotspots in the selected area, if the number of hotspots is less than a preset threshold, continue to perform the following steps until the number of hotspots in the selected area reaches the preset threshold or the selection radius reaches the maximum radius, and obtain the maximum selected area: increase the initial length according to a preset step size, and continue to select the WIFI hotspot list with the adjusted selection radius, and count the number of WIFI hotspots in the current selected area; a calculation subunit, used to calculate the Euclidean distance between each pair of WIFI hotspots in the maximum selected area; a determination subunit, used to determine a pair of WIFI hotspots with the largest Euclidean distance as the third target WIFI hotspot and the fourth target WIFI hotspot.
[0075] Optionally, the at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and the creation module includes: an acquisition unit, used to acquire first attribute information of the first WIFI hotspot, and acquire second attribute information of the second WIFI hotspot; a first creation unit, used to use the first attribute information and the second attribute information to respectively create a first device shadow and a second device shadow in the shadow pool of the user terminal; a second creation unit, used to respectively create a first process and a second process for the first device shadow and the second device shadow; a configuration unit, used to determine the main process of the shadow pool running on the user terminal, and configure the first process and the second process as sub-processes of the main process, respectively.
[0076] Optionally, the at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and the access module includes: a construction unit, used to construct a first virtual Dynamic Host Configuration Protocol DHCP module and a second virtual DHCP module in the shadow pool, and assign a first virtual MAC address and a second virtual MAC address to the first virtual DHCP module and the second virtual DHCP module, respectively; a binding unit, used to bind the first virtual DHCP module to the first device shadow in the shadow pool, and bind the second virtual DHCP module to the second device shadow in the shadow pool, wherein the first device shadow corresponds to the first WIFI hotspot, and the second device shadow corresponds to the second WIFI hotspot; a sending unit, used to send a first DHCP discovery message and a second DHCP discovery message to a first router corresponding to the first WIFI hotspot and a second router corresponding to the second WIFI hotspot, respectively, wherein the first DHCP discovery message carries the first virtual MAC address, and the second DHCP discovery message carries the second virtual MAC address; a receiving unit, used to receive a first routing address returned by the first router based on the first DHCP discovery message, and receive a second routing address returned by the second router based on the second DHCP discovery message; a control unit, used to control the first device shadow to access the first router using the first routing address, and control the second device shadow to access the second router simultaneously using the second routing address.
[0077] Optionally, the at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and the device further includes: a configuration module, which is used to configure the first router as the first entity device of the first device shadow and the second router as the second entity device of the second device shadow after the access module uses the shadow pool to simultaneously access the at least two target WIFI hotspots, wherein the first router corresponds to the first WIFI hotspot and the second router corresponds to the second WIFI hotspot; a first sending module, which is used to send a real-time synchronization policy to the first device shadow and the first entity device, and to send a real-time synchronization policy to the second device shadow and the second entity device; an acquisition module, which is used to acquire a first uplink message and a second uplink message of the user terminal; a first synchronization module, which is used to send the first uplink message and the second uplink message to the first device shadow and the second device shadow respectively, so that the first device shadow synchronizes the first uplink message to the first router, and the second device shadow synchronizes the second uplink message to the second router; a second synchronization module, which is used to receive a first downlink message synchronized by the first device shadow from the first router, and receive a second downlink message synchronized by the second device shadow from the second router.
[0078] Optionally, the at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and the access module includes: a determination unit, used to determine a first target process of a first target program and a second target process of a second target program currently executing data transmission on the user terminal; a construction unit, used to construct a first data channel between the first target process and a first subprocess of the main process of the shadow pool, and to construct a second data channel between the second target process and a second subprocess of the main process of the shadow pool, the main process includes the first subprocess and the second subprocess, the first subprocess corresponds to the first WIFI hotspot, and the second subprocess corresponds to the second WIFI hotspot.
[0079] Optionally, the device also includes: an establishment module, used to establish a TDLS session between the first router and the second router with the user terminal as the access node after the selection module selects at least two target WIFI hotspots, wherein the at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, corresponding to the first router and the second router respectively; a second sending module, used to send configuration instructions to the first router and the second router, wherein the configuration instructions are used to indicate that the first router is a TDLS master node; a processing module, used to obtain a third uplink message to be sent by the user terminal, and send the third uplink message and a TDLS coordination instruction to the first router, wherein the TDLS coordination instruction is used to instruct the first router to synchronize the third uplink message to the second router through the TDLS session; a receiving module, used to receive a third downlink message uploaded by the first router, wherein the third downlink message includes a first message obtained by the first router from the first network server and a second message obtained by the second router from the second network server
[0080] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0081] Example 3
[0082] The embodiment of the present application also provides an electronic device, Figure 6 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 6 As shown, it includes a processor 61, a communication interface 62, a memory 63 and a communication bus 64, wherein the processor 61, the communication interface 62, and the memory 63 complete mutual communication through the communication bus 64, and the memory 63 is used to store computer programs; the processor 61 is used to execute the program stored in the memory 63 to implement the following steps: using a WIFI module to detect an accessible wireless fidelity WIFI hotspot list; selecting at least two target WIFI hotspots, wherein the WIFI hotspot list includes the target WIFI hotspot; creating device shadows of the at least two target WIFI hotspots in a shadow pool of the user terminal, wherein the shadow pool is connected to the WIFI module; using the shadow pool to simultaneously access the at least two target WIFI hotspots.
[0083] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0084] The communication interface is used for communication between the above terminal and other devices.
[0085] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0086] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0087] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes the method for simultaneously accessing multiple networks described in any one of the above embodiments.
[0088] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the method for simultaneously accessing multiple networks described in any one of the above embodiments.
[0089] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0090] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
[0091] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for simultaneously accessing multiple networks, characterized in that: include: Use the WIFI module to detect the list of accessible wireless fidelity WIFI hotspots; Select at least two target WIFI hotspots, wherein the WIFI hotspot list includes the target WIFI hotspots; Creating device shadows of the at least two target WIFI hotspots in a shadow pool of the user terminal, wherein the shadow pool is connected to the WIFI module; Using the shadow pool to access the at least two target WIFI hotspots simultaneously; Among them, selecting at least two target WIFI hotspots includes: detecting a hotspot access instruction; creating a spatial coordinate system, locating the terminal coordinate position of the user terminal in the spatial coordinate system, and locating the hotspot coordinate position of each WIFI hotspot in the WIFI hotspot list in the spatial coordinate system; selecting a third target WIFI hotspot and a fourth target WIFI hotspot in the WIFI hotspot list according to the terminal coordinate position and the hotspot coordinate position; Wherein, selecting a third target WIFI hotspot and a fourth target WIFI hotspot in the WIFI hotspot list according to the terminal coordinate position and the hotspot coordinate position includes: acquiring a historical movement trajectory of the user terminal; extending the historical movement trajectory to generate a target movement trajectory of the user terminal; taking the terminal coordinate position as a segmentation point of the target movement trajectory, dividing the WIFI hotspot list into a first WIFI hotspot area and a second WIFI hotspot area in a direction perpendicular to the target movement trajectory, wherein the first WIFI hotspot area is distributed in a to-be-residence area of the target movement trajectory, and the second WIFI hotspot area is distributed in a historical residence area of the target movement trajectory; selecting a third target WIFI hotspot in the first WIFI hotspot area, and selecting a third target WIFI hotspot in the second WIFI hotspot area. FI hotspot area; or, taking the terminal coordinate position as the center position and the initial length as the circle selection radius, circle the WIFI hotspot list; count the number of WIFI hotspots in the circled area, if the number of hotspots is less than a preset threshold, continue to perform the following steps until the number of hotspots in the circled area reaches the preset threshold or the circle selection radius reaches the maximum radius, and obtain the maximum circled area: increase the initial length according to the preset step size, and continue to circle the WIFI hotspot list with the adjusted circle selection radius, and count the number of WIFI hotspots in the current circled area; calculate the Euclidean distance between each pair of WIFI hotspots in the maximum circled area; determine the pair of WIFI hotspots with the largest Euclidean distance as the third target WIFI hotspot and the fourth target WIFI hotspot.
2. The method according to claim 1, characterized in that The at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and creating device shadows of the at least two target WIFI hotspots in the shadow pool of the user terminal includes: Acquire first attribute information of the first WIFI hotspot, and acquire second attribute information of the second WIFI hotspot; Using the first attribute information and the second attribute information to create a first device shadow and a second device shadow in a shadow pool of a user terminal respectively; Creating a first process and a second process for the first device shadow and the second device shadow, respectively; A main process of the shadow pool running on the user terminal is determined, and the first process and the second process are respectively configured as subprocesses of the main process.
3. The method according to claim 1, characterized in that The at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, and using the shadow pool to simultaneously access the at least two target WIFI hotspots includes: Constructing a first virtual Dynamic Host Configuration Protocol DHCP module and a second virtual DHCP module in the shadow pool, and assigning a first virtual MAC address and a second virtual MAC address to the first virtual DHCP module and the second virtual DHCP module respectively; Bind the first virtual DHCP module to the first device shadow in the shadow pool, and bind the second virtual DHCP module to the second device shadow in the shadow pool, wherein the first device shadow corresponds to the first WIFI hotspot, and the second device shadow corresponds to the second WIFI hotspot; Sending a first DHCP discovery message and a second DHCP discovery message to a first router corresponding to the first WIFI hotspot and a second router corresponding to the second WIFI hotspot, respectively, wherein the first DHCP discovery message carries the first virtual MAC address, and the second DHCP discovery message carries the second virtual MAC address; receiving a first routing address returned by the first router based on the first DHCP discover message, and receiving a second routing address returned by the second router based on the second DHCP discover message; Control the first device shadow to access the first router using the first routing address, and control the second device shadow to access the second router at the same time using the second routing address.
4. The method according to claim 1, characterized in that: The at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot. After simultaneously accessing the at least two target WIFI hotspots using the shadow pool, the method further includes: Configure the first router as a first physical device of the first device shadow, and configure the second router as a second physical device of the second device shadow, wherein the first router corresponds to the first WIFI hotspot, and the second router corresponds to the second WIFI hotspot; Sending a real-time synchronization policy to the first device shadow and the first physical device, and sending a real-time synchronization policy to the second device shadow and the second physical device; Acquire a first uplink message and a second uplink message of the user terminal; Sending the first uplink message and the second uplink message to the first device shadow and the second device shadow respectively, so that the first device shadow synchronizes the first uplink message to the first router, and the second device shadow synchronizes the second uplink message to the second router; Receive a first downlink message synchronized by the first device shadow from the first router, and receive a second downlink message synchronized by the second device shadow from the second router.
5. The method according to claim 1, characterized in that After selecting at least two target WIFI hotspots, the method further includes: Establishing a TDLS session between the first router and the second router with the user terminal as the access node, wherein the at least two target WIFI hotspots include a first WIFI hotspot and a second WIFI hotspot, which correspond to the first router and the second router respectively; Sending a configuration instruction to the first router and the second router, wherein the configuration instruction is used to indicate that the first router is a TDLS master node; Acquire a third uplink message to be sent by the user terminal, and send the third uplink message and a TDLS coordination instruction to the first router, where the TDLS coordination instruction is used to instruct the first router to synchronize the third uplink message to the second router through the TDLS session; A third downlink message uploaded by the first router is received, wherein the third downlink message includes a first message obtained by the first router from a first network server and a second message obtained by the second router from a second network server.
6. A device for simultaneously accessing multiple networks, characterized in that: include: A detection module, used to detect a list of accessible wireless fidelity WIFI hotspots using a WIFI module; A selection module, configured to select at least two target WIFI hotspots, wherein the WIFI hotspot list includes the target WIFI hotspots; A creation module, used to create device shadows of the at least two target WIFI hotspots in a shadow pool of a user terminal, wherein the shadow pool is connected to the WIFI module; An access module, used to simultaneously access the at least two target WIFI hotspots using the shadow pool; The selection module includes: a detection unit, configured to detect a hotspot access instruction; a positioning unit, configured to create a spatial coordinate system, locate the terminal coordinate position of the user terminal in the spatial coordinate system, and locate the hotspot coordinate position of each WIFI hotspot in the WIFI hotspot list in the spatial coordinate system; a selection unit, configured to select a third target WIFI hotspot and a fourth target WIFI hotspot in the WIFI hotspot list according to the terminal coordinate position and the hotspot coordinate position; The selection unit includes: an acquisition subunit, which is used to acquire the historical movement trajectory of the user terminal; a generation subunit, which is used to extend the historical movement trajectory and generate a target movement trajectory of the user terminal; a division subunit, which is used to divide the WIFI hotspot list into a first WIFI hotspot area and a second WIFI hotspot area along a direction perpendicular to the target movement trajectory, taking the terminal coordinate position as the division point of the target movement trajectory, wherein the first WIFI hotspot area is distributed in the waiting residence area of the target movement trajectory, and the second WIFI hotspot area is distributed in the historical residence area of the target movement trajectory; a selection subunit, which is used to select a third target WIFI hotspot in the first WIFI hotspot area and select a fourth target WIFI hotspot in the second WIFI hotspot area; or, the selection unit includes The method comprises: a selection subunit, which is used to select the WIFI hotspot list with the terminal coordinate position as the center position and the initial length as the selection radius; a processing subunit, which is used to count the number of WIFI hotspots in the selected area, and if the number of hotspots is less than a preset threshold, continue to perform the following steps until the number of hotspots in the selected area reaches the preset threshold or the selection radius reaches the maximum radius, and obtain the maximum selected area: increase the initial length according to the preset step length, and continue to select the WIFI hotspot list with the adjusted selection radius, and count the number of WIFI hotspots in the current selected area; a calculation subunit, which is used to calculate the Euclidean distance between each pair of WIFI hotspots in the maximum selected area; and a determination subunit, which is used to determine a pair of WIFI hotspots with the largest Euclidean distance as the third target WIFI hotspot and the fourth target WIFI hotspot.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the steps of any one of the methods of claims 1 to 5 when executed.
