Method, system and device for configuring WiFi perception using Android system
By creating a new perceptual service process and a data acquisition service process in the Android system, combining the local interface and JNI interface, the problem that the WiFi perception method in the existing technology is mainly based on computer systems, and the efficient call and setting of WiFi channel status information by the Android platform is realized.
Patent Information
- Application Number
- CN202310187627.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-02-20
AI Technical Summary
The existing WiFi perception methods are mainly based on computer systems, and it is impossible to effectively use the Android system for WiFi perception.
Create a new sense service process and data acquisition service process in the Android system, establish services through the local interface and preset APP, and use the JNI interface to obtain and set WiFi channel status information.
It realizes the call and setting of WiFi channel status information by the Android platform, improves the application scope of channel status information, and has a simple process and high efficiency.
Smart Images

Figure CN116233301B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Android systems, and in particular to a method, system and device for configuring WiFi perception using an Android system. Background Art
[0002] Existing WiFi sensing methods can be divided into model-based methods and learning-based methods. Model-based methods help us understand the underlying WiFi sensing mechanism and design sensing methods for periodic or single motions, such as breathing and falling. Learning-based deep learning models are developed for computer vision and natural language processing tasks, and they demonstrate the ability to handle high-dimensional and multimodal data problems. These methods inspire the application of deep learning in WiFi sensing from aspects such as data preprocessing, network design, and learning objectives.
[0003] It can be seen that most of the existing WiFi sensing methods are based on computer systems; and with the development of society, the usage rate of easy-to-carry office equipment represented by mobile phones is far greater than the usage of computers. Therefore, a method, system and device for configuring WiFi sensing using the Android system are urgently needed to be developed. Summary of the invention
[0004] In order to overcome the deficiencies of the prior art, the present invention provides a method, system and device for configuring WiFi sensing using an Android system, which are used to solve at least one of the aforementioned technical problems.
[0005] Specifically, the technical solution is as follows:
[0006] A method for configuring WiFi sensing using an Android system, comprising:
[0007] At least one perception service process and at least one data acquisition service process are newly created in the Android system; the data acquisition service process is used to obtain channel state information in the user state, and the user state and the WIFI driver perform data transmission in the form of a socket;
[0008] The perception service process establishes a service with a local interface in the Android system;
[0009] After the preset APP in the Android system loads the shared library compiled and generated by the local interface service corresponding to the WIFI to be detected through the local interface, the preset APP is connected to the Android system as a client;
[0010] Call, set, and obtain the channel status information of the WIFI to be detected through the preset APP;
[0011] When the perception service process establishes a service with the local interface in the Android system:
[0012] Enable the perception service process to communicate with the local interface in the Android system through an inter-process communication mechanism;
[0013] The calling, setting, and obtaining the channel status information of the WIFI to be detected by the preset APP includes:
[0014] The data acquisition service process collects the channel status information of the WIFI to be detected;
[0015] The preset APP obtains, calls or sets the data corresponding to the channel state information through the perception service process;
[0016] The preset APP obtains, calls or sets data corresponding to the channel state information through the perception service process, including:
[0017] The preset APP accesses the perception service process as a client through the jni interface;
[0018] Acquire the channel status information of the WIFI to be detected through the sensing service process;
[0019] Debug and call the setting command to periodically obtain the channel status information of the WIFI to be detected;
[0020] The perception service process establishes a service with a local interface in the Android system, including:
[0021] The local interface establishes a server end to realize the acquisition of the connection interface, the disconnection interface, the notification interface, and the setting interface;
[0022] The preset APP accesses the service established by the local interface as a client through the jni interface;
[0023] The corresponding interface is called through the preset APP to perform function configuration.
[0024] The channel status information of the WIFI to be detected includes:
[0025] One or more of the following: netlink header, CSI frame header, and raw CSI body.
[0026] A system based on the above method comprises:
[0027] The user state module WIFI performs data interaction with the external WIFI to be detected, and is used to collect channel state information of the WIFI to be detected;
[0028] A data acquisition service process module WIFI, one end of which is connected to the user state module WIFI, and is used to obtain the channel state information of the WIFI to be detected;
[0029] A channel status service module WIFI, one end of which is connected to the other end of the data acquisition service process module WIFI, and is used to collect channel status information of the WIFI to be detected;
[0030] A sensing service process module WIFI, one end of which is connected to the other end of the channel state service module WIFI, and is used to collect channel state information of the WIFI to be detected;
[0031] The preset APP module WIFI performs data interaction with the perception service process module WIFI, and is used to collect the channel status information of the WIFI to be detected.
[0032] The system further comprises: a local interface module WIFI;
[0033] The local interface module WIFI is arranged between the perception service process module WIFI and the preset APP module WIFI, and is used to transmit the channel state information of the WIFI to be detected to the local, so as to facilitate the calling of the preset APP module WIFI.
[0034] An electronic device, comprising:
[0035] Storage medium, used to store Android programs;
[0036] The processing unit exchanges data with the storage medium, and is used to execute the Android program through the processing unit when configuring WiFi awareness, and perform the steps of the method for configuring WiFi awareness using the Android system as described above.
[0037] A readable storage medium, wherein:
[0038] The readable storage medium stores an Android program;
[0039] When the Android program is running, the steps of the method for configuring WiFi perception using the Android system are executed as described above.
[0040] The present invention has at least the following beneficial effects:
[0041] The method of the present invention creates at least one new perception service process in the Android system, and uses the perception service process to establish a service with a local interface in the Android system; then, after using a preset APP in the Android system to load the so library corresponding to the WIFI to be detected through the local interface, the preset APP is connected to the Android system as a client; finally, the channel state information is called, set, and obtained through the preset APP; the method of the present invention has a simple process and high efficiency, and can realize the calling and setting of the channel state information by the Android platform, thereby improving the application scope of the channel state information;
[0042] The system of the present invention performs data interaction with external WIFI to be detected through a user state module, so as to collect channel state information of the WIFI to be detected; then obtains the channel state information of the WIFI to be detected through a data acquisition service process module; finally, sends the channel state information of the WIFI to be detected to a preset APP module, and the preset APP module retrieves and adjusts the channel state information data of the WIFI to be detected; the system of the present invention transmits the channel state information data of the WIFI to be detected to a local interface through a perception service process module, and has the advantage of simple structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 It is a schematic diagram of the method of the present invention;
[0045] Figure 2 is a schematic diagram of the system of the present invention;
[0046] Figure 3 is a flow chart of the method of the present invention;
[0047] Figure 4 is a system block diagram of the system of the present invention;
[0048] Figure 5 A screenshot of the calling interface when the method described in the present invention is used;
[0049] Figure 6 A screenshot of the channel status information collection when the method of the present invention is used;
[0050] Figure 7A screenshot of the CSI service acquiring data when the method of the present invention is specifically used;
[0051] Figure 8 A screenshot of obtaining channel status information reported by a WIFI driver when the method of the present invention is used;
[0052] Fig. 9 A waveform diagram for obtaining the real situation of the ground through the method of the present invention;
[0053] Fig.10 Another waveform diagram for obtaining the real situation of the ground through the method of the present invention;
[0054] Fig.11 A schematic diagram of a timestamp obtained by the method of the present invention;
[0055] Fig.12 It is a waveform diagram of the channel state information obtained by the method of the present invention.
[0056] in, Figure 2-3 middle:
[0057] Wifi Sensing Agent: wifi perception agent
[0058] Algerithm
[0059] Config / control: Configuration / control
[0060] Manufacture firmware / SDK: Manufacturer firmware / SDK
[0061] CSI SDK: CSI packet transmission function
[0062] Sensing App: Preset sensing APP
[0063] Sensing JNI: Perceiving JNI Local Interface
[0064] Jar package: Android native framework.jar package
[0065] Client: Client
[0066] Sensing Server: Sensing service process
[0067] CSINFO: CSI information
[0068] Process: Process
[0069] CSIDATA: CSI data packet
[0070] CSI RAW: Raw CSI body
[0071] Wifi driver: Wifi driver; configure CSI function and capture CSI data by scanning channels
[0072] exist Figure 4 middle:
[0073] 100. User state module; 200. Data acquisition service process module; 300. Channel state service module; 400. Perception service process module; 500. Local interface module; 600. Preset APP module. DETAILED DESCRIPTION
[0074] Those skilled in the art will appreciate that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.
[0075] Glossary:
[0076] Binder mechanism: It is an inter-process communication mechanism implemented based on the open source OpenBinder.
[0077] Socket method: A socket is an abstract layer through which an application can send or receive data, and can be opened, read, written, and closed like a file. Sockets allow applications to insert I / O into the network and communicate with other applications in the network. A network socket is a combination of an IP address and a port.
[0078] CSI data: WIFI channel status information
[0079] According to the WiFi sensing function requirements, such as Figure 1 ,include:
[0080] 1. The WIFI driver needs to support the CSI function;
[0081] 2. The WIFI driver transmits CSI data to the application layer by establishing a socket.
[0082] 3. An adaptation layer interface is required to enable APK to act as a WiFi-aware agent to enable and disable CSI data, set parameters, and obtain parameters.
[0083] In order to solve the problems in the prior art, the core idea of the present invention is as follows: Figure 2, add two services, namely: the perception service process, namely Sensing Server, and the data acquisition service process, namely CSI Server; among them, SensingServer is a service established with the local interface JNI. Through the binder mechanism, after loading the LibWifiSensing.so library (a shared library compiled and generated by the local interface service) through the preset APP, after successful access as a client, you can call the settings, acquisition and other interfaces; the other CSI Server is mainly responsible for obtaining the channel status information of the user state. The user state and the WIFI driver are transmitted in the form of sockets for data.
[0084] Specific embodiment 1:
[0085] The present invention provides an embodiment:
[0086] like Figure 3 A method for configuring WiFi perception using an Android system, comprising: creating a new perception service process in the Android system; the perception service process establishing a service with a local interface in the Android system; after a preset APP in the Android system loads a so library corresponding to a WIFI to be detected through the local interface, the preset APP is connected to the Android system as a client; calling, setting, and obtaining channel status information of the WIFI to be detected through the preset APP.
[0087] When "the perception service process establishes a service with the local interface in the Android system", the perception service process communicates with the local interface in the Android system through the binder mechanism.
[0088] The "calling, setting, and obtaining the channel status information through the preset APP" includes: creating a new data acquisition service process in the Android system; the data acquisition service process collects the channel status information of the WIFI to be detected; the preset APP obtains, calls or sets the data corresponding to the channel status information through the perception service process.
[0089] “The channel status information of the WIFI to be detected” includes:
[0090] 1) Netlink header (7 bytes in total): physical network device id, serial number, segment index.
[0091] 2) CSI frame header (56 bytes in total): reserved bytes, received frame source MAC address, CSI capture status, received frame TSF timestamp, CSI_nc status, CSI_nr status, received frame bandwidth, received frame rate, received signal strength indication, CSI conditional subtraction number, CSI status quality bit, length of CSI dump
[0092] 3) Original CSI body (208 bytes in total);
[0093] “The preset APP obtains, calls or sets the data corresponding to the channel state information through the perception service process”, including:
[0094] The preset APP accesses the perception service process as a client through the jni interface;
[0095] Obtain the underlying CSI data packet through the perception service process (i.e., collect the channel status information of the WIFI to be detected)
[0096] You can call the setting command "echo 1 0 0 0 0 30> / proc / net / csi_info"
[0097] The corresponding parameters are as follows:
[0098] CSI switch: 0: disable CSI, 1: enable CSI.
[0099] Group number: 0:num 1,1:num 2,2:num 4,3:num 16
[0100] Accuracy: 0:1byte,1:2bytes
[0101] Mode: 0:ACK, 1:MACID, 2:NDP
[0102] Reserved: Set to 0
[0103] Sending cycle: the sending cycle of NULL data; the unit is msec.
[0104] “The perception service process establishes a service with a local interface in the Android system”, including:
[0105] The local interface establishes a server end to realize the acquisition of the connection interface, the disconnection interface, the notification interface, and the setting interface;
[0106] The preset APP accesses the service established by the local interface as a client through the jni interface;
[0107] The corresponding interface is called through the preset APP to perform function configuration.
[0108] When the method described in this embodiment is used in a specific application, reference can be made to Figure 5-8 Screenshots of the specific application described.
[0109] Specific embodiment II:
[0110] The present invention also provides an embodiment:
[0111] like Figure 4 A system based on the above method includes: a user state module 100, a data acquisition service process module 200, a channel state service module 300, a perception service process module 400, a local interface module 500 and a preset APP module 600; wherein the user state module 100 interacts with the external WIFI to be detected for data collection, and is used to collect the channel state information of the WIFI to be detected; one end of the data acquisition service process module 200 is connected to the user state module 100 for acquiring the channel state information of the WIFI to be detected; one end of the channel state service module 300 is connected to the data acquisition service process module 200 The other end is connected to collect the channel status information of the WIFI to be detected; one end of the perception service process module 400 is connected to the other end of the channel status service module 300, for collecting the channel status information of the WIFI to be detected; the preset APP module 600 interacts with the perception service process module 400 for data collection, and is used to collect the channel status information of the WIFI to be detected; the local interface module 500 is arranged between the perception service process module 400 and the preset APP module 600, and is used to transmit the channel status information of the WIFI to be detected to the local, so as to facilitate the call of the preset APP module 600.
[0112] Through the method of using the Android system to configure WiFi perception described in specific embodiment I, the Android platform obtains the following information through the preset APP: Figure 9-10 The waveform diagram is obtained by collecting CSI data and observing the amplitude of the CSI data according to the timestamp, such as Figure 11-12 .
[0113] The present invention also provides an embodiment:
[0114] An electronic device comprises: a storage medium and a processing unit; wherein the storage medium is used to store an Android program; the processing unit exchanges data with the storage medium, and is used to execute the Android program through the processing unit when configuring WiFi sensing, and perform the steps of the method for configuring WiFi sensing using the Android system as described above.
[0115] A readable storage medium, wherein: the readable storage medium stores an Android program; when the Android program is running, the steps of the method for configuring WiFi perception using the Android system as described above are executed.
[0116] In the present invention, a readable storage medium may be any tangible medium that contains or stores a program, as long as it can be recognized by an Android platform or a computer; the program may be used by or in combination with an instruction execution system, device, or device. In the present invention, a readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, device, or device. The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0117] The present invention provides an embodiment, including a program product, which includes a program carried on an Android platform readable medium, the program including a program for executing Figure 3 The program code of the method shown in any of the flowcharts described in the present invention. The program can be downloaded and installed from the Internet. When the program is executed by the CPU, the functions defined in the system of the present invention are executed; the CPU described here can be any controller chip that supports the Android platform.
[0118] The above serial numbers of the present invention are only for description and do not represent the advantages or disadvantages of the implementation scenarios.
[0119] The above disclosures are only several specific implementation scenarios of the present invention, but the present invention is not limited thereto, and any changes that can be thought of by a person skilled in the art should fall within the protection scope of the present invention. The above serial numbers of the present invention are only for description and do not represent the advantages and disadvantages of the implementation scenarios.
Claims
1. A method for configuring WiFi sensing using an Android system, characterized in that: include: At least one perception service process and at least one data acquisition service process are newly created in the Android system; the data acquisition service process is used to obtain channel state information in the user state, and the user state and the WIFI driver perform data transmission in the form of a socket; The perception service process establishes a service with a local interface in the Android system; After the preset APP in the Android system loads the shared library compiled and generated by the local interface service corresponding to the WIFI to be detected through the local interface, the preset APP is connected to the Android system as a client; Call, set, and obtain the channel status information of the WIFI to be detected through the preset APP; When the perception service process establishes a service with the local interface in the Android system: Enable the perception service process to communicate with the local interface in the Android system through an inter-process communication mechanism; The calling, setting, and obtaining the channel status information of the WIFI to be detected by the preset APP includes: The data acquisition service process collects the channel status information of the WIFI to be detected; The preset APP obtains, calls or sets the data corresponding to the channel state information through the perception service process; The preset APP obtains, calls or sets data corresponding to the channel state information through the perception service process, including: The preset APP accesses the perception service process as a client through the jni interface; Acquire the channel status information of the WIFI to be detected through the sensing service process; Debug and call the setting command to periodically obtain the channel status information of the WIFI to be detected; The perception service process establishes a service with a local interface in the Android system, including: The local interface establishes a server end to realize the acquisition of the connection interface, the disconnection interface, the notification interface, and the setting interface; The preset APP accesses the service established by the local interface as a client through the jni interface; The corresponding interface is called through the preset APP to perform function configuration.
2. The method for configuring WiFi sensing using an Android system according to claim 1, characterized in that: The channel status information of the WIFI to be detected includes: One or more of the following: netlink header, CSI frame header, and raw CSI body.
3. A system based on the method according to any one of claims 1 to 2, characterized in that: include: The user state module WIFI performs data interaction with the external WIFI to be detected, and is used to collect channel state information of the WIFI to be detected; A data acquisition service process module WIFI, one end of which is connected to the user state module WIFI, and is used to obtain the channel state information of the WIFI to be detected; A channel status service module WIFI, one end of which is connected to the other end of the data acquisition service process module WIFI, and is used to collect channel status information of the WIFI to be detected; A sensing service process module WIFI, one end of which is connected to the other end of the channel state service module WIFI, and is used to collect channel state information of the WIFI to be detected; The preset APP module WIFI performs data interaction with the perception service process module WIFI, and is used to collect the channel status information of the WIFI to be detected.
4. The system according to claim 3, characterized in that Also includes: Local interface module WIFI; The local interface module WIFI is arranged between the perception service process module WIFI and the preset APP module WIFI, and is used to transmit the channel state information of the WIFI to be detected to the local, so as to facilitate the calling of the preset APP module WIFI.
5. An electronic device configured with WiFi sensing using an Android system, characterized in that: include: Storage medium, used to store Android programs; A processing unit exchanges data with the storage medium, and is used to execute the Android program through the processing unit when configuring WiFi awareness, and perform the steps of the method for configuring WiFi awareness using the Android system as described in any one of claims 1-2.
6. A readable storage medium, characterized in that: The readable storage medium stores an Android program; When the Android program is running, the steps of the method for configuring WiFi perception using the Android system as described in any one of claims 1-2 are executed.
Citation Information
Patent Citations
Interrupt-tolerant traffic information spreading prototype system based on Android
CN104010047A
Android-based indoor microenvironment perception and home appliance control method
CN104155943A