CN114423024B - WLAN driver framework, componentization method of WLAN driver framework and related equipment - Google Patents
WLAN driver framework, componentization method of WLAN driver framework and related equipment Download PDFInfo
- Publication number
- CN114423024B CN114423024B CN202111556385.6A CN202111556385A CN114423024B CN 114423024 B CN114423024 B CN 114423024B CN 202111556385 A CN202111556385 A CN 202111556385A CN 114423024 B CN114423024 B CN 114423024B
- Authority
- CN
- China
- Prior art keywords
- wlan
- chip
- framework
- component
- driving part
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/02—Arrangements for optimising operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/02—Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
- H04W84/10—Small scale networks; Flat hierarchical networks
- H04W84/12—WLAN [Wireless Local Area Networks]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域technical field
本申请的实施例涉及无线通信领域,尤其涉及一种WLAN驱动框架的组件化方法及相关设备。Embodiments of the present application relate to the field of wireless communication, and in particular, to a componentization method of a WLAN driver framework and related devices.
背景技术Background technique
通常,无线通信技术主要以无线局域网(Wireless Local Area Network,WLAN)技术为主,而在使用WLAN时,需要WLAN芯片和对应的芯片驱动一起配合工作。WLAN技术经过数代的发展以及标准的演进,业务逻辑和应用场景越来越复杂,导致芯片驱动的复杂度也逐渐增大。Usually, the wireless communication technology is mainly based on the wireless local area network (Wireless Local Area Network, WLAN) technology, and when using the WLAN, the WLAN chip and the corresponding chip driver need to work together. After several generations of development and standard evolution of WLAN technology, business logic and application scenarios have become more and more complex, resulting in a gradual increase in the complexity of chip drivers.
WLAN芯片在应用到产品时,由于操作系统提供的开发框架差异很大,导致芯片驱动在不同操作系统上的业务逻辑和实现无法统一,而不同的芯片厂家对开发框架的使用程度不相同,造成相同操作系统下的芯片驱动差异巨大。同时,由于开放框架存在模块间耦合度较高、框架复杂度高、抽象不合理等问题,导致芯片驱动目前开发门槛较高,开发难度很大。When WLAN chips are applied to products, due to the great differences in the development frameworks provided by the operating systems, the business logic and implementation of the chip drivers on different operating systems cannot be unified, and different chip manufacturers use the development frameworks in different degrees, resulting in Chip drivers under the same operating system vary greatly. At the same time, due to the problems of high coupling between modules, high framework complexity, and unreasonable abstraction in the open framework, the development threshold of chip drivers is currently high and the development is very difficult.
发明内容Contents of the invention
本申请实施例公开了一种WLAN驱动框架、WLAN驱动框架的组件化方法及相关设备,能够对WLAN驱动框架进行组件化,规范WLAN驱动框架,降低WLAN驱动框架中组件间的耦合度。The embodiment of the present application discloses a WLAN driver framework, a componentization method of the WLAN driver framework and related equipment, which can componentize the WLAN driver framework, standardize the WLAN driver framework, and reduce the coupling degree between components in the WLAN driver framework.
本申请第一方面公开了一种WLAN驱动框架的组件化方法,WLAN驱动框架的组件化方法包括:将WLAN驱动框架划分为配置部分、核心驱动部分、芯片驱动部分,核心驱动部分包括基础组件和业务组件;利用配置部分对核心驱动部分和芯片驱动部分进行配置,生成配置信息;根据配置信息初始化芯片驱动部分以及核心驱动部分中的基础组件和业务组件;绑定业务组件与芯片驱动部分。The first aspect of the present application discloses a componentization method of the WLAN driver framework. The componentization method of the WLAN driver framework includes: dividing the WLAN driver framework into a configuration part, a core driver part, and a chip driver part. The core driver part includes basic components and Business components; use the configuration part to configure the core driver part and the chip driver part to generate configuration information; initialize the chip driver part and the basic components and business components in the core driver part according to the configuration information; bind the business component and the chip driver part.
本申请的实施例能够对WLAN驱动框架进行组件化,避免不同操作系统中WLAN驱动框架存在巨大差异,规范WLAN驱动框架,降低WLAN驱动框架中组件间的耦合度。此外,还可提升WLAN驱动开发效率,降低开发门槛。The embodiments of the present application can componentize the WLAN driver framework, avoid huge differences in WLAN driver frameworks in different operating systems, standardize the WLAN driver framework, and reduce the coupling degree between components in the WLAN driver framework. In addition, it can also improve the efficiency of WLAN driver development and lower the development threshold.
在一些可选的实施方式中,核心驱动部分的配置信息包括业务组件支持信息、基础组件支持信息。In some optional implementation manners, the configuration information of the core driver part includes business component support information and basic component support information.
通过采用该技术方案,可实现对WLAN驱动框架所支持的业务组件的配置。By adopting the technical solution, the configuration of the service components supported by the WLAN driver framework can be realized.
在一些可选的实施方式中,WLAN驱动框架的组件化方法还包括:利用配置部分根据芯片驱动部分的配置信息修改业务组件支持信息。In some optional implementation manners, the componentization method of the WLAN driver framework further includes: using the configuration part to modify the service component support information according to the configuration information of the chip driver part.
通过采用该技术方案,可实现根据功能或用户需要,对业务组件支持信息进行配置。By adopting the technical solution, it is possible to configure the support information of the service component according to the function or user's needs.
在一些可选的实施方式中,根据配置信息初始化核心驱动部分中的基础组件和业务组件包括:解析核心驱动部分的配置信息,得到解析后的核心驱动部分的配置信息;创建WLAN组件框架;基于WLAN组件框架,根据解析后的核心驱动部分的配置信息初始化核心驱动部分中的基础组件和业务组件。In some optional embodiments, initializing the basic components and service components in the core driver part according to the configuration information includes: analyzing the configuration information of the core driver part to obtain the configuration information of the core driver part after analysis; creating a WLAN component framework; The WLAN component framework initializes the basic components and service components in the core driver part according to the parsed configuration information of the core driver part.
通过采用该技术方案,可实现核心驱动部分中的基础组件和业务组件的初始化,并避免对于配置信息中不需要的业务组件进行初始化,不仅可以提升初始化效率,还可以避免运行不需要的业务组件。By adopting this technical solution, the initialization of the basic components and business components in the core driver part can be realized, and the initialization of unnecessary business components in the configuration information can be avoided, which can not only improve the initialization efficiency, but also avoid running unnecessary business components .
在一些可选的实施方式中,创建WLAN组件框架包括:创建框架结构体;创建框架结构体处理方法;挂接框架结构体处理方法的实现函数;对框架结构体注册框架结构体处理方法和配置信息。In some optional implementation manners, creating the WLAN component framework includes: creating a frame structure; creating a frame structure processing method; hooking an implementation function of the frame structure processing method; registering the frame structure processing method and configuration for the frame structure information.
通过采用该技术方案,可实现WLAN组件框架的创建。By adopting the technical solution, the creation of the WLAN component framework can be realized.
在一些可选的实施方式中,基于WLAN组件框架,根据解析后的核心驱动部分的配置信息初始化核心驱动部分中的基础组件和业务组件包括:根据解析后的核心驱动部分的配置信息确定支持的组件和支持的业务子组件;基于WLAN组件框架初始化支持的组件和支持的业务子组件。In some optional implementation manners, based on the WLAN component framework, initializing the basic components and service components in the core driver part according to the configuration information of the core driver part after parsing includes: determining the supported Components and supported service subcomponents; the supported components and supported service subcomponents are initialized based on the WLAN component framework.
通过采用该技术方案,可实现核心驱动部分中的基础组件和业务组件的初始化。根据配置信息初始化业务组件可以实现根据功能需要裁剪WLAN组件框架中的部分组件。By adopting the technical solution, the initialization of the basic components and business components in the core driver part can be realized. Initializing the service components according to the configuration information can realize tailoring some components in the WLAN component framework according to functional requirements.
在一些可选的实施方式中,绑定业务组件与芯片驱动部分包括:静态绑定业务组件与芯片驱动部分;或动态绑定业务组件与芯片驱动部分。In some optional implementation manners, binding the service component and the chip driver part includes: statically binding the service component and the chip driver part; or dynamically binding the service component and the chip driver part.
通过采用该技术方案,可采用不同的绑定形式实现对业务组件与芯片驱动间的绑定,提升WLAN驱动框架的场景适应性。By adopting this technical solution, different binding forms can be used to realize the binding between service components and chip drivers, and improve the scene adaptability of the WLAN driver framework.
在一些可选的实施方式中,静态绑定业务组件与芯片驱动部分包括:根据静态绑定配置信息确定关联的业务子组件与芯片驱动;通过静态配置的方式存储关联的业务子组件与芯片驱动;在同一流程启动关联的业务子组件与芯片驱动。In some optional implementation manners, the static binding of the service component and the chip driver part includes: determining the associated service subcomponent and the chip driver according to the static binding configuration information; storing the associated service subcomponent and the chip driver through static configuration ; Start the associated business subcomponent and chip driver in the same process.
通过采用该技术方案,可实现业务组件与芯片驱动部分的静态绑定,以进行功能挂接。By adopting this technical solution, the static binding of the business component and the chip driver part can be realized for function hooking.
在一些可选的实施方式中,动态绑定业务组件与芯片驱动部分包括:启动业务组件;基于芯片检测确定芯片;根据确定的芯片从芯片驱动部分启动芯片驱动。In some optional implementation manners, dynamically binding the service component and the chip driver includes: starting the service component; determining the chip based on chip detection; and starting the chip driver from the chip driver according to the determined chip.
通过采用该技术方案,可实现业务组件与芯片驱动部分的动态绑定,根据功能或用户需要进行业务组件与芯片驱动部分的动态绑定,提升WLAN驱动框架的场景适应性。By adopting this technical solution, the dynamic binding of business components and chip driver parts can be realized, and the dynamic binding of business components and chip driver parts can be performed according to functions or user needs, and the scene adaptability of the WLAN driver framework can be improved.
在一些可选的实施方式中,在动态绑定业务组件与芯片驱动部分之后,WLAN驱动框架的组件化方法还包括:业务组件包括一个或多个业务子组件,根据绑定的业务子组件占用的芯片资源和绑定的芯片资源调整绑定的业务子组件与芯片驱动部分间的动态绑定关系。In some optional implementation manners, after dynamically binding the service component and the chip driver part, the componentization method of the WLAN driver framework further includes: the service component includes one or more service sub-components, and the bound service sub-component occupies The chip resource and the bound chip resource adjust the dynamic binding relationship between the bound business sub-component and the chip driver part.
通过采用该技术方案,可进一步提升WLAN驱动框架的部署灵活性,动态地根据用户需要或功能调整绑定关系。By adopting this technical solution, the deployment flexibility of the WLAN driver framework can be further improved, and the binding relationship can be dynamically adjusted according to user needs or functions.
本申请第二方面公开了一种WLAN驱动框架,WLAN驱动框架包括配置部分、核心驱动部分和芯片驱动部分,其中,核心驱动部分包括基础组件和业务组件;配置部分对核心驱动部分和芯片驱动部分进行配置,生成配置信息;核心驱动部分根据配置信息初始化核心驱动部分中的基础组件和业务组件;芯片驱动部分根据配置信息初始化芯片驱动部分中的芯片驱动。The second aspect of the present application discloses a WLAN driver framework. The WLAN driver framework includes a configuration part, a core driver part and a chip driver part, wherein the core driver part includes basic components and service components; Configure and generate configuration information; the core driver part initializes the basic components and business components in the core driver part according to the configuration information; the chip driver part initializes the chip driver in the chip driver part according to the configuration information.
通过采用该技术方案,可避免不同操作系统中WLAN驱动框架存在巨大差异,规范WLAN驱动框架,降低WLAN驱动框架中组件间的耦合度。并提升WLAN驱动开发效率,降低开发门槛。By adopting the technical solution, it is possible to avoid huge differences in WLAN driver frameworks in different operating systems, standardize the WLAN driver framework, and reduce the coupling degree between components in the WLAN driver framework. And improve the efficiency of WLAN driver development and lower the development threshold.
在一些可选的实施方式中,核心驱动部分的配置信息包括业务组件支持信息、基础组件支持信息。In some optional implementation manners, the configuration information of the core driver part includes business component support information and basic component support information.
通过采用该技术方案,可实现对WLAN驱动框架所支持的业务组件的配置。By adopting the technical solution, the configuration of the service components supported by the WLAN driver framework can be realized.
在一些可选的实施方式中,若接收到芯片驱动部分的配置信息,配置部分根据芯片驱动部分的配置信息修改业务组件支持信息。In some optional implementation manners, if the configuration information of the chip driver part is received, the configuration part modifies the service component support information according to the configuration information of the chip driver part.
通过采用该技术方案,可实现根据功能或用户需要配置业务组件支持信息。By adopting the technical solution, it is possible to configure the supporting information of the service component according to the function or user's needs.
在一些可选的实施方式中,核心驱动部分从配置部分解析核心驱动部分的配置信息,得到解析后的核心驱动部分的配置信息;创建WLAN组件框架;基于WLAN组件框架,根据解析后的核心驱动部分的配置信息初始化核心驱动部分中的基础组件和业务组件。In some optional implementation manners, the core driver part parses the configuration information of the core driver part from the configuration part, and obtains the configuration information of the core driver part after analysis; creates a WLAN component framework; based on the WLAN component framework, according to the resolved core driver Part of the configuration information initializes the basic components and business components in the core driver part.
通过采用该技术方案,可实现核心驱动部分中的基础组件和业务组件的初始化。避免对于配置信息中不需要的业务组件进行初始化,提升初始化效率,避免运行不需要的业务组件。By adopting the technical solution, the initialization of the basic components and business components in the core driver part can be realized. Avoid initializing unnecessary business components in configuration information, improve initialization efficiency, and avoid running unnecessary business components.
在一些可选的实施方式中,核心驱动部分创建WLAN组件框架包括:创建框架结构体;创建框架结构体处理方法;挂接框架结构体处理方法的实现函数;对框架结构体注册框架结构体处理方法和配置信息。In some optional implementation manners, the creation of the WLAN component framework by the core driver part includes: creating a frame structure; creating a frame structure processing method; hooking the implementation function of the frame structure processing method; registering the frame structure processing for the frame structure method and configuration information.
通过采用该技术方案,可实现WLAN组件框架的创建。By adopting the technical solution, the creation of the WLAN component framework can be realized.
在一些可选的实施方式中,核心驱动部分根据解析后的核心驱动部分的配置信息确定支持的组件和支持的业务子组件;基于WLAN组件框架初始化支持的组件和支持的业务子组件。In some optional implementation manners, the core driver part determines the supported components and supported service subcomponents according to the parsed configuration information of the core driver part; and initializes the supported components and supported service subcomponents based on the WLAN component framework.
通过采用该技术方案,可实现核心驱动部分中的基础组件和业务组件的初始化。根据配置信息初始化业务组件可以实现根据功能需要裁剪WLAN组件框架中的部分组件。By adopting the technical solution, the initialization of the basic components and business components in the core driver part can be realized. Initializing the service components according to the configuration information can realize tailoring some components in the WLAN component framework according to functional requirements.
在一些可选的实施方式中,核心驱动部分绑定业务组件与芯片驱动部分。In some optional implementation manners, the core driver part binds the service component and the chip driver part.
通过采用该技术方案,可实现业务组件与芯片驱动部分的绑定,进行功能挂接。By adopting this technical solution, the binding of the business component and the driver part of the chip can be realized, and the functions can be linked.
在一些可选的实施方式中,核心驱动部分静态绑定或动态绑定业务组件与芯片驱动部分。In some optional implementation manners, the core driver part is statically or dynamically bound to the service component and the chip driver part.
通过采用该技术方案,可实现对业务组件与芯片驱动的不同绑定形式,提升WLAN驱动框架的场景适应性。By adopting this technical solution, different binding forms of service components and chip drivers can be realized, and the scene adaptability of the WLAN driver framework can be improved.
本申请第三方面公开了一种电子设备,包括处理器和存储器;存储器,用于存储指令;处理器,用于调用存储器中的指令,使得电子设备执行的WLAN驱动框架的组件化方法。The third aspect of the present application discloses an electronic device, including a processor and a memory; the memory is used to store instructions; the processor is used to call the instructions in the memory, so that the electronic device executes a WLAN driver framework componentization method.
本申请第四方面公开了一种计算机可读存储介质,计算机可读存储介质存储有至少一个指令,至少一个指令被处理器执行时实现的WLAN驱动框架的组件化方法。The fourth aspect of the present application discloses a computer-readable storage medium, the computer-readable storage medium stores at least one instruction, and the componentization method of the WLAN driver framework is implemented when the at least one instruction is executed by a processor.
第二方面至第四方面所带来的技术效果可参见上述方法部分各涉及的方法相关的描述,此处不再赘述。For the technical effects brought about by the second aspect to the fourth aspect, please refer to the descriptions related to the methods involved in the above methods, and details will not be repeated here.
附图说明Description of drawings
图1A是LINUX操作系统的WLAN驱动框架示意图。FIG. 1A is a schematic diagram of a WLAN driver framework of a LINUX operating system.
图1B是WINDOWS操作系统的网络驱动框架示意图。FIG. 1B is a schematic diagram of a network driver framework of the WINDOWS operating system.
图2是本申请实施例提供的一种WLAN驱动框架的示意图。Fig. 2 is a schematic diagram of a WLAN driver framework provided by an embodiment of the present application.
图3是本申请实施例提供的一种WLAN驱动框架的组件示意图。Fig. 3 is a schematic diagram of components of a WLAN driver framework provided by an embodiment of the present application.
图4是本申请实施例提供的一种WLAN驱动框架的组件分类示意图。FIG. 4 is a schematic diagram of component classification of a WLAN driver framework provided by an embodiment of the present application.
图5是本申请实施例提供的一种业务组件与芯片驱动部分间的绑定示意图。Fig. 5 is a schematic diagram of binding between a service component and a chip driver provided by an embodiment of the present application.
图6是本申请实施例提供的一种WLAN驱动框架的组件化方法流程图。Fig. 6 is a flow chart of a componentization method of a WLAN driver framework provided by an embodiment of the present application.
图7是本申请实施例提供的初始化的WLAN驱动框架。FIG. 7 is an initialized WLAN driver framework provided by the embodiment of the present application.
图8是本申请实施例提供的电子设备100的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
图9是本申请实施例提供的电子设备100的软件结构框图。FIG. 9 is a block diagram of the software structure of the electronic device 100 provided by the embodiment of the present application.
具体实施方式Detailed ways
需要说明的是,本申请实施例中“至少一个”是指一个或者多个,“多个”是指两个或多于两个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。本申请的说明书和权利要求书及附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不是用于描述特定的顺序或先后次序。It should be noted that in the embodiments of the present application, "at least one" refers to one or more, and "multiple" refers to two or more than two. "And/or" describes the association relationship of associated objects, indicating that there can be three types of relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B Can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this application and the drawings are used to distinguish similar objects, not to Describe a specific order or sequence.
在电子设备的操作系统中,无线局域网(WLAN,Wireless Local Area Network)驱动框架的组件化包括WLAN驱动框架的划分、加载、运行以及WLAN驱动框架内部的处理逻辑。WLAN驱动框架内部的处理逻辑可以包括控制业务和数据业务的处理逻辑。In the operating system of the electronic device, the componentization of the wireless local area network (WLAN, Wireless Local Area Network) driver framework includes division, loading, operation of the WLAN driver framework and processing logic inside the WLAN driver framework. The processing logic inside the WLAN driver framework may include processing logic for control services and data services.
为了更好地理解本申请实施例提供的WLAN驱动框架的组件化方法及相关设备,下面首先对LINUX操作系统和WINDOWS操作系统的WLAN驱动框架进行描述。In order to better understand the componentization method and related devices of the WLAN driver framework provided by the embodiments of the present application, the WLAN driver frameworks of the LINUX operating system and the WINDOWS operating system are firstly described below.
图1A是LINUX操作系统的WLAN驱动框架示意图。如图1A所示,电子设备中的LINUX操作系统的WLAN驱动框架包括组件nl80211、cfg80211、mac80211、chip driver等。其中,nl80211用于与电子设备中的用户态应用程序进行交互;cfg80211是与WLAN功能相关的管理接口,用于电子设备中的系统应用程序对WLAN芯片进行控制;mac80211是WLAN 802.11协议层组件,提供802.11协议标准的媒体存取控制位址(MAC,Media Access ControlAddress)层的功能;WLAN芯片驱动(chip driver)部分可由电子设备中的网络设备的生产厂商提供,用于对网络设备的管理,例如,初始化、控制、参数配置、监控、数据交互等。cfg80211和mac80211通过接口cfg80211_ops与chip driver进行交互。FIG. 1A is a schematic diagram of a WLAN driver framework of a LINUX operating system. As shown in FIG. 1A , the WLAN driver framework of the LINUX operating system in the electronic device includes components nl80211, cfg80211, mac80211, chip driver and so on. Among them, nl80211 is used to interact with user mode applications in electronic devices; cfg80211 is a management interface related to WLAN functions, used for system applications in electronic devices to control WLAN chips; mac80211 is a WLAN 802.11 protocol layer component, Provide the function of the Media Access Control Address (MAC, Media Access Control Address) layer of the 802.11 protocol standard; the WLAN chip driver (chip driver) part can be provided by the manufacturer of the network equipment in the electronic equipment, and is used for the management of the network equipment. For example, initialization, control, parameter configuration, monitoring, data interaction, etc. cfg80211 and mac80211 interact with the chip driver through the interface cfg80211_ops.
LINUX操作系统的WLAN驱动框架还包括skb(网络传输的数据模型),用于保存传输的网络数据及控制信息,提供网络数据的相关操作,以供WLAN驱动框架调用。LINUX操作系统还包括用户态的wpa_supplicant(Wi-Fi驱动与用户的中转站),用于支持协议和加密认证。The WLAN driver framework of the LINUX operating system also includes skb (data model for network transmission), which is used to store transmitted network data and control information, and provide related operations on network data for calling by the WLAN driver framework. The LINUX operating system also includes wpa_supplicant (the transfer station between the Wi-Fi driver and the user) in the user state, which is used to support protocols and encryption authentication.
LINUX操作系统的WLAN驱动框架组件划分简单,接口功能没有分类,面向对象的抽象较为底层。LINUX操作系统可定义cfg80211,未对chip driver进行规范和约束,导致各芯片生产厂商的驱动业务逻辑差异较大,存在功能差异等。The components of the WLAN driver framework of the LINUX operating system are simply divided, the interface functions are not classified, and the object-oriented abstraction is relatively low-level. The LINUX operating system can define cfg80211, but does not regulate and restrict the chip driver, resulting in large differences in driver business logic and functional differences among chip manufacturers.
图1B是WINDOWS操作系统的网络驱动框架示意图,WINDOWS操作系统的网络驱动框架可以包括WLAN驱动框架。如图1B所示,电子设备中的WINDOWS操作系统的WLAN驱动框架包括网络驱动程序接口规范(Network Driver Interface Specification,NDIS)、微型端口驱动(Miniport driver)、中间驱动(Intermediate Driver)等。其中,NDIS通过ndis.sys库提供网络驱动的管理,例如,可包括驱动的注册/卸载、网络设备的添加/删除、网络协议绑定等功能。NDIS内部的“Native 802.11IM driver”模块提供WLAN的通用功能。Miniportdriver是电子设备中的网络设备的生产厂商提供的网络设备驱动,用于网络设备的管理,例如执行初始化、控制、参数配置、监控、数据交互等。网络设备驱动可以向WINDOWS操作系统注册驱动。Intermediate Driver是中间层驱动,用于数据监控、负荷分担等。WINDOWS操作系统的WLAN驱动框架可以通过WLAN设备驱动程序接口(WLAN Device DriverInterface,WDI)隔离WLAN芯片驱动。WINDOWS操作系统提供网络管理、协议层绑定以及驱动管理等功能。FIG. 1B is a schematic diagram of a network driver framework of the WINDOWS operating system, and the network driver framework of the WINDOWS operating system may include a WLAN driver framework. As shown in FIG. 1B, the WLAN driver framework of the WINDOWS operating system in the electronic device includes a Network Driver Interface Specification (NDIS), a miniport driver (Miniport driver), an intermediate driver (Intermediate Driver) and the like. Among them, NDIS provides network driver management through the ndis.sys library, for example, it may include driver registration/uninstallation, network device addition/deletion, network protocol binding and other functions. The "Native 802.11IM driver" module inside NDIS provides general functions of WLAN. Miniportdriver is a network device driver provided by the manufacturer of the network device in the electronic device, which is used for the management of the network device, such as performing initialization, control, parameter configuration, monitoring, data interaction, etc. The network device driver can register the driver with the WINDOWS operating system. Intermediate Driver is an intermediate driver, used for data monitoring, load sharing, etc. The WLAN driver framework of the WINDOWS operating system can isolate the WLAN chip driver through a WLAN Device Driver Interface (WLAN Device Driver Interface, WDI). The WINDOWS operating system provides functions such as network management, protocol layer binding, and driver management.
如图1B所示,TCP/IP(Transmission Control Protocol/Internet Protocol,传输控制协议/网际协议)是网络传输的协议栈,用于处理网络协议;网络接口卡(networkinterface card,NIC),NIC device是网络设备。WDI是NDIS与Miniport driver间的交互接口,管理对象为适配器和接口,用于WLAN网络设备的管理,例如初始化、控制、参数设置以及事件上报等。As shown in Figure 1B, TCP/IP (Transmission Control Protocol/Internet Protocol, Transmission Control Protocol/Internet Protocol) is a protocol stack for network transmission, which is used to process network protocols; network interface card (network interface card, NIC), NIC device is Network equipment. WDI is the interactive interface between NDIS and Miniport driver. The management objects are adapters and interfaces, which are used for WLAN network device management, such as initialization, control, parameter setting, and event reporting.
WINDOWS操作系统的WLAN驱动框架采用规范化网络驱动程序的接口来实现网络驱动的管理,网络驱动程序接口规范可以是NDIS规范;同时提供一系列API接口用于网络设备驱动的管理,包括网络设备驱动的注册/卸载、网络设备的添加/删除、网络协议绑定等功能。The WLAN driver framework of the WINDOWS operating system adopts a standardized network driver interface to realize network driver management. The network driver interface specification can be the NDIS specification; at the same time, it provides a series of API interfaces for network device driver management, including network device driver Functions such as registration/uninstallation, addition/deletion of network devices, network protocol binding, etc.
WINDOWS操作系统的WLAN驱动框架方案较为复杂,依赖NDIS和WDI,WLAN技术中的功能模块间耦合性强,难以进行裁剪;无法适应小型化、嵌入式设备,并且组件逻辑不够明确。The WLAN driver framework scheme of the WINDOWS operating system is relatively complex, relying on NDIS and WDI, the coupling between functional modules in WLAN technology is strong, and it is difficult to tailor; it cannot adapt to miniaturized and embedded devices, and the component logic is not clear enough.
图2是本申请实施例提供的一种WLAN驱动框架的示意图。Fig. 2 is a schematic diagram of a WLAN driver framework provided by an embodiment of the present application.
在本申请提供的实施例中,依照配置与业务分离的思想,可以将WLAN驱动框架进行如图2所示的设计,具体而言,可将WLAN驱动框架分成配置部分(例如,配置部分)和驱动部分,而对于驱动部分再次按照业务和业务提供者的不同进一步划分为两部分,例如,核心驱动部分(Core driver)以及芯片驱动部分(chip driver)。其中,芯片驱动部分的芯片驱动适配于芯片厂家。In the embodiment provided by this application, according to the idea of separation of configuration and business, the WLAN driver framework can be designed as shown in Figure 2. Specifically, the WLAN driver framework can be divided into configuration parts (for example, configuration parts) and The driver part, and the driver part is further divided into two parts according to different services and service providers, for example, a core driver part (Core driver) and a chip driver part (chip driver). Among them, the chip driver of the chip driver part is adapted to the chip manufacturer.
配置部分可以基于华为配置语言HCS(HDF Configuration Source),对核心驱动部分和芯片驱动部分进行描述和配置,并生成配置信息。基于华为配置语言的配置部分(HCS-CFG)可以包括基于华为配置语言的WLAN配置部分(WLAN HCS-CFG)。HCS-CFG可以对WLAN驱动框架进行开发版本配置、驱动配置、组件配置。The configuration part can describe and configure the core driver part and the chip driver part based on the Huawei configuration language HCS (HDF Configuration Source), and generate configuration information. The Huawei configuration language-based configuration part (HCS-CFG) may include the Huawei configuration language-based WLAN configuration part (WLAN HCS-CFG). HCS-CFG can perform development version configuration, driver configuration, and component configuration on the WLAN driver framework.
核心驱动部分根据配置信息初始化核心驱动部分中的基础组件和业务组件。核心驱动部分是WLAN驱动框架中驱动部分的实体,WLAN驱动框架的公共部分。基于对WLAN业务逻辑的拆分和功能的抽象,将核心驱动部分划分为基础组件和业务组件。组件是WLAN驱动功能拆分后的功能单元,每个组件和每个组件的子组件具备标准化的实现。其中,基础组件可以包括配置管理组件、通信组件、协议组件、数据组件、总线(Bus)组件等必需的组件;业务组件可以包括访问接入点(Access Point,AP)子组件、站(Station,STA)子组件、邻近感知网络(Neighbor Awareness Networking,NAN)子组件等实现实际业务的业务子组件。对于各个组件的描述可参考下文针对图3的说明。The core driver part initializes the basic components and business components in the core driver part according to the configuration information. The core driver part is the entity of the driver part in the WLAN driver framework, and is a public part of the WLAN driver framework. Based on the splitting of WLAN business logic and the abstraction of functions, the core driver part is divided into basic components and business components. A component is a functional unit after the WLAN driver function is split, and each component and each sub-component has a standardized implementation. Among them, the basic components can include configuration management components, communication components, protocol components, data components, bus (Bus) components and other necessary components; business components can include access point (Access Point, AP) subcomponents, station (Station, STA) subcomponents, Neighbor Awareness Networking (Neighbor Awareness Networking, NAN) subcomponents and other service subcomponents that implement actual services. For the description of each component, reference may be made to the description of FIG. 3 below.
芯片驱动部分根据配置信息初始化芯片驱动部分中的芯片驱动。芯片驱动实现芯片适配,主要是各芯片厂家实现的802.11MAC层接口、芯片通信、数据流控制以及WLAN芯片控制等。The chip driver part initializes the chip driver in the chip driver part according to the configuration information. The chip driver implements chip adaptation, mainly the 802.11 MAC layer interface, chip communication, data flow control, and WLAN chip control implemented by each chip manufacturer.
核心驱动部分的业务组件可以与芯片驱动部分进行静态绑定或动态绑定。核心驱动部分可以从配置部分解析核心驱动部分的配置信息,得到解析后的核心驱动部分的配置信息。核心驱动部分可以创建WLAN组件框架。基于WLAN组件框架,核心驱动部分可以根据解析后的核心驱动部分的配置信息初始化核心驱动部分中的基础组件和业务组件。The business components of the core driver part can be statically or dynamically bound to the chip driver part. The core driver part can parse the configuration information of the core driver part from the configuration part, and obtain the parsed configuration information of the core driver part. The core driver part can create WLAN component framework. Based on the WLAN component framework, the core driver part can initialize basic components and service components in the core driver part according to the parsed configuration information of the core driver part.
具体地,核心驱动部分可以根据解析后的核心驱动部分的配置信息确定支持的组件和支持的业务子组件;基于WLAN组件框架初始化支持的组件和支持的业务子组件。Specifically, the core driver part can determine the supported components and supported service subcomponents according to the parsed configuration information of the core driver part; and initialize the supported components and supported service subcomponents based on the WLAN component framework.
在本申请的实施例中,可实现静态或动态绑定业务组件与芯片驱动部分。例如,配置信息包括静态绑定配置信息,核心驱动部分根据静态绑定配置信息确定关联的业务子组件与芯片驱动;通过静态配置的方式存储关联的业务子组件与芯片驱动。芯片驱动部分在同一流程启动关联的业务子组件与芯片驱动。又如,动态绑定业务组件与芯片驱动部分包括:启动业务组件;基于芯片检测确定芯片;根据确定的芯片从芯片驱动部分启动芯片驱动。其中,对于业务组件与芯片驱动的绑定方式可参照下文针对图5以及图6中的详细说明。In the embodiment of the present application, static or dynamic binding of the service component and the chip driver part can be realized. For example, the configuration information includes static binding configuration information, and the core driver determines the associated business subcomponent and chip driver according to the static binding configuration information; stores the associated business subcomponent and chip driver through static configuration. The chip driver part starts the associated business subcomponent and chip driver in the same process. As another example, the dynamic binding of the service component and the chip driver includes: starting the service component; determining the chip based on chip detection; and starting the chip driver from the chip driver according to the determined chip. Wherein, for the binding manner of the business component and the chip driver, refer to the detailed description in FIG. 5 and FIG. 6 below.
图3是本申请实施例提供的一种WLAN驱动框架的组件示意图。Fig. 3 is a schematic diagram of components of a WLAN driver framework provided by an embodiment of the present application.
如上文所述,WLAN驱动框架包括核心驱动部分、芯片驱动部分、配置部分,其中,核心驱动部分能根据配置信息初始化核心驱动部分中的基础组件和业务组件。具体地,基础组件可以包括通信组件①、配置管理组件②、协议组件⑥、数据组件、总线组件⑩等必需的组件。业务组件可以包括AP子组件③、STA子组件④、NAN子组件⑤等实现实际业务的业务子组件。数据组件可以包括NetDevice对象⑦、NetBuf数据结构⑧、FlowCtl参数⑨,其中,FlowCtl参数⑨表示用于流控制的参数。As mentioned above, the WLAN driver framework includes a core driver part, a chip driver part, and a configuration part, wherein the core driver part can initialize basic components and service components in the core driver part according to configuration information. Specifically, the basic components may include communication components ①,
以上对组件和/或子组件的说明仅为举例说明,实际应用中不局限于此,例如,业务组件还可以包括更多的业务子组件,如AN子组件。The above description of the components and/or sub-components is only an example, and is not limited thereto in practical applications. For example, the service component may also include more service sub-components, such as the AN sub-component.
业务组件是按照WLAN功能进行抽象化的组件对象,其中,AP子组件③提供无线工作站对有线局域网的访问,以及有线局域网对无线工作站的访问,STA子组件④实现站(基础架构)功能,NAN子组件⑤实现WLAN感知功能。核心驱动部分可以按照“通信组件-业务组件-协议组件-数据组件-总线组件”的方式对多个组件进行组合。其中,业务组件可根据实际功能需求进行组件化组装,例如,对于不需要的功能,可以删除相应的组件;对于新增的功能,可以新建相应的组件。Business components are component objects abstracted according to WLAN functions. Among them, AP subcomponent ③ provides wireless workstations with access to wired LANs, and wired LANs to wireless workstations. STA subcomponent ④ implements station (infrastructure) functions. NAN Subcomponent ⑤ implements the WLAN sensing function. The core driver part can combine multiple components in the manner of "communication component-business component-protocol component-data component-bus component". Among them, business components can be assembled according to actual functional requirements. For example, for unnecessary functions, corresponding components can be deleted; for newly added functions, corresponding components can be created.
配置管理组件②可以配置核心驱动部分,可以解析、管理配置信息,用于裁剪组件。The
通信组件①可以用多种通信方式解决不同平台的通信差异,同时通信组件①可以分别部署在业务子组件,用来支持业务子组件的独立运行。通信组件①可以与保护无线电脑网络安全系统(Wi-Fi Protected Access,WPA)通信。The communication component ① can use multiple communication methods to solve the communication differences between different platforms. At the same time, the communication component ① can be deployed in the business sub-components to support the independent operation of the business sub-components. The communication component ① can communicate with the wireless computer network security system (Wi-Fi Protected Access, WPA).
协议组件⑥可以是802.11协议MAC层的API适配接口层,用来适配不同芯片驱动的MAC的API,以屏蔽不同芯片驱动的协议的差异,并对业务屏蔽差异。可选地,协议组件可以包括更多的协议类型。The protocol component ⑥ can be the API adaptation interface layer of the MAC layer of the 802.11 protocol, which is used to adapt the MAC APIs of different chip drivers, so as to shield the differences of the protocols of different chip drivers and shield the differences in services. Optionally, the protocol component can include more protocol types.
本申请实施例提供的WLAN驱动框架可以规范化对上层的API,以统一不同操作系统的WLAN驱动框架对上层的API。The WLAN driver framework provided in the embodiment of the present application can standardize the APIs to the upper layer, so as to unify the APIs to the upper layer from the WLAN driver frameworks of different operating systems.
数据组件是数据业务的抽象组件,用于实现对数据报文的处理、转发和流量控制。其中,NetDevice对象⑦与业务子组件对应。例如NetDevice对象⑦对应AP子组件③。The data component is an abstract component of the data service, which is used to realize the processing, forwarding and flow control of data packets. Among them, the
总线组件⑩可以对WLAN芯片所使用的硬件总线进行归一化封装,规范读写接口,使核心驱动部分和芯片驱动部分归一访问总线接口,以向核心驱动部分和芯片驱动部分屏蔽差异。The bus component ⑩ can normalize the hardware bus used by the WLAN chip, standardize the read-write interface, and make the core driver part and the chip driver part access the bus interface in a unified way, so as to shield the core driver part and the chip driver part from differences.
核心驱动部分还包括芯片探测器(Chip detector)、控制读写接口(Ctrl R/W)、数据读写接口(Data R/W)等。The core driver part also includes chip detector (Chip detector), control read and write interface (Ctrl R/W), data read and write interface (Data R/W), etc.
图4是本申请实施例提供的一种WLAN驱动框架的组件分类示意图。可选地,WLAN驱动框架可以包括通信组件、业务组件、协议组件、数据组件、总线组件。其中,通信组件可以包括Message组件,业务组件可以包括AP子组件、STA子组件、NAN子组件,协议组件可以包括Mac80211协议层组件,数据组件可以包括NetDevice对象、NetBuf数据结构、FlowCtl参数,总线组件可以包括Bus组件。业务组件和协议组件是可扩展组件,可以根据功能或用户需要新增子组件。FIG. 4 is a schematic diagram of component classification of a WLAN driver framework provided by an embodiment of the present application. Optionally, the WLAN driver framework may include communication components, service components, protocol components, data components, and bus components. Wherein, the communication component can include the Message component, the business component can include the AP subcomponent, the STA subcomponent, the NAN subcomponent, the protocol component can include the Mac80211 protocol layer component, and the data component can include the NetDevice object, the NetBuf data structure, the FlowCtl parameter, the bus component Can include Bus components. Business components and protocol components are extensible components, and subcomponents can be added according to functions or user needs.
图5是本申请实施例提供的一种业务组件与芯片驱动部分间的绑定示意图,其中,左图表示静态绑定业务组件与芯片驱动部分,右图表示动态绑定业务组件与芯片驱动部分。Fig. 5 is a schematic diagram of binding between a business component and a chip driver provided by an embodiment of the present application, wherein the left figure shows a static binding of a business component and a chip driver, and the right figure shows a dynamic binding of a business component and a chip driver .
如图5的左图所示,组件A1为AP子组件,组件A2为STA子组件,组件AN为NAN子组件,组件A1、A2与芯片驱动部分的芯片驱动B1静态绑定,组件AN与芯片驱动部分的芯片驱动BN静态绑定。As shown in the left figure of Figure 5, component A1 is an AP subcomponent, component A2 is an STA subcomponent, and component AN is a NAN subcomponent. Components A1 and A2 are statically bound to the chip driver B1 of the chip driver. The chip driver BN of the driver part is statically bound.
如图5的右图所示,组件A1为AP子组件,组件A2为STA子组件,组件AN为NAN子组件,组件A2、AN与芯片驱动部分的芯片驱动B1动态绑定,组件A1与芯片驱动部分的芯片驱动BN动态绑定。图5所示为业务组件与芯片驱动部分间进行绑定的一个范例,实际应用中并不局限于如图所示的范例,具体的绑定的实现方式可参照图6所示的WLAN驱动框架的组件化方法流程图中对绑定部分的详细描述。As shown in the right figure of Figure 5, component A1 is an AP subcomponent, component A2 is a STA subcomponent, and component AN is a NAN subcomponent. Components A2 and AN are dynamically bound to the chip driver B1 of the chip driver part. Component A1 and the chip The chip of the driver part drives BN dynamic binding. Figure 5 shows an example of binding between business components and chip drivers. The actual application is not limited to the example shown in the figure. The specific binding implementation can refer to the WLAN driver framework shown in Figure 6 A detailed description of the binding part in the componentized method flow chart of .
图6所示,为本申请实施例提供的一种WLAN驱动框架的组件化方法流程图,WLAN驱动框架的组件化方法应用于电子设备中,具体地,WLAN驱动框架的组件化方法包括:As shown in FIG. 6, it is a flowchart of a componentization method of a WLAN driver framework provided by an embodiment of the present application. The componentization method of the WLAN driver framework is applied to an electronic device. Specifically, the componentization method of the WLAN driver framework includes:
S601,将WLAN驱动框架划分为配置部分、核心驱动部分、芯片驱动部分,核心驱动部分包括基础组件和业务组件。S601. Divide the WLAN driver framework into a configuration part, a core driver part, and a chip driver part, where the core driver part includes basic components and service components.
S602,利用配置部分对核心驱动部分和芯片驱动部分进行配置,生成配置信息。S602. Using the configuration part to configure the core driver part and the chip driver part to generate configuration information.
利用配置部分向开发用户显示配置模板,并接收开发用户基于配置模板输入的对核心驱动部分和芯片驱动部分的配置,生成配置信息。The configuration part is used to display the configuration template to the development user, and the configuration of the core driver part and the chip driver part input by the development user based on the configuration template is received to generate configuration information.
配置信息可以包括WLAN驱动框架的配置信息、核心驱动部分的配置信息和芯片驱动部分的配置信息。The configuration information may include configuration information of the WLAN driver framework, configuration information of the core driver part, and configuration information of the chip driver part.
核心驱动部分的配置信息可以包括:业务组件支持信息、基础组件支持信息等。The configuration information of the core driver part may include: business component support information, basic component support information, and the like.
芯片驱动部分的配置信息可以包括:芯片数量、芯片运算效率、芯片种类等。The configuration information of the chip driver part may include: chip quantity, chip operation efficiency, chip type, and the like.
核心驱动部分的配置信息还可以包括:WLAN驱动框架功能支持表。芯片驱动部分的配置信息还可以包括:WLAN驱动框架功能支持表。The configuration information of the core driver part may also include: a WLAN driver framework function support table. The configuration information of the chip driver part may also include: a WLAN driver framework function support table.
WLAN驱动框架的配置信息是对WLAN驱动框架挂接的CPU、总线等的配置描述。The configuration information of the WLAN driver framework is a description of the configuration of the CPU and bus connected to the WLAN driver framework.
在本申请的一个实施例中,电子设备可以利用配置部分根据芯片驱动部分的配置信息修改业务组件支持信息。具体地,若芯片数量大于预设芯片数量,和/或芯片运算效率大于预设芯片运算效率,在业务组件支持信息中增加支持的业务子组件;若芯片数量小于等于预设芯片数量;和/或芯片运算效率小于等于预设芯片运算效率,在业务组件支持信息中减少支持的业务子组件。可选地,电子设备可以判断支持的业务子组件需要占用的芯片资源是否大于或等于可用的芯片资源;若支持的业务子组件需要占用的芯片资源大于或等于可用的芯片资源,在业务组件支持信息中减少支持的业务子组件;若支持的业务子组件需要占用的芯片资源小于可用的芯片资源,在业务组件支持信息中增加支持的业务子组件。In an embodiment of the present application, the electronic device can use the configuration part to modify the service component support information according to the configuration information of the chip driver part. Specifically, if the number of chips is greater than the preset number of chips, and/or the computing efficiency of the chip is greater than the preset computing efficiency of the chip, add the supported business sub-components in the business component support information; if the number of chips is less than or equal to the preset chip number; and/or Or the chip computing efficiency is less than or equal to the preset chip computing efficiency, and the supported business sub-components are reduced in the business component support information. Optionally, the electronic device can determine whether the chip resource occupied by the supported service subcomponent is greater than or equal to the available chip resource; if the chip resource occupied by the supported service subcomponent is greater than or equal to the available chip resource, the service component supports Reduce the supported business sub-components in the information; if the supported business sub-components need to occupy less chip resources than the available chip resources, add the supported business sub-components in the business component support information.
S603,根据配置信息初始化芯片驱动部分以及核心驱动部分中的基础组件和业务组件。S603. Initialize the basic components and service components in the chip driver part and the core driver part according to the configuration information.
在本申请的一个实施例中,电子设备可以解析核心驱动部分的配置信息,得到解析后的核心驱动部分的配置信息;创建WLAN组件框架;基于WLAN组件框架,根据解析后的核心驱动部分的配置信息初始化核心驱动部分中的基础组件和业务组件。In one embodiment of the present application, the electronic device can analyze the configuration information of the core driver part, obtain the configuration information of the core driver part after analysis; create a WLAN component framework; based on the WLAN component framework, according to the configuration of the core driver part after analysis The information initializes the basic components and business components in the core driver part.
具体地,电子设备创建WLAN组件框架可以包括:电子设备创建框架结构体;创建框架结构体处理方法;挂接框架结构体处理方法的实现函数;对框架结构体注册框架结构体处理方法和配置信息。Specifically, the creation of the WLAN component framework by the electronic device may include: creating a frame structure by the electronic device; creating a processing method for the frame structure; attaching an implementation function of the processing method for the frame structure; registering the processing method and configuration information for the frame structure .
例如,在具体实现时,可以根据WifiModuleCreate方法创建WLAN组件框架。可以根据“struct WifiModule*module=OsalMemAlloc(sizeof(*module))”创建框架结构体,其中“struct”为结构体,“*module”为指针,“OsalMemAlloc”为分配指定大小的内存的函数,“sizeof”为内存大小。可以根据“iface=OsalMemAlloc(sizeof(*iface))”创建框架结构体处理方法iface。可以根据“iface->updateModule=UpdateWiFiModule”为iface挂接修改实现函数;可以根据“iface->addFeature=AddFeature”为iface挂接添加实现函数;可以根据“iface->delFeature=DelFeature”为iface挂接删除实现函数。可以根据“module->iface=iface;module->moduleConfig.hslConfig=config”对框架结构体注册框架结构体处理方法和配置信息。For example, during specific implementation, the WLAN component framework can be created according to the WifiModuleCreate method. A frame structure can be created according to "struct WifiModule*module=OsalMemAlloc(sizeof(*module))", where "struct" is a structure, "*module" is a pointer, "OsalMemAlloc" is a function to allocate memory of a specified size, " sizeof" is the memory size. The frame structure processing method iface can be created according to "iface=OsalMemAlloc(sizeof(*iface))". According to "iface->updateModule=UpdateWiFiModule", you can modify the implementation function for iface connection; you can add implementation functions for iface connection according to "iface->addFeature=AddFeature"; you can use "iface->delFeature=DelFeature" to connect iface Remove implementation function. According to "module->iface=iface; module->moduleConfig.hslConfig=config", the framework structure processing method and configuration information can be registered with the framework structure.
具体地,基于WLAN组件框,架根据解析后的核心驱动部分的配置信息初始化核心驱动部分中的基础组件和业务组件包括:Specifically, based on the WLAN component framework, the framework initializes the basic components and service components in the core driver part according to the configuration information of the parsed core driver part, including:
根据解析后的核心驱动部分的配置信息确定支持的组件和支持的业务子组件;基于WLAN组件框架初始化支持的组件和支持的业务子组件。Determine supported components and supported service subcomponents according to the parsed configuration information of the core driver; and initialize supported components and supported service subcomponents based on the WLAN component framework.
例如,核心驱动部分解析后的配置信息包括“Station{name="sta";mode=true;}HostAp{name="ap";mode=false;}P2P{name="p2p";mode=false;}Mac80211{mode=true;}NetFlow{mode=false;}NetDevice{mode=true;}Netbuf{mode=true;}”,根据解析后的核心驱动部分的配置信息确定支持的组件为协议组件“Mac80211”、“NetDevice”、“Netbuf”,支持的业务子组件为STA子组件"sta";基于WLAN组件框架遍历每个组件,并初始化支持的组件和支持的业务子组件。例如,可以将mode值等于true的组件或业务子组件确定为支持的组件或业务子组件;可以将mode值等于false的组件或业务子组件确定为不可支持的组件或业务子组件。For example, the configuration information parsed by the core driver part includes "Station{name="sta"; mode=true; }HostAp{name="ap"; mode=false;}P2P{name="p2p"; mode=false; }Mac80211{mode=true;}NetFlow{mode=false;}NetDevice{mode=true;}Netbuf{mode=true;}", according to the analyzed configuration information of the core driver part, it is determined that the supported component is the protocol component "Mac80211 ", "NetDevice", "Netbuf", the supported service subcomponent is the STA subcomponent "sta"; traverse each component based on the WLAN component framework, and initialize the supported components and supported service subcomponents. For example, a component or business sub-component whose mode value is equal to true may be determined as a supported component or business sub-component; a component or business sub-component whose mode value is equal to false may be determined as an unsupportable component or business sub-component.
可选地,在基于WLAN组件框架初始化支持的组件和支持的业务子组件之前,还可判断WLAN驱动框架功能支持表中是否存在与支持的组件和支持的业务子组件匹配的功能。若WLAN驱动框架功能支持表中存在与支持的组件和支持的业务子组件匹配的功能,基于WLAN组件框架初始化支持的组件和支持的业务子组件。Optionally, before the supported components and supported service subcomponents are initialized based on the WLAN component framework, it may also be determined whether there is a function matching the supported components and supported service subcomponents in the WLAN driver framework function support table. If there is a function matching the supported components and supported service subcomponents in the WLAN driver framework function support table, the supported components and supported service subcomponents are initialized based on the WLAN component framework.
在本申请提供的实施例中,电子设备可以根据解析后的核心驱动部分的配置信息确定支持的组件;基于WLAN组件框架初始化支持的组件。电子设备可以根据解析后的核心驱动部分的配置信息确定支持的业务子组件;基于WLAN组件框架初始化支持的业务子组件。In the embodiment provided by the present application, the electronic device can determine the supported components according to the parsed configuration information of the core driver part; and initialize the supported components based on the WLAN component framework. The electronic device can determine the supported service subcomponents according to the parsed configuration information of the core driver part; and initialize the supported service subcomponents based on the WLAN component framework.
电子设备可以解析芯片驱动部分的配置信息,得到解析后的芯片驱动部分的配置信息;根据解析后的芯片驱动部分的配置信息初始化芯片驱动部分。The electronic device can analyze the configuration information of the chip driver part to obtain the analyzed configuration information of the chip driver part; initialize the chip driver part according to the analyzed configuration information of the chip driver part.
结合图7进行说明,如图7所示,为本申请实施例提供的初始化的WLAN驱动框架。初始化的组件包括配置部分、核心驱动部分(配置管理组件、通信组件、业务组件、协议组件、数据组件、总线组件)、芯片驱动部分。其中,业务组件包括一个业务子组件(STA子组件④),数据组件包括NetDevice对象、NetBuf数据结构。芯片驱动部分的芯片驱动可以驱动芯片。例如,芯片驱动部分的芯片驱动可以驱动Hi3881芯片。It will be described with reference to FIG. 7 , as shown in FIG. 7 , it is the initialized WLAN driver framework provided by the embodiment of the present application. The initialized components include configuration part, core driver part (configuration management component, communication component, business component, protocol component, data component, bus component), chip driver part. Among them, the business component includes a business sub-component (STA sub-component ④), and the data component includes NetDevice object and NetBuf data structure. The chip driver of the chip driver part can drive the chip. For example, the chip driver of the chip driver part can drive the Hi3881 chip.
电子设备可以通过配置组件解析配置信息。The electronic device can parse the configuration information through the configuration component.
S604,绑定业务组件与芯片驱动部分。S604, binding the service component and the chip driver part.
在本申请的一个实施例中,电子设备可以对业务组件与芯片驱动部分进行静态绑定或者动态绑定。In an embodiment of the present application, the electronic device may perform static binding or dynamic binding on the service component and the chip driver part.
具体地,配置信息还包括静态绑定配置信息,电子设备静态绑定业务组件与芯片驱动部分包括:根据静态绑定配置信息确定关联的业务子组件与芯片驱动;通过静态配置的方式存储关联的业务子组件与芯片驱动;在同一流程启动关联的业务子组件与芯片驱动。Specifically, the configuration information also includes static binding configuration information, and the static binding of the service component and the chip driver of the electronic device includes: determining the associated service sub-component and the chip driver according to the static binding configuration information; storing the associated Business subcomponents and chip drivers; start the associated business subcomponents and chip drivers in the same process.
具体地,电子设备动态绑定业务组件与芯片驱动部分包括:启动业务组件;基于芯片检测确定芯片;根据确定的芯片从芯片驱动部分启动芯片驱动。Specifically, the dynamic binding of the service component and the chip driver of the electronic device includes: starting the service component; determining the chip based on chip detection; and starting the chip driver from the chip driver according to the determined chip.
进一步地,确定的芯片可以包括一个芯片、相同种类的多个芯片或不同种类的多个芯片,在芯片驱动启动之后,芯片驱动可以驱动一个芯片、相同种类的多个芯片或不同种类的多个芯片,以支持业务组件。例如,结合图5左图,芯片驱动可驱动不同种类的两个芯片,分别为芯片B1和芯片BN,芯片B1为业务组件中的STA子组件和AP子组件提供支持,芯片BN为业务组件中的NAN子组件提供支持。结合图5右图,芯片驱动可驱动不同种类的两个芯片,分别为芯片B1和芯片BN,芯片B1为业务组件中的STA子组件和NAN子组件提供支持,芯片BN为业务组件中的AP子组件提供支持。Further, the determined chip may include one chip, multiple chips of the same type, or multiple chips of different types. After the chip driver is started, the chip driver may drive one chip, multiple chips of the same type, or multiple chips of different types. chips to support business components. For example, combined with the left figure in Figure 5, the chip driver can drive two different types of chips, namely chip B1 and chip BN, chip B1 provides support for the STA sub-component and AP sub-component in the business component, and chip BN is The NAN subassembly provides support. Combined with the right figure in Figure 5, the chip driver can drive two different types of chips, namely chip B1 and chip BN. Chip B1 provides support for the STA sub-component and NAN sub-component in the business component, and chip BN is the AP in the business component. Subcomponents provide support.
在本申请的一个实施例中,在电子设备动态绑定业务组件与芯片驱动部分之后,WLAN驱动框架的组件化方法还包括:根据绑定的业务子组件占用的芯片资源和绑定的芯片资源调整绑定的业务子组件与芯片驱动部分间的动态绑定关系。具体地,电子设备可以判断绑定的业务子组件占用的芯片资源是否大于或等于绑定的芯片资源;若绑定的业务子组件占用的芯片资源大于或等于绑定的芯片资源,将绑定的业务子组件重新绑定至芯片驱动部分中的可用的芯片驱动。芯片资源可以由芯片数量和芯片运算效率确定,例如,芯片资源可以等于芯片数量与芯片运算效率的乘积。In one embodiment of the present application, after the electronic device dynamically binds the service component and the chip driver part, the componentization method of the WLAN driver framework further includes: according to the chip resource occupied by the bound service sub-component and the bound chip resource Adjust the dynamic binding relationship between the bound business sub-component and the chip driver part. Specifically, the electronic device can determine whether the chip resource occupied by the bound service sub-component is greater than or equal to the bound chip resource; if the chip resource occupied by the bound service sub-component is greater than or equal to the bound chip resource, the bound Rebind the business subcomponents to the available chip drivers in the chip driver section. The chip resources may be determined by the number of chips and the computing efficiency of the chips. For example, the chip resources may be equal to the product of the number of chips and the computing efficiency of the chips.
在电子设备动态绑定业务组件与芯片驱动部分之后,WLAN驱动框架的组件化方法还包括:根据配置信息动态调整业务子组件与芯片驱动部分间的动态绑定关系。具体地,电子设备可以根据配置信息确定业务子组件与芯片驱动间的绑定关系或非绑定关系;并根据确定的绑定关系绑定业务子组件与芯片驱动,根据确定的非绑定关系解除业务子组件与芯片驱动间的绑定。可以通过预设值配置绑定关系或非绑定关系,如0和1。After the electronic device dynamically binds the service component and the chip driver, the componentization method of the WLAN driver framework further includes: dynamically adjusting the dynamic binding relationship between the service sub-component and the chip driver according to the configuration information. Specifically, the electronic device can determine the binding relationship or non-binding relationship between the service sub-component and the chip driver according to the configuration information; and bind the service sub-component and the chip driver according to the determined binding relationship; Release the binding between the business subcomponent and the chip driver. Binding or non-binding can be configured through preset values, such as 0 and 1.
下面通过部分示例性的代码说明本申请实施例的一种实现方式。An implementation manner of the embodiment of the present application is described below through some exemplary codes.
例如,核心驱动的配置文件可以包括如下配置信息:For example, a kernel driver configuration file can include the following configuration information:
例如,创建WLAN组件框架;基于WLAN组件框架,根据解析后的核心驱动部分的配置信息初始化核心驱动部分中的基础组件和业务组件:For example, create a WLAN component framework; based on the WLAN component framework, initialize the basic components and business components in the core driver part according to the parsed configuration information of the core driver part:
例如,创建WLAN组件框架具体包括:For example, creating a WLAN component framework specifically includes:
图8是本申请实施例提供的电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。FIG. 8 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application. The electronic device 100 may include a
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments,
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL). In some embodiments,
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments,
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal. In some embodiments, the
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(displayserial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface conforming to the USB standard specification, specifically, it may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 . In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be realized by the antenna 1 , the
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 . In some embodiments, the modem processor may be a stand-alone device. In some other embodiments, the modem processor may be independent from the
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),第五代无线通信系统(5G,the 5thGeneration of wireless communication system),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light emitting diode). AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used for processing the data fed back by the camera 193 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be located in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other image signals. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be realized through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer-executable program codes including instructions. The
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。Speaker 170A, also referred to as a "horn", is used to convert audio electrical signals into sound signals. Electronic device 100 can listen to music through speaker 170A, or listen to hands-free calls.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the receiver 170B can be placed close to the human ear to receive the voice.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used for connecting wired earphones. The earphone interface 170D may be the USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 180A may be disposed on display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may be comprised of at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B can be used to determine the motion posture of the electronic device 100 . In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y and z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a clamshell machine, the electronic device 100 can detect opening and closing of the clamshell according to the magnetic sensor 180D. Furthermore, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, features such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。The distance sensor 180F is used to measure the distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F for distance measurement to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The electronic device 100 emits infrared light through the light emitting diode. Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 . The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to make a call, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used for sensing ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket, so as to prevent accidental touch.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, take pictures with fingerprints, answer incoming calls with fingerprints, and the like.
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to implement a temperature treatment strategy. For example, when the temperature reported by the temperature sensor 180J exceeds the threshold, the electronic device 100 may reduce the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from being shut down abnormally due to the low temperature. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also known as "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the position of the display screen 194 .
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 180M can also contact the human pulse and receive the blood pressure beating signal. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone, combined into a bone conduction earphone. The
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 191 can generate a vibrating reminder. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations applied to different applications (such as taking pictures, playing audio, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects for touch operations acting on different areas of the display screen 194 . Different application scenarios (for example: time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
图9是本申请实施例提供的电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。FIG. 9 is a block diagram of the software structure of the electronic device 100 provided by the embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can consist of a series of application packages.
如图9所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in FIG. 9, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图9所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 9, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make it accessible to applications. Said data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions of the electronic device 100 . For example, the management of call status (including connected, hung up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application program layer and the application program framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
所述电子设备100集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM)、随机存取存储器(RAM)等。If the integrated modules of the electronic device 100 are implemented in the form of software function modules and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above-mentioned embodiments in the present application can also be completed by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium In this example, when the computer readable instructions are executed by the processor, the steps of the above-mentioned various method embodiments can be realized. Wherein, the computer-readable instructions include computer-readable instruction codes, and the computer-readable instruction codes may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random memory access memory (RAM), etc.
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的WLAN驱动框架的组件化方法。This embodiment also provides a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are run on the electronic device, the electronic device is made to perform the steps of the above-mentioned related methods to implement the WLAN driver framework in the above-mentioned embodiment. Component approach.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在电子设备上运行时,使得电子设备执行上述相关步骤,以实现上述实施例中的WLAN驱动框架的组件化方法。This embodiment also provides a computer program product, which, when running on the electronic device, causes the electronic device to execute the above related steps, so as to realize the componentization method of the WLAN driver framework in the above embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的WLAN驱动框架的组件化方法。In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the componentization method of the WLAN driver framework in the above method embodiments.
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the corresponding method provided above The beneficial effects in the method will not be repeated here.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined Or it can be integrated into another device, or some features can be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The unit described as a separate component may or may not be physically separated, and a component displayed as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or may be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program codes. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the protection scope of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application should be covered within the protection scope of the application . Therefore, the protection scope of the present application should be determined by the protection scope of the claims.
Claims (20)
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2020109497903 | 2020-09-10 | ||
CN202010949790 | 2020-09-10 | ||
CN202011540530.7A CN114173354A (en) | 2020-09-10 | 2020-12-23 | WLAN driving framework, assembly method of WLAN driving framework and related equipment |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011540530.7A Division CN114173354A (en) | 2020-09-10 | 2020-12-23 | WLAN driving framework, assembly method of WLAN driving framework and related equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114423024A CN114423024A (en) | 2022-04-29 |
CN114423024B true CN114423024B (en) | 2022-11-25 |
Family
ID=80476232
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011540530.7A Pending CN114173354A (en) | 2020-09-10 | 2020-12-23 | WLAN driving framework, assembly method of WLAN driving framework and related equipment |
CN202111556385.6A Active CN114423024B (en) | 2020-09-10 | 2020-12-23 | WLAN driver framework, componentization method of WLAN driver framework and related equipment |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011540530.7A Pending CN114173354A (en) | 2020-09-10 | 2020-12-23 | WLAN driving framework, assembly method of WLAN driving framework and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN114173354A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101137960A (en) * | 2004-03-04 | 2008-03-05 | 美商内数位科技公司 | Mobility Enabled System Architecture Software Architecture and API |
CN102193788A (en) * | 2010-03-12 | 2011-09-21 | 复旦大学 | Method for multiplexing cross-platform driver based on dynamic binary translation |
CN102467381A (en) * | 2010-11-16 | 2012-05-23 | 北京中电华大电子设计有限责任公司 | Implementation method for wireless local area network (WLAN) driver |
CN105975249A (en) * | 2015-12-31 | 2016-09-28 | 小米科技有限责任公司 | Method and device for application program execution based on hardware chip |
CN106227516A (en) * | 2016-07-13 | 2016-12-14 | 北京安控科技股份有限公司 | A kind of apparatus and method of network chip adaptive communications |
CN110476402A (en) * | 2017-05-22 | 2019-11-19 | 华为技术有限公司 | The method, apparatus and communication system of network slice creation |
CN111479336A (en) * | 2019-01-06 | 2020-07-31 | 半导体元件工业有限责任公司 | Software framework and development platform of WI-FI chipset |
CN111740885A (en) * | 2020-05-25 | 2020-10-02 | 杭州涂鸦信息技术有限公司 | Network distribution method and related equipment and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9775164B2 (en) * | 2014-01-28 | 2017-09-26 | Netgear, Inc. | Automatic wireless network channel selection |
-
2020
- 2020-12-23 CN CN202011540530.7A patent/CN114173354A/en active Pending
- 2020-12-23 CN CN202111556385.6A patent/CN114423024B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101137960A (en) * | 2004-03-04 | 2008-03-05 | 美商内数位科技公司 | Mobility Enabled System Architecture Software Architecture and API |
CN102193788A (en) * | 2010-03-12 | 2011-09-21 | 复旦大学 | Method for multiplexing cross-platform driver based on dynamic binary translation |
CN102467381A (en) * | 2010-11-16 | 2012-05-23 | 北京中电华大电子设计有限责任公司 | Implementation method for wireless local area network (WLAN) driver |
CN105975249A (en) * | 2015-12-31 | 2016-09-28 | 小米科技有限责任公司 | Method and device for application program execution based on hardware chip |
CN106227516A (en) * | 2016-07-13 | 2016-12-14 | 北京安控科技股份有限公司 | A kind of apparatus and method of network chip adaptive communications |
CN110476402A (en) * | 2017-05-22 | 2019-11-19 | 华为技术有限公司 | The method, apparatus and communication system of network slice creation |
CN111479336A (en) * | 2019-01-06 | 2020-07-31 | 半导体元件工业有限责任公司 | Software framework and development platform of WI-FI chipset |
CN111740885A (en) * | 2020-05-25 | 2020-10-02 | 杭州涂鸦信息技术有限公司 | Network distribution method and related equipment and device |
Also Published As
Publication number | Publication date |
---|---|
CN114423024A (en) | 2022-04-29 |
CN114173354A (en) | 2022-03-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111602379B (en) | Voice communication method, electronic equipment and system | |
CN113961157B (en) | Display interaction system, display method and equipment | |
CN113448382B (en) | Multi-screen display electronic device and multi-screen display method of electronic device | |
CN114079893B (en) | Bluetooth communication method, terminal device and computer-readable storage medium | |
CN116233300B (en) | Method for controlling communication service status, terminal device and readable storage medium | |
CN113691842A (en) | A cross-device content projection method and electronic device | |
CN111372329B (en) | Connection establishing method and terminal equipment | |
CN113973398B (en) | Wireless network connection method, electronic device and chip system | |
CN117873357A (en) | Application window management method, terminal device and computer readable storage medium | |
CN111343326A (en) | Method and related device for acquiring test log | |
CN114915747B (en) | Video call method, electronic device and readable storage medium | |
CN114765768B (en) | Network selection method and device | |
CN110609650B (en) | Application state switching method and terminal equipment | |
CN116048629B (en) | System service switching method and control device, electronic device and storage medium | |
WO2022242412A1 (en) | Method for killing application, and related device | |
CN114423024B (en) | WLAN driver framework, componentization method of WLAN driver framework and related equipment | |
CN114828098B (en) | Data transmission method and electronic device | |
CN116095224A (en) | Notification display method and terminal device | |
CN113645595B (en) | Equipment interaction method and device | |
CN114116073A (en) | Electronic device and driver loading method and medium thereof | |
CN113950045A (en) | Subscription data downloading method and electronic equipment | |
CN116382728B (en) | Propagation name display method and terminal equipment | |
CN114125805B (en) | Bluetooth connection method and terminal device | |
CN116700556B (en) | Card generation method and related device | |
CN116668763B (en) | Screen recording method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |