Camera switch button driving implementation method and device, equipment and storage medium

By building and integrating a camera switch button driver, monitoring WMI events and using the Input subsystem to report OSD icons, the resource waste problem when the camera is not enabled on domestic x86 platform models is solved, and camera status adaptation and resource optimization are achieved.

CN120676241APending Publication Date: 2025-09-19KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510822933.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Models developed based on the domestic x86 platform have a problem where the camera occupies resources when not enabled, resulting in a waste of system resources.

Method used

Build a camera switch button driver that supports WMI events and integrate it into the Linux kernel. It monitors WMI events, returns camera switch flag information through the callback function, uses the Input subsystem to report WMI events, and displays the OSD icon on the terminal. It only applies for the Input subsystem device when the WMI event is reported for the first time to reduce resource usage.

Benefits of technology

By applying for the Input subsystem device when reporting the WMI event for the first time, the occupation and waste of system resources are reduced, the adaptation of the camera switch button status of models developed based on the domestic x86 platform is achieved, and the system driver defects are filled.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120676241A_ABST
    Figure CN120676241A_ABST
Patent Text Reader

Abstract

The invention discloses a camera switch button driving implementation method and device, equipment and a storage medium. The camera switch button driving implementation method comprises the steps of constructing a driving program and integrating the driving program to a Linux kernel; monitoring a WMI event of a camera switch button, and returning switch flag bit information through a callback function; and applying for an Input subsystem, reporting a WMI event by using the Input subsystem, and showing a corresponding OSD icon on the terminal. According to the method, the input subsystem device is applied to report the WMI event only when the WMI event is reported for the first time instead of applying for the input subsystem device when the driver is loaded, and the WMI event can be continuously reported through the applied input subsystem when a new WMI event is generated due to the fact that the switch button is triggered, so that occupation and waste of system resources are reduced, and the WMI event reporting efficiency is improved. Meanwhile, a corresponding driving program is compiled, and support adaptation based on a domestic x86 platform development model is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of hardware driver technology, and in particular to a camera switch button drive implementation method, device, equipment and storage medium. Background Art

[0002] The camera on / off button is a hardware switch used to turn the camera on and off. When the user toggles the button, a corresponding icon should be displayed to the user to indicate whether the camera is on or off. On models based on the domestic x86 platform, there is currently no driver that supports the camera on / off button, as it is developed based on localization and information innovation requirements.

[0003] To show users whether the camera's on / off status changes when the camera's power button is pressed, the kernel driver can monitor WMI events reported by the underlying firmware. The kernel driver responds to the event and reports the agreed-upon event code via the Input subsystem. This displays a corresponding OSD icon on the terminal, allowing users to understand the camera's status changes. However, cameras are often enabled based on user needs, rather than being enabled at all times. However, the driver often requests related resources when the system boots up, causing the camera to occupy some resources even when it's not enabled, resulting in a waste of system resources. Summary of the Invention

[0004] The embodiments of the present invention provide a camera switch button drive implementation method, apparatus, device and storage medium to solve the technical problem of system resource waste caused by occupying resources when the camera of a model developed based on the domestic x86 platform is not enabled.

[0005] In a first aspect, an embodiment of the present invention provides a method for driving a camera switch button, comprising:

[0006] S101, building a camera switch button driver that supports WMI events, and integrating the camera switch button driver into the Linux kernel, and the Linux kernel compiling and verifying the camera switch button driver;

[0007] S102, the Linux kernel monitors the WMI event of the camera switch button, and the camera switch button driver returns the camera switch flag information through the callback function;

[0008] S103, the camera switch button driver applies for the input subsystem according to the camera switch flag information, and uses the input subsystem to report a WMI event according to the switch flag information;

[0009] S104: Display a corresponding OSD icon on the terminal according to the reported WMI event and switch flag information.

[0010] Furthermore, the S103 includes:

[0011] The camera switch button driver applies for the Input subsystem device and fills in the device properties;

[0012] The input subsystem device reports the corresponding WMI event to the terminal based on the camera switch flag information;

[0013] Register the Input subsystem device.

[0014] Furthermore, the S102 also includes adding GUID information to the camera switch button, binding the GUID information to the camera switch button driver, and reporting a WMI event according to the GUID information.

[0015] Furthermore, the S103 further includes:

[0016] According to the GUID information, the corresponding WMI event is reported to the terminal through the Input subsystem device after applying for and filling in the device attributes.

[0017] Furthermore, the S101 includes:

[0018] Build the camera switch button driver file, add the kernel driver compilation configuration item in the camera switch button driver file, and add the camera switch button driver to the kernel configuration options;

[0019] Add a kernel driver compilation file generation item to the camera switch button driver file, and add the compilation rules of the camera switch button driver to the kernel compilation item.

[0020] Furthermore, the S101 further includes:

[0021] In the camera switch button driver file, declare that the driver type supports WMI events;

[0022] Define the camera switch button driver as a general callback function to fill in the interface function;

[0023] Add module flag to the camera switch button driver file;

[0024] Add a GUID flag to the camera switch button driver file.

[0025] Furthermore, the S101 further includes:

[0026] Add driver loading function and unloading function in the camera switch button driver file.

[0027] In a second aspect, an embodiment of the present invention provides a device for implementing camera switch button driving, including:

[0028] A driver building module, used to build the camera switch button driver and integrate the camera switch button driver into the Linux kernel;

[0029] The event monitoring module is used to monitor the camera switch button action and generate WMI events and return the camera switch flag information through the callback function;

[0030] The event reporting module is used to apply for the Input subsystem and use the Input subsystem to report WMI events;

[0031] The icon display module is used to display the corresponding OSD icon on the terminal according to the reported WMI event.

[0032] In a third aspect, an embodiment of the present invention provides an electronic device, including:

[0033] one or more processors;

[0034] a storage device for storing one or more programs,

[0035] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned camera switch button driving implementation method.

[0036] In a fourth aspect, an embodiment of the present invention provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute the above-mentioned camera switch button driving implementation method.

[0037] An embodiment of the present invention provides a camera switch button driver implementation method, apparatus, device and storage medium. The method constructs a camera switch button driver program suitable for domestic x86 platform development models, so that models developed based on the domestic x86 platform can support state change events of the camera switch button. By capturing the trigger action of the camera switch button, a WMI event is generated, and the camera switch flag information and the GUID bound to the camera switch button are returned to the driver through a callback function. Then, the WMI event is reported to the terminal through the Input subsystem according to the switch flag information and the GUID, and the corresponding OSD icon is displayed. By applying for the Input subsystem device, filling in the device properties and registering it when reporting the WMI event for the first time, instead of applying for the Input subsystem device when the driver is loaded, when a new WMI event is generated due to the camera switch button being triggered again, the WMI event can be continued to be reported by applying for the registered Input subsystem, reducing the occupation and waste of system resources. The WMI event of the camera switch button is identified by binding the GUID with the driver, and the corresponding driver is written at the same time, so that models developed based on the domestic x86 platform can adapt to the state changes of the camera switch button, filling the system driver defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which constitute part of the present invention, are provided to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are provided to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:

[0039] Figure 1 This is a flowchart of a method for implementing camera switch button driving according to the first embodiment of the present invention;

[0040] Figure 2 This is a flowchart of a method for implementing camera switch button driving according to the second embodiment of the present invention;

[0041] Figure 3 This is a structural diagram of a device for driving a camera switch button according to a third embodiment of the present invention;

[0042] Figure 4 This is a structural diagram of the device described in Example 4 of the present invention. DETAILED DESCRIPTION

[0043] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0044] Models developed based on the domestic x86 platform are ICT versions developed based on the Linux system. For models developed with domestic ICT versions, the adaptability and compatibility of certain edge hardware are often difficult to fully cover. The camera switch button is a hardware device used to control the camera switch. Since the on and off states of the camera are difficult to distinguish directly by observation, when the camera is turned on or off by the switch button, it is necessary to display the camera status changes to the user through the terminal so that the user can promptly grasp the status of the camera and other hardware. However, displaying icons based on device status changes requires driver support. The camera switch button is a relatively marginal device, so it needs to be adapted through the driver. A highly compatible driver that is compatible with domestic platforms is required. At the same time, it is necessary to ensure that relevant resources are called for processing only when an event is triggered, reducing the waste of system resources and improving the system resource optimization capabilities.

[0045] Example 1

[0046] Figure 1 This is a flowchart of a camera switch button driver implementation method according to Embodiment 1 of the present invention. This embodiment reduces system resource waste by applying for and registering the Input subsystem to report WMI events when the camera switch button triggers a WMI event. The method specifically includes the following steps:

[0047] S101, building a camera switch button driver that supports WMI events, and integrating the camera switch button driver into the Linux kernel, and the Linux kernel compiling and verifying the camera switch button driver.

[0048] First, you need to write a driver that supports the camera switch button. The driver must support WMI events. By configuring the Kconfig file, add the camera switch button driver configuration item to the Linux kernel. Then, configure the Makefile file to add the compilation option for the camera switch button driver during kernel compilation to enable the camera switch button driver and support the capture of the camera switch button trigger event.

[0049] S102, the Linux kernel monitors the WMI event of the camera switch button, and the camera switch button driver returns the camera switch flag information through the callback function.

[0050] The Linux kernel monitors the triggering action of the camera switch button, which generates a WMI event. The driver can parse the WMI event and return the switch flag information of the camera switch button through a pre-defined callback function to report the status change of the camera switch button to the system.

[0051] Specifically, GUID information is added to the camera switch button, and the GUID information is bound to the camera switch button driver, and a WMI event is reported according to the GUID information.

[0052] In order to accurately identify the events of the camera switch button, GUID (Globally Unique Identifier) ​​information is added to the camera switch button, the GUID is bound to the constructed camera switch button driver, and the camera switch button is marked. When the camera switch button is touched, a signal is generated and captured to form a WMI event, the camera switch button can be tracked through the GUID, which facilitates the distribution of WMI events and the corresponding driver is called according to the GUID to parse and report the event.

[0053] S103, the camera switch button driver applies for the Input subsystem according to the camera switch flag information, and uses the Input subsystem to report a WMI event according to the switch flag information.

[0054] After a WMI event is generated, the corresponding driver will be matched according to the event GUID, and the WMI event will be distributed. After the camera switch button driver responds to the distributed WMI event, it applies for the Input subsystem device. The Input subsystem (Linux input subsystem) is the core framework for processing input devices in the kernel. Input events can be reported through the Input subsystem, and the Input subsystem can be used to report the WMI event of the camera switch button to the terminal.

[0055] Specifically, the S103 includes:

[0056] The camera switch button driver applies for the Input subsystem device and fills in the device properties.

[0057] When the camera switch button driver responds to the distributed WMI event, it first needs to apply for the Input subsystem device and fill in the corresponding parameters and device properties for the Input subsystem device. The device properties are set according to the information of the camera switch button.

[0058] The Input subsystem device reports the corresponding WMI event to the terminal based on the camera switch flag information.

[0059] The Input subsystem device will parse the camera switch status and GUID event code based on the received WMI event, and report information including device parameters, event code and camera switch status to the terminal.

[0060] Register the Input subsystem device.

[0061] When reporting a WMI event to the terminal for the first time, the above-mentioned process of applying, filling, and registering the Input subsystem needs to be performed. After applying for and filling the Input subsystem device, the Input subsystem device needs to be registered in the kernel. At the same time, when a new WMI event of the camera switch button is generated subsequently, the event can continue to be reported to the terminal through the Input.

[0062] Optionally, according to the GUID information, a corresponding WMI event is reported to the terminal through the Input subsystem device after applying for and filling in the device attributes.

[0063] After applying for, filling in, and registering the Input subsystem device when reporting the event for the first time, no further configuration operations are required when a new WMI event is subsequently generated. It can be directly distributed to the corresponding Input subsystem device via the GUID and reported directly to the terminal.

[0064] S104: Display a corresponding OSD icon on the terminal according to the reported WMI event and switch flag information.

[0065] After the WMI event is reported to the terminal using the Input subsystem, the terminal confirms the corresponding event based on the reported event code (GUID), confirms the camera's switch status based on the reported camera switch information (switch flag information), and finally displays the corresponding OSD (on-screen display) icon on the screen based on the event and switch status to prompt the user of the camera's switch status change.

[0066] This embodiment builds a camera switch button driver for models developed on the domestic x86 platform, enabling models developed on the domestic x86 platform to support camera switch button state change events. By capturing the triggering action of the camera switch button, a WMI event is generated. The callback function returns the camera switch flag information and the GUID for binding the camera switch button to the driver. The Input subsystem then reports the WMI event to the terminal based on the switch flag information and GUID, displaying the corresponding OSD icon. By applying for the Input subsystem device, filling in the device properties, and registering the WMI event only when the WMI event is first reported, rather than applying for the Input subsystem device when the driver is loaded, the WMI event is reported. Subsequent WMI events generated by the camera switch button being triggered can continue to be reported by applying for the registered Input subsystem, thus reducing the use and waste of system resources. By identifying the WMI event of the camera switch button by binding the GUID to the driver and simultaneously writing the corresponding driver, models developed on the domestic x86 platform can adapt to camera switch button state changes, thus filling in system driver defects.

[0067] Example 2

[0068] Figure 2 This is a flow chart of a camera switch button driving implementation method according to the second embodiment of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, S101 is specifically optimized as follows:

[0069] Build the camera switch button driver file, add the kernel driver compilation configuration item in the camera switch button driver file, and add the camera switch button driver to the kernel configuration options;

[0070] Add a kernel driver compilation file generation item to the camera switch button driver file, and add the compilation rules of the camera switch button driver to the kernel compilation item.

[0071] Accordingly, the camera switch button driving implementation method provided in this embodiment specifically includes:

[0072] S201, building a camera switch button driver file, adding a kernel driver compilation configuration item in the camera switch button driver file, and adding the camera switch button driver program to the kernel configuration option.

[0073] In order to support the display of the camera switch button status, you first need to write a driver to support the camera switch button, form a camera switch button driver file, and integrate it into the kernel so that the driver can run and provide support. Models developed based on the domestic x86 platform have not yet adapted the camera switch button driver. The corresponding driver is written in C language to form a C language file. When writing the driver, under the domestic x86 platform, such as the Kirin system, it is necessary to add a kernel driver compilation configuration item to the driver file so that the kernel has the driver configuration item. You can choose to load the camera switch button driver. After that, you need to add the C language configuration item to the Kconfig file so that the kernel can configure the C language file when loading. For example, add the "LENOVO_WMI_CAMERA" driver configuration item to the kernel through "config LENOVO_WMI_CAMERA".

[0074] S202 , adding a kernel driver compilation file generation item to the camera switch button driver file, and adding the compilation rule of the camera switch button driver program to the kernel compilation item.

[0075] After the kernel has the driver configuration item, it is also necessary to add the kernel compilation file generation item to the camera switch button driver file to define the compilation rules of the driver for the kernel. By adding the compilation rules to the Makefile file, the kernel can compile according to the specified compilation rules when it is loaded. For example, by adding the compilation rule "obj-$(CONFIG_LENOVO_WMI_CAMERA+=lenovo-wmi-camera.o)" during kernel compilation, the kernel will generate the .o suffix file when compiling the driver's .c suffix file.

[0076] Specifically, in the camera switch button driver file, it is declared that the driver type supports WMI events.

[0077] You also need to add corresponding settings to the camera switch button driver to declare that the driver type supports WMI events so that the driver can receive distributed WMI events. For example, this can be declared in the driver file using "module_wmi_driver(lenovo_wmi_driver);".

[0078] Define the camera switch button driver as a general callback function to fill in the interface function.

[0079] In the camera switch button driver, in order to enable the WMI event to be transmitted, the camera switch button driver is defined as a general callback function to fill the interface function, and the general callback function is used to fill the interface function, so that when the WMI event is triggered, the WMI event can be distributed directly through the callback function.

[0080] Add the module flag to the camera switch button driver file.

[0081] In order to enable the camera switch button driver to support multiple instances and improve the driver's scalability, a module flag is added to the driver. By adding .no_singleton=true, it tells the kernel that the driver can load multiple instances.

[0082] Add a GUID flag to the camera switch button driver file.

[0083] To enable the camera switch button driver to identify the camera switch button GUID, a GUID flag is added to the driver to record and bind supported camera switch buttons. This can increase the number of supported camera switch buttons by adding GUID information. For example, a table for storing GUIDs is defined in the camera switch button driver file using ".id_table=lenovo_wmi_id_table," and then the corresponding event is determined based on this table.

[0084] Optionally, a driver loading function and an unloading function are added to the camera switch button driver file.

[0085] Add a probe driver loading function to the camera switch button driver to load the driver, and add a remove driver writing function to the camera switch button driver to unload the driver. Use the probe and remove functions to load and unload the camera switch button driver.

[0086] S203, the Linux kernel monitors the WMI event of the camera switch button, and the camera switch button driver returns the camera switch flag information through the callback function.

[0087] S204: The camera switch button driver applies for the Input subsystem according to the camera switch flag information, and uses the Input subsystem to report a WMI event according to the switch flag information.

[0088] S205: Display a corresponding OSD icon on the terminal according to the reported WMI event and switch flag information.

[0089] This embodiment writes a driver file for the camera switch button, adds kernel driver compilation configuration items and kernel driver compilation file generation items to the driver file, and adds the driver file to the Kconfig file and Makefile file, so that the Linux kernel can integrate the driver module and compile and verify it; adds a declaration to support WMI events in the driver, defines the driver as a general callback function to fill the interface function, supports multiple instances by adding module flags, and adds a GUID flag for identifying GUIDs, so that models developed based on the domestic x86 platform can have a driver that supports the camera switch button, while improving the compatibility and scalability of support for the camera switch button, filling the system support gap.

[0090] Example 3

[0091] Figure 3This is a schematic diagram of the structure of a camera switch button driving implementation device according to Embodiment 3 of the present invention. In this embodiment, the camera switch button driving implementation device includes:

[0092] A driver building module 810 is used to build a driver for the camera switch button and integrate the camera switch button driver into the Linux kernel;

[0093] An event monitoring module 820 is used to monitor the camera switch button action and generate a WMI event and return the camera switch flag information through a callback function;

[0094] The event reporting module 830 is used to apply for the Input subsystem and use the Input subsystem to report WMI events;

[0095] The icon display module 840 is used to display the corresponding OSD icon on the terminal according to the reported WMI event.

[0096] This embodiment establishes a driver program that supports the camera switch button through a driver construction module, captures the action of the camera switch button through an event monitoring module to form a WMI event, reports the WMI event using the Input subsystem through an event reporting module, and displays the corresponding OSD icon according to the reported WMI event through an icon display module. By applying for the Input subsystem device, filling in the device properties and registering it only when the WMI event is first reported, the WMI event is reported, rather than applying for the Input subsystem device when the driver is loaded. When a new WMI event is subsequently generated due to the camera switch button being triggered, the WMI event can continue to be reported by applying for the registered Input subsystem, thereby reducing the occupation and waste of system resources. The WMI event of the camera switch button is identified by binding the GUID with the driver, and the corresponding driver is written at the same time, so that the models developed based on the domestic x86 platform can adapt to the state changes of the camera switch button, filling the system driver defects.

[0097] The camera switch button driving implementation device provided in the embodiment of the present invention can execute the camera switch button driving implementation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0098] Example 4

[0099] Figure 4 This is a structural diagram of an electronic device according to a fourth embodiment of the present invention. Figure 4 A block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The device 12 shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present invention.

[0100] like Figure 4 As shown, device 12 is implemented as a general-purpose computing device. Components of device 12 may include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).

[0101] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0102] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.

[0103] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 4 Not shown, often called a "hard drive"). Although Figure 4 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.

[0104] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0105] Device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with device 12 / server / computer, and / or any device that enables device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may occur via input / output (I / O) interface 22. Furthermore, device 12 may communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of device 12 via bus 18. It should be understood that, although not shown, other hardware and / or software modules may be used in conjunction with device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0106] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the camera switch button driving implementation method provided in the embodiment of the present invention.

[0107] Example 5

[0108] Embodiment 5 of the present invention further provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute the camera switch button driving implementation method provided in the above embodiment.

[0109] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0110] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0111] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0112] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0113] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. A camera switch button driving implementation method, characterized in that: include: S101, building a camera switch button driver that supports WMI events, and integrating the camera switch button driver into the Linux kernel, and the Linux kernel compiling and verifying the camera switch button driver; S102, the Linux kernel monitors the WMI event of the camera switch button, and the camera switch button driver returns the camera switch flag information through the callback function; S103, the camera switch button driver applies for the input subsystem according to the camera switch flag information, and uses the input subsystem to report a WMI event according to the switch flag information; S104: Display a corresponding OSD icon on the terminal according to the reported WMI event and switch flag information.

2. The method according to claim 1, characterized in that The S103 includes: The camera switch button driver applies for the Input subsystem device and fills in the device properties; The input subsystem device reports the corresponding WMI event to the terminal based on the camera switch flag information; Register the Input subsystem device.

3. The method according to claim 2, characterized in that The S102 further includes: Add GUID information to the camera switch button, bind the GUID information to the camera switch button driver, and report WMI events based on the GUID information.

4. The method according to claim 3, characterized in that The S103 further includes: According to the GUID information, the corresponding WMI event is reported to the terminal through the Input subsystem device after applying for and filling in the device attributes.

5. The method according to claim 1, wherein The S101 includes: Build the camera switch button driver file, add the kernel driver compilation configuration item in the camera switch button driver file, and add the camera switch button driver to the kernel configuration options; Add a kernel driver compilation file generation item to the camera switch button driver file, and add the compilation rules of the camera switch button driver to the kernel compilation item.

6. The method according to claim 5, characterized in that The S101 further includes: In the camera switch button driver file, declare that the driver type supports WMI events; Define the camera switch button driver as a general callback function to fill in the interface function; Add module flag to the camera switch button driver file; Add a GUID flag to the camera switch button driver file.

7. The method according to claim 6, characterized in that The S101 further includes: Add driver loading function and unloading function in the camera switch button driver file.

8. A camera switch button driving device, characterized in that: include: A driver building module, used to build the camera switch button driver and integrate the camera switch button driver into the Linux kernel; The event monitoring module is used to monitor the camera switch button action and generate WMI events and return the camera switch flag information through the callback function; The event reporting module is used to apply for the Input subsystem and use the Input subsystem to report WMI events; The icon display module is used to display the corresponding OSD icon on the terminal according to the reported WMI event.

9. An electronic device, characterized in that: The device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the camera switch button driving implementation method as described in any one of claims 1-7.

10. A storage medium comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute the camera switch button driving implementation method according to any one of claims 1 to 7.