CN117440088A - Conversation method and related equipment - Google Patents

Conversation method and related equipment Download PDF

Info

Publication number
CN117440088A
CN117440088A CN202311754175.7A CN202311754175A CN117440088A CN 117440088 A CN117440088 A CN 117440088A CN 202311754175 A CN202311754175 A CN 202311754175A CN 117440088 A CN117440088 A CN 117440088A
Authority
CN
China
Prior art keywords
adsp
time
restart
restarting
electronic device
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.)
Granted
Application number
CN202311754175.7A
Other languages
Chinese (zh)
Other versions
CN117440088B (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 CN202311754175.7A priority Critical patent/CN117440088B/en
Publication of CN117440088A publication Critical patent/CN117440088A/en
Application granted granted Critical
Publication of CN117440088B publication Critical patent/CN117440088B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M3/00Automatic or semi-automatic exchanges
    • H04M3/22Arrangements for supervision, monitoring or testing
    • H04M3/2272Subscriber line supervision circuits, e.g. call detection circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M3/00Automatic or semi-automatic exchanges
    • H04M3/22Arrangements for supervision, monitoring or testing
    • H04M3/2254Arrangements for supervision, monitoring or testing in networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M3/00Automatic or semi-automatic exchanges
    • H04M3/22Arrangements for supervision, monitoring or testing
    • H04M3/229Wire identification arrangements; Number assignment determination
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M3/00Automatic or semi-automatic exchanges
    • H04M3/22Arrangements for supervision, monitoring or testing
    • H04M3/26Arrangements for supervision, monitoring or testing with means for applying test signals or for measuring
    • H04M3/28Automatic routine testing ; Fault testing; Installation testing; Test methods, test equipment or test arrangements therefor
    • H04M3/32Automatic routine testing ; Fault testing; Installation testing; Test methods, test equipment or test arrangements therefor for lines between exchanges
    • H04M3/323Automatic routine testing ; Fault testing; Installation testing; Test methods, test equipment or test arrangements therefor for lines between exchanges for the arrangements providing the connection (test connection, test call, call simulation)
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M3/00Automatic or semi-automatic exchanges
    • H04M3/42Systems providing special services or facilities to subscribers
    • H04M3/42187Lines and connections with preferential service

Abstract

The embodiment of the application provides a call method and related equipment, and relates to the technical field of terminals. The method comprises the following steps: in a first preset time period, if the restarting times of the ADSP is greater than or equal to a preset value, controlling the ADSP not to trigger restarting; in the period that ADSP does not trigger restarting, the electronic equipment receives a call operation; in response to the call operation, the electronic device establishes an audio path using the ADSP. In this way, under the condition that the electronic equipment causes the ADSP to restart repeatedly due to the bus fault so as to influence the voice call, the ADSP is controlled not to trigger the restart so as to establish an audio channel by using the ADSP and establish the call; the user can still use the call service under the condition that the hardware of the electronic equipment is damaged, so that the use experience of the user is improved.

Description

Conversation method and related equipment
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a call method and related devices.
Background
The electronic device may provide a variety of service functions, for example, the electronic device may support telephony services.
However, in a possible implementation, a user may encounter an abnormal scene that a call cannot be made in the process of using the electronic device, so as to affect the use experience of the user.
Disclosure of Invention
The embodiment of the application provides a call method and related equipment, which are applied to the technical field of terminals, and under the condition that the electronic equipment is repeatedly restarted due to bus faults so as to influence voice call, the ADSP is controlled not to trigger the restarting so as to establish an audio channel by using the ADSP and establish the call; the user can still use the call service under the condition that the hardware of the electronic equipment is damaged, so that the use experience of the user is improved.
In a first aspect, an embodiment of the present application provides a call method. The method comprises the following steps: in a first preset time period, if the restarting times of the ADSP is greater than or equal to a preset value, controlling the ADSP not to trigger restarting; in the period that ADSP does not trigger restarting, the electronic equipment receives a call operation; in response to the call operation, the electronic device establishes an audio path using the ADSP. In this way, when the bus failure causes the ADSP to restart repeatedly, the electronic device may control the ADSP not to restart, so that the electronic device can provide basic services, such as a call service, during the period when the ADSP is not restarted; therefore, the utilization rate of the electronic equipment after the hardware is damaged is improved, and the use experience of a user is improved.
In one possible implementation, controlling the ADSP does not trigger a restart, including: under the condition that a bus passage is blocked, controlling the bus passage not to trigger ADSP to restart; and/or, under the condition that the time length used by the bus access to read the sensor information does not reach the first preset time length, controlling the sensor access not to trigger ADSP to restart; the first preset time period is longer than the second preset time period, and the second preset time period is the preset time period for judging that the sensor access triggers the ADSP to restart. In this way, the ADSP does not trigger a restart during a call made by a user using the electronic device, and the ADSP can establish an audio link with the call application, thereby successfully establishing the call.
In one possible implementation, before controlling the sensor path not to trigger the ADSP restart, the method includes: reading file information and acquiring system time under the condition that the length of time for reading sensor information of a bus access is equal to a second preset time length; the file information comprises a zone bit for triggering ADSP restarting, ADSP restarting times, ADSP restarting time and a position for storing the ADSP restarting time; the system time is the current time displayed by the electronic equipment; the value of the flag bit comprises a first value and a second value, wherein the first value is used for indicating that ADSP restarting is not triggered; the second value is used for indicating triggering ADSP restarting; the flag bit is a second value; or under the condition that the system time is not in the second preset time period, obtaining the first ADSP restarting time and the last ADSP restarting time in the file information, and calculating the time difference between the first ADSP restarting time and the last ADSP restarting time; controlling the sensor path not to trigger an ADSP restart includes: controlling the sensor access not to trigger ADSP restarting under the condition that the time difference is smaller than a third preset time length and the restarting times reach a preset value; the third preset time period is longer than the second preset time period. Thus, the electronic device can control the ADSP to stop restarting when the ADSP is restarted repeatedly. For example, after an electronic device has repeatedly restarted, the electronic device may control the ADSP to not restart at present.
In one possible implementation manner, after controlling the sensor path not to trigger the ADSP restart when the time difference is smaller than the third preset duration and the number of restarts reaches the preset value; further comprises: setting a flag bit to a first value and acquiring system time when the time taken by the bus path to read the sensor information is longer than a second preset time; and under the condition that the flag bit is a first value and the system time is not within a second preset time period, controlling the sensor access not to trigger ADSP to restart. In this way, after the ADSP is repeatedly restarted, and the electronic device controls the ADSP to stop restarting, the ADSP restart is kept not to occur any more within the first preset time period. For example, ADSP restart does not occur within a first preset time period corresponding to 0 point 5 minutes; the user can normally use the call function within the first preset time period.
In one possible implementation, before controlling the sensor path not to trigger the ADSP restart, the method includes: and updating the second preset time length to the first preset time length. Therefore, the time interval of ADSP restarting can be prolonged, so that the user can normally use the call function during the time interval, and the use experience of the user is further improved.
In one possible implementation, the length of time that the bus path takes to read the sensor information is obtained by: updating a first counting range, wherein the first counting range can meet the requirement of counting a first preset duration; acquiring a first thread; the first thread is used for executing the task of reading sensor information by the bus path; and under the condition that the starting time of the task in the first thread is not changed, increasing the duration of the task in the first thread to obtain the updated time length for reading the sensor information by the bus access. In this way, the count range can be enlarged, so that the duration can reach the first preset duration, and the ADSP restart is not generated within the first preset duration.
In one possible implementation, the electronic device does not acquire sensor information during the period that the ADSP does not trigger a restart; the method further comprises the steps of: under the condition that the time length of the ADSP without triggering the restarting reaches the first preset time length, whether the sensor information can be obtained or not is detected by controlling the restarting of the ADSP. Therefore, the electronic equipment can detect whether the bus fault is recovered by itself, and after the bus fault is recovered, the electronic equipment can provide sensor service so as to improve the use experience of a user.
In one possible implementation, the method for controlling whether the ADSP restart detection can acquire the sensor information includes: acquiring system time under the condition that the time for reading the sensor information by the bus access is longer than a second preset time; if the system time is within the second preset time period, setting the flag bit to a second value, triggering ADSP restarting, and resetting the file information. Therefore, the electronic equipment can judge whether the sensor function is recovered or not through ADSP restarting in a specific time, so that after the bus fault is recovered, a user can timely apply the sensor function of the electronic equipment, and the use experience of the user is improved.
In one possible implementation manner, after setting the flag bit to the second value, triggering the ADSP to restart and resetting the content in the file information, the method further includes: acquiring file information and obtaining a time difference under the condition that the length of time for reading the sensor information by the bus access is equal to a second preset time length; wherein the flag bit is a second value; and updating the file information and indicating ADSP to restart under the condition that the time difference is greater than or equal to a third preset time length or the number of restarting times does not reach a preset value. Therefore, the electronic equipment can detect whether the bus fault is recovered or not through restarting for a plurality of times, and the accuracy of the judging result is improved.
In one possible implementation manner, in the cleared file information, the flag bit is a second value, the ADSP restart number is 0, and the position storing the ADSP restart time does not include the ADSP restart time; in the updated file information, the flag bit is a second value, the number of ADSP restarting times is increased by 1, the position for storing the ADSP restarting time is increased by 1, and the newly added position for storing the ADSP restarting time is stored with the ADSP restarting time. Thus, the electronic equipment can read and write file information only when ADSP restarting occurs; when the time length for reading the sensor information by the bus channel is smaller than the second preset time length, the operation of reading and writing the file information is not performed, and the power consumption is reduced.
In a second aspect, embodiments of the present application provide an electronic device, which may also be referred to as a terminal device, a terminal (terminal), a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), or the like. The terminal device may be a mobile phone, a smart television, a wearable device, a tablet (Pad), a computer with wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented reality (augmented reality, AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving (self-driving), a wireless terminal in teleoperation (remote medical surgery), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), or the like.
The electronic device includes: comprising the following steps: a processor and a memory; the memory stores computer-executable instructions; the processor executes computer-executable instructions stored in the memory to cause the electronic device to perform the method as in the first aspect.
In a third aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, implements a method as in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run, causes a computer to perform the method as in the first aspect.
In a fifth aspect, embodiments of the present application provide a chip comprising a processor for invoking a computer program in a memory to perform a method as described in the first aspect.
It should be understood that, the second aspect to the fifth aspect of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding possible embodiments are similar, and are not repeated.
Drawings
FIG. 1 is a scenario in which a call fails in a possible implementation;
Fig. 2 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application;
fig. 3 is a software block diagram of an electronic device 100 according to an embodiment of the present application;
fig. 4 is a schematic flow chart of an ADSP repeated restart provided in an embodiment of the present application;
fig. 5 is a schematic flow chart of an ADSP restart not triggered according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of another method for triggering ADSP restart according to the embodiment of the present application;
fig. 7 is a schematic flow chart of a watchdog monitoring duration according to an embodiment of the present application;
FIG. 8 is a schematic flow chart of another method for triggering ADSP restart according to the embodiment of the present application;
fig. 9 is a flow chart of a call method according to an embodiment of the present application;
fig. 10 is a flow chart of another call method according to an embodiment of the present application;
fig. 11 is a flow chart of another call method according to an embodiment of the present application;
fig. 12 is a flow chart of a call method according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a call device according to an embodiment of the present application.
Detailed Description
For purposes of clarity in describing the embodiments of the present application, in the embodiments of the present application, words such as "exemplary" or "such as" are used to indicate by way of example, illustration, or description. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
The term "at … …" in the embodiment of the present application may be instantaneous when a certain situation occurs, or may be a period of time after a certain situation occurs, which is not particularly limited in the embodiment of the present application. In addition, the display interface provided in the embodiments of the present application is merely an example, and the display interface may further include more or less content.
In a possible implementation, in the process of using the electronic equipment, the electronic equipment may have an abnormal scene that a call cannot be received; meanwhile, the electronic equipment can have abnormal scenes such as incapability of brightening a screen, incapability of using a screen turning function, incapability of using a hand-lifting screen brightening function, incapability of charging and the like; affecting the user's experience of use.
The reason for these abnormal scenes was found by analysis to be: the main board of the electronic equipment is damaged by short circuit of physical devices caused by liquid inlet or impact. For example, corrosion marks exist on devices such as circuits and capacitors near the ambient light guide posts of the motherboard.
Taking the example that the electronic equipment cannot normally use the call function due to the short circuit of the physical device; the reason why the electronic device cannot normally talk may be: the physical device short circuit in the motherboard causes bus damage abnormality connected with a sensor, so that the audio digital processor subsystem (audio digitalsignal processor sub system, ADSP subsystem, also called ADSP) is restarted repeatedly, and the electronic device cannot communicate with the network device.
By way of example, fig. 1 shows a schematic diagram of a possible implementation in which the electronic device cannot use the talk function.
S101, the electronic equipment initiates a call to other equipment based on the call application.
S102, the call application of the electronic device sends a request for establishing a modem link to a modem subsystem.
S103, the modem subsystem initiates a request for establishing connection to the network equipment.
S104, under the condition that the modem subsystem establishes connection with the network equipment, the modem subsystem establishes a modem link with the call application.
S105, the communication application of the electronic equipment sends a request for establishing an audio channel to the ADSP subsystem.
When the electronic device initiates a call to other devices, the electronic device may first establish a connection with the network device based on the modem subsystem, with the network device supporting communication traffic between the two electronic devices. After the electronic device establishes a connection with the network device, the electronic device may send voice information of the user to the network device.
This process may be illustrated, for example, in steps S101-S105.
After the electronic device establishes a connection with the network device, the electronic device needs to receive the voice information of the user and send the voice information. At this point, the electronic device may establish a connection with the ADSP subsystem, and obtain voice information based on the ADSP subsystem.
S106, the ADSP subsystem of the electronic device is restarted repeatedly.
S107, the communication application of the electronic equipment detects that the time for establishing the audio path exceeds the preset time.
S108, the call application of the electronic equipment prompts call failure.
The ADSP subsystem may be used to manage audio information. The ADSP subsystem may be restarted repeatedly after a physical device is shorted. In the restarting process, the ADSP subsystem cannot support the normal audio management function, and the ADSP subsystem cannot respond to a request from a call application, so that the audio channel is failed to be established. The electronic device cannot acquire the voice information of the user, which results in call failure.
It can be seen that the reason why the electronic device cannot support the call is that: the ADSP subsystem repeatedly restarts, resulting in an audio path connection timeout.
In a possible implementation, after the electronic device has the abnormal scene, the user may select to replace the motherboard of the electronic device to restore the electronic device to normal function. However, in real life, the cost of replacing the motherboard is often high, and the user may abandon maintenance, resulting in idle electronic equipment due to failure of communication and charging.
In possible realization, in order to reduce the mainboard damage, can be in the mainboard production stage, the position point that easily leaks liquid or easily receive the tide is glued in the mainboard, protects the device through the point is glued, strengthens waterproof treatment, reduces the probability that leads to the device short circuit to damage because of the weeping. However, the method belongs to measures for preventing the main board from being damaged, and when the main board is damaged, the method cannot support the electronic equipment to continue to use.
Therefore, in the two solutions, one has the defect of high maintenance cost, and the other has the defect of incapability of normal use after the occurrence of faults; still affecting the user experience.
In view of this, the embodiments of the present application provide a call method, where in the case that a bus related to a sensor in an ADSP fails, related functions of the sensor may not be used to ensure that other functions (such as an audio path) in the ADSP normally operate, where the related functions without using a sensor may be that processes related to restarting the ADSP caused by the bus are processed, so that a situation of restarting the ADSP is reduced, so that a user does not restart the ADSP during a call, and the ADSP can establish the audio path to make the call normally proceed.
In order to better understand the embodiments of the present application, the following describes the structure of the electronic device of the embodiments of the present application:
fig. 2 shows a schematic structural diagram of the electronic device 100. The electronic device 100 may include a 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 1, an antenna 2, a mobile communication module 150, 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, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, a subscriber identity module (subscriberidentification module, SIM) card interface 195, and an embedded security chip (embedded secure element, eSE) 196, among others. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, 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.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP). In this embodiment, the AP is configured to request a sensor service with the ADSP side after the electronic device 100 is turned on.
In some embodiments, the 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 circuitsound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2C bus may be used to couple with the sensor, and under the fault of the I2C bus, the ADSP may be caused to restart repeatedly, which causes the problem scenario of fig. 1 that the call cannot be made. In the embodiment of the present application, the electronic device 100 may restore the call function in the case that the I2C bus fails.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is illustrative, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
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. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. 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 processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
In this embodiment of the present application, the internal memory 121 may be used to store file information, where data of multiple ADSP restarts, for example, restart time, number of times, and the like, are recorded in the file information.
The electronic device 100 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 disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110. In the embodiment of the present application, in the case where the electronic device 100 initiates a call to or receives a call from another device, the voice information of the user may be sent to the other device through the audio module.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture, among others. In this embodiment, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 3 is a software configuration block diagram of the electronic device 100 according to the embodiment of the present application.
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. In some embodiments, the electronic device may include an application processor (application process, AP) side and an ADSP side. The AP side may include: an application layer (applications), an application framework layer (application framework), a hardware abstraction layer (hardware abstract layer, HAL), and a kernel layer (kernel), which may be referred to as a driver layer. The ADSP side may be used to manage power, sensors, and audio processing, etc.
The application layer on the AP side includes a series of application packages. For example, the application package may include a telephony application. In the embodiment of the present application, in the case where the electronic device 100 runs a call application, the call application may request to the ADSP side to establish an audio path.
The telephony application may also access the underlying hardware. For example, the hardware layer may include a modem chip, and the telephony application may request to establish a modem link from the modem chip via an application framework layer, a hardware abstraction layer, and a kernel layer (not shown in fig. 3).
The ADSP side may communicate with the AP side. For example, the electronic device 100 also includes a shared memory (shared memory driver); ADSP may communicate with the AP side via shared memory and interfaces (e.g., QMI interfaces and/or IPC interfaces).
The ADSP side may communicate with the hardware layer. For example, the ADSP may access devices of the hardware layer, execute corresponding instructions and return device data. For example, in the embodiment of the present application, the AP side may request to the ADSP to acquire information of a sensor, and the ADSP accesses the sensor in the hardware layer based on the request. After the ADSP acquires the information of the sensor, the information of the sensor is transmitted back to the AP side.
ADSPs may include bus path modules, power path modules, sensor path modules, and audio path modules, among others. The bus path module may be used to trigger each traffic path to start, load, and identify the corresponding device. The power supply access module can be used for accessing a power supply to acquire power supply parameters; the sensor access module can be used for accessing the sensor to acquire sensor parameters; the audio path module may be used to access the audio module 170 to establish an audio path. The bus path module comprises a watchdog, and the sensor path module comprises a watchdog, wherein the watchdog can be used for detecting whether each task overtime.
It can be understood that repeated restarting of the ADSP may cause abnormal call, and the reason why the repeated restarting of the ADSP may be caused in the embodiment of the present application is first analyzed with reference to fig. 4. As shown in fig. 4:
s401, when the electronic equipment is started, the electronic equipment starts an AP.
S402, the AP loads data and starts each service process.
The AP side may support a plurality of services provided by the electronic device, for example, a call service, a photographing service, a sensor service, and the like. The service process may be a process for running various services; the service process may include a sensor service process.
The electronic equipment can start various service processes after being started so as to enable the electronic equipment to support a plurality of service functions.
S403, the AP starts a sensor service process and requests a sensor identification from the ADSP.
ADSP may be used to manage batteries, sensors, and audio processing, among others. The AP initiates an asynchronous request to the ADSP based on the sensor service process to acquire data on the ADSP side. The data on the ADSP side includes a sensor identification (sensor suid).
S404, the electronic equipment starts ADSP.
As shown in fig. 3, the ADSP may include a bus route module, a sensor route module, an audio route, a power supply route, and the like. ADSP is a subsystem common to multiple services such as a sensor, audio and power, wherein the restarting of the ADSP subsystem caused by any service affects the failure of other service paths.
S405, ADSP loads the identification bus.
The bus may support communication between the ADSP side and the AP side, as well as ADSP access hardware and devices, execute related instructions, and return device data. The bus may be, for example, an inter-integrated circuit (inter-integrated circuit, I2C) qualcom information interface (qualcom message interface, QMI) and inter-process communication (inter process communication, IPC), etc. Wherein the ADSP may load a bus identifying the access sensor to obtain sensor information based on the bus.
S406, ADSP judges whether the bus is blocked or not.
S407, if the bus is blocked, the bus channel triggers ADSP restarting.
After the electronic equipment feeds liquid, the bus is abnormal; ADSP cannot access the sensor using the bus. In case of a bus blocking, an ADSP restart is triggered. For example, in fig. 3, the bus path module of the ADSP includes a watchdog (watch dog), which is a timer circuit that instructs the ADSP to reset when the time recorded by the watchdog expires, to prevent the program from going to a dead loop. Here, in the event of a bus jam, the watchdog times out, triggering an ADSP restart instruction (ADSP fatal).
It can be seen that the ADSP always loops through S404 to S407 due to bus damage, so that the ADSP is continuously restarted.
S408, if the bus is not blocked, the ADSP starts and establishes each service path, and loads and identifies the sensor.
The ADSP-supported services may include sensor services, power services, audio services, and the like. After the ADSP establishes the traffic lanes, the corresponding traffic may be loaded based on each traffic lane, e.g., ADSP initiates the sensor lane and loads the identification sensor.
S409, ADSP determines whether or not the time for reading the register via the bus has expired when the sensor is identified.
When the electronic device queries the sensor, the ADSP reads the register address via the bus, and obtains a value, e.g., a suid value, from the register address that identifies the sensor name. The time threshold may be a first time threshold, for example 20s.
S410, if the time of reading the register by the bus exceeds a first time threshold, the sensor access triggers ADSP to restart.
It can be understood that if the abnormal step of S407 is skipped in the execution flow, the step S407 does not trigger the ADSP restart, and the problem of ADSP restart still cannot be solved.
This is because: ADSP when identifying a sensor, ADSP will read the register over the bus. And the bus can not read the register due to the exception of the bus caused by liquid inlet. In fig. 3, a watchdog is included in the sensor channel module; when the watchdog detects that the bus reading sensor information is overtime, an ADSP fatal instruction is triggered, and the ADSP is restarted based on the instruction.
It can be seen that even if the abnormal step S407 is skipped, the ADSP is restarted when the sensor is identified, and the ADSP always loops through steps S404 to S409; so that ADSP is restarted repeatedly
S411, if the time of reading the register by the bus is not timed out, the ADSP identifies the sensor and returns the sensor information to the AP.
S412, ADSP starting is completed.
S413, the electronic equipment judges whether returned sensor information exists.
And S414, under the condition that the electronic equipment obtains the sensor information, the electronic equipment loads other processes and related data.
The AP side obtains the data of the ADSP side, and the electronic equipment can work normally after the electronic equipment loads other processes and related data.
And S415, loading other processes and related data by the electronic equipment under the condition that the electronic equipment does not obtain the sensor information.
The AP side does not obtain the data of the ADSP side, and after the electronic equipment loads other processes and related data, the electronic equipment can normally use other functions, but the electronic equipment cannot use the related functions of the sensor. For example, screen rotation, hand up, screen up, etc.
S416, the electronic equipment is started.
As can be seen from steps S401-S412, the conditions that can cause the ADSP subsystem to restart may include: bus congestion, and read register timeout due to bus congestion. When the bus blocking condition is satisfied, the electronic device executes steps S401-S407, and repeatedly executes steps S404-S407, and the ADSP is restarted repeatedly, so that the ADSP cannot be started normally. When the condition of timeout of the read register due to bus blocking is satisfied, the electronic device will execute steps S401-S410, and repeatedly execute steps S404-S410, the ADSP will restart repeatedly, so that the ADSP cannot start normally.
Embodiments of the present application may address these two conditions that may cause an ADSP subsystem to restart, to reduce instances of repeated restarts of the ADSP subsystem.
In one possible implementation, the electronic device may reduce the number of ADSP restarts by skipping the abnormal flow. For example, the electronic device may not perform a flow similar to steps S406 and S410. Specifically, fig. 5 shows a method for reducing repeated restarting scenarios of an ADSP subsystem according to an embodiment of the present application, where the method is shown in fig. 5:
after step S403, the electronic device may attempt to start the ADSP subsystem. For example:
s501, the electronic equipment starts ADSP.
S502, ADSP loads the identification bus.
S503, ADSP judges whether the bus is blocked or not.
Steps S501 to S503 may refer to the relevant descriptions in steps S404 to S406, and are not described here again.
If the bus is blocked, the electronic device clicks the bus path log, and executes step S505.
When the electronic equipment detects that the bus is blocked, the electronic equipment can record the bus fault in a log dotting mode. In addition, when the bus is detected to be blocked, the electronic device does not respond to an instruction for indicating the ADSP subsystem to restart, so that the ADSP subsystem does not restart.
In some embodiments, when bus congestion causes a timeout, the electronic device may intercept an instruction to instruct the ADSP subsystem to restart and not respond to the instruction; for example, the instruction to instruct the ADSP subsystem to restart may be a bus recovery error instruction (bus recovery fatal).
S505, ADSP starts and establishes each service path, and loads and identifies the sensor.
S506, when the sensor is identified, the ADSP judges whether the time for reading the register through the bus reaches a first time threshold.
Steps S505 to S506 may refer to the related descriptions in steps S408 to S409, and will not be described here.
S507, if the time of reading the register by the bus reaches a first time threshold, the electronic device clicks the sensor path log, and step S508 is executed.
When the electronic device detects that the time of reading the register by the bus is over, the electronic device can record the sensor access fault in a form of dotting by a log. In addition, when the time of reading the register by the bus is detected to be overtime, the electronic device does not issue or respond to the ADSP fatal instruction, so that the ADSP subsystem is not restarted.
In some embodiments, upon detecting a time-out of the bus read register, the electronic device may intercept an instruction to instruct the ADSP subsystem to restart and not respond to the instruction; for example, the instruction to instruct the ADSP subsystem to restart may be a sensor error instruction (SNS ERR fault).
S508, the ADSP does not recognize the sensor and does not return the sensor information.
In the event of a failure of the bus associated with the sensor, the ADSP may not invoke the function of the sensor to ensure that other services can operate properly. For example, in the above scenario, the electronic device reduces frequent restarting of the ADSP subsystem by interrupting the execution of the sensor service, and preferably ensures normal operation of the call service and the charging service.
S509, ADSP starting is completed.
In the above embodiment, the electronic device may prevent the ADSP subsystem from restarting by skipping the two abnormal flows, so that the electronic device may still support the call service when the bus fails.
In practical applications, there is a single restart on the ADSP side; for example, upon detecting a failure, the electronic device may control the ADSP restart in order to attempt to recover from the failure; ADSP subsystem reboots typically do not cause a complete machine to reboot and can be recovered within a few seconds. Considering that there may be a single restart on the ADSP side, another possible implementation is provided by the embodiments of the present application.
In another possible implementation manner, the electronic device may reduce the number of ADSP restarts by skipping the abnormal procedure and limiting the number of ADSP restarts within the preset duration. Fig. 6 illustrates another method for reducing repeated restarting scenarios of an ADSP subsystem according to an embodiment of the present application, as shown in fig. 6:
After step S403, the electronic device may attempt to start the ADSP subsystem. For example:
s601, the electronic equipment starts ADSP.
S602, ADSP loads the identification bus.
S603, ADSP judges whether the bus is blocked or not.
If the bus is blocked, the electronic device clicks the bus path log, and executes step S605.
S605, ADSP starts and establishes each service path, and loads and identifies the sensor.
S606, when the sensor is identified, the ADSP judges whether the time for reading the register through the bus reaches a second time threshold value.
The steps S601-S606 may refer to the related descriptions in the steps S501-S506, and are not described herein.
If the time of reading the register by the bus does not reach the second time threshold, the electronic device executes step S608.
In this embodiment of the present application, in a case where the electronic device detects that the time of reading the register by the bus does not reach the second time threshold, the electronic device may determine that the ADSP restart is not triggered currently. The second time threshold is greater than the first time threshold. For example, the second time threshold is 1 hour.
S608, ADSP does not recognize the sensor and does not return sensor information.
S609, ADSP starting is completed.
After step S606, further comprising:
S610, if the time of reading the register by the bus reaches a second time threshold, the sensor access is indicated to trigger ADSP to restart.
The method and the device can reduce the restarting times of ADSP by prolonging the restarting time interval of each ADSP. For example, the electronic device does not restart within the second time threshold, and when the second time threshold is reached, the electronic device restarts the ADSP; ADSP re-executes steps S601-S606, time reset of bus read register; the time for the bus to read the register is less than the second time threshold, the electronic device may perform steps S607-S609, so that the ADSP completes the startup. The subsequent user may successfully place a call within the second time threshold.
For example, the first time threshold is 20s and the second time threshold is 1 hour. When the bus fails, the electronic device may restart the ADSP once every one hour, so that the user can successfully talk within one hour after restarting the ADSP.
Optionally, before step S606, a determination process of the electronic device to determine whether an ADSP is repeatedly restarted, for example, when the ADSP is continuously restarted, the electronic device performs step S606 may be further included. Specifically, in the fourth time threshold, under the condition that the number of times of restarting the ADSP reaches the number threshold, the electronic equipment determines that repeated restarting of the ADSP occurs; the electronic device may update the first time threshold to the second time threshold and perform step S606.
The process of determining whether to restart the ADSP based on the second time threshold in step S608 is explained below.
Illustratively, the watchdog of the sensor pathway begins a monitoring procedure, S701.
In the process of identifying the sensor information by the sensor path, the watchdog of the sensor path is triggered to time each task in the sensor path. After the watchdog of the sensor path is started, the watchdog callback function pointer designates a function to be executed when the watchdog timer is triggered, for example, the callback function pointer may be timer_cb, and the function to be executed when the watchdog timer is triggered may be sns_timer_cb_func_arg.
S702, monitoring a duration of a thread in a thread pool of a watchdog of a sensor path.
A set of watchdog may be included in the sensor pathway module; ADSP can obtain the collection of watchdog through entry. Any watchdog in the set includes a plurality of thread pools, and any thread pool includes a plurality of threads. The thread may be a thread associated with sensor operation.
It will be appreciated that tasks in a thread include bus read register addresses, and that when a task is a bus read register address, the duration may also be used to indicate the time that the register was read by the bus.
In embodiments of the present application, a watchdog may detect the duration of a thread in any thread pool. For example, a watchdog performs timer_cb once per second, monitoring the thread once. During this monitoring, the watchdog will traverse all threads; when the duration of any thread is overtime, the watchdog will make overtime error.
In the embodiment of the application, the process of the watchdog monitoring thread can be as follows:
1) The current count range is updated.
The counting range can be the number that the watchdog can count, for example, the counting range can be unit32, and the data range corresponding to unit32 is 1-2 32
It can be understood that in a possible implementation, the preset count range in the watchdog is unit8, the maximum count supported by unit8 is 256, the watchdog monitors the thread once every second, and if the monitoring passes, the count value is increased by 1; unit8 is able to support watchdog writing 256-bit counts, i.e. 256s, with a first time threshold of less than 256s, e.g. 20s in a possible implementation. In the embodiment of the application, the electronic device needs to enlarge the time threshold value and delay the ADSP restarting time, so that a period of time for normally answering and making calls is provided for the user. While unit8 supports a time threshold of around 4 minutes at maximum, that is, when the time threshold is 256s, the electronic device will restart ADSP every 4 minutes or so. The call duration of the user is often longer than 4 minutes, so the unit8 cannot meet the normal call duration of the user. Here, the electronic device may expand the count range, e.g., adjust the count range from unit8 to unit32.
In the embodiment of the present application, the count range is exemplified by unit32, and in the embodiment of the present application, the count range after expansion may be also exemplified by unit16, unit64, and the like, which is not limited in the embodiment of the present application.
2) The current thread is acquired.
Any thread pool may include multiple threads, which may be counted by the watchdog for any thread; for example, after the watchdog monitors the jth-1 thread, the jth thread may be monitored. During monitoring, the watchdog may acquire a current worker thread (woker thread) by counting j to monitor the thread.
3) And judging whether the watchdog timeout count is started or not.
After the watchdog timeout count function is turned on, the watchdog may monitor the duration of the thread. For example, the instruction that the watchdog timeout count is on may be the watchdog_en.
4) When the watchdog timeout count is on, the watchdog determines whether the start time of the task in the current thread has changed.
The watchdog may view the start time of the task, in one possible implementation, the watchdog may view the start time of the task in the thread with the count j at the previous monitoring and the start time of the task in the thread with the count j at the current monitoring. If the starting time of the two tasks is the same, the current thread is considered to still execute the same task, and the starting time of the task in the current thread is unchanged. If the starting time of the two tasks is different, the previous task is considered to be completed, the current monitoring is a new task in the current thread, and the starting time of the task in the current thread is changed.
5) In the event that the start time of a task in the current thread changes, the watchdog resets the start time of a new task.
When the start time of a task in the current thread is changed, the task executed by the current thread is a new task, and the watchdog needs to reckon the new task.
6) In the event that the start time of a task in the current thread has not changed, the watchdog increases the duration of the task in the current thread.
Under the condition that the starting time of the task in the current thread is not changed, the task executed by the current thread and the task executed by the current thread in the previous monitoring are the same task, and the watchdog can accumulate the count on the basis of the count of the task of the current thread in the previous monitoring. For example, the task count of the current thread is 10s in the previous monitoring, the watchdog count is increased by 1, and the task count of the current thread is 11s in the current monitoring, so that the duration of the task in the current thread is increased.
S703, if the task in the thread does not reach the second time threshold and the current thread is not the last thread in the last thread pool, continuing to traverse the next thread.
The value of the second time threshold is less than or equal to the updated count range, and the value of the second time threshold is greater than the pre-update count range, e.g., the second time threshold is 3600s. The second time threshold may be for controlling an ADSP restart time in case of a bus failure. When the duration of the task does not reach the second time threshold, the watchdog does not detect that an exception has occurred to the task, and continues to monitor the task in the next thread (e.g., the j+1th thread).
In this embodiment, the second time threshold is 3600s as an example, and the second time threshold may also be set to other values in this embodiment, which is not limited in this embodiment of the present application.
S704, under the condition that the last thread of the last thread pool is traversed, ending the monitoring flow.
After the watchdog monitors all threads in all thread pools, if no abnormal task is monitored, the watchdog may end the monitoring process and start the next monitoring process, for example, the watchdog repeatedly executes steps S701-S704.
And S705, if the task in the thread reaches a second time threshold, indicating the ADSP to restart.
When the duration of the task reaches the second time threshold, the watchdog detects that the task is abnormal, and triggers an ADSP restart instruction, for example, the watchdog triggers an SNS_ERR_FATAL instruction.
It will be appreciated that in a possible implementation, the first time threshold is 20s, resulting in the watchdog of the sensor channel forcing the ADSP to restart when the task duration reaches 20 s; that is, in the case of a bus failure, the ADSP will restart every 20s, and the duration of the ADSP to complete the restart is about 24s, so in a possible implementation, the ADSP will have a problem scenario of repeated restart. In the embodiment of the application, the electronic device limits the restart of the ADSP through the second time threshold, taking 3600s as an example, under the condition of bus failure, the ADSP can be restarted every 1 hour, the restart time takes about 24s, and in the time of 1 hour, the user can make a call normally, and the call duration of the user can be met.
The above embodiment provides another possible implementation manner, by extending the ADSP restart time interval twice, so that the ADSP does not restart within the time interval, the electronic device can provide the call service. In some embodiments, the electronic device has a self-recovery capability, for example, the electronic device may recover from a bus short circuit failure due to liquid feeding, and the bus path may recover after the liquid volatilizes. After the bus path is restored, the electronic device needs to use the sensor function to support various services, such as a function of turning on a screen, turning on a screen with a hand, and the like, which are related to the sensor. For this scenario, the embodiment of the present application provides a further possible implementation manner, in which the electronic device may periodically detect, after the bus fails, whether the bus path is available for use, so as to restore the corresponding function of the sensor.
A further possible implementation is described below in connection with fig. 8, as shown in fig. 8:
after step S403, the electronic device may attempt to start the ADSP subsystem. For example:
s801, the electronic equipment starts ADSP.
S802, ADSP loads the identification bus.
S803, ADSP judges whether the bus is blocked or not.
S804, if the bus is blocked, the electronic device clicks the bus path log, and executes step S805.
S805, ADSP starts and establishes each service path, and loads and identifies the sensor.
Steps S801 to S805 may refer to the related descriptions in steps S501 to S505, and are not described herein.
S806, when the sensor is identified, the ADSP determines whether the time for reading the register through the bus exceeds a third time threshold.
The third time threshold is smaller than the second time threshold, wherein the third time threshold may be the same value as the first time threshold, e.g., the third time threshold is 20s.
Illustratively, the ADSP fetch bus read register time course may be as follows:
7) The watchdog of the sensor path starts the monitoring procedure.
8) Threads in a thread pool of a watchdog of a sensor path are acquired.
8) The current count range is updated.
9) The current thread is acquired.
10 Judging whether the watchdog timeout count is on.
11 If the watchdog timeout count is on, the watchdog determines if the start time of the task in the current thread has changed.
12 If the start time of a task in the current thread changes, the watchdog resets the start time of a new task.
13 In the event that the start time of the task in the current thread has not changed, the watchdog increases the duration of the task in the current thread.
Steps 7) to 13) may refer to the relevant steps in the embodiment shown in fig. 7, and will not be described herein.
S807, if the time for reading the register by the bus is less than the third time threshold, the identified sensor information is returned to the AP.
And if the time for reading the register by the bus is smaller than the third time threshold, the bus is not failed, and the ADSP is not restarted. The electronic device may perform step S808.ADSP is started normally.
S808, ADSP starting is completed.
In this embodiment, the flow chart of steps S801 to S808 is not shown in fig. 8, and reference may be made to the related description in the above embodiment, which is not repeated here.
Alternatively, after step S806, further including:
s809, if the time of reading the register by the bus is greater than or equal to the third time threshold, the electronic device executes step S810 or S811.
When the time for reading the register by the bus is greater than or equal to the third time threshold, the bus can be considered to be faulty, the electronic device can process the fault scene, and the processing flow can be shown in steps S810-S819;
S810, when the time of reading the register by the bus is equal to a third time threshold value, the electronic device reads the file information.
The third time threshold may be, for example, 20s, and the electronic device may read the file information when the duration of the watchdog monitoring task is 20 s.
The file information may be stored in a preset path, and the file information includes data related to ADSP restart. For example, the file information may be in the form of a far_tick structure; the total_tick structure may include 4 member variables, and specifically, the file information may include a flag bit (trigger_state) for triggering an ADSP restart, the number of ADSP restarts (total_times), a location (current_total_time) where an ADSP restart time is stored in the array, and an ADSP restart time (total_time).
The value of the flag bit for triggering ADSP restart includes a first value and a second value, wherein the first value can be used for indicating that ADSP restart is not triggered, and the second value can be used for indicating that ADSP restart is triggered. For example, the first and second values may be in the form of 1 and 0, 0 and 1, true and false, false and true, etc., which are not limiting embodiments of the present application. For example, in the embodiment of the present application, the first value may be 1, and the second value may be 0.
The ADSP restart times are used for counting ADSP restart times, and in the embodiment of the present application, the electronic device may set a time threshold, and the electronic device may determine whether the current ADSP restart reaches the time threshold based on the ADSP restart times. In this embodiment, the initial value of total_time may be 0, and the value of total_time is increased by 1 every time adsp is restarted.
The ADSP restart time (fat_time) may be the start time when the electronic device recordable ADSP is restarted. The electronic device may record the ADSP restart time in an array, where the number of ADSP restart times that the array can store is N. In this embodiment, the sequence number corresponding to the last time recorded in the array is 10, for example, max_fault_mes=10.
The electronic device may record an ADSP restart time in chronological order, for example, when the ADSP is restarted for the first time, the ADSP restart time is stored in the first position in the array, and the value of current_far_time is 1. In this embodiment of the present application, the initial value of current_far_time is 0, and the maximum value is N.
The electronic equipment can read the file information from the preset path to obtain a zone bit for triggering ADSP restarting, ADSP restarting times, the storage position of ADSP restarting time in the array and ADSP restarting time.
Or, when the time of reading the register by the bus is greater than the third time threshold, the electronic device sets the flag bit for triggering the ADSP restart to the first value; the first value is used to indicate that an ADSP restart is not triggered.
The flag bit for triggering the ADSP restart is set to a first value, for example, trigger_state is set to 1.
S812, the electronic equipment acquires the system time.
The system time may be a standard time of the current time. In the embodiment of the application, the electronic device can set a specific time to enable the ADSP to detect whether the bus channel is recovered or not in the specific time so as to recover the corresponding function of the sensor.
S813, judging whether a flag bit for triggering ADSP restarting is a first value and whether the system time is within a specific time; the first value is used to indicate that an ADSP restart is not triggered.
S814, if the flag bit for triggering ADSP restart is a first value and the system time is within a specific time, the electronic device sets the flag bit for triggering ADSP restart to a second value, triggers ADSP restart, and clears the file information. The second value is used to indicate that an ADSP restart is triggered.
In a specific time, the electronic device needs to detect whether the bus fault is recovered through restarting, so in the specific time, when the flag bit indicates that the ADSP restart is not triggered, the electronic device can set the flag bit to trigger the ADSP restart to instruct the ADSP restart to detect the bus path. Wherein, the specific time can be 0 point to 0 point 5 minutes.
S815, if the flag bit used for triggering the ADSP restart is a second value or the system time is not within a specific time, the electronic device calculates a time difference between the first ADSP restart time and the last ADSP restart time based on the file information.
The file information records the storage position of the ADSP restarting time in the array and the ADSP restarting time, for example, the ADSP restarting time is a, and the electronic equipment can obtain the fatal_time in the array with the current_fatal_time value of 1; and the value of current_far_time is far_timestamp in the array with a value of a. The electronic equipment calculates the time difference between the two fatalities and obtains the time difference from the first ADSP restart to the last ADSP restart.
S816, judging whether a flag bit for triggering ADSP restarting is a first value; or the time difference is smaller than a fourth time threshold, the restarting times reach a time threshold, and the flag bit for triggering the ADSP restarting is a second value.
And S817, if so, the electronic equipment does not issue an instruction for indicating ADSP restart.
When the flag bit indicates that ADSP restart is not triggered, the electronic device does not issue an instruction for indicating ADSP restart.
Or in the fourth time threshold, the number of times of restarting the electronic device reaches the number threshold, and when the flag bit indicates that the ADSP restarting is triggered, the electronic device can not issue an instruction for indicating the ADSP restarting.
Illustratively, the number of TIMES threshold is the same as the maximum value of the array, e.g., max_fault_mes=10, the number of TIMES threshold is 10; the fourth time threshold is greater than or equal to the product of the number of times threshold and the time taken for the ADSP restart, which may be 24s, for example, the fourth time threshold may be 5 minutes.
In this embodiment of the present application, the electronic device may trigger the ADSP restart within a specific time, and if a scene of repeated ADSP restart is detected, the bus is considered to be faulty. In order to ensure normal operation of the call function, the electronic device may not restart the ADSP in a non-specific time. For example, in the case where the electronic device is continuously restarted 10 times within a specific time, it may be determined that the bus is malfunctioning, and the electronic device does not trigger the ADSP restart until the next specific time comes.
Specifically, taking the fourth time threshold as 5 minutes, the time for restarting the ADSP may be 24s, and the specific time is 0 point to 0 point 5, for example, the electronic device starts to detect whether continuous restarting of the ADSP occurs at the 0 point, if 10 times of restarting occurs within five minutes, the ADSP is restarted repeatedly, and it is determined that the bus fault is not repaired by itself; after the 0 point is 5 minutes and before the next day 0 point, the electronic equipment does not restart ADSP, so that under the condition that a bus fails, a user can normally use basic functions such as conversation service and the like in a working period.
S818, if not, the electronic device judges whether the flag bit for triggering ADSP restart is a second value.
When the flag bit for triggering ADSP restarting is a second value; and the ADSP is not continuously restarted within the fourth time threshold to reach the time threshold, the condition that the electronic equipment does not meet the condition for judging the occurrence of the fault of the bus is confirmed, and the electronic equipment can continuously monitor whether the fault of the bus occurs by triggering the ADSP to restart.
It will be appreciated that when the bus is restored, there may be a single restart caused by some other faults, and after a single restart, the faults can be repaired, so that the problem scenario that the ADSP repeatedly restarts to cause a failure to talk does not occur. According to the embodiment of the application, through the judging condition in the step S816, the scene can be screened out from the problem scene of repeated restarting of the ADSP, so that the accuracy of monitoring the bus line fault in the embodiment of the application is improved.
And S819, if the flag bit for triggering the ADSP restart is a second value, updating the number of ADSP restart times in the file information, and issuing an instruction for indicating the ADSP restart.
After step S818, the electronic device may issue an instruction indicating an ADSP restart, for example, issue an sns_err_fault instruction, in the case where the flag bit indicates that the ADSP restart is triggered. Meanwhile, the electronic equipment records the related information of the ADSP restarting in the file information. For example, in the first array where the ADSP restart time is not saved, the start time of the ADSP restart is saved, and the number of ADSP restarts is increased by 1.
Thus, when the next ADSP restart arrives, the electronic device can perform related calculation and determination flow based on the data of the first ADSP restart and the data of the current ADSP restart.
The following describes the execution of the steps in fig. 8 with reference to a specific scenario, taking the number of times threshold as 10 as an example.
Taking the current system time as 0 point as an example, the time for the electronic device to monitor the bus to read the register is greater than 20S, executing step S811, and setting the flag bit to a first value; it will be appreciated that since the determination was made from 0 to 5 minutes on the previous day, ADSP will not restart until 0 on the present day, and the time for bus reading registers will be greater than 21s. The electronic device obtains the system time 0 point. In step S813, the flag bit is a first value, and in a specific time, the electronic device satisfies the condition of step S813, executes step S814, sets the flag bit to a second value, triggers the ADSP restart, and clears the file information.
When the electronic device monitors that the time for reading the register by the bus reaches 20S for the first time, executing step S810, and reading file information; the flag bit is a second value, and the condition of step S813 is not satisfied, and the electronic device executes step S815. Clearing the data such as the number of times of ADSP restarting and the time of ADSP restarting in the electronic device, so that the judging condition of the step S816 is not satisfied, and the electronic device executes the step S818; at this time, the flag bit is a second value, the electronic device executes step S819 to record the first time of ADSP restart in the file information, and store the first time of ADSP restart in the first position of the array, and at the same time, the number of ADSP restart is set to 1; and issuing an instruction for indicating the ADSP to restart, and controlling the ADSP to restart for the first time.
When the electronic device monitors that the time for reading the register by the bus for the second time reaches 20S, executing step S810, and reading file information; the flag bit is a second value, and the condition of step S813 is not satisfied, and the electronic device executes step S815. The file information of the electronic device only records the data of the first ADSP restart, so that the determination condition of step S816 is not satisfied, and the electronic device executes step S818; at this time, the flag bit is a second value, the electronic device executes step S819 to record the time when the ADSP restart occurs for the second time in the file information, and store the time when the ADSP restart occurs for the second time in the second position of the array, and at the same time, the number of ADSP restarts is set to 2; and issuing an instruction for indicating the ADSP to restart, and controlling the ADSP to restart for the second time.
When the electronic device monitors that the time for reading the register by the bus reaches 20S for the third to tenth times, executing step S810, and reading file information; the flag bit is a second value, and the condition of step S813 is not satisfied, and the electronic device executes step S815. The file information of the electronic device records the data of the first ADSP restart and the data of the second to ninth ADSP restarts, the number of times of restarting the ADSP is not up to 10, the judging condition of the step S816 is not satisfied, and the electronic device executes the step S818; at this time, the flag bit is a second value, the electronic device executes step S819 to record the third-tenth ADSP restart time in the file information, and store the third-tenth ADSP restart time in the third-tenth positions of the array, and the ADSP restart times are set to 3-10; and issuing an instruction for indicating the ADSP to restart, and controlling the ADSP to restart for the third time to the tenth time.
When the eleventh time of the electronic device monitors that the time of reading the register by the bus reaches 20S, executing step S810, and reading file information; the flag bit is a second value, and the condition of step S813 is not satisfied, and the electronic device executes step S815. The file information of the electronic device records the data of the first ADSP restart and the data of the 10 th ADSP restart, the number of times of ADSP restart reaches 10 times and does not exceed 5 minutes, the judgment condition of the step S816 is met, and the electronic device executes the step S817; at this time, the flag bit is a second value, but the electronic device only clicks the log, but does not trigger the ADSP restart.
Since the ADSP is not restarted and the watchdog monitors the duration of the task once per second, the time for the watchdog to monitor the bus reading register reaches 21S, exceeding the third time threshold, the electronic device performs step S811 to set the flag bit from the second value to the first value. It will be appreciated that the electronic device needs to go through a fourth time threshold corresponding duration to complete a consecutive number of threshold times of ADSP reboots. For example, the electronic device may perform 10 ADSP restarts within 5 minutes, and the system time obtained by the electronic device may not be within a specific time, e.g., the system time is greater than 0 point 5 minutes. The electronic apparatus does not satisfy the determination condition of step S813, and executes step S815. The electronic device obtains a time difference between the first restart and the tenth restart. The electronic device determines that the determination condition that the flag bit is the first value in step S816 is satisfied, so the electronic device executes S817 without restarting the ADSP.
Similarly, in the event that the bus read register time is monitored to be 22s and longer, the electronic device may perform steps similar to those when the duration is 21s, without restarting the ADSP until the next day 0.
The above embodiments provide three implementations that can reduce the ADSP repeated restart problem scenario. The process of the electronic device making a call in the implementation shown in fig. 8 is described below with reference to fig. 9 and 11.
Fig. 9 shows a flow chart of a call method provided in the embodiment of the present application, as shown in fig. 9:
in some embodiments, the electronic device initially initiates a continuous restart of the ADSP due to a hardware failure. If the user dials a call during the continuous restart of the ADSP, the call cannot be made. After experiencing the fourth time threshold, the user again attempts to place a call, and may then switch on. The process may be as shown in steps S901-S915:
s901, a call application of the electronic device receives an operation for dialing a phone call.
S902, in response to the operation for making a call, the telephony application sends a request for establishing a modem link to the modem subsystem.
S903, the modem subsystem initiates a request to the network device for establishing a connection.
S904, in the case that the modem subsystem establishes connection with the network equipment, the modem subsystem establishes a modem link with the call application.
S905, the call application of the electronic device sends a request for establishing an audio path to the ADSP subsystem.
S906, the ADSP subsystem of the electronic device is restarted repeatedly.
S907, the talking application of the electronic device detects that the time for establishing the audio path exceeds the preset time.
S908, the call application of the electronic device prompts a call failure.
Steps S902 to S908 may refer to the relevant descriptions in steps S102 to S108, and are not described here again.
It will be appreciated that the electronic device may determine whether an ADSP repeated restart of the electronic device occurs by whether the number of restarts reaches the number threshold within the fourth time threshold. In the case of a continuous restart of the ADSP, the electronic device is not issuing an instruction for instructing the ADSP to restart. For example, the electronic device may not instruct the ADSP to restart by detecting whether the number of restarts reaches 10 within 5 minutes, if so. Therefore, the electronic device cannot make a call within the 5 minutes.
S909, after the fourth time threshold, the call application of the electronic device receives an operation for making a call.
For example, after 5 minutes, the electronic device may detect an ADSP repeatedly reboot and prevent the ADSP reboot such that after 5 minutes, the electronic device no longer experiences an ADSP reboot.
S910, in response to the operation for making a call, the telephony application sends a request for establishing a modem link to the modem subsystem.
S911, modem subsystem initiates a request to the network device for establishing a connection.
S912, in case that the modem subsystem establishes connection with the network device, the modem subsystem establishes a modem link with the call application.
S913, the call application of the electronic device sends a request for establishing an audio path to the ADSP subsystem.
S914, the communication application of the electronic equipment and the ADSP subsystem establish an audio channel.
S915, the call application of the electronic device successfully establishes the call.
When the ADSP does not restart, the call application may establish an audio path with the ADSP so that the electronic device successfully establishes a call service.
Taking the scene as an example, the fourth time threshold is 5 minutes, the electronic device has bus faults at 12 points, and the electronic device executes continuous ten times of ADSP restarting between 12 points and 12 points for 5 minutes, so that the ADSP is determined to be restarted repeatedly. After 5 minutes at 12, the electronic device controls the ADSP to not restart. So the user can not make a call between 12 and 5 minutes, and after 12 and 5 minutes, the user can normally use the call service.
In this way, the electronic device may control the ADSP to be not restarted after the ADSP having undergone the fourth time threshold is restarted, so that the call application and the ADSP subsystem successfully establish an audio link to provide a call service for the user.
In other embodiments, the electronic device may cause bus blocking due to software, and the ADSP may restart. If the user makes a call in the ADSP restarting process, the user cannot make the call. After the ADSP reboot is completed, the user again tries to make a call, and then can switch on. This process may be as shown in fig. 10:
s1001, the call application of the electronic device receives an operation for making a call.
S1002, in response to an operation for making a call, the telephony application transmits a request for establishing a modem link to the modem subsystem.
S1003, the modem subsystem initiates a request for establishing a connection to the network device.
S1004, in the case that the modem subsystem establishes connection with the network equipment, the modem subsystem establishes a modem link with the call application.
S1005, the call application of the electronic device sends a request for establishing an audio path to the ADSP subsystem.
S1006, the ADSP subsystem of the electronic device is restarted once.
S1007, the talking application of the electronic device detects that the time for establishing the audio path exceeds the preset time.
S1008, the call application of the electronic equipment prompts call failure.
Steps S1001 to S1002 may refer to steps S901 to S908, which are not described in detail in the embodiment of the present application. The reason for step S1008 may be that the ADSP is restarted once due to the software failure. It will be appreciated that software-caused bus blocking can often resume itself after a single ADSP restart. So after a single ADSP restart period, the user may normally use the electronic device, and the call function of the electronic device, for example, after step S1008, may further include:
s1009, after the single ADSP restart period, the call application of the electronic device receives an operation for making a call.
For example, the duration of one time of the ADSP restart may be 24s, after 24s, the ADSP restart is completed, the software failure is repaired, and the electronic device does not perform the ADSP restart any more.
S1010, in response to the operation for making a call, the call application transmits a request for establishing a modem link to the modem subsystem.
S1011, modem subsystem initiates a request to the network device for establishing a connection.
S1012, in the case that the modem subsystem establishes connection with the network equipment, the modem subsystem establishes a modem link with the call application.
S1013, the call application of the electronic device sends a request for establishing an audio path to the ADSP subsystem.
S1014, the call application of the electronic device establishes an audio channel with the ADSP subsystem.
S1015, the call application of the electronic device determines that the call is successfully established.
When ADSP is restarted once, the software fault is recovered, and the electronic equipment does not detect continuous ADSP restarting, the electronic equipment can interact with the sensor channel, and the electronic equipment can normally use the sensor function and the call function.
In still other embodiments, the electronic device may restart the ADSP due to a bus blocking caused by a hardware failure, and the electronic device may prevent the ADSP from restarting based on the embodiment shown in fig. 9, where the electronic device may not use the sensor function and may use the call co-energy and charging functions. At a particular time, the electronic device may detect the ADSP to determine if the sensor function is restored. As shown in fig. 11:
s1101, the call application of the electronic device receives an operation for making a call within a specific time.
The specific time may be, for example, 0 point to 0 point 5 minutes. In the scene, the electronic equipment tries to restart the ADSP subsystem once, if the ADSP subsystem cannot be recovered after restarting, the electronic equipment continues to try to restart the ADSP subsystem once, and if the sensor function cannot be recovered after continuously restarting ten times in 5 branches, the electronic equipment does not perform ADSP restarting.
S1102, in response to an operation for making a call, the telephony application transmits a request for establishing a modem link to the modem subsystem.
S1103, the modem subsystem initiates a request to the network device for establishing a connection.
S1104, in the case that the modem subsystem establishes connection with the network device, the modem subsystem establishes a modem link with the call application.
S1105, the call application of the electronic device sends a request for establishing an audio path to the ADSP subsystem.
S1106, the ADSP subsystem of the electronic device is restarted repeatedly.
S1107, the talking application of the electronic device detects that the time for establishing the audio path exceeds the preset time.
S1108, the call application of the electronic device prompts the call failure.
S1109, after a certain period of time, the conversation application of the electronic device receives an operation for making a call.
For example, after 5 minutes at 0, the electronic device may not be able to resume sensor function by consecutive ADSP reboots, and the electronic device may no longer instruct ADSP reboot. At this point, the user may successfully place a call.
S1110, in response to the operation for making a call, the telephony application sends a request for establishing a modem link to the modem subsystem.
S1111, the modem subsystem initiates a request to the network device for establishing a connection.
S1112, in case the modem subsystem establishes connection with the network device, the modem subsystem establishes a modem link with the telephony application.
S1113, the call application of the electronic device sends a request for establishing an audio path to the ADSP subsystem.
S1114, the call application of the electronic device establishes an audio path with the ADSP subsystem.
S1115, the call application of the electronic device determines that the call is successfully established.
It will be appreciated that when the electronic device is not within a particular time, repeated reboots of the ADSP subsystem will not occur; for example, ADSP will not restart after 5 minutes at 0 to 0 the next day, and the user will not be able to make a call during these periods. Therefore, the electronic device can successfully perform step S1114, so that the electronic device successfully establishes a call.
In the embodiment of the present application, in order to reduce the scenario caused by step S1108, the electronic device may set the specific time to a non-working period, such as night, so as to reduce the probability of abnormal call caused by the ADSP restart, and improve the success rate of the call.
On the basis of the above embodiments, the embodiments of the present application provide a call method. Fig. 12 is a schematic flow chart of a call method according to an embodiment of the present application.
As shown in fig. 12, the call method may be applied to an electronic device, including an ADSP, and the call method may include the steps of:
and S1201, controlling the ADSP not to trigger restarting if the restarting times of the ADSP are greater than or equal to a preset value in a first preset time period.
The first preset period may be a period in which repeated restarts of the ADSP occur, for example, the ADSP occurs continuously for a plurality of restarts, and the preset value may be a frequency threshold in the foregoing embodiment.
It can be appreciated that, in the case where the electronic device detects that the ADSP is repeatedly restarted, the electronic device may execute the method in the embodiment of the present application, and stop the ADSP from being repeatedly restarted. The detection method is that the preset value is 10 times, when the ADSP is restarted ten times within 5 minutes, the electronic device determines that repeated restarting of the ADSP occurs, and the ADSP can be controlled not to restart any more.
S1202, the electronic equipment receives a call operation in a period that ADSP does not trigger restarting.
S1203, in response to the call operation, the electronic device establishes an audio path using ADSP.
During the period when the ADSP is not restarted, the electronic device may perform the processes shown in steps S909-S914, S1009-S1014, and/or S1109-S1114, establish an audio path between the call application and the ADSP, so that the electronic device can successfully establish a call.
In this way, when the bus failure causes the ADSP to restart repeatedly, the electronic device may control the ADSP not to restart, so that the electronic device can provide basic services, such as a call service, during the period when the ADSP is not restarted; therefore, the utilization rate of the electronic equipment after the hardware is damaged is improved, and the use experience of a user is improved.
Optionally, controlling the ADSP does not trigger a restart, including: under the condition that a bus passage is blocked, controlling the bus passage not to trigger ADSP to restart; and/or, under the condition that the time length used by the bus access to read the sensor information does not reach the first preset time length, controlling the sensor access not to trigger ADSP to restart; the first preset time period is longer than the second preset time period, and the second preset time period is the preset time period for judging that the sensor access triggers the ADSP to restart.
The first preset duration may correspond to the second time threshold in the embodiment shown in fig. 6, for example, the first preset duration is 1 hour. The first preset duration may also correspond to a duration other than the specific time in the embodiment shown in fig. 8, for example, the first preset duration may be a duration corresponding to a time period from 0 point 5 minutes to 0 point on the next day. The first preset duration may be a first time threshold, for example, the first preset duration may be 20s. The length of time that the bus path takes to read the sensor information can be understood as the time the bus path reads the register in the above-described embodiment.
Analysis in the example shown in fig. 4 gave: the decision condition that can trigger an ADSP restart may be a bus path blocking and a long timeout for the bus path to read sensor information. The electronic device can control the ADSP not to trigger restarting when the two conditions occur, so that the scene of restarting the ADSP is reduced.
In this way, the ADSP does not trigger a restart during a call made by a user using the electronic device, and the ADSP can establish an audio link with the call application, thereby successfully establishing the call.
Optionally, reading file information and acquiring system time when the length of time taken by the bus path to read the sensor information is equal to a second preset length of time; the file information comprises a zone bit for triggering ADSP restarting, ADSP restarting times, ADSP restarting time and a position for storing the ADSP restarting time; the system time is the current time displayed by the electronic equipment; the value of the flag bit comprises a first value and a second value, wherein the first value is used for indicating that ADSP restarting is not triggered; the second value is used for indicating triggering ADSP restarting; the flag bit is a second value; or under the condition that the system time is not in the second preset time period, obtaining the first ADSP restarting time and the last ADSP restarting time in the file information, and calculating the time difference between the first ADSP restarting time and the last ADSP restarting time; controlling the sensor path not to trigger an ADSP restart includes: controlling the sensor access not to trigger ADSP restarting under the condition that the time difference is smaller than a third preset time length and the restarting times reach a preset value; the third preset time period is longer than the second preset time period.
The array may be used to store the ADSP restart time, where the location where the ADSP restart time is stored may be the location (current_far_time) where the ADSP restart time is stored in the array. The second preset duration may correspond to the third time threshold in the embodiment shown in fig. 8, for example, the second preset duration may be 20s. The third preset duration may correspond to the fourth time threshold in the embodiment shown in fig. 8, for example, the third preset duration may be 5 minutes. The second preset time period may correspond to a specific time; the first preset time period and the second preset time period may be the same time period of the same day, or the same time period of two days, for example, 0 point to 0 point for 5 minutes; the first preset time period may also be a different time period from the second preset time period, for example, the second time period is from 0 point to 0 point for 5 minutes, and the first preset time period is any time period when the ADSP first generates a bus fault. The embodiments of the present application are not limited in this regard.
This step may correspond to the scenario of the eleventh monitoring of the bus read register time reaching 20s in the embodiment shown in fig. 8.
In a first preset time period, the electronic equipment detects that the restarting time of the ADSP is greater than or equal to a preset value; for example, 10 restarts are performed within 5 minutes. At this time, the information of the ten times of restarting may be counted in the file information, for example, the flag bit may be a second value, the number of restarting is 10, and the positions storing the time of the ADSP restart sequentially store the time of 10 times of restarting.
After the first preset time period, it may be monitored that the length of time taken for the bus to read the sensor information is equal to the second preset time period, the electronic device performs steps S810 and S812, reads the file information, and acquires the system time. Since the system time is not within the second preset period, step S813 is not satisfied, and the electronic device performs step S815 and step S816. Because the flag bit is a second value, the time difference is smaller than a third preset duration, and the restarting times reach a preset value; the electronic device performs S817 without performing ADSP restart, satisfying the condition of step S816.
Thus, the electronic device can control the ADSP to stop restarting when the ADSP is restarted repeatedly. For example, after an electronic device has repeatedly restarted, the electronic device may control the ADSP to not restart at present.
Optionally, when the time difference is smaller than a third preset time length and the number of restarting times reaches a preset value, controlling the sensor access not to trigger the ADSP to restart; further comprises: setting a flag bit to a first value and acquiring system time when the time taken by the bus path to read the sensor information is longer than a second preset time; and under the condition that the flag bit is a first value and the system time is not within a second preset time period, controlling the sensor access not to trigger ADSP to restart.
This step may correspond to the scenario in the embodiment shown in fig. 8 where the watchdog monitors the bus reading register for a duration of 21s and above.
The bus path takes longer than a second preset time period for reading the sensor information, steps S811 and S812 may be performed, the flag bit is set to a first value, and the system time is acquired; since step S813 is not satisfied, the electronic device performs steps S815 and S816. Because the flag bit is the first value, the condition of step S816 is satisfied, and the electronic device executes step S817 without triggering the ADSP restart. It may be appreciated that, since the flag bit is the first value, the electronic device may not need to determine the condition S816 through the information such as the time difference, and the embodiment of the present application may omit the process of obtaining the time difference, for example, the electronic device does not execute step S815.
In this way, after the ADSP is repeatedly restarted, and the electronic device controls the ADSP to stop restarting, the ADSP restart is kept not to occur any more within the first preset time period. For example, ADSP restart does not occur within a first preset time period corresponding to 0 point 5 minutes; the user can normally use the call function within the first preset time period.
Optionally, before the control sensor path does not trigger the ADSP restart, the method includes: and updating the second preset time length to the first preset time length.
This step may correspond to the embodiment shown in fig. 6, and it may be understood that when the bus fault causes the ADSP to restart repeatedly, the electronic device may be maintained, and the second preset duration in the original flow may be prolonged, so that the time interval between the two ADSP restarts is longer, and the ADSP does not restart any longer in the longer time interval. For example, the first preset duration is 1 hour and the second preset duration is 20s.
Therefore, the time interval of ADSP restarting can be prolonged, so that the user can normally use the call function during the time interval, and the use experience of the user is further improved.
Optionally, the length of time for the bus path to read the sensor information is obtained by: updating a first counting range, wherein the first counting range can meet the requirement of counting a first preset duration; acquiring a first thread; the first thread is used for executing the task of reading sensor information by the bus path; and under the condition that the starting time of the task in the first thread is not changed, increasing the duration of the task in the first thread to obtain the updated time length for reading the sensor information by the bus access.
This step may correspond to the embodiment shown in fig. 7, and the electronic device may set the first count range according to the first preset duration. A first preset duration, such as 1 hour or 1 day, and a first count range, such as unit 32. For example, in the native flow, the count range is unit8, and the count of 256s can be recorded, which does not satisfy the first preset time period (e.g., 3600s or 86400 s). The embodiment of the application expands the counting range to unit32 to support counting of the first preset duration.
In this way, the count range can be enlarged, so that the duration can reach the first preset duration, and the ADSP restart is not generated within the first preset duration.
Optionally, during the period when the ADSP does not trigger the restart, the electronic device does not acquire the sensor information; the method further comprises the steps of: under the condition that the time length of the ADSP without triggering the restarting reaches the first preset time length, whether the sensor information can be obtained or not is detected by controlling the restarting of the ADSP.
In the embodiment of the application, the electronic device can detect whether the function of the sensor is recovered through ADSP restarting at a specific time.
Therefore, the electronic equipment can detect whether the bus fault is recovered by itself, and after the bus fault is recovered, the electronic equipment can provide sensor service so as to improve the use experience of a user.
Optionally, the step of controlling whether the ADSP restart detection can acquire the sensor information includes: acquiring system time under the condition that the time for reading the sensor information by the bus access is longer than a second preset time; if the system time is within the second preset time period, setting the flag bit to a second value, triggering ADSP restarting, and resetting the file information.
This process may correspond to the scenario shown in fig. 8 where the current system time is 0 point and the electronic device monitors the bus read register for more than 20 s.
The bus path takes longer than 20S to read the sensor information, and the electronic device executes steps S811 and S812; when the system time is at a specific time and the flag bit is a first value, the electronic device executes step S814 to reset the file information and the flag bit; so that ADSP can trigger a restart.
Therefore, the electronic equipment can judge whether the sensor function is recovered or not through ADSP restarting in a specific time, so that after the bus fault is recovered, a user can timely apply the sensor function of the electronic equipment, and the use experience of the user is improved.
Optionally, after setting the flag bit to the second value, triggering the ADSP to restart and resetting the content in the file information, the method further includes: acquiring file information and obtaining a time difference under the condition that the length of time for reading the sensor information by the bus access is equal to a second preset time length; wherein the flag bit is a second value; and updating the file information and indicating ADSP to restart under the condition that the time difference is greater than or equal to a third preset time length or the number of restarting times does not reach a preset value.
This step may correspond to the scenario of the electronic device monitoring the bus read register for up to 20s the first through tenth times in the embodiment shown in fig. 8.
The bus path takes up to 20S to read the sensor information and the electronic device performs steps S810-S813. The flag bit is the second value, step S813 is not satisfied, and the electronic device executes step S815. The number of times of the ADSP restart is less than 10, the condition of step S816 is not satisfied, and the condition of step S818 is satisfied, the electronic device performs step S819, updates the file information, and controls the ADSP restart.
Therefore, the electronic equipment can detect whether the bus fault is recovered or not through restarting for a plurality of times, and the accuracy of the judging result is improved.
Optionally, in the cleared file information, the flag bit is a second value, the ADSP restart number is 0, and the position storing the ADSP restart time does not include the ADSP restart time; in the updated file information, the flag bit is a second value, the number of ADSP restarting times is increased by 1, the position for storing the ADSP restarting time is increased by 1, and the newly added position for storing the ADSP restarting time is stored with the ADSP restarting time.
Thus, the electronic equipment can read and write file information only when ADSP restarting occurs; when the time length for reading the sensor information by the bus channel is smaller than the second preset time length, the operation of reading and writing the file information is not performed, and the power consumption is reduced.
The foregoing has described a call method according to an embodiment of the present application, and a device for executing the call method according to the embodiment of the present application is described below. Those skilled in the art will understand that the methods and apparatuses may be combined and referred to, and the related apparatuses provided in the embodiments of the present application may perform the steps in the foregoing call method.
As shown in fig. 13, a telephony device 1300 may be used in a communication apparatus, circuit, hardware component, or chip, the telephony device comprising: a display unit 1301, and a processing unit 1302. Wherein the display unit 1301 is configured to support a step of displaying performed by the telephony device 1300; the processing unit 1302 is configured to support the step of the telephony device 1300 performing information processing.
In a possible implementation manner, the communication unit 1303 may also be included in the communication apparatus 1300. Specifically, the communication unit is configured to support the communication apparatus 1300 to perform the steps of transmitting data and receiving data. The communication unit 1303 may be an input or output interface, a pin, a circuit, or the like.
In a possible embodiment, the call device may further include: a storage unit 1304. The processing unit 1302 and the storage unit 1304 are connected by a line. The memory unit 1304 may include one or more memories, which may be one or more devices, circuits, or means for storing programs or data. The storage unit 1304 may exist independently and is connected to the processing unit 1302 provided in the communication device through a communication line. The memory unit 1304 may also be integrated with the processing unit 1302.
The storage unit 1304 may store computer-executable instructions of a method in the terminal device to cause the processing unit 1302 to perform the method in the above-described embodiment. The storage unit 1304 may be a register, a cache, a RAM, or the like, and the storage unit 1304 may be integrated with the processing unit 1302. The memory unit 1304 may be a read-only memory (ROM) or other type of static storage device that may store static information and instructions, and the memory unit 1304 may be independent of the processing unit 1302.
The communication method provided by the embodiment of the application can be applied to the electronic equipment with the communication function. The electronic device includes an electronic device, and specific device forms and the like of the electronic device may refer to the above related descriptions, which are not repeated herein.
The embodiment of the application provides electronic equipment, which comprises: comprising the following steps: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to cause the electronic device to perform the method described above.
The embodiment of the application provides a chip system, which comprises at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected through a circuit, and the at least one processor is used for running a computer program or instructions to execute the method. The principle and technical effects of the present invention are similar to those of the above-described related embodiments, and will not be described in detail herein.
Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The computer program realizes the above method when being executed by a processor. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer readable media can include computer storage media and communication media and can include any medium that can transfer a computer program from one place to another. The storage media may be any target media that is accessible by a computer.
In one possible implementation, the computer readable medium may include RAM, ROM, compact disk-read only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium targeted for carrying or storing the desired program code in the form of instructions or data structures and accessible by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (Digital Subscriber Line, DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes optical disc, laser disc, optical disc, digital versatile disc (Digital Versatile Disc, DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The present embodiments provide a computer program product comprising a computer program which, when executed, causes a computer to perform the above-described method.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing detailed description of the invention has been presented for purposes of illustration and description, and it should be understood that the foregoing is by way of illustration and description only, and is not intended to limit the scope of the invention.

Claims (13)

1. A method of talking, applied to an electronic device, where the electronic device includes an audio digital processor ADSP, the method comprising:
in a first preset time period, if the restarting times of the ADSP are greater than or equal to a preset value, controlling the ADSP not to trigger restarting;
during the period that the ADSP does not trigger restarting, the electronic equipment receives a call operation;
in response to the call operation, the electronic device establishes an audio path using the ADSP.
2. The method of claim 1, wherein controlling the ADSP not to trigger a restart comprises:
under the condition that a bus passage is blocked, controlling the bus passage not to trigger ADSP to restart;
and/or controlling the sensor access not to trigger ADSP restarting under the condition that the time length used by the bus access to read the sensor information does not reach the first preset time length; the first preset time period is longer than the second preset time period, and the second preset time period is a preset time period for judging that the sensor access triggers ADSP restarting in the first preset time period.
3. The method of claim 2, wherein before controlling the sensor path not to trigger an ADSP restart, comprising:
Reading file information and acquiring system time under the condition that the length of time for reading the sensor information by a bus access is equal to a second preset time length; the file information comprises a zone bit for triggering ADSP restarting, ADSP restarting times, ADSP restarting time and a position for storing the ADSP restarting time; the system time is the current time displayed by the electronic equipment; the value of the flag bit comprises a first value and a second value, wherein the first value is used for indicating that ADSP restarting is not triggered; the second value is used for indicating to trigger ADSP restart;
the flag bit is the second value; or under the condition that the system time is not in a second preset time period, obtaining the first ADSP restarting time and the last ADSP restarting time in the file information, and calculating the time difference between the first ADSP restarting time and the last ADSP restarting time;
the controlling the sensor path not to trigger an ADSP restart includes:
controlling the sensor access not to trigger ADSP restarting under the condition that the time difference is smaller than a third preset time length and the restarting times reach the preset value; the third preset time period is longer than the second preset time period.
4. A method according to claim 3, wherein in case the time difference is less than a third preset time period and the number of restarts reaches the preset value, controlling the sensor path not to trigger an ADSP restart; further comprises:
setting the flag bit to the first value and acquiring a system time when the bus path takes longer than the second preset time period for reading the sensor information;
and controlling the sensor access not to trigger ADSP restart under the condition that the flag bit is the first value and the system time is not within the second preset time period.
5. The method of claim 2, wherein before controlling the sensor path not to trigger an ADSP restart, comprising:
and updating the second preset time length to the first preset time length.
6. The method according to any of claims 1-5, characterized in that the length of time for reading sensor information by the bus path is obtained by: updating a first counting range, wherein the first counting range can meet the requirement of counting a first preset duration; acquiring a first thread; the first thread is used for executing the task that the bus path reads the sensor information; and under the condition that the starting time of the task in the first thread is not changed, increasing the duration of the task in the first thread to obtain the updated time length for reading the sensor information by the bus access.
7. The method of claim 1, wherein the electronic device is not able to obtain sensor information during a period in which the ADSP does not trigger a restart; the method further comprises the steps of:
and under the condition that the duration of the ADSP without triggering the restarting reaches the first preset duration, controlling whether the sensor information can be obtained through the ADSP restarting detection.
8. The method of claim 7, wherein obtaining sensor information by controlling the ADSP restart detection comprises:
acquiring system time under the condition that the time period for reading the sensor information by the bus access is longer than a second preset time period;
if the system time is within the second preset time period, setting a flag bit to a second value, triggering the ADSP to restart, and resetting file information.
9. The method of claim 8, wherein setting the flag bit to the second value, triggering the ADSP restart, and clearing the contents of the file information, further comprises:
acquiring the file information and obtaining a time difference under the condition that the length of time taken by the bus path for reading the sensor information is equal to the second preset time length; wherein the flag bit is the second value;
And updating the file information and indicating ADSP restarting under the condition that the time difference is larger than or equal to a third preset time length or the restarting times do not reach the preset value.
10. The method according to claim 8 or 9, wherein in the cleared file information, the flag bit is the second value, the ADSP restart number is 0, and the ADSP restart time is not included in the position storing ADSP restart time;
in the updated file information, the flag bit is the second value, the number of times of ADSP restarting is increased by 1, 1 is added to the position for storing ADSP restarting time, and the newly added position for storing ADSP restarting time stores the ADSP restarting time.
11. An electronic device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory to cause the electronic device to perform the method of any one of claims 1-10.
12. A computer readable storage medium storing a computer program, which when executed by a processor implements the method according to any one of claims 1-10.
13. A system on a chip comprising at least one processor and a communication interface, the communication interface and the at least one processor being interconnected by a wire, the at least one processor being configured to execute a computer program or instructions to perform the method of any of claims 1-10.
CN202311754175.7A 2023-12-20 2023-12-20 Conversation method and related equipment Active CN117440088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311754175.7A CN117440088B (en) 2023-12-20 2023-12-20 Conversation method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311754175.7A CN117440088B (en) 2023-12-20 2023-12-20 Conversation method and related equipment

Publications (2)

Publication Number Publication Date
CN117440088A true CN117440088A (en) 2024-01-23
CN117440088B CN117440088B (en) 2024-05-14

Family

ID=89555687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311754175.7A Active CN117440088B (en) 2023-12-20 2023-12-20 Conversation method and related equipment

Country Status (1)

Country Link
CN (1) CN117440088B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180181364A1 (en) * 2016-06-27 2018-06-28 Qualcomm Incorporated Systems and methods for using distributed universal serial bus (usb) host drivers
CN113254281A (en) * 2021-04-29 2021-08-13 中国长城科技集团股份有限公司 Detection method and detection device for USB controller
WO2023284415A1 (en) * 2021-07-16 2023-01-19 荣耀终端有限公司 Power key mistouch detection method and electronic device
CN115794456A (en) * 2022-10-19 2023-03-14 超聚变数字技术有限公司 PCIe link repair method and device and computing equipment
CN117130824A (en) * 2023-01-10 2023-11-28 荣耀终端有限公司 Method for processing exception, electronic equipment and storage medium
CN117234698A (en) * 2023-11-16 2023-12-15 荣耀终端有限公司 Program exception handling method, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180181364A1 (en) * 2016-06-27 2018-06-28 Qualcomm Incorporated Systems and methods for using distributed universal serial bus (usb) host drivers
CN113254281A (en) * 2021-04-29 2021-08-13 中国长城科技集团股份有限公司 Detection method and detection device for USB controller
WO2023284415A1 (en) * 2021-07-16 2023-01-19 荣耀终端有限公司 Power key mistouch detection method and electronic device
CN115794456A (en) * 2022-10-19 2023-03-14 超聚变数字技术有限公司 PCIe link repair method and device and computing equipment
CN117130824A (en) * 2023-01-10 2023-11-28 荣耀终端有限公司 Method for processing exception, electronic equipment and storage medium
CN117234698A (en) * 2023-11-16 2023-12-15 荣耀终端有限公司 Program exception handling method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN117440088B (en) 2024-05-14

Similar Documents

Publication Publication Date Title
EP3937426B1 (en) Master-slave server switching method, apparatus and storage medium
KR20150054413A (en) Apparatas and method for determining a location of content according to user's eyes data in an electronic device
CN112035298A (en) Data backup method and device, electronic equipment and storage medium
WO2018034544A1 (en) Communication network connection control method, storage medium, and electronic device therefor
CN109684406A (en) Method, apparatus, equipment and the storage medium of redis cluster backup data across computer room
CN115328563B (en) System starting method and electronic equipment
US11832349B2 (en) Nomination of a primary cell phone from a pool of cell phones
KR20170027118A (en) Method and apparatus for connecting with external device
CN113760611A (en) System site switching method and device, electronic equipment and storage medium
CN113886021A (en) Mirror image backup method and device, electronic equipment and readable storage medium
CN112486733B (en) System restoration method, device, terminal and storage medium
CN117440088B (en) Conversation method and related equipment
CN111478817A (en) Network fault processing method and device, storage medium and mobile device
CN107688498B (en) Application program processing method and device, computer equipment and storage medium
CN116450386A (en) Watchdog detection method, device and storage medium
CN112363895A (en) System fault positioning method and device and electronic equipment
CN110221928B (en) Information recording method, information recording apparatus, terminal, and storage medium
CN111083719A (en) Method, device and storage medium for flexibly adjusting network element capacity
CN112732568B (en) System log acquisition method and device, storage medium and terminal
CN112825021B (en) System response method and device, electronic equipment and computer readable storage medium
CN115793991B (en) Data reading method and device, electronic equipment and readable storage medium
CN110471714B (en) Method, device, terminal and storage medium for controlling application starting
CN115037595A (en) Network recovery method, device, equipment and storage medium
CN115002877A (en) Network searching method and device
CN116594814A (en) Dual MCU switching method and device 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