Method, device and product for optimizing audio acquisition vulnerability in online car-hailing travel safety
By intercepting and detecting audio session configuration methods, speaker options are added to ensure that the audio session is output to the speaker by default, which solves the problem that online call ringtones cannot be restored to normal during online car-hailing trips, and improves recording quality and user experience.
Patent Information
- Application Number
- CN202411152650.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-13
AI Technical Summary
During online car-hailing trips, the driver's online call ringtone cannot return to normal after hanging up, resulting in low voice broadcast sound during recording, affecting the quality of recording in the line, and may cause the driver to miss the passenger's online call.
By intercepting and detecting audio session configuration methods, add speaker options to ensure that the audio session is output to the speaker by default, ensuring that the ringtone and recording volumes return to normal.
It effectively solves the problem of ringtone volume recovery, ensures the quality of recording in the line, reduces the possibility of drivers missing online calls, and improves user experience.
Smart Images

Figure CN119135806A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of online car-hailing, and more specifically, to a method, device and product for optimizing audio collection vulnerabilities in online car-hailing trip safety. Background Art
[0002] With the advancement of technology, the online car-hailing industry is developing in the direction of intelligence and efficiency. It provides online taxis, express cars, private cars, ride-sharing and other service types to meet the travel needs of different users, and has become a mainstream travel mode. Therefore, improving the quality of service products, reducing disputes between drivers and passengers, and ensuring user safety are also the goals pursued by online car-hailing platforms. Among them, recording the online car-hailing trip is an effective measure. Recording during the driving of the online car-hailing can serve as important evidence to help solve the problem when service quality problems or safety incidents occur.
[0003] Currently, for drivers equipped with the IOS system, after turning on in-flight recording, if the driver is called by an Internet call, when the call is not answered (that is, not joined the channel), the volume of the recording and the call ringtone are normal. At this time, the in-flight recording and ringtone playback use the same AudioSession configuration. During the call, the audio playback volume of the driver's side will become smaller. After hanging up the Internet call, if the driver is called by the Internet call again, the volume of the call ringtone may not return to normal, which will cause the voice broadcast during the recording process to be low, affecting the quality of the in-flight recording. At the same time, it will also make it easy for the driver to miss the Internet call initiated by the passenger, affecting the user experience of online car-hailing passengers.
[0004] Chinese patent application number 202111320312.7, application date 2021.11.09, discloses a terminal video playback method, which calls RTCSDK for microphone connection according to the startup instruction of starting RTC. If the microphone connection is successful, AVAudioSeesionCategory is set to AVAudioSeesionCategoryPlayAndRecord. Further, if a media playback request is received after the microphone connection is successful, that is, a scenario where voice call and video playback are required at the same time, the audio rendering driver of the player is set to AudioUnit according to the media playback request, and the parameter componentSubType of AudioComponentDescription is set to kAudioUnitSubType_VoiceProcessingIO. Therefore, by changing the audio rendering logic of the video player, the iOS mobile operating system will treat the media volume as the call volume, so that it will not be suppressed or even inaudible by echo cancellation, avoiding the problem of suppressed media volume of video playback. This patent solution solves the problem of too low media volume during voice calls, and cannot solve the problem that the ringtone playback sound cannot return to normal when answering the network call again. Summary of the invention
[0005] In view of this, the present invention provides a method, device and product for optimizing audio collection vulnerabilities in online car-hailing trip safety, which can restore the ringtone playback sound to normal when the driver answers the network call again.
[0006] In order to achieve the above object, the present invention adopts the following technical scheme:
[0007] In a first aspect, the present invention provides a method for optimizing audio collection vulnerabilities in online car-hailing trip safety, the method comprising:
[0008] The client intercepts all audio session configuration methods of the current audio session in the audio session management class in response to the network call request;
[0009] The client detects whether there is an audio session configuration method lacking a speaker option among the intercepted audio session configuration methods;
[0010] If there is an audio session configuration method that lacks a speaker option, the client adds an enumeration value corresponding to the speaker option to the audio session configuration method that lacks the speaker option;
[0011] The speaker option is used to indicate that the current audio session is output to the speaker by default.
[0012] The method provided by the present invention automatically intercepts all audio session configuration methods when the client receives a network call request, and detects whether there is a situation where the audio session is not set to be output to the speaker by default. If this situation exists, the option of outputting the audio session to the speaker by default is added to the audio session configuration method that lacks this option. In this way, the ringtone volume of the new network call request will be restored to normal, ensuring the quality of the recording during the trip. At the same time, it also reduces the possibility of the driver missing the network call due to the low ringtone volume.
[0013] In a possible implementation, the audio session configuration method includes a first configuration method, a second configuration method, a third configuration method, and a fourth configuration method, wherein:
[0014] The first configuration method is used to configure the category of the current audio session;
[0015] The second configuration method is used to configure the category and options of the current audio session;
[0016] The third configuration method is used to configure the category and mode of the current audio session;
[0017] The fourth configuration method is used to configure the category, mode, route sharing strategy and options of the current audio session.
[0018] In a possible implementation, the client intercepts all audio session configuration methods of the current audio session in the audio session management class in response to the network call request, including:
[0019] The client obtains the method objects of the original method and the custom method of each audio session configuration method through the method object acquisition function;
[0020] The client exchanges the implementation of the original method and the custom method through the method exchange function.
[0021] In a possible implementation, the method signature of the custom method is the same as that of the original method, and the method signature includes parameter types, the number of parameters, and the return value type.
[0022] In a second aspect, the present invention provides a device for optimizing audio collection vulnerabilities in online car-hailing trip safety, the device comprising: an interception module, a detection module and an addition module; wherein:
[0023] An interception module, connected to the detection module, is used for the client to intercept all audio session configuration methods of the current audio session in the audio session management class in response to a network call request;
[0024] The detection module is connected to the interception module and the addition module respectively, and is used by the client to detect whether there is an audio session configuration method lacking a speaker option in the intercepted audio session configuration method; wherein the speaker option is used to indicate that the current audio session is output to the speaker by default;
[0025] The adding module is connected to the detecting module and is used for, if there is an audio session configuration method lacking the speaker option, the client adds an enumeration value corresponding to the speaker option to the audio session configuration method lacking the speaker option.
[0026] In a possible implementation, the interception module is specifically configured for the client to intercept the first configuration method, the second configuration method, the third configuration method, and the fourth configuration method in response to the network call request;
[0027] The first configuration method is used to configure the category of the current audio session;
[0028] The second configuration method is used to configure the category and options of the current audio session;
[0029] The third configuration method is used to configure the category and mode of the current audio session;
[0030] The fourth configuration method is used to configure the category, mode, route sharing strategy and options of the current audio session.
[0031] In a possible implementation, the interception module is further specifically used for the client to obtain the method objects of the original method and the custom method of each audio session configuration method through the method object acquisition function; the client exchanges the implementation of the original method and the custom method through the method exchange function.
[0032] In a third aspect, the present invention provides an electronic device comprising a processor and a memory; the memory stores a computer program or computer instructions that can be loaded by the processor and executed such as a method for optimizing audio collection vulnerabilities in online car-hailing trip safety in the first aspect and any possible implementation thereof.
[0033] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program or computer instructions that can be loaded by a processor and executed as a method for optimizing audio collection vulnerabilities in online car-hailing trip safety according to the first aspect and any possible implementation thereof.
[0034] In a fifth aspect, the present invention provides a computer program product, including a computer program or computer instructions, which, when loaded and executed by a processor, implement the steps of a method for optimizing audio collection vulnerabilities in online car-hailing trip safety as described in the first aspect and any possible implementation thereof.
[0035] For the specific description of the second to fifth aspects and their various implementations in the present invention, reference can be made to the detailed description in the first aspect and its various implementations; and for the beneficial effects of the second to fifth aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first aspect and its various implementations, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0037] Figure 1 It is a flow chart of a method for optimizing audio collection vulnerabilities in online car-hailing trip safety according to an embodiment of the present invention;
[0038] Figure 2 It is another flow chart of a method for optimizing audio collection vulnerabilities in online car-hailing trip safety according to an embodiment of the present invention;
[0039] Figure 3 It is a flowchart of a specific application of a method for optimizing audio collection vulnerabilities in online car-hailing trip safety according to an embodiment of the present invention;
[0040] Figure 4 It is an internal structural block diagram of a device for optimizing audio acquisition vulnerabilities in online car-hailing trip safety according to an embodiment of the present invention;
[0041] Figure 5 It is a block diagram of the internal structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.
[0043] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0044] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0045] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0046] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0047] In order to facilitate understanding of the technical solution of the present invention, the terms involved in the present invention are briefly introduced below.
[0048] 1. Driver terminal: refers to an intelligent service terminal device with an application interface or operating system designed for drivers by the online car-hailing service platform, and with functions such as drivers receiving passengers' car-hailing requests, viewing order details, navigation, receiving orders, and dropping off passengers. It can be a smartphone, tablet computer, portable computer, etc.
[0049] 2. Passenger terminal: refers to an intelligent service terminal device with an application interface or operating system designed for passengers by the online car-hailing service platform, as well as functions such as reservation, navigation, fare payment, and receiving order status updates. It can be a smartphone, tablet computer, portable computer, etc.
[0050] 3. AVAudioSession: AVAudioSession is a class used to manage audio sessions in iOS and macOS development. It provides control and access to audio devices and allows applications to configure their audio behaviors. AVAudioSession can coordinate the use of audio hardware devices by multiple applications through different settings, and handle scenarios such as audio playback and recording. For example, you can set whether the APP can coexist with the audio of other APPs, or whether the sound can be played when the phone is set to silent mode.
[0051] 4. AVAudioSessionCategory: A set of categories used to identify the application's intent to use audio resources. By setting different categories, you can control the application's audio behavior, such as whether to allow audio mixing with other applications, whether to respond to the system's mute button, whether to support recording or playback, etc.
[0052] 5. AVAudioSessionCategoryOptionDefaultToSpeaker: This is an option for setting the default output of the audio session to the speaker. It belongs to the AVAudioSessionCategoryOptions enumeration type and is used to specify the default output mode of the audio session. This option is only valid when using the AVAudioSessionCategoryPlayAndRecord category.
[0053] 6. AVAudioSessionCategoryPlayAndRecord: This is an audio session category, which means that the application needs to play audio as well as record audio. When using this category, the application can play and record audio at the same time.
[0054] 7. AVAudioSessionModeDefault: is an audio session mode (Mode), indicating that the audio session uses the default mode. The default mode is usually suitable for most applications and provides basic audio behavior.
[0055] Embodiment 1:
[0056] The embodiment of the present invention provides a method for optimizing audio collection vulnerabilities in online car-hailing trip safety. Figure 1 , which is a flow chart of a method for optimizing audio acquisition vulnerabilities in online car-hailing trip safety provided by an embodiment of the present invention. Figure 1 As shown, the method for optimizing audio collection vulnerabilities in online car-hailing trip safety provided by the present invention mainly includes the following steps (steps S101 to S103):
[0057] Step S101, the client intercepts all audio session configuration methods of the current audio session in the audio session management class in response to the network call request;
[0058] Step S102, the client detects whether there is an audio session configuration method lacking a speaker option among the intercepted audio session configuration methods;
[0059] In step S102, the speaker option is used to indicate that the current audio session is output to the speaker by default.
[0060] Step S103: If there is an audio session configuration method that lacks a speaker option, the client adds an enumeration value corresponding to the speaker option to the audio session configuration method that lacks the speaker option.
[0061] In this embodiment, after the enumeration value corresponding to the speaker option is added, the missing speaker option is added to the audio session configuration method.
[0062] Normally, during an Internet call, the audio broadcast volume is lower than the Internet call volume, and after the call ends, the system automatically outputs the audio session to the speaker by default, that is, increases the audio broadcast volume. However, in the existing IOS system, when a network call request is received again, the ringtone volume, that is, the audio broadcast volume, does not return to normal. This is a system bug, and the audio session is not output to the speaker by default after the call ends.
[0063] To this end, the method of this embodiment, when the driver receives an Internet call request, will automatically intercept all audio session configuration methods and detect whether there is a situation where the audio session is not set to be output to the speaker by default. If this situation exists, the option of outputting the audio session to the speaker by default is added to the audio session configuration method that lacks this option. In this way, the ringtone volume of the Internet call request received again will return to normal, ensuring the quality of the recording during the trip. At the same time, it also reduces the possibility of the driver missing the Internet call due to the low ringtone volume.
[0064] Embodiment 2:
[0065] The embodiment of the present invention also provides a method for optimizing the audio collection vulnerability in the online car-hailing trip safety. Figure 2 , which is a flow chart of a method for optimizing audio acquisition vulnerabilities in online car-hailing trip safety provided by an embodiment of the present invention. Figure 2 As shown, the method for optimizing audio collection vulnerabilities in online car-hailing trip safety provided by the present invention mainly includes the following steps (steps S201 to S204):
[0066] Step S201, in response to a network call request, the client obtains the method objects of the original method and the custom method of each audio session configuration method of the current audio session in the audio session management class through a method object acquisition function;
[0067] Step S202, the client exchanges the implementation of the original method and the custom method through the method exchange function to achieve interception;
[0068] Step S203, the client detects whether there is an audio session configuration method lacking a speaker option in the intercepted audio session configuration methods;
[0069] In step S203, the speaker option is used to indicate that the current audio session is output to the speaker by default.
[0070] Step S204: If there is an audio session configuration method that lacks a speaker option, the client adds an enumeration value corresponding to the speaker option to the audio session configuration method that lacks the speaker option.
[0071] Optionally, the audio session configuration method includes a first configuration method, a second configuration method, a third configuration method, and a fourth configuration method, wherein:
[0072] The first configuration method is used to configure the category of the current audio session;
[0073] The second configuration method is used to configure the category and options of the current audio session;
[0074] The third configuration method is used to configure the category and mode of the current audio session;
[0075] The fourth configuration method is used to configure the category, mode, route sharing strategy and options of the current audio session
[0076] Since the audio session management class includes the following attributes: category, mode, option, and route sharing strategy, the above four configuration methods basically cover all audio session configuration methods.
[0077] In order to intercept successfully, the method signature of the custom method needs to be set the same as that of the original method, that is, the parameter type, number of parameters and return value type must be set the same.
[0078] This embodiment uses runtime technology to intercept the audio session configuration method, so that the developer can modify the behavior of the audio session management class without modifying the original code.
[0079] Furthermore, in order to ensure thread safety, the method exchange in step S202 is usually performed in the +load method, because the load method is called when the class is loaded for the first time and is guaranteed to be called only once.
[0080] Therefore, when the driver receives an Internet call request, the runtime technology will automatically intercept the calls of all audio session configuration methods to detect whether the audio session is not set to output to the speaker by default. If this happens, the option of outputting the audio session to the speaker by default will be added to the audio session configuration method that lacks this option. In this way, the ringtone volume of the Internet call request received again will return to normal, ensuring the quality of the recording during the trip. At the same time, it also reduces the possibility of the driver missing the Internet call due to the low ringtone volume.
[0081] Embodiment three:
[0082] In actual applications, the above-mentioned embodiment 2 and the preferred embodiment can be integrated according to actual application requirements. In order to facilitate technical personnel in this field to understand how to implement the actual application and how to combine with the preferred embodiment, the following detailed description is given of the method for optimizing the audio collection vulnerability in the above-mentioned online car-hailing trip safety by taking a specific scenario as an example.
[0083] When the driver is called by an Internet call, a ringtone is played. When the call is not answered (not joined in the channel), the recording and audio playback volume are normal. At this time, the recording and ringtone playback in the row use the same AudioSession configuration, the category Category is AVAudioSessionCategoryPlayAndRecord, the mode mode is AVAudioSessionModeDefault, and the options options are 43, namely AVAudioSessionCategoryOptionDefaultToSpeaker, AVAudioSessionCategoryOptionMixWithOthers, AVAudioSessionCategoryOptionDuckOthers, and AVAudioSessionCategoryOptionAllowBluetoothA2DP.
[0084] When joining a channel, the mode is set to AVAudioSessionVoiceChat, the category is AVAudioSessionCategoryPlayAndRecord, and the option does not contain AVAudioSessionCategoryOptionDefaultToSpeaker, so the audio broadcast volume will become lower. After hanging up the network call, the iOS system will reset the audio session, that is, the category is AVAudioSessionCategoryPlayAndRecord, the mode is set to AVAudioSessionModeDefault, and the option contains AVAudioSessionCategoryOptionDefaultToSpeaker. However, there is a vulnerability in the iOS system. After receiving a new network call request, the option performs a -0x8 operation, that is, the AVAudioSessionCategoryOptionDefaultToSpeaker option is removed.
[0085] Therefore, in order to make the ringtone volume of the new network call request normal, you need to find the audio session configuration method that performs the -0x8 operation, force it to perform the +0x8 operation, and reset the AVAudioSessionCategoryOptionDefaultToSpeaker.
[0086] For the specific implementation process, please refer to Figure 3 , Figure 3Schematic diagram of a specific application of a method for optimizing audio acquisition vulnerabilities in online car-hailing trip safety in an embodiment of the present invention. Figure 3 As shown, the method includes the following steps (steps S301 to S303):
[0087] Step S301, the client intercepts all audio session configuration methods of the current audio session in the audio session management class AVAudioSession in response to the network call request;
[0088] Step S302, the client detects whether there is an audio session configuration method that lacks a speaker option AVAudioSessionCategoryOptionDefaultToSpeaker in the intercepted audio session configuration method, wherein the speaker option AVAudioSessionCategoryOptionDefaultToSpeaker is used to indicate that the current audio session is output to the speaker by default;
[0089] Step S303: If there is an audio session configuration method that lacks the speaker option AVAudioSessionCategoryOptionDefaultToSpeaker, the client adds an enumeration value corresponding to the speaker option AVAudioSessionCategoryOptionDefaultToSpeaker to the audio session configuration method that lacks the speaker option AVAudioSessionCategoryOptionDefaultToSpeaker.
[0090] In some optional embodiments, the driver side obtains the method objects of the original method and the custom method of each audio session configuration method through the method object acquisition function class_getInstanceMethod, and then exchanges the implementations of the original method and the custom method through the method exchange function method_exchangeImplementations to complete the interception of all audio session configuration methods, and after the exchange is successful, when the original method is called, the code of the exchanged custom method will be executed.
[0091] To ensure successful interception, the method signature of the custom method is the same as that of the original method, which includes the parameter type, number of parameters, and return value type.
[0092] In this embodiment, the audio session configuration method may include the following:
[0093] (1) The first configuration method setCategory:error: used to configure the category of the current audio session;
[0094] (2) A second configuration method setCategory:withOptions:error: for configuring the category and options of the current audio session;
[0095] (3) a third configuration method setCategory:mode:options:error: for configuring the category and mode of the current audio session; and,
[0096] (4) The fourth configuration method setCategory:mode:routeSharingPolicy:options:error: is used to configure the category, mode, route sharing policy and options of the current audio session.
[0097] The following are the specific meanings of the parameters in the above session configuration method:
[0098] category: Specifies the category of the audio session, such as playback, recording, or both playback and recording; this parameter determines the application's access rights and behavior to the audio hardware.
[0099] mode: specifies the mode of the audio session, such as default mode, voice chat, video chat, etc. This parameter further refines the behavior of the audio session to adapt to specific usage scenarios.
[0100] routeSharingPolicy: Specifies the routing sharing policy for the audio session; this parameter determines how audio output shares or competes with other applications for audio hardware resources.
[0101] options: A bit mask containing AVAudioSessionCategoryOptions, which is used to fine-tune the behavior of the audio session. For example, you can set whether to allow audio mixing with other applications, or whether to support Bluetooth devices, etc.
[0102] error: A pointer to an NSError object. If an error occurs while setting audio session properties, the error information will be stored in this object.
[0103] In addition, to facilitate understanding of the method of the embodiment of the present invention, the applicable relationship and property description between AVAudioSessionCategory (audio session category), AVAudionSessionMode (audio session mode), and AVAudioSessionCategoryOptions (audio session options) involved in the AVAudioSession class are listed in Table 1.
[0104] Table 1 Applicable relationships and property descriptions between categories, modes, and options in the AVAudioSession class
[0105]
[0106]
[0107]
[0108] It should be noted that if the method of this embodiment is not used to optimize the above-mentioned IOS system vulnerability, but when a new network call request is generated, the attribute active of AVAudioSession is set to NO, so that the current audio session is deactivated, it will affect the configuration of the trip recording and cause the recording to fail. Therefore, this solution is not recommended.
[0109] It should be noted that the client in the above embodiment refers to the driver's end.
[0110] Embodiment 4:
[0111] Based on the same inventive concept, the embodiment of the present invention also provides a device for optimizing audio collection vulnerabilities in online car-hailing trip safety for implementing the above-mentioned method for optimizing audio collection vulnerabilities in online car-hailing trip safety. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more embodiments of the device for optimizing audio collection vulnerabilities in online car-hailing trip safety provided below can be referred to the limitations of the method for optimizing audio collection vulnerabilities in online car-hailing trip safety above, and will not be repeated here.
[0112] Figure 4 The structure block diagram of a device 400 for optimizing audio acquisition vulnerabilities in online car-hailing trip safety is shown. Figure 4 As shown, the audio collection vulnerability optimization device 400 for online car-hailing trip safety includes: an interception module 401, a detection module 402 and an addition module 403; wherein,
[0113] The interception module 401 is connected to the detection module 402 and is used for the driver to intercept all audio session configuration methods of the current audio session in the audio session management class in response to the network call request;
[0114] The detection module 402 is connected to the interception module 401 and the addition module 403, respectively, and is used to detect whether there is an audio session configuration method lacking a speaker option in the intercepted audio session configuration method, wherein the speaker option is used to indicate that the current audio session is output to the speaker by default;
[0115] The adding module 403 is connected to the detecting module 402 and is used for adding an enumeration value corresponding to the speaker option to the audio session configuration method lacking the speaker option if there is an audio session configuration method lacking the speaker option.
[0116] In some optional embodiments, the interception module 401 is specifically used for the driver to intercept the first configuration method, the second configuration method, the third configuration method and the fourth configuration method in response to the network call request;
[0117] The first configuration method is used to configure the category of the current audio session;
[0118] The second configuration method is used to configure the category and options of the current audio session;
[0119] The third configuration method is used to configure the category and mode of the current audio session;
[0120] The fourth configuration method is used to configure the category, mode, route sharing strategy and options of the current audio session.
[0121] Furthermore, the interception module 401 is also specifically used for the driver side to obtain the method objects of the original method and the custom method of each audio session configuration method through the method object acquisition function; the driver side exchanges the implementation of the original method and the custom method through the method exchange function.
[0122] It should be noted that the above-mentioned functional modules can be integrated together to form an independent unit, for example, integrated into a processing unit, or each module can exist physically separately, or two or more modules can be integrated to form an independent unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0123] Embodiment five:
[0124] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device 500, the internal structure of the electronic device 500 is as follows: Figure 5 The electronic device 500 includes a memory 501 , a processor 502 and a communication bus 503 ; the memory 501 and the processor 502 are connected via the communication bus 503 .
[0125] The memory 501 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 501 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the method for optimizing audio collection vulnerabilities in online car-hailing trip safety provided in the above embodiment, etc.; the data storage area may store data involved in the method for optimizing audio collection vulnerabilities in online car-hailing trip safety provided in the above embodiment, etc.
[0126] The processor 502 may include one or more processing cores. The processor 502 executes various functions and processes data of the present invention by running or executing instructions, programs, code sets or instruction sets stored in the memory 501, calling the data stored in the memory 501. The processor 502 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller and a microprocessor. It is understandable that for different devices, the electronic device used to implement the above-mentioned processor function may also be other, and the embodiment of the present invention is not specifically limited.
[0127] The communication bus 503 may include a path to transmit information between the above components. The communication bus 503 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 503 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one double arrow is used in the diagram, but it does not mean that there is only one bus or one type of bus. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0128] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present invention, and does not constitute a limitation on the electronic device to which the scheme of the present invention is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] In particular, according to an embodiment of the present invention, the process described in the above flowchart may be implemented as a computer software program.
[0130] The technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, that is, the embodiment of the present invention also provides a computer-readable storage medium, which includes a number of computer programs or computer instructions, which are used to enable an electronic device (which can be a personal computer, server or network device, etc.) or a processor to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory, random access memory, disk or optical disk, etc., various media that can store program codes.
[0131] An embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), various functions defined in the present invention are performed.
[0132] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will be appreciated by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A method for optimizing audio collection vulnerabilities in online car-hailing trip safety, characterized in that: The method comprises: The client intercepts all audio session configuration methods of the current audio session in the audio session management class in response to the network call request; The client detects whether there is an audio session configuration method lacking a speaker option among the intercepted audio session configuration methods; If the audio session configuration method lacking the speaker option exists, the client adds an enumeration value corresponding to the speaker option to the audio session configuration method lacking the speaker option; The speaker option is used to indicate that the current audio session is output to the speaker by default.
2. The method for optimizing audio acquisition vulnerabilities in online car-hailing trip safety according to claim 1 is characterized in that: The audio session configuration method includes a first configuration method, a second configuration method, a third configuration method and a fourth configuration method, wherein: The first configuration method is used to configure the category of the current audio session; The second configuration method is used to configure the category and options of the current audio session; The third configuration method is used to configure the category and mode of the current audio session; The fourth configuration method is used to configure the category, mode, route sharing strategy and options of the current audio session.
3. The method for optimizing audio acquisition vulnerabilities in online car-hailing trip safety according to claim 1 or 2, characterized in that: The client intercepts all audio session configuration methods of the current audio session in the audio session management class in response to the network call request, including: The client obtains the method object of the original method and the custom method of each of the audio session configuration methods through a method object acquisition function; The client exchanges the implementation of the original method and the custom method through a method exchange function.
4. The method for optimizing audio acquisition vulnerabilities in online car-hailing trip safety according to claim 3 is characterized in that: The custom method has the same method signature as the original method, and the method signature includes parameter type, parameter quantity and return value type.
5. A device for optimizing audio acquisition vulnerabilities in online car-hailing trip safety, characterized in that: The device comprises: an interception module, a detection module and an addition module; wherein, The interception module is connected to the detection module and is used for the client to intercept all audio session configuration methods of the current audio session in the audio session management class in response to the network call request; The detection module is connected to the interception module and the addition module respectively, and is used by the client to detect whether there is an audio session configuration method that lacks a speaker option in the intercepted audio session configuration method; wherein the speaker option is used to indicate that the current audio session is output to the speaker by default; The adding module is connected to the detecting module and is used for, if the audio session configuration method lacking the speaker option exists, causing the client to add an enumeration value corresponding to the speaker option to the audio session configuration method lacking the speaker option.
6. The device for optimizing audio acquisition vulnerabilities in online car-hailing trip safety according to claim 5 is characterized in that: The interception module is specifically used for the client to intercept the first configuration method, the second configuration method, the third configuration method and the fourth configuration method in response to the network call request; Wherein, the first configuration method is used to configure the category of the current audio session; The second configuration method is used to configure the category and options of the current audio session; The third configuration method is used to configure the category and mode of the current audio session; The fourth configuration method is used to configure the category, mode, route sharing strategy and options of the current audio session.
7. The device for optimizing audio acquisition vulnerabilities in online car-hailing trip safety according to claim 5 or 6, characterized in that: The interception module is further specifically used for the client to obtain the method objects of the original method and the custom method of each of the audio session configuration methods through a method object acquisition function; the client exchanges the implementation of the original method and the custom method through a method exchange function.
8. An electronic device, characterized in that: including a processor and a memory; The memory stores a computer program or computer instruction that can be loaded by the processor and executed by the method for optimizing audio collection vulnerabilities in online car-hailing trip safety as described in any one of claims 1 to 4.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or computer instructions that can be loaded by a processor and execute a method for optimizing audio collection vulnerabilities in online car-hailing trip safety as described in any one of claims 1 to 4.
10. A computer program product comprising a computer program or computer instructions, characterized in that When the computer program or the computer instructions are loaded and executed by the processor, the steps of the method for optimizing audio collection vulnerabilities in online car-hailing trip safety as described in any one of claims 1 to 4 are implemented.
