Embedded device and wireless network security authentication method, device and product thereof
Patent Information
- Application Number
- CN202611138752.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-13
AI Technical Summary
但这样的方式会导致分支化、维护成本指数级增长,且难以实现跨平台代码复用与迁移,严重制约嵌入式开发的灵活性和可持续性
[0023]进一步地,所述发送层将数据传输至共享的存储单元,并通过所述存储单元的指示信息通知接收层;所述接收层基于所述指示信息从所述存储单元中获取所述数据,包括:
Smart Images

Figure CN122903219A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of embedded technology, and more specifically, to an embedded device and its wireless network security authentication method, apparatus, and product. Background Technology
[0002] Standard wireless network security middleware, such as wpa_supplicant, is designed specifically for the multitasking and network environments of Linux systems. It natively relies on system calls provided by the Linux operating system, such as pthreads, sockets, and select. However, in the embedded field, embedded devices often employ RTOS (Real-Time Operating System) due to resource constraints and real-time requirements, such as FreeRTOS, Zephyr, and ThreadX. These operating systems differ significantly from the APIs (Application Programming Interfaces) in Linux.
[0003] In related technologies, the core code of the wireless network security middleware is directly modified to adapt to each RTOS. However, this approach leads to branching, exponentially increased maintenance costs, and difficulty in achieving cross-platform code reuse and migration, severely restricting the flexibility and sustainability of embedded development. Summary of the Invention
[0004] The purpose of this application is to provide an embedded device and its wireless network security authentication method, apparatus and product, so as to improve the portability of wireless network security middleware.
[0005] A first aspect of this application provides a wireless network security authentication method in an embedded device, the method comprising: In response to a pending wireless network security authentication task, the wireless network security middleware calls a target kernel function through a system service interface provided by the operating system abstraction layer to obtain system services; wherein, the target kernel function is adapted to the target operating system of the embedded device; the system service interface and the target kernel function are bound during the compilation phase of the wireless network security middleware or during the initialization phase of the target operating system; The wireless network security middleware performs the wireless network security authentication task based on the system service.
[0006] In the above implementation, the wireless network security middleware is no longer deeply bound to a specific operating system. Instead, an operating system abstraction layer is constructed to uniformly encapsulate and adapt the middleware's dependencies on system calls. The wireless network security middleware only needs to call the abstract system service interfaces, without caring about how the underlying kernel functions are called, thus decoupling the middleware from the operating system and improving portability. Therefore, the originally complex and standard wireless network security middleware can be adapted to various embedded operating systems in a "plug-and-play" manner, expanding the applicability of standard wireless network security protocols in the fragmented hardware ecosystem of the Internet of Things. It also avoids the fragmentation problem of maintaining independent code branches for each operating system, achieving consistent maintenance and reuse of cross-platform code.
[0007] Furthermore, the system service interface and the target kernel function are bound together during the compilation phase of the wireless network security middleware through the following steps: During the compilation phase of the wireless network security middleware, the system service interface is bound to the target kernel function based on the target implementation file.
[0008] In the above implementation process, by binding the system service interface with the target kernel function during the compilation stage, the system service interface can be automatically linked to the bound target kernel function when it is called at each layer. Each layer does not need to care about how the underlying kernel function is called, thus achieving decoupling between the wireless network security middleware and the underlying operating system.
[0009] Furthermore, the binding of the system service interface to the target kernel function based on the target implementation file includes: The target implementation file corresponding to the target operating system is determined from multiple implementation files; wherein, each implementation file records the mapping relationship between system service interfaces and kernel functions under the corresponding operating system; Based on the target mapping relationship recorded in the target implementation file, the system service interface is bound to the target kernel function.
[0010] In the above implementation process, the target implementation file adapted to the target operating system is selected from multiple implementation files during the compilation stage. Then, the binding of system service interfaces and target kernel functions is completed based on the target mapping relationship recorded in the target implementation file. This enables the system service interface to be automatically linked to its bound target kernel function when it is called at each layer. Each layer does not need to care about how the underlying kernel function is called, thus achieving decoupling between the wireless network security middleware and the underlying operating system.
[0011] Furthermore, the target implementation file includes mapping relationships between system service interfaces and kernel functions under multiple operating systems; the binding of the system service interfaces and the target kernel functions based on the target implementation file includes: In the target implementation file, a target mapping relationship corresponding to the target operating system is selected through conditional compilation macros; Based on the target mapping relationship, the target kernel function is bound to the system service interface.
[0012] In the above implementation process, by maintaining the mapping relationship of multiple operating systems in the same implementation file set, the target mapping relationship corresponding to the target operating system is automatically selected and bound during compilation using conditional compilation macros, thereby avoiding the creation of a large number of scattered implementation files and reducing file fragmentation.
[0013] Furthermore, the system service interface is bound to the target kernel function during the initialization phase of the target operating system; the wireless network security middleware calls the target kernel function through the system service interface provided by the operating system abstraction layer, including: In response to a call to the system service interface, a target function pointer table pointed to by a global pointer is obtained; wherein, the target function pointer table is one of a plurality of function pointer tables pre-established and corresponding to the target operating system, and is registered to the global pointer during the initialization of the target operating system; each function pointer table corresponds to an operating system and contains function pointers to kernel functions corresponding to each system service interface; In the target function pointer table, find the target function pointer corresponding to the called system service interface, and call the target kernel function corresponding to the target function pointer.
[0014] In the above implementation process, the target function pointer table is registered to the global pointer during the system initialization phase. This allows the target function pointer to be automatically obtained and the target kernel function to be called when the system service interface is called, by pointing to the target function pointer table through the global pointer. Each layer does not need to care about how the underlying kernel function is called, thus decoupling the wireless network security middleware from the underlying operating system.
[0015] Furthermore, the system service interface includes a message sending interface, and the method further includes: When the wireless network security authentication task is executed, the sending layer writes the message to the message queue of the receiving layer by calling the message sending interface; The receiving layer reads the message from the message queue; The transmitting layer includes any one of the user layer, the wireless network security middleware, and the driver layer; the receiving layer includes any one or more of the user layer, the wireless network security middleware, and the driver layer, excluding the transmitting layer.
[0016] In the above implementation process, message queues are configured for each layer, and message reading and writing are performed based on the unified interface provided by the operating system abstraction layer, which realizes asynchronous communication between layers and improves the message concurrency processing capability.
[0017] Furthermore, the message carries first indication information of the message type; the message type includes control commands and events; the message queue includes a control command queue and an event queue; the sending layer writes the message to the receiving layer's message queue by calling the message sending interface, including: The sending layer determines whether the message is a control command or an event based on the first indication information by calling the message sending interface. If it is a control command, the message is written to the control command queue of the receiving layer; if it is an event, the message is written to the event queue of the receiving layer.
[0018] In the above implementation process, message isolation and differentiated processing are achieved through the aforementioned classification and routing mechanism. The sending layer completes automatic routing through a unified interface combined with indication information, shielding the complexity of the underlying queues and enhancing the decoupling between modules.
[0019] Furthermore, the sending layer writes the message to the message queue of the receiving layer by calling the message sending interface, including: The sending layer verifies the validity of the message by calling the message sending interface, and / or converts the initial format of the message to a target format suitable for the receiving layer, and writes the processed message into the message queue of the receiving layer.
[0020] In the above implementation process, message queues are configured for each layer, and message reading and writing are performed based on the unified interface provided by the operating system abstraction layer, realizing asynchronous communication between layers and improving message concurrency processing capabilities. Validation can effectively intercept illegal, incomplete, or abnormal messages, thereby improving security and robustness. Format conversion decouples the data between the sending and receiving ends, shielding the data format differences between heterogeneous modules and enhancing compatibility and scalability.
[0021] Furthermore, the method also includes: When the wireless network security authentication task is executed, the sending layer transmits data to the shared storage unit and notifies the receiving layer through the indication information of the storage unit; The receiving layer obtains the data from the storage unit based on the indication information.
[0022] In the above implementation, the message transmission path and data transmission path are separated. Message queues are used to transmit control commands and events, while shared memory is used to transmit data. This ensures reliable control between different levels and achieves high-speed data transmission, improving overall efficiency. Simultaneously, the architecture ensures that the determinism and reliability of control signaling are not impacted by the data flow, and data forwarding achieves throughput close to the hardware limits with minimal resource overhead.
[0023] Further, the transmitting layer transmits data to a shared storage unit and notifies the receiving layer through indication information from the storage unit; the receiving layer retrieves the data from the storage unit based on the indication information, including: The sending layer transmits data to the storage unit, encapsulates the indication information of the storage unit into a message, and writes the message into the message queue of the receiving layer by calling the message sending interface. The receiving layer obtains the indication information from the message queue and obtains the data from the storage unit based on the indication information.
[0024] In the above implementation, shared storage units are used to carry data, and message queues are used to transmit lightweight indication information. This avoids the frequent memory copying and queue blocking problems caused by directly writing large amounts of data to the message queue, significantly reducing memory overhead and improving the throughput of the message queue. At the same time, the sending layer encapsulates and sends indication information by calling the message sending interface, shielding the upper-layer business from the interaction details of the underlying shared storage, maintaining the uniformity of the message communication interface and the asynchronous decoupling between layers, and greatly improving the efficiency of data transmission between layers.
[0025] Further, the transmitting layer transmits data to a shared storage unit and notifies the receiving layer through indication information from the storage unit; the receiving layer retrieves the data from the storage unit based on the indication information, including: The transmitting layer transmits data to the storage unit and updates the first pointer in the storage unit index table; wherein the storage unit index table is used to record indication information of multiple storage units, and includes a first pointer and a second pointer; When the first pointer and the second pointer are different, the receiving layer reads data from the storage unit pointed to by the second pointer and updates the second pointer until the first pointer and the second pointer are the same.
[0026] In the above implementation, read-write synchronization is achieved by comparing the first and second pointers in the storage unit index table. This eliminates the need for heavyweight mutex locks or complex synchronization mechanisms, reducing thread blocking and context switching overhead, and enabling lightweight, low-latency data interaction. Furthermore, the storage unit filling and data retrieval logic are integrated into the corresponding tasks, further simplifying the data flow.
[0027] A second aspect of this application provides a wireless network security authentication device in an embedded device, comprising: an operating system abstraction layer, a wireless network security middleware, and a driver layer; wherein... The operating system abstraction layer is used to provide system service interfaces; the system service interfaces are bound to the target kernel functions during the compilation phase of the wireless network security middleware or during the initialization phase of the target operating system of the embedded device; the target kernel functions are adapted to the target operating system. The wireless network security middleware is used to respond to the wireless network security authentication task to be executed by calling the target kernel function through the system service interface to obtain system services; and to execute the wireless network security authentication task based on the system services.
[0028] A third aspect of this application provides a computer program product, the computer program product including a computer program, which, when executed by a processor, implements any of the methods described in the first aspect.
[0029] A fourth aspect of this application provides an embedded device, including: a memory and a processor, wherein the memory and the processor are connected; The memory is used to store programs; The processor is configured to invoke a program stored in the memory to execute the method as described in any of the first aspects.
[0030] A fifth aspect of this application provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of any of the methods described in the first aspect. Attached Figure Description
[0031] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1A structural block diagram of a wireless network security authentication device in an embedded device provided in this application embodiment; Figure 2 A flowchart illustrating a wireless network security authentication method in an embedded device, provided as an embodiment of this application; Figure 3 A flowchart illustrating the message passing mechanism between layers provided in the embodiments of this application; Figure 4 A schematic diagram illustrating the process of the receiving layer reading messages from the message queue, provided in an embodiment of this application; Figure 5 A schematic diagram illustrating the message passing and data passing mechanisms between layers provided in the embodiments of this application; Figure 6 A flowchart illustrating the data transfer mechanism between layers provided in the embodiments of this application; Figure 7 This is a schematic diagram of the process of receiving task RX reading data provided in an embodiment of this application; Figure 8 This is a hardware structure diagram of an embedded device provided in an embodiment of this application. Detailed Implementation
[0033] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0034] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0035] First, some of the terms used in the embodiments of this application will be explained to facilitate understanding by those skilled in the art.
[0036] WPA: Wi-Fi Protected Access, is a technical standard developed and published by the Wi-Fi Alliance for protecting the security of wireless networks (Wi-Fi). WPA (WPA1) is based on an earlier draft and uses the Temporary Key Integrity Protocol (TKIP).
[0037] WPA2: Supports the more advanced AES (Advanced Encryption Standard), providing stronger security.
[0038] WPA3: Released in 2018, it is currently the most secure and up-to-date security protocol.
[0039] RTOS: Real-Time Operating System, is a type of system software specifically designed to manage hardware resources and control microcontrollers (MCUs) or microprocessors, aiming to ensure that tasks can be responded to and processed within a specified time.
[0040] As mentioned above, the standard wpa_supplicant natively relies on system calls in the Linux operating system. However, there are significant differences between the APIs of RTOS and Linux systems, making it impossible to directly port the standard wpa_supplicant to RTOS. Without wpa_supplicant, embedded devices will not support mainstream wireless security protocols such as WPA, WPA2, and WPA3, will be unable to connect to encrypted networks, and will fail to meet industry security standards.
[0041] In related technologies, wpa_supplicant is deeply refactored into a native FreeRTOS "service," allowing it to be ported and tightly integrated into FreeRTOS. However, this approach sacrifices the portability and ecosystem flexibility of wpa_supplicant in exchange for high optimization and tight integration on the target system. It also limits flexibility in resource management, impacting code modularity and long-term maintainability. Therefore, this approach is only suitable for embedded projects that are committed to FreeRTOS and have high requirements for Wi-Fi performance. For projects that need to consider future platform migration or pursue maximum middleware portability, this deep binding is a significant architectural disadvantage.
[0042] Therefore, this application provides a wireless network security authentication method in embedded devices to improve the portability of wireless network security middleware. The application scenarios of this application are introduced below. Figure 1 A schematic diagram of a wireless network security authentication device (also known as a wireless network software architecture) in an embedded device is shown. The device includes, from top to bottom, an operating system abstraction layer 110, a wireless network security middleware 120, and a driver layer 130. The operating system abstraction layer 110 is connected to both the wireless network security middleware 120 and the driver layer 130. The wireless network security middleware 120 is connected to the driver layer 130, and the driver layer 130 is also connected to a hardware platform (not shown in the figure).
[0043] Optionally, in Figure 1Based on this, the device may further include a user layer, for example, including, from top to bottom, a user layer, an operating system abstraction layer 110, a wireless network security middleware 120, and a driver layer 130. The user layer is connected to the wireless network security middleware 120 and the driver layer 130 via the operating system abstraction layer 110.
[0044] The operating system abstraction layer 110, also known as the OS layer, provides various system service interfaces to any one or more of the user layer, wireless network security middleware 120, and driver layer 130. The wireless network security middleware 120 is, for example, wpa_supplicant.
[0045] Based on this, this application provides a wireless network security authentication method in an embedded device, including as follows: Figure 2 Steps 210-220 are shown.
[0046] Step 210: In response to the pending wireless network security authentication task, the wireless network security middleware calls the target kernel function through the system service interface provided by the operating system abstraction layer to obtain system services.
[0047] The target kernel functions are adapted to the target operating system of the embedded device. System service interfaces are bound to the target kernel functions.
[0048] Step 220: The wireless network security middleware performs wireless network security authentication tasks based on system services.
[0049] Wireless network security authentication tasks refer to the tasks undertaken by embedded devices during the establishment of a wireless communication link with a wireless access point (AP) to verify the legitimacy of access and establish an encrypted communication channel. For example, wireless network security authentication tasks include, but are not limited to, security authentication tasks and key negotiation tasks.
[0050] It should be understood that there are various operating systems adapted to embedded devices, and each operating system corresponds to different kernel functions. In this embodiment, the kernel function adapted to the target operating system running on the embedded device is called the target kernel function. The target operating system running on the embedded device may include one or more. For example, the embedded device can run multiple target operating systems through virtualization technology.
[0051] The operating system abstraction layer provides system service interfaces to each layer. These system service interfaces are multiple, and each interface is bound to one or more target kernel functions. For example, system service interfaces may include, but are not limited to, task or thread management interfaces (such as `os_task_create`, `os_task_exit`), synchronization mechanism interfaces (such as `os_mutex_init / lock / unlock`, `os_semaphore_give / take`), memory management interfaces (such as `os_malloc`, `os_free`, `os_zalloc`), message queue interfaces (such as `os_message_queue_send / receive`), time and delay interfaces (such as `os_get_time`, `os_sleep_ms`, `os_delay_us`), log output interfaces (such as `os_printf`, `os_log`), and event and timer interfaces (such as `os_timer_init`, `os_timer_start`). These interfaces cover commonly used system services in wireless network security middleware and represent a minimal set adaptable to different operating systems.
[0052] Thus, when the wireless network security middleware needs to perform a wireless network security authentication task, it can invoke the target kernel function by calling the system service interface. For example, after calling the system service interface, the wireless network security middleware automatically links to the target kernel function bound to that system service interface, thereby obtaining the corresponding system service. Then, the wireless network security middleware can perform the wireless network security authentication task based on the obtained system service.
[0053] As can be seen, the wireless network security authentication method for embedded devices provided in this application no longer deeply binds the wireless network security middleware to a specific operating system. Instead, it constructs an operating system abstraction layer to uniformly encapsulate and adapt the wireless network security middleware's dependencies on system calls. The wireless network security middleware only needs to call the abstract system service interface and does not care about how the underlying kernel functions are called, thus decoupling the wireless network security middleware from the operating system and improving portability. Therefore, the originally complex and standard wireless network security middleware can be adapted to various embedded operating systems in a "plug-and-play" manner, expanding the applicability of standard wireless network security protocols in the fragmented hardware ecosystem of the Internet of Things. At the same time, it avoids the fragmentation problem of maintaining independent code branches for each operating system and achieves the same maintenance and reuse of cross-platform code.
[0054] The following provides a detailed description of steps 210-220.
[0055] First, the binding process between the system service interface and the target kernel function is described. According to some embodiments of this application, the system service interface and the target kernel function are bound during the compilation phase of the wireless network security middleware, or during the initialization phase of the target operating system running on the embedded device.
[0056] The process of binding system service interfaces to target kernel functions during the compilation phase of wireless network security middleware is as follows: In the operating system abstraction layer, header files (such as os.h and os_types.h) and implementation files (such as os_*.c) are configured. Header files define necessary data types and system service interfaces (also known as function prototypes). Implementation files implement all system service interfaces declared in the header files. There may be one or more implementation files, which contain the mapping relationship between each system service interface and kernel functions under various operating systems.
[0057] Therefore, during the compilation phase of the wireless network security middleware, system service interfaces are bound to target kernel functions based on the target implementation file. For example, during the compilation phase, the target implementation file is determined from one or more implementation files. The target implementation file includes the target mapping relationship between each system service interface and the target kernel function under the target operating system, and then the system service interfaces are bound to the target kernel functions based on the target mapping relationship.
[0058] In this way, by binding the system service interface to the target kernel function during the compilation stage, the system service interface can be automatically linked to the bound target kernel function when it is called at each layer. Each layer does not need to care about how the underlying kernel function is called, thus decoupling the wireless network security middleware from the underlying operating system.
[0059] In some embodiments, multiple implementation files are included, each corresponding to an operating system, and recording the mapping relationship between each system service interface and kernel function under the corresponding operating system. For example, the multiple implementation files include os_freertos.c, os_zephyr.c, and os_baremetal.c, which correspond to FreeRTOS, Zephyr system, and bare metal, respectively. The target implementation file is the one among the multiple implementation files that corresponds to the target operating system, and records the target mapping relationship between each system service interface and target kernel function under the target operating system.
[0060] Thus, the above-mentioned binding of system service interfaces to target kernel functions based on the target implementation file includes steps S11-S12: Step S11: Determine the target implementation file corresponding to the target operating system from multiple implementation files.
[0061] Step S12: Based on the target mapping relationship recorded in the target implementation file, bind the system service interface to the target kernel function.
[0062] For example, when compiling wireless network security middleware, the user selects the target implementation file to be linked in the compilation options based on the target operating system required by the embedded device. During the compilation process, the system service interfaces are bound to the target kernel functions based on the target mapping relationship recorded in the target implementation file.
[0063] In this way, by selecting the target implementation file adapted to the target operating system from multiple implementation files during the compilation stage, and then completing the binding of system service interfaces and target kernel functions based on the target mapping relationship recorded in the target implementation file, the system service interface can be automatically linked to the bound target kernel function when it is called at each layer. Each layer does not need to care about how the underlying kernel function is called, thus achieving decoupling between the wireless network security middleware and the underlying operating system.
[0064] In some embodiments, the mapping relationship between each system service interface and kernel function under multiple operating systems is recorded in an implementation file, which is the target implementation file mentioned above. That is, the target implementation file includes the mapping relationship between each system service interface and kernel function under multiple operating systems. For example, the mapping relationship originally recorded in multiple implementation files can be recorded in the same implementation file through conditional compilation macros.
[0065] Thus, the above-mentioned binding of system service interfaces to target kernel functions based on the target implementation file includes steps S21-S22: Step S21: In the target implementation file, select the target mapping relationship corresponding to the target operating system through conditional compilation macros.
[0066] Step S22: Based on the target mapping relationship, bind the target kernel function to the system service interface.
[0067] For example, when compiling wireless network security middleware, conditional compilation macros are parsed to preserve target mappings that match the target operating system while eliminating mappings for other operating systems. Based on the preserved target mappings, system service interfaces are bound to target kernel functions.
[0068] In this way, by maintaining the mapping relationship for multiple operating systems in the same set of implementation files, the target mapping relationship for the target operating system can be automatically selected and bound during compilation using conditional compilation macros, thereby avoiding the creation of a large number of scattered implementation files and reducing file fragmentation.
[0069] The process of binding system service interfaces to target kernel functions during the target operating system initialization phase is as follows: Multiple function pointer tables are pre-established, each corresponding to an operating system and containing function pointers to kernel functions for each system service interface under that operating system. The function pointers indicate the memory addresses of the kernel functions. During operating system initialization, the target operating system can be determined through detection or configuration. The target function pointer table corresponding to the target operating system is then selected from the multiple function pointer tables and registered with a global pointer, thereby completing the binding between system service interfaces and target kernel functions.
[0070] Based on this, in step 210, the wireless network security middleware calls the target kernel function through the system service interface, specifically including steps 211-212.
[0071] Step 211: In response to a call to the system service interface, obtain the target function pointer table pointed to by the global pointer.
[0072] Step 212: In the target function pointer table, find the target function pointer corresponding to the system service interface being called, and call the target kernel function corresponding to the target function pointer.
[0073] The target function pointer table contains function pointers to the target kernel functions corresponding to each system service interface under the target operating system. When a system service interface is called, the target function pointer corresponding to the called system service interface can be looked up in the target function pointer table. This target function pointer points to the storage address of the target kernel function, such as a memory address. Thus, the target kernel function can be called from that storage address to obtain the system service.
[0074] In this way, the target function pointer table is registered to the global pointer during the system initialization phase. This allows the system service interface to be called automatically by pointing to the target function pointer table through the global pointer, and then calling the target kernel function. Each layer does not need to care about how the underlying kernel function is called, thus decoupling the wireless network security middleware from the underlying operating system.
[0075] The execution process of wireless network security authentication tasks includes message passing and data passing between layers. Based on any of the above embodiments, the message transmission path and data transmission path between layers are separated. That is, messages and data use different transmission paths. For example, messages between layers are transmitted through message queues; data between layers is transmitted through a shared storage unit, and the indication information of this storage unit is transmitted through the message queue. By separating the transmission of messages and data, reliable control between layers is ensured, high-speed data transmission is achieved, and the determinism and reliability of messages are protected from data flow impacts at the architectural level.
[0076] The following describes the message passing mechanism between different layers.
[0077] Based on any of the above embodiments, the system service interface includes a message sending interface. Therefore, the method further includes, for example... Figure 3 Steps 310-320 are shown.
[0078] Step 310: When the wireless network security authentication task is executed, the sending layer writes the message to the message queue of the receiving layer by calling the message sending interface.
[0079] Step 320: The receiving layer reads messages from the message queue.
[0080] The transmitting layer includes any one of the user layer, the wireless network security middleware, and the driver layer. The receiving layer includes any one or more of the user layer, the wireless network security middleware, and the driver layer, excluding the transmitting layer.
[0081] During the execution of wireless network security authentication tasks, message exchange is required between different layers. The sending layer refers to the layer that sends messages or data, and the receiving layer refers to the layer that receives messages or data. Neither the sending nor receiving layer is specifically defined as any layer. Therefore, any layer among the user layer, wireless network security middleware, and driver layer can act as a sending layer to send messages or data. The same message or data can be sent to one or more layers; therefore, any layer or layer among the user layer, wireless network security middleware, and driver layer other than the sending layer can act as a receiving layer to receive messages or data.
[0082] For example, each level is configured with a message queue. This message queue could be, for instance, a software-simulated mailbox or a central event queue. The structure of the mailbox can be represented as follows: typedef struct { uint8_t *pool; / / Base address of the message pool uint32_t msg_size; / / Size of each message uint32_t depth; / / Maximum number of messages uint32_t read_idx; / / Read index uint32_t write_idx; / / Write index uint32_t count; / / Current message count } mailbox_core_t.
[0083] Messages between the sending layer and the receiving layer are transmitted via message queues. For example, the sending layer can write messages to the receiving layer's message queue by calling the message sending interface provided by the operating system abstraction layer. Correspondingly, the receiving layer reads the message from the message queue. For example, the receiving layer can read messages by polling the message queue or in response to hardware interrupts.
[0084] For example, such as Figure 4 As shown, when a hardware interrupt based on GPIO (General Purpose Input / Output) or a timer occurs, an ISR (Interrupt Service Routine) is triggered. The ISR selectively posts messages to the central event queue of the receiving layer or sets a flag (e.g., flag_button = 1). Subsequently, the main task of the receiving layer cyclically retrieves messages after detecting that the queue is not empty or the flag is valid. Finally, the main task looks up the event handling table and calls the corresponding function (e.g., app_handler, wpa_handler, etc.) based on the event identifier of the message to complete one event processing, and this process is repeated. Messages correspond to events; for example, a connection request event may generate control command messages and status event messages indicating successful or failed connections. Therefore, each message carries a corresponding event identifier.
[0085] As can be seen, this embodiment configures message queues for each layer and performs message reading and writing based on the unified interface provided by the operating system abstraction layer, thereby realizing asynchronous communication between layers and improving the message concurrency processing capability.
[0086] According to some embodiments of this application, the message carries first indication information of the message type. The message type includes control commands and events. Accordingly, the message queue includes a control command queue and an event queue. The control command queue can be further refined into a control queue and a command queue.
[0087] Based on this, in step 310, the sending layer writes the message into the message queue of the receiving layer, specifically including: the sending layer determines whether the message is a control command or an event based on the first indication information by calling the message sending interface. If it is a control command, the message is written into the control command queue of the receiving layer; if it is an event, the message is written into the event queue of the receiving layer.
[0088] For example, such as Figure 5 As shown, when the sending layer is the user layer and the receiving layer is the wireless network security middleware, the user tasks in the user layer write commands (such as connection commands, scan commands, etc., which are commonly used commands for interaction with the driver layer) into the command queue of the wireless network security middleware, such as the command Mailbox (corresponding to...). Figure 5 In the code "1. Send command e.g., SCAN, CONNECT", the wireless network security middleware reads the command from the command queue and executes it (corresponding to...). Figure 5 (2. Receive command).
[0089] When the sending layer is a wireless network security middleware and the receiving layer is a user layer, the wireless network security middleware writes events such as successful connection, disconnection, and EAP (Extensible Authentication Protocol) requests to an event queue, such as an event mailbox, to notify the user task in the user layer (corresponding to...). Figure 5 The text refers to "3. Sending events, e.g., CONNECTED, DISCONNECTED" and "4. Receiving events".
[0090] When the transmitting layer is a wireless network security middleware and the receiving layer is a driver layer, the wireless network security middleware sends control commands such as setting the channel and sending management frames to the driver layer through a control queue. Figure 5 (5. Send control commands, e.g., SET_CHANNEL, SEND_MGMT) and "6. Receive commands).
[0091] When the transmitting layer is the driver layer and the receiving layer is the wireless network security middleware, the driver layer notifies the wireless network security middleware of events such as scan results, hardware interrupts, and management frame reception through an event queue. Figure 5 (Refer to “7. Send Event / Interrupt e.g., SCAN_RESULTS, RX_MGMT” and “8. Receive Event”).
[0092] As can be seen, this embodiment achieves message isolation and differentiated processing through the aforementioned classification and routing mechanism. The sending layer completes automatic routing through a unified interface combined with indication information, shielding the complexity of the underlying queues and enhancing the decoupling between modules.
[0093] According to some embodiments of this application, based on any of the above embodiments, in step 310, the sending layer writes the message to the message queue of the receiving layer, specifically including: the sending layer performs a validity check on the message by calling the message sending interface, and / or converts the initial format of the message to a target format that is compatible with the receiving layer, and writes the processed message to the message queue of the receiving layer.
[0094] For example, the sending layer encapsulates the message into a unified message format, which includes an event identifier corresponding to the message (used to uniquely identify the event), such as an event ID (Identification), a sending layer tag, a receiving layer tag, and a parameter pointer. The receiving layer tag includes one or more tags, and the parameter pointer indicates the data area storing specific parameters.
[0095] The sending layer automatically performs message validity checks by calling the message sending interface, including checking whether the event identifier is within the defined range, whether the sending layer flag and the receiving layer flag are empty, and whether the data length is reasonable.
[0096] Furthermore, the sending layer can automatically convert the initial message format to a target format suitable for the receiving layer by calling the message sending interface. For example, the receiving layer can be determined based on the receiving layer flag, and then the initial message format can be converted to the target format.
[0097] Finally, the message that has undergone validity verification and / or format conversion is written to the message queue of the receiving layer.
[0098] Taking the user layer sending a connection command and transmitting it to the wireless network security middleware and driver layer as an example, the process is as follows: First, the user layer encapsulates the connection command into a unified message format, including an event ID (indicating a connection event), a sending layer flag indicating the user layer's status, a receiving layer flag indicating the wireless network security middleware and driver layer's status, and a parameter pointer. Next, the user layer automatically performs validity checks by calling the message sending interface `os_send_event`. After passing the validity check, the receiving layer flag determines that the connection command needs to be sent to both the wireless network security middleware and driver layer simultaneously. Thus, the message format is converted for each receiving layer, encapsulating the connection command into a message format recognizable by both the wireless network security middleware and driver layer. Finally, the processed connection command is asynchronously delivered to the respective message queues of the wireless network security middleware and driver layer.
[0099] The wireless network security middleware and driver layer retrieve connection commands from the message queue by polling the message queue or responding to hardware interrupts, and then trigger corresponding functions. Specifically, upon receiving a connection command, the wireless network security middleware notifies the internal protocol stack connection state handler to initiate connection. Upon receiving the connection command, the driver layer triggers hardware connection functions, such as configuring wireless network RF parameters, activating the baseband, and exchanging low-level frames with the target AP. The subsequent interactions between the wireless network security middleware and the driver layer, and their respective complex processing procedures, are transparent to the user layer, as they only communicate with the outside world through the message queue.
[0100] Similarly, the wireless network security middleware and the driver layer return connection processing status to the user layer by calling the message sending interface os_send_event. Specifically, after the wireless network security middleware completes protocol negotiation (e.g., successful or failed association), it generates an event-type message. This message carries an event ID (indicating a connection event), a sending layer identifier indicating the wireless network security middleware, and a receiving layer identifier indicating the user layer. Then, it delivers this message to the user layer's message queue by calling the message sending interface os_send_event. The driver layer also independently delivers event-type messages to the user layer in a similar manner when the hardware completes connection establishment or when an error occurs.
[0101] As can be seen, this embodiment configures message queues for each layer and performs message reading and writing based on the unified interface provided by the operating system abstraction layer, realizing asynchronous communication between layers and improving message concurrency processing capabilities. Legality verification effectively intercepts illegal, incomplete, or abnormal messages, thereby improving security and robustness. Furthermore, format conversion decouples the data between the sending and receiving ends, shielding data format differences between heterogeneous modules and enhancing compatibility and scalability.
[0102] The following describes the data transfer mechanism between different layers.
[0103] Based on any of the above embodiments, the method further includes, for example: Figure 6 Steps 610-620 are shown.
[0104] Step 610: When the wireless network security authentication task is executed, the sending layer transmits data to the shared storage unit and notifies the receiving layer through the indication information of the storage unit.
[0105] For example, the driver layer can manage a pre-allocated shared storage pool, such as a shared memory buffer pool, to store the payloads of data frames to be sent to the outside world, as well as the payloads of data frames received from the outside world. The shared memory buffer pool includes multiple shared storage units, such as multiple shared memory buffers. "Shared" means that the user layer, the wireless network security middleware, and the driver layer can all write and read data from this shared storage pool.
[0106] Based on this, during the execution of the wireless network security authentication task, the sending layer first requests a storage unit that has not yet been written to, and obtains the indication information of that storage unit. This indication information is used to indicate the address of the storage unit. For example, the indication information can be a buffer descriptor (BD). Subsequently, the sending layer transmits data to the storage unit, for example, by writing data to the storage unit based on DMA (Direct Memory Access), and notifies the receiving layer through the indication information of the storage unit. The specific notification process will be described below.
[0107] Step 620: The receiving layer retrieves data from the storage unit based on the indication information.
[0108] For example, the receiving layer can access the address recorded in the instruction information and read data from the storage unit, for example, by retrieving data from the storage unit based on DMA.
[0109] As can be seen, this embodiment separates the message transmission path from the data transmission path, uses message queues to transmit control commands and events, and uses shared memory to transmit data. This ensures reliable control between different levels and achieves high-speed data transmission, improving overall efficiency. Simultaneously, at the architectural level, it ensures that the determinism and reliability of control signaling are not impacted by the data flow, and data forwarding can achieve throughput close to the hardware limits with minimal resource overhead.
[0110] In some embodiments, in steps 610-620 above, the transmitting layer transmits data to a shared storage unit and notifies the receiving layer through the indication information of the storage unit. The receiving layer retrieves data from the storage unit based on the indication information, specifically including steps 611-621.
[0111] Step 611: The sending layer transmits the data to the storage unit, encapsulates the indication information of the storage unit into a message, and writes the message into the message queue of the receiving layer by calling the message sending interface.
[0112] Step 621: The receiving layer obtains indication information from the message queue and obtains the data from the storage unit based on the indication information.
[0113] For example, the indication information of the storage unit can be delivered to the event queue of the receiving layer in the form of a message. The encapsulation process, delivery process, and process of the receiving layer reading the indication information from the message queue are described in the above embodiment and will not be repeated here. Thus, data between the sending layer and the receiving layer is transmitted through a shared storage unit, while the indication information of that storage unit is transmitted through a message queue.
[0114] See also Figure 5 When it is necessary to send network data packets to the outside world, the wireless network security middleware or user layer can act as the sending layer, request a buffer from the shared memory buffer pool, obtain the buffer descriptor of the buffer, and then transfer the network data packet to be sent to the buffer via DMA (corresponding to...). Figure 5 (9. DMA write network data packet). The buffer descriptor is then encapsulated into a message and posted to the driver layer's event queue (corresponding to...). Figure 5 (See "10. Notification Buffer Descriptor"). Accordingly, the driver layer, acting as the receiving layer, reads messages from the event queue and retrieves the buffer descriptor (corresponding to...) from those messages. Figure 5 (11. Read the buffer descriptor). The network packet to be sent is then read from the buffer indicated by the buffer descriptor via DMA (corresponding to...). Figure 5 The code "12. DMA reads network data packets" is then sent to the outside world.
[0115] Similarly, when a network data packet is received from the outside, the driver layer, acting as the sending layer, requests a buffer from the shared memory buffer pool, obtains the buffer descriptor for that buffer, and then transfers the received network data packet to that buffer via DMA. The buffer descriptor is then encapsulated into a message and posted to the event queue of the wireless network security middleware. Correspondingly, the wireless network security middleware, acting as the receiving layer, reads the message from the event queue and retrieves the buffer descriptor from the message. It then reads the received network data packet from the buffer indicated by the buffer descriptor via DMA, decrypts and processes it, and then passes it to the user layer.
[0116] As can be seen, this embodiment utilizes a shared storage unit to carry data and a message queue to transmit lightweight indication information. This avoids the frequent memory copying and queue blocking problems caused by directly writing large amounts of data to the message queue, significantly reducing memory overhead and improving the throughput of the message queue. Simultaneously, the sending layer encapsulates and sends indication information by calling the message sending interface, shielding upper-layer services from the interaction details of the underlying shared storage. This maintains the uniformity of the message communication interface and the asynchronous decoupling between layers, and greatly improves the efficiency of inter-layer data transmission.
[0117] In some embodiments, in steps 610-620 above, the transmitting layer transmits data to a shared storage unit and notifies the receiving layer through indication information from the storage unit. The receiving layer then retrieves data from the storage unit based on the indication information, specifically including steps 612-622. Steps 611-621 and 612-622 can be executed selectively.
[0118] Step 612: The transmitting layer transmits the data to the storage unit and updates the first pointer in the storage unit index table. The storage unit index table records indication information for multiple storage units and includes a first pointer and a second pointer.
[0119] For example, one or more storage unit index tables are pre-established, recording indication information for multiple storage units. Each storage unit index table includes a first pointer and a second pointer. The storage unit index table is, for example, a descriptor ring, essentially a circular array. The recorded indication information includes, for example, buffer descriptors. The first pointer is, for example, a write pointer, and the second pointer is, for example, a read pointer. When the first and second pointers are the same, i.e., pointing to the same indication information, it means there is no data to be read in the shared storage pool. When the first and second pointers are different, i.e., pointing to different indication information, it means there is data to be read in the shared storage pool.
[0120] Based on this, the sending layer first requests a storage unit that has not yet been written to, for example, the storage unit corresponding to the indication information currently pointed to by the first pointer. Then, it writes the data into the storage unit and, for example, points the first pointer to the next indication information that has not yet been written to.
[0121] Step 622: When the first pointer and the second pointer are different, the receiving layer reads data from the memory cell pointed to by the second pointer and updates the second pointer until the first pointer and the second pointer are the same.
[0122] After the transmitting layer updates the first pointer, the first pointer and the second pointer are different, meaning they point to different indication information, representing data to be read. At this point, the receiving layer starts reading data from the storage unit pointed to by the second pointer and updates the second pointer, for example, by pointing the second pointer to the indication information of the next data to be read, until the first pointer and the second pointer are the same, that is, they point to the same indication information.
[0123] Furthermore, a transmit task (TX) is set up for data to be sent to the outside world, and a receive task (RX) is set up for data received from the outside world. A storage unit index table, such as a descriptor ring, is set up for each of the transmit and receive tasks (TX and RX), and this storage unit index table is directly accessible by hardware. Figure 7As shown, taking the receive task RX as an example, during initialization, the receive task RX pre-attaches indication information (such as buffer descriptors) corresponding to multiple empty memory units (such as empty buffers) in the RX memory unit index table. When the hardware (such as a Wi-Fi chip) receives data, the driver layer automatically writes the received data into these empty memory units sequentially based on DMA. For example, if the first pointer (such as the write pointer) currently points to the buffer descriptor desc2, then the data is written into the memory unit corresponding to the buffer descriptor desc2. After the data writing is completed, the ISR is triggered, and the ISR updates the first pointer in the RX memory unit index table to point to the next empty indication information, indicating that there is new received data. The receive task RX is notified to perform task processing by sending signals or setting flag bits.
[0124] Accordingly, the receive task RX is awakened, and when the first pointer and the second pointer are not the same, it starts from the second pointer (e.g., the read pointer) in the RX storage cell index table, reads data from the storage cell that has been filled with data, hands it over to the protocol stack in the wireless network security middleware for processing, and updates the second pointer to point to the next indication information that needs to be read, until the first pointer and the second pointer are the same. At the same time, the receive task RX obtains a new storage cell that has not been written to from the shared storage pool and fills the indication information of the storage cell into the RX storage cell index table to keep DMA running continuously. The data processing process of the transmit task TX is similar to that of the receive task RX, and will not be described in detail here.
[0125] As can be seen, this embodiment achieves read-write synchronization by comparing the first and second pointers in the storage unit index table, without relying on heavyweight mutex locks or complex synchronization mechanisms. This reduces thread blocking and context switching overhead, achieving lightweight, low-latency data interaction. Furthermore, the storage unit filling and data extraction logic are integrated into the corresponding tasks, further simplifying the data flow.
[0126] Based on any of the above embodiments, this application also provides, as follows: Figure 1 The wireless network security authentication device shown in the embedded device includes an operating system abstraction layer 110, a wireless network security middleware 120, and a driver layer 130. Optionally, the device also includes a user layer.
[0127] The operating system abstraction layer 110 provides system service interfaces. These interfaces are bound to the target kernel functions during the compilation phase of the wireless network security middleware or during the initialization phase of the target operating system on the embedded device. The target kernel functions are adapted to the target operating system.
[0128] Wireless network security middleware 120 is used to respond to wireless network security authentication tasks to be executed by calling target kernel functions through system service interfaces to obtain system services and then executing wireless network security authentication tasks based on the system services.
[0129] In some embodiments, the wireless network security middleware 120 is specifically configured to, in response to a call to a system service interface, obtain a target function pointer table pointed to by a global pointer; in the target function pointer table, find the target function pointer corresponding to the called system service interface, and call the target kernel function corresponding to the target function pointer.
[0130] The target function pointer table is one of multiple pre-established function pointer tables corresponding to the target operating system, and is registered to the global pointer during the initialization of the target operating system; each function pointer table corresponds to an operating system and contains function pointers to the kernel functions corresponding to each system service interface; In some embodiments, the system service interface includes a message sending interface, and any one of the user layer, the wireless network security middleware 120, and the driver layer 130 is a sending layer; any one or more of the user layer, the wireless network security middleware 120, and the driver layer 130 other than the sending layer are receiving layers.
[0131] The sending layer is used to write messages to the message queue of the receiving layer by calling the message sending interface when the wireless network security authentication task is executed.
[0132] The receiving layer is used to read messages from the message queue.
[0133] In some embodiments, the message carries first indication information of the message type; the message type includes control commands and events; the message queue includes a control command queue and an event queue.
[0134] Specifically, the sending layer is used to determine whether a message is a control command or an event based on the first indication information by calling the message sending interface. If it is a control command, the message is written to the control command queue of the receiving layer; if it is an event, the message is written to the event queue of the receiving layer.
[0135] In some embodiments, the sending layer is specifically used to perform validity checks on messages by calling the message sending interface, and / or convert the initial format of the message to a target format adapted to the receiving layer, and write the processed message into the message queue of the receiving layer.
[0136] In some embodiments, the transmitting layer is specifically configured to transmit data to a shared storage unit during the execution of a wireless network security authentication task, and notify the receiving layer through indication information from the storage unit.
[0137] The receiving layer is specifically used to retrieve data from the storage unit based on instruction information.
[0138] In some embodiments, the sending layer is specifically used to transmit data to the storage unit, encapsulate the indication information of the storage unit into a message, and write the message into the message queue of the receiving layer by calling the message sending interface. The receiving layer is specifically used to retrieve indication information from the message queue and retrieve data from the storage unit based on the indication information.
[0139] In some embodiments, the transmitting layer is specifically configured to transmit data to a storage unit and update a first pointer in the storage unit index table. The storage unit index table records indication information for multiple storage units and includes a first pointer and a second pointer.
[0140] Specifically, the receiving layer is used to read data from the memory cell pointed to by the second pointer and update the second pointer when the first pointer and the second pointer are different, until the first pointer and the second pointer are the same.
[0141] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0142] Based on the wireless network security authentication method in an embedded device described in any of the above embodiments, this application also provides a computer program product, which includes one or more computer programs or instructions. The computer program or instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. When the computer program is executed by a processor, it implements the wireless network security authentication method in an embedded device described in any of the above embodiments.
[0143] Based on the wireless network security authentication method in an embedded device described in any of the above embodiments, this application also provides, as well as... Figure 8 The diagram shows the structure of an embedded device. Figure 8 At the hardware level, the embedded device includes a processor, an internal bus, a network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the wireless network security authentication method in an embedded device as described in any of the above embodiments.
[0144] This application also provides a computer storage medium storing a computer program, which, when executed by a processor, can be used to perform a wireless network security authentication method in an embedded device as described in any of the above embodiments.
[0145] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0146] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0147] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0148] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0149] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0150] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A wireless network security authentication method in an embedded device, characterized in that, The method includes: In response to a pending wireless network security authentication task, the wireless network security middleware calls a target kernel function through a system service interface provided by the operating system abstraction layer to obtain system services; wherein, the target kernel function is adapted to the target operating system of the embedded device; the system service interface and the target kernel function are bound during the compilation phase of the wireless network security middleware or during the initialization phase of the target operating system; The wireless network security middleware performs the wireless network security authentication task based on the system service.
2. The method according to claim 1, characterized in that, The system service interface and the target kernel function are bound together during the compilation phase of the wireless network security middleware through the following steps: During the compilation phase of the wireless network security middleware, the system service interface is bound to the target kernel function based on the target implementation file.
3. The method according to claim 2, characterized in that, The binding of the system service interface to the target kernel function based on the target implementation file includes: The target implementation file corresponding to the target operating system is determined from multiple implementation files; wherein, each implementation file records the mapping relationship between system service interfaces and kernel functions under the corresponding operating system; Based on the target mapping relationship recorded in the target implementation file, the system service interface is bound to the target kernel function.
4. The method according to claim 2, characterized in that, The target implementation file includes mapping relationships between system service interfaces and kernel functions under multiple operating systems; the binding of the system service interfaces and the target kernel functions based on the target implementation file includes: In the target implementation file, a target mapping relationship corresponding to the target operating system is selected through conditional compilation macros; Based on the target mapping relationship, the target kernel function is bound to the system service interface.
5. The method according to claim 1, characterized in that, The system service interface and the target kernel function are bound to each other during the initialization phase of the target operating system; The wireless network security middleware calls target kernel functions through the system service interface provided by the operating system abstraction layer, including: In response to a call to the system service interface, a target function pointer table pointed to by a global pointer is obtained; wherein, the target function pointer table is one of a plurality of function pointer tables pre-established and corresponding to the target operating system, and is registered to the global pointer during the initialization of the target operating system; each function pointer table corresponds to an operating system and contains function pointers to kernel functions corresponding to each system service interface; In the target function pointer table, find the target function pointer corresponding to the called system service interface, and call the target kernel function corresponding to the target function pointer.
6. The method according to claim 1, characterized in that, The system service interface includes a message sending interface, and the method further includes: When the wireless network security authentication task is executed, the sending layer writes the message to the message queue of the receiving layer by calling the message sending interface; The receiving layer reads the message from the message queue; The transmitting layer includes any one of the user layer, the wireless network security middleware, and the driver layer; the receiving layer includes any one or more of the user layer, the wireless network security middleware, and the driver layer, excluding the transmitting layer.
7. The method according to claim 6, characterized in that, The message carries first indication information about the message type; the message type includes control commands and events; the message queue includes a control command queue and an event queue. The sending layer writes messages to the message queue of the receiving layer by calling the message sending interface, including: The sending layer determines whether the message is a control command or an event based on the first indication information by calling the message sending interface. If it is a control command, the message is written to the control command queue of the receiving layer; if it is an event, the message is written to the event queue of the receiving layer.
8. The method according to claim 6 or 7, characterized in that, The sending layer writes messages to the message queue of the receiving layer by calling the message sending interface, including: The sending layer verifies the validity of the message by calling the message sending interface, and / or converts the initial format of the message to a target format suitable for the receiving layer, and writes the processed message into the message queue of the receiving layer.
9. The method according to any one of claims 1-7, characterized in that, The method further includes: When the wireless network security authentication task is executed, the sending layer transmits data to the shared storage unit and notifies the receiving layer through the indication information of the storage unit; The receiving layer obtains the data from the storage unit based on the indication information.
10. The method according to claim 9, characterized in that, The transmitting layer transmits data to a shared storage unit and notifies the receiving layer through indication information from the storage unit; the receiving layer retrieves the data from the storage unit based on the indication information, including: The sending layer transmits data to the storage unit, encapsulates the indication information of the storage unit into a message, and writes the message into the message queue of the receiving layer by calling the message sending interface. The receiving layer obtains the indication information from the message queue and obtains the data from the storage unit based on the indication information.
11. The method according to claim 9, characterized in that, The transmitting layer transmits data to a shared storage unit and notifies the receiving layer through the indication information of the storage unit; The receiving layer obtains the data from the storage unit based on the indication information, including: The transmitting layer transmits data to the storage unit and updates the first pointer in the storage unit index table; wherein, the storage unit index table is used to record indication information of multiple storage units, and includes a first pointer and a second pointer; When the first pointer and the second pointer are different, the receiving layer reads data from the storage unit pointed to by the second pointer and updates the second pointer until the first pointer and the second pointer are the same.
12. A wireless network security authentication device in an embedded device, characterized in that, include: Operating system abstraction layer, wireless network security middleware, and driver layer; among them, The operating system abstraction layer is used to provide system service interfaces; The system service interface and the target kernel function are bound during the compilation phase of the wireless network security middleware or during the initialization phase of the target operating system of the embedded device; the target kernel function is adapted to the target operating system. The wireless network security middleware is used to respond to the wireless network security authentication task to be executed by calling the target kernel function through the system service interface to obtain system services; and to execute the wireless network security authentication task based on the system services.
13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-11.
14. An embedded device, characterized in that, include: A memory and a processor, wherein the memory and the processor are connected; The memory is used to store programs; The processor is configured to invoke a program stored in the memory to execute as claimed in claim 1. The method described in any one of 11.
15. A computer-readable storage medium, characterized in that, It stores computer instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-11.