CN117082419B - Speaker control method, system, device, apparatus and storage medium - Google Patents

Speaker control method, system, device, apparatus and storage medium Download PDF

Info

Publication number
CN117082419B
CN117082419B CN202311351285.9A CN202311351285A CN117082419B CN 117082419 B CN117082419 B CN 117082419B CN 202311351285 A CN202311351285 A CN 202311351285A CN 117082419 B CN117082419 B CN 117082419B
Authority
CN
China
Prior art keywords
protection program
loudspeaker
speaker
power
notification
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
Application number
CN202311351285.9A
Other languages
Chinese (zh)
Other versions
CN117082419A (en
Inventor
张辉
张效国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202311351285.9A priority Critical patent/CN117082419B/en
Publication of CN117082419A publication Critical patent/CN117082419A/en
Application granted granted Critical
Publication of CN117082419B publication Critical patent/CN117082419B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R9/00Transducers of moving-coil, moving-strip, or moving-wire type
    • H04R9/06Loudspeakers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R9/00Transducers of moving-coil, moving-strip, or moving-wire type
    • H04R9/02Details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2400/00Loudspeakers
    • H04R2400/11Aspects regarding the frame of loudspeaker transducers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The embodiment of the invention provides a loudspeaker control method, a system, a device, equipment and a storage medium, wherein the method comprises the following steps: in the process of playing the audio, the electronic device can acquire state data corresponding to a protection program of the loudspeaker. And the status data may reflect whether the protection procedure of the speaker is valid, i.e. that the speaker is likely to be damaged by continued operation at a power greater than the rated power. When the state data is a first preset value indicating that the protection program corresponding to the loudspeaker is in a failure state, the electronic device can generate a first notification. And controlling a preset pin of a power amplifier connected with the loudspeaker to be low level in response to the first notification, so that the loudspeaker works under the power smaller than rated power. In the method, when the protection program fails, the level value of the pin of the power amplifier is adjusted to reduce the amplification factor of the power amplifier, so that the working power of the loudspeaker is reduced, and the protection of the loudspeaker is realized.

Description

Speaker control method, system, device, apparatus and storage medium
Technical Field
The present invention relates to the field of speaker technologies, and in particular, to a speaker control method, system, device, apparatus, and storage medium.
Background
Personal computers (Personal Computer, abbreviated as PCs), such as desktops, notebooks, mini-notebooks, tablets, and ultrabooks, are provided with speakers. In order to provide better audio effects to the user, it is desirable to have the speaker on the PC continuously operating at a power exceeding its rated power. Continuous high power operation of the speaker is prone to burning itself. In order to improve this problem, a protection program for the speaker may be deployed in the PC, and the speaker may be operated continuously at a power exceeding the rated power without being burned out by executing the program.
In practice, however, there may be a situation that the protection program of the speaker fails, and how to continue to provide protection for the speaker is a problem to be solved.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a system, an apparatus, a device, and a storage medium for controlling a speaker, which are used to continue to protect the speaker when a protection program of the speaker fails.
In a first aspect, an embodiment of the present invention provides a speaker control method, including:
responding to the playing of the audio, and acquiring state data corresponding to a protection program of the loudspeaker;
When the state data is a first preset value reflecting the failure of the protection program, generating a first notification, and enabling the effective protection program to enable the loudspeaker to continuously work under the power larger than rated power;
and responding to the first notice, and controlling a preset pin of a power amplifier connected with the loudspeaker to be at a low level so that the working power of the loudspeaker is smaller than rated power.
In a second aspect, an embodiment of the present invention provides a speaker control system, including: the power amplifier is respectively connected with the controller and the loudspeaker, and the controller is connected with the monitoring driver;
the monitoring driver is used for responding to the playing of the audio and acquiring state data corresponding to a protection program of the loudspeaker; when the state data is a first preset value reflecting the failure of the protection program, generating a first notification, and enabling the effective protection program to enable the loudspeaker to continuously work under the power larger than rated power;
and the controller is used for responding to the first notification and controlling a preset pin of a power amplifier connected with the loudspeaker to be at a low level so that the working power of the loudspeaker is smaller than the rated power.
In a third aspect, an embodiment of the present invention provides a speaker control apparatus, including:
the acquisition module is used for responding to the playing of the audio and acquiring state data corresponding to a protection program of the loudspeaker;
the generating module is used for generating a first notification when the state data is a first preset value reflecting the failure of the protection program, and the effective protection program enables the loudspeaker to continuously work under the power larger than rated power;
and the control module is used for responding to the first notification and controlling a preset pin of a power amplifier connected with the loudspeaker to be at a low level so that the working power of the loudspeaker is smaller than the rated power.
In a fourth aspect, an embodiment of the present invention provides a terminal device, including a memory, a processor, a controller, a power amplifier, and a speaker; the power amplifier is respectively connected with the controller and the loudspeaker, and the processor comprises a monitoring driver; the memory is configured to store one or more computer instructions that, when executed by the processor, implement the speaker control method of the first aspect described above. The terminal device may also include a communication interface for communicating with other devices or communication systems.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, a controller, a power amplifier, and a speaker; the power amplifier is respectively connected with the controller and the loudspeaker, and the processor comprises a monitoring driver; the memory is configured to store one or more computer instructions that, when executed by the processor, implement the speaker control method of the first aspect described above. The electronic device may also include a communication interface for communicating with other devices or communication systems.
In a sixth aspect, embodiments of the present invention provide a non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device or a terminal device, causes the processor to implement at least a speaker control method as in the first aspect above.
The power amplifier is connected with the loudspeaker, and the loudspeaker can be driven to work by means of the signal amplifying function of the power amplifier, so that audio playing is realized.
Based on this, in the speaker control method provided by the embodiment of the present invention, during the process of playing audio, the electronic device may obtain the state data corresponding to the protection program of the speaker, where the protection program and the speaker are both deployed in the electronic device. The status data may reflect whether the protection procedure of the speaker is valid, i.e. that continued operation of the speaker at a power greater than the rated power is likely to cause damage to the speaker. The electronic device may generate a first notification when the status data is a first preset value indicating that the protection program of the speaker is in a disabled state. And controlling a preset pin of a power amplifier connected with the loudspeaker to be at a low level in response to the first notification, so that the amplification factor of the power amplifier is reduced, and the loudspeaker is enabled to continuously work under the power smaller than rated power.
In the method, when the protection program is determined to be invalid through the state data, the amplification factor of the power amplifier can be reduced by adjusting the level value of the pin of the power amplifier, so that the working power of the loudspeaker is reduced, the possibility of damage to the loudspeaker is reduced, and the protection to the loudspeaker is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 2 is a signaling diagram of a speaker control procedure according to an embodiment of the present invention;
fig. 3 is a schematic working diagram of an electronic device control speaker according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another electronic device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a speaker control system according to an embodiment of the present invention;
Fig. 6 is a flowchart of a method for controlling a speaker according to an embodiment of the present invention;
fig. 7 is a flowchart of another speaker control method according to an embodiment of the present invention;
fig. 8 is a flowchart of another speaker control method according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a speaker control device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another electronic device according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, the "plurality" generally includes at least two, but does not exclude the case of at least one.
It should be understood that the term "and/or" as used herein is merely one relationship describing the association of the associated objects, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to an identification", depending on the context. Similarly, the phrase "if determined" or "if identified (stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when identified (stated condition or event)" or "in response to an identification (stated condition or event), depending on the context.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present invention are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide corresponding operation entries for the user to select authorization or rejection.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a product or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such product or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a commodity or system comprising such elements.
Some embodiments of the invention will now be described in detail with reference to the accompanying drawings. In the case of no conflict between the embodiments, the following embodiments and features and steps in the embodiments may be combined with each other. The sequence of steps in the method embodiments described below is only an example and is not strictly limiting.
Before describing the details provided in the following embodiments of the present invention, the details about the validity of the protection program may be further described:
as mentioned in the background, a protection program in a PC may protect speakers in the PC. The operation of the protection program of the loudspeaker can enable the loudspeaker to continuously work under the power exceeding the rated power of the loudspeaker. The protection program can realize the protection of the loudspeaker by reducing the vibration amplitude of the loudspeaker diaphragm and/or reducing the temperature of the loudspeaker. And the continuous operation of the over-rated power of the loudspeaker can provide good sound effect for users.
In practice, the protection program may also fail, and at this time, the method, system or apparatus provided in the embodiments of the present invention described below may be used to continue to provide protection for the speaker.
Alternatively, the reasons for the protection program failure may include: the user prunes the program file of the protection program. Wherein, the user's pruning can be active pruning or false pruning. The program files may include dependency files and configuration files for protecting the program, and so forth. Optionally, the reasons for the protection program failure may further include: the user directly deletes the entire protection program. Alternatively, the user may perform deletion of the protection program through the management application. The management application may be an application program such as a computer manager installed on a PC, and the application program is used for managing the whole life cycle of the protection program.
In addition, in practice, the protection program is not always invalid, and therefore, the protection program can be restored to be valid from the invalidation. Alternatively, the reason why the protection program is restored to be effective may be that the user actively restores the deleted file after discovering that the program file of the protection program was deleted by mistake. The reason for the restoration may be that the user reinstalls the speaker protection program through the management application on the PC after discovering that the protection program is deleted entirely.
It can be seen that the occurrence of changes in the program files in the protection program can result in changes in the effectiveness of the protection program. More specifically, pruning of a program file may cause a protection program to become invalid from valid, and restoration of a program file may cause a protection program to become valid from invalid.
It should be noted that, the speakers protected by the methods, systems or apparatuses according to the embodiments of the present invention are not necessarily provided on the PC. The speaker to be protected may also be installed on a different electronic device, and the program file of the protection program of the speaker in the electronic device is set to be user-modifiable. Alternatively, the electronic device may be a smart screen, a smart speaker, a smart phone, or the like.
Based on the above description, in order to facilitate solution understanding, a control procedure of the speaker may be described based on a system architecture of the electronic device.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Alternatively, the electronic device in the present embodiment may be any device suitable for the present solution in the above description, such as a PC, a smart screen, or the like.
As shown in fig. 1, the electronic device may include: a main processor, a controller, a power amplifier and a speaker. The host processor may include, among other things, a monitor driver and a speaker protector.
The Power Amplifier (PA) may be specifically represented as a chip. The controller may specifically be an embedded controller (Embedded Controller, EC for short), which may also be represented as a chip.
Optionally, the electronic device further comprises an (Audio Digital Signal Processing, ADSP) audio digital signal processor for audio digital signal processing. The main processor and the audio digital signal processor may in particular be represented as chips.
As shown in fig. 1, the main processor is connected with the audio digital signal processor and the controller, and the power amplifier is connected with the audio digital signal processor, the controller and the speaker. And the main processor, the audio digital signal processor, and the controller may be packaged as one SOP (Small Out-Line Package), and the power amplifier and the speaker may be external devices to the SOP.
The main processor in the electronic device may adopt a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. As shown in fig. 1, a software system of an electronic device provided by an embodiment of the present invention may employ a hierarchical architecture. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. As shown in fig. 1, the software system of the electronic device may be divided into four layers, namely, an application layer, an application framework layer, an operating system layer and a hardware driving layer from top to bottom. The main processor of the electronic device performs data calculation based on the software architecture.
The application layer may include a series of application packages. As shown in FIG. 1, the application layer may include applications such as a browser, a computer manager, notes, photos, a media player, and the like.
The application framework layer provides an application programming interface (ApplicationProgramming Interface, abbreviated API) and programming framework for the application of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 1, the application framework layer may include a view system and its interfaces, a graphics system and its interfaces, and other system services. Other system services may specifically include: window manager, content provider, resource manager, notification manager, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a message notification icon may include a view displaying text and a view displaying a picture.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, browsing history, bookmarks, and the like.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a message notification icon may include a view displaying text and a view displaying a picture.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
A notification manager for managing and displaying notification messages from different applications and systems. The notification manager can help users to timely learn and process important events, reminders, and messages. Such as notification manager is used to inform that the download is complete, message alerts, etc.
The application layer and the application framework layer both run in dependence upon the operating environment provided by the operating system. The operating system is responsible for distributing computer resources, managing processes and threads, providing basic functions such as file system access, and providing an interactive interface with hardware devices. The application layer and application framework layer run and execute tasks through these interfaces and functions provided by the operating system.
The operating system layer is typically made up of a number of functional modules, such as: process management, memory management, file systems, device drivers, user interfaces, network communications, security management, system scheduling, and the like.
And (3) process management: creation, scheduling, synchronization, and termination of process processes, inter-process communication, and resource management.
And (3) memory management: and the method is responsible for distributing and managing the computer memory, including memory paging, virtual memory, memory protection, memory reclamation and the like.
File system: management and access to files and directories is provided, including creation, reading, writing, deletion of files, organization and storage of files, and the like.
Device driver: and managing the driver of the computer hardware device, and communicating and controlling with the device. Such as a keyboard driver, a mouse driver, a printer driver, etc.
User interface: interfaces for interacting with a user are provided, including command line interfaces, graphical User Interfaces (GUIs), and the like.
Network communication: providing network functions including network protocol stack, network connection management, data transmission, network security, etc.
And (3) safety management: security for protecting computer systems and data, including user authentication, rights management, data encryption, and protection from malware, etc.
And (3) system scheduling: computer resources are scheduled and managed to ensure smooth execution of tasks and reasonable utilization of resources.
The hardware driver layer is a layer between hardware and software. The hardware driver layer may include at least a display driver, a camera driver, an audio driver, a sensor driver, a protection program, and the like. In the embodiment of the present invention, in order to continue to provide protection for the speaker when the protection program fails, the hardware driver layer may be further added with a monitoring driver for monitoring whether the protection program is valid. The protection program and the monitoring driver in the hardware driver layer are the drivers which are mainly used in the scheme.
Based on the above software architecture, the control procedure of the electronic device on the speaker can be generally described as:
in response to the audio playback, the monitor driver in the hardware driver layer may obtain an operational state corresponding to the protection program of the speaker. The operating conditions may include normal and abnormal. Normal operation indicates that the protection program may provide protection to the speaker to keep the speaker operating at a power higher than the rated power. Abnormal operation indicates that the protection program cannot provide protection to the speaker, and that continued operation of the speaker at a power higher than the rated power may cause damage to the speaker. Alternatively, the operating state may be reflected in operating data, which in turn may be embodied as key value data in a registry.
Based on the acquired operational status, the monitoring driver may further notify the controller of the operational status. The controller can control the working power of the loudspeaker according to the received running state so as to realize the protection of the loudspeaker. Specifically, when the operation state of the protection program is abnormal, the controller can control the loudspeaker to work under the power smaller than the rated power, namely, the protection of the loudspeaker is realized by the cooperation of the monitoring driver and the controller. When the operation state of the protection program is normal, the protection controller can control the loudspeaker to work under the power higher than the rated power, and the protection program can protect the loudspeaker.
The control procedure of the loudspeaker by the electronic device will be described in detail below.
The user may trigger an audio playback operation, after which the electronic device may implement audio playback through the speaker via the audio driver in the hardware driver layer in response to this operation.
Alternatively, the user may trigger an audio playback operation in an application layer that provides audio playback functionality, such as a music application, a video application, etc., and the application layer in the electronic device may respond to the playback operation.
The process of the audio driver driving the speaker to play audio can be described as follows: after the audio driver is running, a lower power audio signal may be generated. The power amplifier connected with the loudspeaker can further amplify the power of the low-power audio signal, when the power of the amplified audio signal reaches the driving power of the loudspeaker, the loudspeaker starts to amplify the audio, and at the moment, the user can hear the audio.
During the audio playing process, the protection program in the hardware driving layer is also driven to run so as to protect the loudspeaker, namely, the loudspeaker can continuously work under the power exceeding the rated power of the loudspeaker and is not burnt. It is also because the speaker is continuously operated at a high power exceeding the rated power, and thus the speaker can provide a good sound effect to the user.
During audio playback, the speaker protection program may be active, or may be suddenly inactive for some time, and such an invalidation may be maintained for some time. Specific reasons for failure may be found in the above-mentioned related descriptions and will not be described in detail herein. The monitoring driver in the hardware driver layer can perform continuous monitoring of the effectiveness of the protection program. Alternatively, such continuous monitoring may be periodic or may be in response to a user continually triggering operation.
Specifically, during the audio playing process, the monitoring driver may obtain state data corresponding to the protection program of the speaker. The status data is used to reflect the running status of the protection program, i.e. whether the protection program is invalid. When the acquired state data is a first preset value reflecting the failure of the protection program, the monitoring driver may generate a first notification and send the first notification to the controller of the electronic device.
Alternatively, the status data acquired by the monitor driver may be specifically represented as key value data recorded in the registry. The first preset value may be set to 0.
Alternatively, the monitoring driver may call its own callback function and read status data representing key value data from the registry according to the path of the registry contained in the callback function. Alternatively, the callback function may be a CmRegisterCallback function. The callback function may be created when the monitor driver is written and registered in the hardware driver layer of the electronic device when the monitor driver is running. And optionally the callback function is re-registered each time the electronic device is started. Alternatively, the name of the key value data recorded in the registry may be mec_state. Alternatively, the path of the REGISTRY may be REGISTRY\USER\S-1-5-19\Software\AWinicAPO.
The controller of the electronic device may then receive a first notification generated by the monitoring driver. The controller is responsive to the first notification to determine that the protection program of the speaker is disabled, and the controller may further control a preset pin (e.g., GAIN0 pin) of a power amplifier coupled to the speaker to be low.
Since the amplification factor of the power amplifier is reduced at a low level, the operating power of the speaker can be reduced to make the operating power of the speaker lower than the rated power. At this time, damage is not likely to occur even if the speaker is continuously operated.
For controlling the level of the preset pin, optionally, after the controller receives the first notification, the controller may modify data in a preset address in its shared memory to control the level of the preset pin, and optionally, the shared memory is shared by the controller and the underlying software in the electronic device.
In this embodiment, during the process of playing audio, the monitor driver may obtain status data corresponding to the protection program of the speaker, where the status data may reflect whether the protection program of the speaker is effective, that is, reflect that the speaker is easy to damage when continuously working at a power greater than the rated power. The monitoring driver may generate a first notification when the status data is a first preset value reflecting a failure of the protection program. The controller responds to the first notice to control a preset pin of a power amplifier connected with the loudspeaker to be at a low level, so that the amplification factor of the power amplifier is reduced, and the loudspeaker is enabled to continuously work under a first power smaller than rated power.
In the control process, when the monitoring driver determines that the protection program fails, the controller responds to the notification of the monitoring driver, and the amplification factor of the power amplifier can be reduced by adjusting the level value of the pin of the power amplifier, so that the working power of the loudspeaker is reduced, the possibility of damage to the loudspeaker is reduced, and the protection to the loudspeaker is realized.
In summary, when the protection procedure is effective, the protection of the loudspeaker may be achieved by reducing the amplitude of the vibrations of the loudspeaker diaphragm and/or by reducing the temperature of the loudspeaker. When the protection program is invalid, the protection of the loudspeaker can be realized by reducing the working power of the loudspeaker in the mode of the embodiment shown in fig. 1.
According to the embodiment shown in fig. 1, the monitoring driver can continuously monitor the validity of the protection program. And for any one of the processes of continuous monitoring it may be performed in the manner of the embodiment shown in figure 1.
When the previous monitoring determines that the protection program fails, the controller may reduce the speaker operating power by changing the power amplifier pin level value to continue to protect the speaker, as shown in fig. 1. The failure of the protection program in this case can be classified into two cases:
The state data of the protection program acquired by the monitoring driver when the monitoring driver performs the last monitoring or continuously monitors for several times is a first preset value, namely, the protection program is invalid when the monitoring driver performs at least one monitoring before the last monitoring, namely, the state data of the protection program keeps the first preset value unchanged before and after the controller responds to the first notification, namely, the protection program is always in an invalid state in the adjacent at least one monitoring process. At this time, the controller controls the preset pin of the power amplifier to be at a low level, which is to maintain the level of the preset pin at a low level.
In this case, the cooperative operation of the monitor driver and the controller may provide protection for the speaker during the period that the protection program is continuously inactive.
In another case, the state data of the protection program obtained by the monitoring driver during the previous monitoring is a second preset value reflecting the validity of the protection program, that is, before the controller responds to the first notification, the state data of the protection program is converted from the second preset value to the first preset value, that is, the state of the protection program is changed from valid to invalid during the two adjacent monitoring processes. At this time, the controller controls the preset pin of the power amplifier to be low level, which is to change the level value of the preset pin from high level to low level. Alternatively, the second preset value may be set to 1.
In this case, the cooperative operation of the monitor driver and the controller may continue to provide protection to the speaker when the protection program transitions from active to inactive.
In practice, the protection program of the speaker is not always in an inactive state, and when the protection program of the speaker is in an active state, the control process of the electronic device on the speaker may be further described as:
during the audio playing process, the monitoring driver may obtain state data corresponding to the protection program of the speaker. When the acquired state data is a second preset value reflecting that the protection program is valid, the monitoring driver can generate a second notification and send the second notification to the controller of the electronic device. Alternatively, the representation and the acquisition of the status data may be described with reference to the embodiment shown in fig. 1.
The controller of the electronic device may then receive a second notification generated by the monitoring driver. The controller may further control the preset pin of the power amplifier connected to the speaker to be high in response to the second notification to determine that the protection procedure of the speaker is valid. Because the amplification factor of the power amplifier can be increased under the high level, the working power of the loudspeaker can be improved, the working power of the loudspeaker can be higher than rated power, and the loudspeaker can provide good sound effect for users.
Optionally, after the controller receives the second notification, the controller may modify the data in the preset address in the shared memory to control the level of the preset pin.
In this embodiment, when the monitor driver determines that the protection program is effective, the controller may enable the speaker to operate at a power exceeding the rated power by controlling the level value of the pin of the power amplifier, thereby providing a good sound effect for the user.
Similar to the protection program failure described above, in the process of continuously monitoring the effectiveness of the protection program by the monitoring drive program, when the protection program is determined to be effective by the current monitoring, the controller can enable the speaker to operate at a power exceeding the rated power by controlling the pin level value of the power amplifier. The effectiveness of the protection procedure in this case can be divided into two cases:
the state data of the protection program acquired by the monitoring driver when the monitoring driver performs the previous monitoring or continuously performs several times of monitoring is a second preset value, namely the protection program is valid during at least one monitoring before the previous monitoring, namely the state data of the protection program is kept unchanged after the controller responds to the second notification, namely the protection program is always in a valid state during at least one adjacent monitoring. At this time, the controller controls the preset pin of the power amplifier to be at a high level, which is effective to maintain the level of the preset pin at a high level.
In this case, the cooperative operation of the monitor driver and the controller may enable the speaker to operate continuously at an over-rated power during the duration of the protection procedure to provide a good sound effect to the user.
In another case, the state data of the protection program acquired by the monitoring driver during the previous monitoring is a first preset value reflecting that the protection program is invalid, that is, the state data of the protection program is changed from the first preset value to a second preset value before the controller responds to the second notification, that is, the state of the protection program is changed from invalid to valid during the adjacent monitoring. At this time, the controller may control the preset pin of the power amplifier to be at a high level, which is to switch the level value of the preset pin from a low level to a high level.
In this case, the cooperative operation of the monitor driver and the controller can make the speaker continuously operate under the over-rated power when the protection program is recovered from invalid to valid, so as to provide good sound effect for the user.
In the embodiments described above, the monitoring of the effectiveness of the protection program by the monitoring driver may be implemented by means of status data. Then, optionally, for the status data, it may be generated by a protection program.
Specifically, the play protection program responsive to audio also starts running. In the running process of the protection program, the protection program can detect whether the protection program is effective or not by calling a callback function of the protection program, so that state data is obtained. Alternatively, the status data may be represented as key value data and written into a registry of the electronic device.
When the state data is specifically key value data in the registry, if the protection program fails, the protection program writes the key value data of a first preset value in the registry; if the protection program fails, the protection program writes key value data of a second preset value in the registry.
In order to distinguish the callback function used for acquiring the state in the monitoring driver from the callback function in the protection program, the callback function in the protection program may be referred to as a first callback function, and the callback function in the monitoring driver may be referred to as a second callback function.
For the specific working process of the first callback function, optionally, by executing the first callback function, the protection program can query whether the program file of the protection program stored in the electronic device is complete or not, and can also query whether the configuration parameters in the program file are correct or not. It will be readily appreciated that the integrity of the program file and the correctness of the parameters can reflect whether and in what direction the program file is modified.
If the program file is complete and the configuration parameters are correct, which indicates that the program file is not modified or the program file is modified to be correct by an error, the function execution result output by the first callback function indicates that the protection program is effective, and the key value data written in the registry by the protection program is a second preset value. If the program file is incomplete and/or the configuration parameters are wrong, the program file is modified and the program file is modified into errors, the function execution result output by the first callback function indicates that the protection program is invalid, and the key value data written in the registry by the protection program is a first preset value.
Alternatively, the protection program may continuously monitor its own availability as with the drive monitor program. Such continuous monitoring may be periodic or may be in response to a user continually triggering operation. And optionally the monitoring period of the protection program may be the same as or different from the monitoring period of the monitoring driver.
When the protection program is invalid due to the user deleting the program file of the protection program, the method provided by the embodiment can be used, that is, the protection program can monitor the validity of the protection program by querying the file.
In this embodiment, the protection program may monitor its own validity, and write the monitoring result into the registry. Thereafter, the monitoring driver may determine the validity of the protection program by reading the data in the registry. That is, the protection program directly monitors the effectiveness of the protection program, and the monitoring driver indirectly monitors the effectiveness of the protection program. In addition, by means of the monitoring function of the protection program, the effectiveness of the protection program can be determined by the monitoring driver in a form of directly reading data, so that the monitoring logic of the monitoring driver can be simplified, and the development difficulty of the monitoring driver is reduced.
When the user directly deletes the protection program through the management application program to cause the protection program to be invalid, the protection program validity can also be optionally monitored by other programs in the electronic device, such as the management application program. In particular, the management application may continuously monitor the installation of different types of programs in the electronic device.
When the management application monitors that the protection program is not installed in the electronic device, the management application may write key value data reflecting that the protection program is invalid in the registry. The monitor driver may read the key value data and implement protection of the speaker by controlling a preset pin of the power amplifier to be low. The specific process may be referred to the description of the related embodiments, and will not be repeated here.
When the management application program monitors that the protection program is installed in the electronic device, the protection program can further monitor the running state directly, and then the protection program or the monitoring driver and the controller protect the loudspeaker according to the modes provided by the embodiments.
In combination with the above embodiments, the cooperative work of the monitor driver, the protection program, the controller and the power amplifier can realize the control of the working power of the speaker according to the effectiveness of the protection program. The control of the working power of the loudspeaker can also realize that the loudspeaker provides good sound effect for users when the protection program is effective; when the protection program fails, the working power of the loudspeaker is reduced, and the possibility of burning the loudspeaker is reduced. The process by which the above components work together can also be understood in conjunction with the signaling diagram shown in fig. 2 and the schematic diagram shown in fig. 3.
The electronic device suitable for the speaker control method provided by the embodiment of the invention can include, but is not limited to, devices such as a PC, a tablet computer, a notebook computer, a vehicle-mounted computer and the like. It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device. In other embodiments of the invention, the electronic device may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Taking a PC as an example, fig. 4 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
The electronic device may include a main processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (Universal Serial Bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, an indicator 192, a camera 193, a display 194, a power amplifier 195, and the like.
The main processor 110 (including the controller and ADSP) in the electronic device, the speaker 170A in the audio module 170, and the power amplifier 195 cooperate to implement the speaker control process in the embodiments shown in fig. 1-3.
The functions of the main processor 110, the speaker 170A, and the power amplifier 195 used in the speaker control process will be described first.
The main processor 110 may include one or more processing units, such as: the host processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), a controller, a video codec, a digital signal processor (digital signal processor, DSP), and the DSP may include ADSP in particular. Baseband processor and/or neural Network Processor (NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the main processor 110 for storing instructions and data. In some embodiments, the memory in the main processor 110 is a cache memory. The memory may hold instructions or data that is just used or recycled by the main processor 110. If the main processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the main processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the host processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a general-purpose input/output (GPIO) interface, and/or a universal serial bus (universal serial bus, USB) interface, etc.
The electronic device may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the main processor 110, or some functional modules of the audio module 170 may be provided in the main processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device may listen to music, or to hands-free conversations, through speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the electronic device picks up a phone call or voice message, the voice can be picked up by placing the receiver 170B close to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device may be provided with at least one microphone 170C, which may enable noise reduction, identification of the source of sound to enable directional recording functions, etc., in addition to collecting sound signals.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (Open Mobile Terminal Platform, OMTP) standard interface, a american cellular telecommunications industry association (Cellular Telecommunications Industry Association of the USA, CTIA) standard interface.
The power amplifier 195 is connected to the controller and ADSP in the main processor 110, respectively, and also connected to the audio module 170 for amplifying the power of the audio signal to the start-up power of the speaker a.
The function of the other components in the electronic device will be further described below.
The external memory interface 120 may be used to connect external memory cards, such as a usb disk, an external hard disk, a memory card, etc., to enable expansion of the memory capabilities of the electronic device. The external memory card communicates with the main processor 110 through an external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The internal memory 121 may include a storage program area and a storage data area. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The main processor 110 performs various functional applications of the electronic device and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. USB interface 130 may be used to transfer data between an electronic device and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the connection relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and does not limit the structure of the electronic device. In other embodiments of the present invention, the electronic device may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger.
The power management module 141 is used for connecting the battery 142, and the charging management module 140 and the main processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the main processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the main processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device may be implemented by an antenna, a wireless communication module 160, a modem processor, a baseband processor, and the like.
The antenna is used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antennas may be multiplexed into diversity antennas of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the host processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (Wireless Local Area Networks, WLAN) (e.g., wireless fidelity (Wireless Fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (Global Navigation Satellite System, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (Near Field Communication, NFC), infrared technology (IR), etc., as applied on electronic devices. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the main processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the main processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via an antenna.
In some embodiments, the antenna and wireless communication module 160 are coupled such that the electronic device may communicate with the network and other devices through wireless communication techniques.
The electronic device implements display functions via a GPU, a display screen 194, an application processor, and the like.
The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The host processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. In some embodiments, the electronic device may include 1 or N display screens 194, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, and so on.
Video codecs are used to compress or decompress digital video. The electronic device may support one or more video codecs. In this way, the electronic device may play or record video in a variety of encoding formats, such as: dynamic picture experts group (Moving Picture Experts Group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a Neural-Network (NN) computing processor, and can rapidly process input information by referencing a biological Neural Network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent cognition of electronic devices can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The sensor module 180 may include a temperature sensor 180A, an accelerometer 180B, a light sensor 180C, a magnetometer 180D, and the like.
Temperature sensor 180A: the temperature sensor is used for measuring the temperature inside the computer so as to monitor and control the temperature change and ensure the normal operation of the computer.
Accelerometer 180B: for detecting and measuring acceleration and inclination angles of the computer in three axes. It can be used for automatic rotation screen, gesture sensing, game control, etc.
Light sensor 180C: the device is used for measuring the ambient illumination intensity so as to automatically adjust the screen brightness or control the functions of keyboard backlight and the like.
Magnetometer (magnetic field sensor) 180D: for detecting and measuring the strength and direction of the surrounding magnetic field. It can be used for compass application, direction sensing, magnetic field monitoring, etc.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
When the electronic device is a tablet computer or a mobile phone, the electronic device may optionally further include keys such as a power-on key, a volume keypad, etc., and a motor for generating a vibration alert.
Optionally, the electronic device further comprises a pressure sensor, a gyroscope sensor, a barometric pressure sensor, an acceleration sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
Optionally, the electronic device may further include a mobile communication module that may provide a solution for wireless communication including 2G/3G/4G/5G, etc. applied to the electronic device, that is, the mobile communication module. The mobile communication module may receive electromagnetic waves from another antenna other than the antenna in fig. 4, perform processes such as filtering, amplifying, etc., on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module can amplify the signal modulated by the modulation and demodulation processor and convert the signal into electromagnetic waves to radiate through another antenna. In some embodiments, at least some of the functional modules of the mobile communication module may be provided in the main processor 110. In some embodiments, at least some of the functional modules of the mobile communication module may be provided in the same device as at least some of the modules of the main processor 110.
In addition, in the electronic device shown in fig. 1 or fig. 4, the components for realizing speaker protection may also constitute a speaker control system. The system can be considered as a soft and hard combined system. Fig. 5 is a schematic structural diagram of a speaker control system according to an embodiment of the present invention. As shown in fig. 5, the system includes a monitor driver, a controller, a power amplifier, and a speaker.
The power amplifier is respectively connected with the controller and the loudspeaker; the controller is connected with the monitoring driver.
Optionally, the speaker control system may further include a protection program for the speaker.
And responding to the playing of the audio, and acquiring state data corresponding to the protection program of the loudspeaker by the monitoring driver.
Optionally, when the status data is a first preset value reflecting failure of the protection program, the monitoring driver generates a first notification and sends the first notification to the controller. The controller responds to the first notice and controls a preset pin of a power amplifier connected with the loudspeaker to be low level, so that the working power of the loudspeaker is smaller than rated power, and the possibility of burning the loudspeaker is reduced.
Optionally, when the status data is a second preset value reflecting that the protection program is valid, the monitoring driver generates a second notification and sends the second notification to the controller. The controller responds to the second notice and controls the preset pin of the power amplifier connected with the loudspeaker to be high level, so that the working power of the loudspeaker is higher than the rated power, and good sound effect is provided for a user. At this time, protection is provided for the speaker by the protection program.
In this embodiment, the monitor driver may obtain status data corresponding to the protection program of the speaker, where the status data may reflect whether the protection program of the speaker is valid. The monitoring driver may generate a first notification when the status data is a first preset value reflecting a failure of the protection program. The controller responds to the first notification to control a preset pin of a power amplifier connected with the loudspeaker to be at a low level, so that the amplification factor of the power amplifier is reduced, the loudspeaker continuously works at a power smaller than rated power, namely the working power of the loudspeaker is reduced, the damage possibility of the loudspeaker is reduced, and the protection of the loudspeaker is realized.
In addition, the details and the technical effects that can be achieved in this embodiment are all referred to in the above embodiments, and are not described herein.
Alternatively, the state data in the embodiment shown in fig. 5 may specifically be key value data in a registry, where the key value data may be written by a protection program. The process of writing key value data by the protection program and various situations of the validity transformation of the protection program can be referred to the related descriptions in the embodiments shown in fig. 1 to 3, and are not repeated here.
The control procedure of the loudspeaker can also be described below from a method point of view. Fig. 6 is a flowchart of a method for controlling a speaker according to an embodiment of the present invention. The text generation method provided by the embodiment of the invention can be executed by the electronic equipment provided by the embodiment. As shown in fig. 6, the method may include the steps of:
s101, responding to the playing of the audio, and acquiring state data corresponding to a protection program of the loudspeaker.
S102, when the state data is a first preset value reflecting the failure of the protection program, a first notification is generated.
S103, responding to the first notice, and controlling a preset pin of a power amplifier connected with the loudspeaker to be low level, so that the working power of the loudspeaker is smaller than the rated power.
And the electronic equipment responds to the playing of the audio to acquire the state data corresponding to the protection program of the loudspeaker. The status data is used to reflect whether the protection procedure of the speaker is valid. The protection program effectively indicates that the loudspeaker continuously works under the power higher than the rated power and is not easy to burn.
Alternatively, the state data may be embodied as key value data written into a registry. The electronic device may read the key value data from the registry by calling a callback function to determine if the protection program is valid. And optionally the callback function for reading the key-value data needs to be re-registered each time the electronic device is started.
For the acquired status data, the present embodiment gives a case: when the state data is a first preset value reflecting the failure of the protection program, the electronic device generates a first notification, and controls a preset pin of a power amplifier connected with the loudspeaker to be at a low level in response to the first notification. At low levels, the speaker may operate at less than rated power, thereby reducing the likelihood of the speaker burning out.
Alternatively, in this embodiment, the protection program may be in an invalid state before and after the first notification is generated, or may be changed from valid to invalid. In either case, however, the electronic device may operate the speaker at a power below the rated power by controlling the pin level.
Alternatively, the steps in the present implementation may be specifically performed by a monitoring driver in the electronic device.
In this embodiment, the electronic device may obtain state data corresponding to the protection program of the speaker, where the state data may reflect whether the protection program of the speaker is valid. When the state data is a first preset value reflecting failure of the protection program, a first notification can be generated and responded to control a preset pin of a power amplifier connected with the loudspeaker to be at a low level, so that the amplification factor of the power amplifier is reduced, the loudspeaker continuously works at a power smaller than rated power, namely, the working power of the loudspeaker is reduced, the damage possibility of the loudspeaker is reduced, and the protection of the loudspeaker is realized.
In addition, the details and the technical effects that can be achieved in this embodiment are all referred to in the above embodiments, and are not described herein.
Fig. 7 is a flowchart of another speaker control method according to an embodiment of the present invention. As shown in fig. 7, the following steps may be included:
s201, responding to the playing of the audio, and acquiring state data corresponding to a protection program of the loudspeaker.
The specific implementation process of the above step S201 may refer to the specific description of the related steps in the embodiment shown in fig. 6, which is not repeated herein.
S202, when the state data is a second preset value reflecting that the protection program is valid, a second notification is generated.
S203, responding to the second notice, and controlling a preset pin of the power amplifier to be set to be high level, so that the working power of the loudspeaker is larger than the rated power.
Corresponding to the embodiment shown in fig. 6, this embodiment gives another case: when the state data is a second preset value reflecting the failure of the protection program, the electronic device generates a second notification, and controls a preset pin of a power amplifier connected with the loudspeaker to be at a high level in response to the second notification. At high levels, the speaker may continue to operate at power exceeding the rated power, providing good sound effects to the user, and the speaker is also not easily burned.
Alternatively, the steps in the present implementation may be specifically performed by a monitoring driver in the electronic device.
Alternatively, in this embodiment, the protection program may be in an active state before and after the second notification is generated, or may be changed from inactive to active. In either case, however, the electronic device may operate the speaker at a power exceeding the rated power by controlling the pin level.
In this embodiment, the electronic device may obtain state data corresponding to a protection program of the speaker. When the state data is a second preset value reflecting the effectiveness of the protection program, a second notification can be generated and responded to control the preset pin of the power amplifier connected with the loudspeaker to be at a high level, so that the amplification factor of the power amplifier is improved, and the loudspeaker continuously works under the power higher than the rated power, so that good sound effect is provided for a user. Meanwhile, since the protection program is effective at this time, protection can be provided for the speaker.
In addition, the details and the technical effects that can be achieved in this embodiment are all referred to in the above embodiments, and are not described herein.
The state data in the embodiments shown in fig. 6 and 7 may be embodied as key value data written into a registry. Alternatively, the writing of the key value data may also be performed by the electronic device.
Specifically, in response to playing audio, the electronic device may determine whether the protection program is valid by calling a callback function, and then determine key value data written in the registry according to the determination result. Alternatively, according to the actual situation, the validity of the protection program may be implemented by means of a callback function in the protection program or the management application program in the electronic device, and the specific process may be referred to as the description in the above related embodiments. For distinguishing, the callback function used for determining the validity of the protection program may be called a first callback function, and the callback function used for reading the key value data may be called a second callback function.
And when the protection program is determined to be invalid, writing a first preset value in the registry. And when the protection program is determined to be effective, writing a second preset value in the registry.
And in view of the foregoing description of the method embodiment, the control flow of the electronic device to the speaker may also be understood in conjunction with the flowchart shown in fig. 8.
The control process of the speaker has been described in detail above from the viewpoint of the apparatus, system and method. The control process of the speaker can be described below by taking a specific application scenario in which the PC plays audio as an example.
An audio application and a protection program for speakers may be installed in the PC, and a program file of the protection program is set to be user-modifiable.
In practice, in one case, the user may delete at least one program file of the protection program or modify parameters in the program file by mistake during the manual system cleaning.
Under the above situation, the user can still trigger the operation on the audio application program in the PC under the condition that the protection program has failed, so as to realize audio playing.
During the audio playing process, the protection program in the hardware driving layer of the PC can monitor the effectiveness of the protection program, in particular, the protection program can determine whether the program file is complete and whether the parameters in the file are correct in a query mode. The protection program may then write key value data reflecting the validity of the protection program to the registry based on the monitored validity. Under the above situation, the protection program determines that the program file is incomplete and/or the parameters in the file are wrong in a query mode, so that the protection program is invalid, and the key value data written into the registry by the protection program is 0.
The monitor driver in the PC hardware driver layer may further read key data reflecting the failure of the protection program from the registry and further generate a notification. The controller in the PC can respond to the notification to control the pin of the power amplifier connected with the loudspeaker to be at a low level, thereby reducing the working power of the loudspeaker, reducing the possibility of burning out the loudspeaker, namely realizing continuous protection of the loudspeaker when the protection program fails.
Optionally, the user may also actively restore the misshapen program file and/or parameters, and the protection program may monitor that the misshapen program file is restored, at which point the protection program may modify the key value data in the registry to 1. Then, the monitoring driver can know that the protection program has been restored to be effective by reading the key value data in the registry, and can send a notification to the controller so that the controller controls the pin of the power amplifier to be at a high level, and the loudspeaker operates at a power exceeding the rated power. At this time, since the protection program is restored to be effective, the protection program can provide protection for the speaker, and the speaker also provides good sound effects for the user.
In another case, the user may also directly delete the whole protection program by mistake in the process of manually cleaning the system. Alternatively, the user may trigger the false deletion of the protection program by a computer manager installed on the PC.
In the above case, when the user triggers an operation on the audio application, the playback of the audio is responded. During the audio playing process, the effectiveness of the protection program can be monitored by a computer manager in the PC. The validity at this time is specifically whether or not the protection program of the speaker is reinstalled in the PC. The computer manager may write key value data reflecting the validity of the protection program to the registry. The monitoring driver in the PC can also control the level of the pins of the power amplifier in a meter reading mode, so that the protection of the loudspeaker is realized.
The working processes not specifically described in the above cases may be referred to the relevant descriptions in the above embodiments, and are not repeated here.
A speaker control apparatus according to one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these speaker control devices may be configured using commercially available hardware components through the steps taught by the present solution.
Fig. 9 is a schematic structural diagram of a speaker control device according to an embodiment of the present invention, as shown in fig. 9, where the device includes:
the obtaining module 11 is configured to obtain, in response to the playing of the audio, status data corresponding to a protection program of the speaker.
And the generating module 12 is used for generating a first notification when the state data is a first preset value reflecting the failure of the protection program, and the effective protection program enables the loudspeaker to continuously work under the power larger than the rated power.
And the control module 13 is used for responding to the first notification and controlling a preset pin of a power amplifier connected with the loudspeaker to be at a low level so that the working power of the loudspeaker is smaller than the rated power.
Before the first notification is generated, the state data is converted into the first preset value from a second preset value, the second preset value reflects that the protection program is effective, the preset pin of the power amplifier is at a high level, and the working power of the loudspeaker is greater than the rated power.
Optionally, the control module 13 is configured to modify data in a preset address in the shared memory in response to the first notification, so as to control a preset pin of the power amplifier to be at a low level.
Optionally, the generating module 12 is configured to generate a second notification when the status data is a second preset value reflecting that the protection program is valid.
The control module 13 is configured to control, in response to the second notification, a preset pin of the power amplifier to be set to a high level, so that the working power of the speaker is greater than the rated power.
Before the second notification is generated, the state data is converted from the first preset value to the second preset value, the preset pin of the power amplifier is in a low level, and the working power of the loudspeaker is smaller than the rated power.
Optionally, the state data of the protection program is key value data recorded in a registry.
The apparatus further comprises: a detection module 14, configured to detect, in response to the playing of the audio, whether the protection program is valid by calling a first callback function in the protection program;
when the protection program fails, writing key value data of the first preset value into the registry;
and when the protection program is effective, writing key value data of the second preset value in the registry.
Optionally, the detecting module 14 is configured to determine that the protection program fails in response to a pruning of the program file of the protection program; the protection program is determined to be valid in response to recovery of the pruned program file of the protection program.
Optionally, the obtaining module 11 is configured to call a second callback function in the monitoring driver, and read key value data recorded in the registry according to a path included in the second callback function.
Optionally, the apparatus further comprises a registration module 15 for registering the second callback function in response to a start-up of the electronic device equipped with the speaker.
The apparatus shown in fig. 9 may perform the method of the embodiment shown in fig. 6 to 8, and reference is made to the relevant description of the embodiment shown in fig. 6 to 8 for a part of this embodiment that is not described in detail. The implementation process and technical effects of this technical solution are described in the embodiments shown in fig. 1 to 9, and are not described herein.
In one possible design, the speaker control method provided in the above embodiments may be applied to an electronic device, as shown in fig. 10, where the electronic device may include: the first processor 21 and the first memory 22, the first controller 23, the first speaker 24 and the first power amplifier 25. Wherein the first memory 22 is for storing a program for supporting the electronic device to execute the speaker control method provided in the embodiments shown in fig. 6 to 8 described above, the first processor 21 and the first controller 23 are configured to execute the program stored in the first memory 22.
The program comprises one or more computer instructions which, when executed by the first processor 21 and the first controller 23, are capable of performing the steps of:
responding to the playing of the audio, and acquiring state data corresponding to a protection program of the loudspeaker;
when the state data is a first preset value reflecting the failure of the protection program, generating a first notification, and enabling the effective protection program to enable the loudspeaker to continuously work under the power larger than rated power;
and responding to the first notice, and controlling a preset pin of a power amplifier connected with the loudspeaker to be at a low level so that the working power of the loudspeaker is smaller than rated power.
Optionally, the first processor 21 and the first controller 23 are further configured to perform all or part of the steps in the embodiments shown in fig. 6 to 8 described above.
The electronic device may also include a first communication component 26 in its structure for communicating with other devices or communication systems.
In one possible design, the speaker control method provided in the foregoing embodiments may be applied to a terminal device, as shown in fig. 11, where the electronic device may include: a second processor 31 and a second memory 32, a second controller 33, a second speaker 34 and a second power amplifier 35. Wherein the second memory 32 is for storing a program for supporting the electronic device to execute the speaker control method provided in the embodiments shown in fig. 6 to 8 described above, the second processor 31 and the second controller 33 are configured to execute the program stored in the second memory 32.
The program comprises one or more computer instructions which, when executed by the second processor 31 and the second controller 33, are capable of performing the steps of:
responding to the playing of the audio, and acquiring state data corresponding to a protection program of the loudspeaker;
when the state data is a first preset value reflecting the failure of the protection program, generating a first notification, and enabling the effective protection program to enable the loudspeaker to continuously work under the power larger than rated power;
and responding to the first notice, and controlling a preset pin of a power amplifier connected with the loudspeaker to be at a low level so that the working power of the loudspeaker is smaller than rated power.
Optionally, the second processor 31 and the second controller 33 are further configured to perform all or part of the steps in the embodiments shown in fig. 6 to 8 described above.
A second communication component 36 may also be included in the structure of the electronic device for communicating with other devices or communication systems.
In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions for the electronic device, which includes a program for executing the speaker control method shown in fig. 6 to 8.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (17)

1. A speaker control method, comprising:
responding to the playing of the audio, and acquiring state data corresponding to a protection program of the loudspeaker;
when the state data is a first preset value reflecting the failure of the protection program, generating a first notification, wherein the state data is converted into the first preset value from a second preset value reflecting the effectiveness of the protection program before the first notification is generated, a preset pin of a power amplifier connected with the loudspeaker is set to be high level, and the effective protection program enables the loudspeaker to continuously work under the power larger than rated power;
And responding to the first notice, and controlling the preset pin of the power amplifier to be at a low level so that the working power of the loudspeaker is smaller than rated power.
2. The method of claim 1, wherein controlling the preset pin of the power amplifier connected to the speaker to be low in response to the first notification comprises:
and responding to the first notice, and modifying data in a preset address in the shared memory to control a preset pin of the power amplifier to be in a low level.
3. The method according to claim 1, wherein the method further comprises:
when the state data is a second preset value reflecting the effectiveness of the protection program, generating a second notification;
and responding to the second notification, and controlling a preset pin of the power amplifier to be set to be at a high level so that the working power of the loudspeaker is larger than the rated power.
4. A method according to claim 3, wherein the state data is converted from the first preset value to the second preset value before the second notification is generated, the preset pin of the power amplifier is low, and the operating power of the speaker is less than the rated power.
5. The method of claim 1, wherein the state data of the protection program is key value data recorded in a registry.
6. The method of claim 5, wherein the method further comprises:
responding to the playing of the audio, and detecting whether the protection program is valid or not by calling a first callback function in the protection program;
when the protection program fails, writing key value data of the first preset value into the registry;
and when the protection program is effective, writing key value data of the second preset value in the registry.
7. The method of claim 6, wherein the detecting whether the protection program is valid by calling a first callback function in the protection program comprises:
determining that the protection program fails in response to a pruning of a program file of the protection program;
in response to restoration of the program file of the protection program where the pruning occurred, the protection program is determined to be valid.
8. The method according to claim 5, wherein the obtaining the status data corresponding to the protection program of the speaker includes:
And calling a second callback function in the monitoring driver, and reading key value data recorded in a registry according to a path contained in the second callback function.
9. The method of claim 8, wherein the method further comprises:
the second callback function is registered in response to a start-up of the electronic device configured with the speaker.
10. A speaker control system, comprising: the power amplifier is respectively connected with the controller and the loudspeaker, and the controller is connected with the monitoring driver;
the monitoring driver is used for responding to the playing of the audio and acquiring state data corresponding to a protection program of the loudspeaker;
when the state data is a first preset value reflecting the failure of the protection program, generating a first notification, wherein the state data is converted into the first preset value from a second preset value reflecting the effectiveness of the protection program before the first notification is generated, a preset pin of a power amplifier connected with the loudspeaker is set to be high level, and the effective protection program enables the loudspeaker to continuously work under the power larger than rated power;
And the controller is used for responding to the first notification and controlling a preset pin of a power amplifier connected with the loudspeaker to be at a low level so that the working power of the loudspeaker is smaller than the rated power.
11. The system of claim 10, wherein the controller is configured to modify data in a preset address in the shared memory in response to the first notification to control a preset pin of the power amplifier to be low.
12. The system of claim 10, wherein the monitor driver is configured to generate a second notification when the status data is a second preset value reflecting that the protection program is valid;
and the controller is used for responding to the second notification and controlling a preset pin of the power amplifier to be at a high level so that the working power of the loudspeaker is larger than the rated power.
13. The system according to claim 10 or 12, wherein the monitor driver is configured to call a callback function in the monitor driver, and read the state data according to a path included in the callback function, where the state data includes key value data recorded in a registry.
14. A speaker control apparatus, comprising:
the acquisition module is used for responding to the playing of the audio and acquiring state data corresponding to a protection program of the loudspeaker;
the generating module is used for generating a first notification when the state data is a first preset value reflecting the failure of the protection program, wherein the state data is converted into the first preset value from a second preset value reflecting the effectiveness of the protection program before the first notification is generated, a preset pin of a power amplifier connected with the loudspeaker is set to be high level, and the effective protection program enables the loudspeaker to continuously work under the power larger than rated power;
and the control module is used for responding to the first notification and controlling the preset pin of the power amplifier to be at a low level so that the working power of the loudspeaker is smaller than the rated power.
15. A terminal device, comprising: memory, processor, controller, power amplifier and speaker;
the power amplifier is respectively connected with the controller and the loudspeaker, and the processor comprises a monitoring driver; the memory has stored thereon executable code of the monitor driver and the speaker protection program, which when executed by the processor, causes the controller and the processor to perform the speaker control method according to any one of claims 1 to 9.
16. An electronic device, comprising: memory, processor, controller, power amplifier and speaker;
the power amplifier is respectively connected with the controller and the loudspeaker, and the processor comprises a monitoring driver; the memory has stored thereon executable code of the monitor driver and the speaker protection program, which when executed by the processor, causes the controller and the processor to perform the speaker control method according to any one of claims 1 to 9.
17. A non-transitory machine-readable storage medium having executable code stored thereon, which when executed by a processor of an electronic device, causes the processor to perform the speaker control method of any of claims 1-9.
CN202311351285.9A 2023-10-18 2023-10-18 Speaker control method, system, device, apparatus and storage medium Active CN117082419B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311351285.9A CN117082419B (en) 2023-10-18 2023-10-18 Speaker control method, system, device, apparatus and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311351285.9A CN117082419B (en) 2023-10-18 2023-10-18 Speaker control method, system, device, apparatus and storage medium

Publications (2)

Publication Number Publication Date
CN117082419A CN117082419A (en) 2023-11-17
CN117082419B true CN117082419B (en) 2024-04-02

Family

ID=88708471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311351285.9A Active CN117082419B (en) 2023-10-18 2023-10-18 Speaker control method, system, device, apparatus and storage medium

Country Status (1)

Country Link
CN (1) CN117082419B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4887298A (en) * 1988-06-15 1989-12-12 Renkus-Heinz Electronic circuit for sensing disconnect or failure of a power output sense line in an audio power system
CN110225434A (en) * 2019-05-31 2019-09-10 Oppo(重庆)智能科技有限公司 Excess temperature protection method, device and computer storage medium and electronic equipment
CN114727187A (en) * 2022-04-02 2022-07-08 头领科技(昆山)有限公司 Audio output device state detection chip and earphone
CN115708362A (en) * 2021-08-19 2023-02-21 荣耀终端有限公司 Method for improving sound effect of playing out and related device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030118193A1 (en) * 2001-12-21 2003-06-26 Leske Lawrence A. Method and system for digitally controlling a speaker

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4887298A (en) * 1988-06-15 1989-12-12 Renkus-Heinz Electronic circuit for sensing disconnect or failure of a power output sense line in an audio power system
CN110225434A (en) * 2019-05-31 2019-09-10 Oppo(重庆)智能科技有限公司 Excess temperature protection method, device and computer storage medium and electronic equipment
CN115708362A (en) * 2021-08-19 2023-02-21 荣耀终端有限公司 Method for improving sound effect of playing out and related device
CN114727187A (en) * 2022-04-02 2022-07-08 头领科技(昆山)有限公司 Audio output device state detection chip and earphone

Also Published As

Publication number Publication date
CN117082419A (en) 2023-11-17

Similar Documents

Publication Publication Date Title
CN111191213B (en) Method for deleting security service and electronic equipment
CN114553814B (en) Method and device for processing push message
CN112214294A (en) Method for calling hardware interface and electronic equipment
CN113805797B (en) Processing method of network resource, electronic equipment and computer readable storage medium
CN111381996B (en) Memory exception handling method and device
WO2023051094A1 (en) Memory recovery method and apparatus, electronic device, and readable storage medium
CN117082419B (en) Speaker control method, system, device, apparatus and storage medium
CN113467821A (en) Application program repairing method, device, equipment and readable storage medium
CN114117367A (en) Data protection method and electronic equipment
WO2020024087A1 (en) Working method of touch control apparatus, and terminal
CN117076089B (en) Application management method, terminal device and storage medium
CN114945176B (en) Clipboard access control method, electronic equipment and storage medium
WO2024022310A1 (en) Device security processing method and electronic devices
CN114006969B (en) Window starting method and electronic equipment
CN116048544B (en) Processing method of popup advertisement, electronic equipment and readable storage medium
CN116052376B (en) Remote monitoring method and terminal equipment
CN115952564B (en) Data writing method and terminal equipment
CN116709220B (en) Network connection method, network connection device, electronic equipment and computer readable storage medium
CN116048545B (en) Processing method of popup advertisement, electronic equipment and readable storage medium
CN116991274B (en) Upper sliding effect exception handling method and electronic equipment
CN116302291B (en) Application display method, electronic device and storage medium
CN116048829B (en) Interface calling method, device and storage medium
WO2024066837A1 (en) Incoming call alert method and electronic device
CN116931802A (en) Control method and central control equipment
CN117116258A (en) Voice awakening method and electronic equipment

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