Recording management method of vehicle-mounted system, vehicle-mounted system, medium and intelligent vehicle
By adding recording service application interface and callback interface to the native application focus management category of the vehicle system, the problems of high cost and poor scalability of recording service management in the existing technology are solved, and simpler and more efficient recording service management is achieved.
Patent Information
- Application Number
- CN202411403309.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-02-21
AI Technical Summary
The prior art has the need to provide SDK in vehicle-mounted systems to realize recording functions, resulting in high cost of recording service management and cannot meet the scalability needs of the system.
Add recording service application interface and recording service change callback interface to the native application focus management category of the vehicle system. Through these interfaces, the management strategy of recording service is realized, and the application installation SDK is not required, which can cope with the need for multiple applications to seize recording.
It reduces the complexity of system management and the cost of recording service management, improves the scalability of the system, and can effectively manage applications that use recording services at will.
Smart Images

Figure CN119493646A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of recording technology, and in particular to a recording management method for an in-vehicle system, an in-vehicle system, a medium and an intelligent car. Background Art
[0002] As smart cockpit systems become increasingly intelligent, numerous ecological applications such as smart voice assistants, voice interaction, meeting records, entertainment interaction, outside-car shouting, voice input methods, etc. have been connected, greatly enriching the convenience of user in-car interaction. These applications generally rely on recording to realize their core functions.
[0003] In order to support the ability of multiple applications to record simultaneously at the vehicle system level. In the prior art, each application usually needs to provide an SDK (Software Development Kit) to other applications in the vehicle system that need to use the recorder, so that other applications can monitor their own needs. At the same time, the application itself also needs to receive the SDK provided by other applications to implement the monitoring service. Figure 1 , is a schematic diagram of the integration relationship among the four applications that provide SDKs to each other.
[0004] Since each application needs to integrate the SDK of other applications, when the in-vehicle system faces the demand for multiple applications to preempt recording, it needs to control and manage the SDKs of all applications at the same time, which increases the system's recording service management costs and cannot meet the system's scalability requirements. Summary of the invention
[0005] In order to solve or partially solve the technical problem that the prior art increases the recording service management cost of the system and cannot meet the scalability requirements of the system, the present invention provides a recording management method for a vehicle-mounted system, a vehicle-mounted system, a medium and a smart car, and adds a recording service application interface and a recording service change callback interface to the native application focus management class of the vehicle-mounted system. The management strategy of the recording service based on the vehicle-mounted system level is implemented through extremely simple system changes. The need for multiple applications to preempt recording can be well met without the need to install an SDK for the application. Not only does it reduce the complexity of system management, it also reduces the system's recording service management cost, and can extend the management of any application that uses the recording service, thereby meeting the scalability requirements of the system.
[0006] In order to solve the above technical problems, the first aspect of the present invention discloses a recording management method for an in-vehicle system, the method is applied to the in-vehicle system, a recording service application interface and a recording service change callback interface are added to the native application focus management class of the in-vehicle system, and the method comprises:
[0007] In the process of the first application using the recording service, monitoring in real time whether the recording service application interface has a recording application request of the second application for the recording service;
[0008] If yes, extracting the application type of the second application from the recording application request;
[0009] Based on the application type of the second application, assigning the recording service use permission to the second application so that the second application uses the recording service;
[0010] Generate permission allocation information related to the second application, and send the permission allocation information of the second application to the first application through the recording service change callback interface, so that the first application stops using the recording service.
[0011] Optionally, allocating the recording service usage permission to the second application based on the application type of the second application specifically includes:
[0012] Extracting the application type of the first application from the recording service stack;
[0013] If it is determined whether the priority of the application type of the second application is greater than or equal to the priority of the application type of the first application, the recording service usage permission is allocated to the second application.
[0014] Optionally, after generating the permission allocation information related to the second application, the method further includes:
[0015] storing the permission allocation information of the second application in the recording service stack; the permission allocation information of the second application at least includes: the application type of the second application and the recording service occupancy status;
[0016] The permission allocation information of the first application is deleted from the recording service stack.
[0017] Optionally, a recording service release interface is added to the native application focus management class;
[0018] After sending the permission allocation information of the second application to the first application through the recording service change callback interface, the method further includes:
[0019] In the process of the second application using the recording service, monitoring in real time whether the recording service application interface has other recording requests from other applications for recording service, and monitoring in real time whether the recording service release interface has a stop recording request from the second application;
[0020] If the recording service application interface has no other recording requests, and the recording service release interface has the stop recording request, extracting the application type of the second application from the stop recording request;
[0021] Based on the application type of the second application, the recording service use permission is revoked from the second application, so that the second application stops using the recording service.
[0022] Optionally, after monitoring in real time whether the recording service application interface has other recording requests from other applications for recording service, and monitoring in real time whether the recording service release interface has a stop recording request from the second application, the method further includes:
[0023] If the recording service application interface has the other recording request, and the recording service release interface does not have the stop recording request, extracting the application type of other applications from the other recording request;
[0024] Based on the application type of the other application, assigning the recording service use permission to the other application so that the other application can use the recording service;
[0025] Generate permission allocation information related to the other applications, and send the permission allocation information of the other applications to the second application through the recording service change callback interface, so that the second application stops using the recording service.
[0026] Optionally, after extracting the application type of the second application from the stop recording request, the method further includes:
[0027] Extracting the recording service usage type of the second application from the recording stop request; the recording service usage type of the second application is used to instruct the first application to resume applying for the recording service after the second application stops using the recording service, or to stop applying for the recording service after the second application stops using the recording service;
[0028] Generate permission release information based on the recording service usage type of the second application;
[0029] The permission release information is sent to the first application through the recording service change callback interface, so that the first application resumes applying for the recording service after the second application stops using the recording service, or stops applying for the recording service after the second application stops using the recording service.
[0030] Optionally, the reclaiming the recording service use permission from the second application based on the application type of the second application specifically includes:
[0031] Extract the top application type from the top of the recording service stack;
[0032] Comparing whether the application type of the second application is consistent with the application type of the top of the stack;
[0033] If they are consistent, the recording service usage permission is revoked from the second application.
[0034] In a second aspect of the present invention, an in-vehicle system is disclosed, wherein a recording service application interface and a recording service change callback interface are added to a native application focus management class of the in-vehicle system, and the in-vehicle system comprises:
[0035] A monitoring module, used for monitoring in real time whether the recording service application interface has a recording application request for the recording service by the second application during the process of the first application using the recording service;
[0036] an extraction module, configured to extract the application type of the second application from the recording application request, if any;
[0037] an allocating module, configured to allocate the recording service use permission to the second application based on the application type of the second application, so that the second application can use the recording service;
[0038] The generation module is used to generate permission allocation information related to the second application, and send the permission allocation information of the second application to the first application through the recording service change callback interface, so that the first application stops using the recording service.
[0039] Optionally, the allocation module is specifically used to:
[0040] Extracting the application type of the first application from the recording service stack;
[0041] If it is determined whether the priority of the application type of the second application is greater than or equal to the priority of the application type of the first application, the recording service usage permission is allocated to the second application.
[0042] Optionally, the system further includes:
[0043] A storage module, configured to store the permission allocation information of the second application in a recording service stack after generating the permission allocation information related to the second application; the permission allocation information of the second application at least includes: an application type of the second application and a recording service occupancy status;
[0044] The deleting module is used to delete the permission allocation information of the first application from the recording service stack.
[0045] Optionally, a recording service release interface is added to the native application focus management class;
[0046] The system further comprises:
[0047] The monitoring module is further used to monitor in real time whether the recording service application interface has other recording requests from other applications for recording services during the process of the second application using the recording service, and to monitor in real time whether the recording service release interface has a stop recording request from the second application;
[0048] The extraction module is further configured to extract the application type of the second application from the stop recording request if the recording service application interface has no other recording request and the recording service release interface has the stop recording request;
[0049] The recovery module is used to recover the recording service use permission from the second application based on the application type of the second application, so that the second application stops using the recording service.
[0050] Optionally, the system further includes:
[0051] The extraction module is further configured to extract application types of other applications from the other recording requests if the recording service application interface has the other recording requests and the recording service release interface does not have the stop recording request;
[0052] The allocation module is used to allocate the recording service use permission to the other application based on the application type of the other application, so that the other application can use the recording service;
[0053] The sending module is used to generate permission allocation information related to the other applications, and send the permission allocation information of the other applications to the second application through the recording service change callback interface, so that the second application stops using the recording service.
[0054] Optionally, the extraction module is further used to extract the recording service usage type of the second application from the recording stop request; the recording service usage type of the second application is used to instruct the first application to resume applying for the recording service after the second application stops using the recording service, or to stop applying for the recording service after the second application stops using the recording service;
[0055] The generating module is further configured to generate permission release information based on the recording service usage type of the second application;
[0056] The sending module is further used to send the permission release information to the first application through the recording service change callback interface, so that the first application resumes applying for the recording service after the second application stops using the recording service, or stops applying for the recording service after the second application stops using the recording service.
[0057] Optionally, the recycling module is specifically used for:
[0058] Extract the top application type from the top of the recording service stack;
[0059] Comparing whether the application type of the second application is consistent with the application type of the top of the stack;
[0060] If they are consistent, the recording service usage permission is revoked from the second application.
[0061] According to a third aspect of the present invention, a computer-readable storage medium is disclosed, on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented.
[0062] In a fourth aspect of the present invention, an intelligent car is disclosed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0063] Through one or more technical solutions of the present invention, the present invention has the following beneficial effects or advantages:
[0064] The present invention provides a recording management method for an in-vehicle system, an in-vehicle system, a medium and an intelligent car. A recording service application interface and a recording service change callback interface are added to the native application focus management class of the in-vehicle system. A management strategy for the recording service based on the in-vehicle system level is implemented through extremely simple system changes. The need for multiple applications to preempt recording can be well met without the need to install an SDK for the application. This not only reduces the complexity of system management, but also reduces the system's recording service management cost. The management of any application that uses the recording service can be extended to meet the system's scalability requirements.
[0065] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0067] Figure 1 A schematic diagram of the integration relationship of SDKs of various applications in the prior art;
[0068] Figure 2A flow chart of a recording management method of a vehicle-mounted system according to an embodiment of the present invention;
[0069] Figure 3 A schematic diagram of the interaction between an instant messaging application, system voice and other application recording services according to an embodiment of the present invention;
[0070] Figure 4 FIG. 1 is a schematic diagram of a vehicle-mounted system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0072] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0073] In the first aspect, the recording management method of the vehicle system provided by the embodiment of the present invention adds the following method class interface to the CarAppFocusManager native application focus management class of the vehicle system:
[0074] int requestAppFocusWithAppFlag(): recording service application interface.
[0075] int adandonAppFocusWithAppFlag(): recording service release interface.
[0076] interface OnAppFocusWithAppFlagChangedListener(): recording service change callback interface.
[0077] The above interfaces are mainly used to manage the recording service and are controlled by the native application focus management class.
[0078] In actual applications, in order to facilitate the native application focus management class to manage the recording service, the recording service is supervised by the native application focus management class in the form of recording focus. Recording focus refers to the system-level permission or state of the recorder obtained in order to exclusively or prioritize audio recording tasks in a multi-tasking environment. This focus mechanism ensures that each application can reduce or avoid interference with audio resources by other applications when recording audio, thereby ensuring the quality and clarity of the recording.
[0079] The management form of recording focus makes the use rights of recording service have the following characteristics:
[0080] a) Exclusivity. Multiple applications are allowed to be in the recording system at the same time, but only one application is allowed to have the right to use the recording service at the same time. Therefore, when an application applies for the recording service, another application holding the recording service will lose the right to use the recording service. The application that loses the right to use the recording service will receive a notification in the recording service change callback interface.
[0081] b) Priority: When a high-priority application holds the recording service, a low-priority application will fail to apply for the recording service. When an application of the same or higher priority applies for the recording service, success is returned.
[0082] c) The recording service provides two types of usage: long recording service and short recording service.
[0083] In addition to using the native application focus management class to manage the recording service, you can also add a CarRecorderFocusManager: recording service management class in the car system to replace the native application focus management class to manage the recording service.
[0084] It is worth noting that the application configuration with recording requirements includes: void addFocusListenerWithAppFlag(): recording service change listener, used in conjunction with the recording service change callback interface.
[0085] See Table 1 for the method class interfaces and their definitions.
[0086] Table 1
[0087]
[0088]
[0089] The recording service application interface contains the following parameters: application type appFlag, and recording service usage type FocusType.
[0090] The recording service application interface can be used by calling the application type alone or in combination with the recording service usage type.
[0091] The application type appFlag is divided according to the application function, privacy strength, etc., and a class of applications with the same application function or the same privacy strength in the application type, such as the application type of system voice (human-computer interaction) and the application type of instant messaging application are different. Of course, the application package name can be directly used in the application type, or numbers, letters, characters and other identifiers can be used to represent different types. Furthermore, different application types correspond to different priorities, such as privacy priority, usage priority, etc. After obtaining the application type to which the application belongs, its priority level can be known. For example, the application type of instant messaging application is: Flag2; the application type of system voice is: Flag1. By comparing the application types, it can be known that the privacy priority of instant messaging application is higher than the privacy priority of system voice. In addition, the priority carried by the application type has an indicative function, which is used to instruct the application being recorded (for example: the first application) to make an action related to the priority carried by the application type of the application for recording service (for example: the second application), such as turning off the recorder, so as to avoid privacy leakage when the application for recording service uses the recorder, thereby enhancing the security of the entire system. Of course, you can also use the recording service at the same time as the application that applies for the recording service, and the two can coexist. However, in order to avoid affecting the recording function of the application that applies for the recording service, the recording application is processed with sound reduction.
[0092] The recording service usage type is applied for according to the duration of the application using the recorder, and is used to indicate whether the first application that is recording should resume applying for the recording service after the second application stops the recording service.
[0093] Among them, the recording service usage type includes long recording service and short recording service. Long recording service means that the application needs to record for a long time. When an application applies for a long recording service, the application whose recording service is preempted by it may not need to restore the recorder and recording service. For example, if the system voice applies for a long recording service, the application whose recording service is preempted by it, such as voice input method, KTV and other applications, does not need to re-acquire the recorder and recording service. Short recording service means that the application needs to record for a short time. When an application applies for a short recording service, the application whose recording service is preempted by it, such as system voice and other applications, may need to restore the recorder and recording service. For example, if the instant messaging application calls apply for a short recording service, the application whose recording service is preempted by it, such as system voice and other applications, may need to re-apply for the recorder and recording service after the instant messaging application is used. Furthermore, different recording service usage types can be indicated by numbers, letters, characters and other identifiers. For example: long recording service 1, short recording service 0. If focusType is long recording service 1, after the second application uses the recorder, the first application will not resume the application for recording service. If focusType is short recording service 0, after the second application uses the recorder, the first application will be notified and will resume the recording service application.
[0094] In the recording service release interface, the parameters contained are consistent with those in the recording service application interface, including: application type appFlag, recording service usage type FocusType. Its meaning and usage rules are consistent with those in the recording service application interface, so they will not be repeated here.
[0095] The recording service change listener is configured in each application with recording requirements. Each application uses the recording service change listener in conjunction with the interfaces in the native application focus management class. Compared with the prior art in which each application needs to integrate the SDK of all other applications with recording requirements, this configuration greatly reduces the access complexity and cost of the application.
[0096] In the recording service change callback interface, the callback parameters included are: application type appFlag, recording service occupancy status active, and recording service usage type FocusType. Among them, the recording service occupancy status active includes: recording service application status and recording service release status. Both can use numbers, letters, characters and other identifiers to represent different recording service occupancy states. For example, true represents the recording service application status, and false represents the recording service release status.
[0097] The above are modifications of the present invention at the vehicle-mounted system level, which are used as a basic framework to implement the recording service management strategy based on the vehicle-mounted system level.
[0098] The following Figure 2As shown, the audio recorder management method of the vehicle-mounted system of the present invention comprises at least the following steps:
[0099] S201, in the process of using a recording service by a first application, monitoring in real time whether the recording service application interface has a recording application request of a second application for the recording service.
[0100] The first application is an application that is currently using the recording service, and the second application is an application that is about to apply for the recording service.
[0101] When the second application applies to use the recording service, a recording application request is generated and transmitted to the recording service application interface.
[0102] Specifically, the second application calls the recorder application interface int requestAppFocusWithAppFlag(), and passes the application type of the second application: Flag2, into the recorder application interface int requestAppFocusWithAppFlag() to represent the second application's demand and priority for applying for the recording service. At this time, the recording service application interface is: int requestAppFocusWithAppFlag(Flag2).
[0103] Of course, you can also pass the application type parameter appFlag: the application type Flag2 of the second application and the recording service usage type parameter FocusType: long recording service 1 or short recording service 0 to the recorder application interface int requestAppFocusWithAppFlag(). For ease of explanation, short recording service 0 is used as the recording service usage type of the second application. At this time, the recording service application interface is: int requestAppFocusWithAppFlag(Flag2, 0).
[0104] When the first application uses the recording service, the native application focus management class monitors in real time whether the recording service application interface has a recording application request. If not, the native application focus management class continues to monitor. Otherwise, the native application executes S202.
[0105] S202: If yes, extract the application type of the second application from the recording application request.
[0106] When the recording service application interface is: int requestAppFocusWithAppFlag(Flag2), it means that the recording request contains the parameter: Flag2, then the parameter is extracted.
[0107] When the recording service application interface is int requestAppFocusWithAppFlag(Flag2, 0), indicating that the recording request contains two parameters: Flag2, 0, these two parameters are extracted.
[0108] S203: Allocate recording service usage permission to the second application based on the application type of the second application, so that the second application can use the recording service.
[0109] In a specific implementation process, the application type of the first application is extracted from the recording service stack. The recording service stack is used to store the permission allocation information of applications that have been assigned the permission to use the recording service. When the recording service is used, the recording service stack will not be empty. For example, if the first application is using the recording service, the permission allocation information of the first application is stored in the recording service stack. The permission allocation information of the first application includes: the package name of the first application, the application type of the first application (for example, Flag1), the recording service occupancy status, and the recording service usage type. Therefore, the application type of the first application is extracted from the permission allocation information of the first application.
[0110] If the priority of the application type of the second application is greater than or equal to the priority of the application type of the first application, the recording service usage permission is allocated to the second application so that the second application can use the recording service. If not, an application failure message is returned to the second application. For example, compare the priority of Flag2 with the priority of Flag1. If the priority of Flag2 is greater than or equal to the priority of Flag1, the recording service usage permission is allocated to the second application.
[0111] Of course, the recording service stack item may contain more than just the permission allocation information of the first application. Since each application that successfully applies for the recording service will generate permission allocation information and put it into the stack, in this scenario, it is determined whether the priority of the second application type is greater than or equal to the priority of all application types in the stack item of the recording service stack.
[0112] If yes, the recording service use permission is allocated to the second application, indicating that the second application successfully applies for the recording service, and the second application uses the recording service. If no, an application failure message is returned to the second application.
[0113] S204: Generate permission allocation information related to the second application, and send the permission allocation information of the second application to the first application through the recording service change callback interface, so that the first application stops using the recording service.
[0114] The permission allocation information of the second application includes at least: the application type of the second application and the recording service occupancy status.
[0115] Specifically, the permission allocation information of the second application includes the following parameters:
[0116] 1. The application type parameter appFlag is: flag2, which indicates the application type of the second application, so that the first application that is recording can know the priority of the second application. Among them, the priority carried by the second application type has an indicative function, which is used to instruct the first application that is recording to take actions related to the priority carried by the second application type, such as turning off the recorder, to avoid privacy leakage when the second application uses the recorder, and to enhance the security of the entire system. Of course, it is also possible to use the recording service at the same time as the second application, and the two can coexist. At this time, the first application performs sound reduction processing.
[0117] 2. The recording service occupation status active is: true, indicating the recording service application status.
[0118] 3. The recording service usage type focusType is: 0, indicating short service recording. The recording service usage type is used to instruct the first application to resume applying for the recording service after the second application stops using the recording service, or to stop applying for the recording service after the second application stops using the recording service. At this time, the recording service usage type focusType is: 0, which is used to instruct the first application to resume applying for the recording service after the second application stops using the recording service.
[0119] 4. The package name of the second application. This parameter can be added or deleted according to actual conditions.
[0120] After generating and assigning permission information for the second application:
[0121] On the one hand, the callback operation for the first application is triggered through the recording service change callback interface, and the permission allocation information of the second application is sent to the first application. Specifically, the permission allocation information of the second application is passed into the recording service change callback interface OnAppFocusWithAppFlagChangedListener(flag2, true, 0), and the recording service change listener void addFocusListenerWithAppFlag() installed by the first application is used to send the permission allocation information of the second application to the first application. According to the application type flag2 in the permission allocation information of the second application and the indication of the recording service occupancy status true, the first application stops the recording service, thereby avoiding the risk of privacy leakage when the intended recording uses the recorder, and enhancing the security of the entire system. In addition, because the recording service usage type of the second application is 0, the first application can also be instructed to resume applying for the recording service after the second application stops using the recording service.
[0122] On the other hand, the permission allocation information of the second application is stored in the recording service stack. And the permission allocation information of the first application is deleted from the recording service stack. Optionally, after deleting the permission allocation information of the first application, the second permission allocation information is located at the top of the stack. Of course, after deletion, it is not ruled out that the permission allocation information of other applications is located before the stack of the permission allocation information of the second application, such as the permission allocation information that was not deleted successfully or was collected by mistake. The processing method of these permission allocation information will be introduced later, and will not be repeated here.
[0123] As an optional implementation, during the process of the second application using the recording service, the recording service application interface is monitored in real time to see whether there are other recording requests from other applications for recording service, and the recording service release interface is monitored in real time to see whether there is a stop recording request from the second application.
[0124] Specifically, when other applications have the need to apply for recording services, they can call the recording service application interface and pass their application type and recording service usage type into the recording service application interface.
[0125] When the second application has a demand to stop the recording service, the second application calls the recording service release interface and transmits a stop recording request to the recording service release interface to indicate the demand of the second application to stop the recording service.
[0126] Specifically, the second application calls the recorder release interface int adandonAppFocusWithAppFlag(), and passes the application type of the second application: Flag2, into the recorder release interface int adandonAppFocusWithAppFlag() to indicate the second application's request to stop using the recording service. At this time, the recorder release interface is: intadandonAppFocusWithAppFlag(Flag2). Of course, the application type parameter appFlag: the application type Flag2 of the second application and the recording service usage type parameter FocusType: 0 can also be passed into the recorder release interface intadandonAppFocusWithAppFlag(). At this time, the recorder release interface is: intadandonAppFocusWithAppFlag(Flag2, 0).
[0127] If the recording service application interface has no other recording requests, and the recording service release interface has the stop recording request, it means that the second application has a demand to stop recording, and no other application has seized the recording service during the recording process of the second application.
[0128] At this time, the application type of the second application is extracted from the stop recording request. For example, when the recorder release interface is: int adandonAppFocusWithAppFlag(Flag2), one parameter is extracted: Flag2. When the recorder release interface is: int adandonAppFocusWithAppFlag(Flag2,0), two parameters are extracted: Flag2,0.
[0129] Based on the application type of the second application, the recording service use permission is revoked from the second application, so that the second application stops using the recording service.
[0130] In the process of reclaiming the right to use the recording service, extract the top application type from the top of the recording service stack; compare whether the application type of the second application is consistent with the top application type. If they are consistent, reclaim the recording service usage permission from the second application. If they are inconsistent, it means that the recorder stack is not empty, and there are other applications whose permission allocation information is located before the second application, such as permission allocation information that has not been successfully deleted or permission allocation information that has been mistakenly collected. The native application focus management class is required to call the recording service change callback interface to trigger the callback operation of executing the permission allocation information, so that the application to which the permission allocation information has not been successfully deleted or the permission allocation information that has been mistakenly collected belongs performs the corresponding action, such as stopping recording. In addition, it is also necessary to delete the permission allocation information that has not been successfully deleted or the permission allocation information that has been mistakenly collected in the stack until the top application type and the second application type match each other.
[0131] The above operation is the implementation logic of controlling the second application to stop the recording service at the system level. On this basis, the first application can also be controlled to resume the application for the recording service or stop the application for the recording service.
[0132] In a specific implementation process, the recording stop request may also carry the recording service usage type of the second application. On this basis, the recording service usage type of the second application is extracted from the recording stop request. The recording service usage type of the second application is used to indicate that the first application resumes applying for the recording service after the second application stops using the recording service, or stops applying for the recording service after the second application stops using the recording service.
[0133] Based on the recording service usage type of the second application, permission release information is generated.
[0134] The permission release information related to the second application includes the following parameters:
[0135] 1. The application type parameter appFlag is: flag2, indicating the application type of the second application.
[0136] 2. The recording service occupation status active is: false, indicating that the recording service is released.
[0137] 3. The recording service usage type focusType is: 0, which means short service recording.
[0138] 4. The package name of the second application. This parameter can be added or deleted according to actual conditions.
[0139] After the permission release information is generated, the callback operation for the first application is triggered through the recording service change callback interface, and the permission release information related to the second application is sent to the first application. Specifically, the permission release information of the second application is passed to the recording service change callback interface OnAppFocusWithAppFlagChangedListener(), and the permission release information related to the second application is sent to the first application in conjunction with the recording service change listener void addFocusListenerWithAppFlag() installed by the first application, so that the first application can resume applying for the recording service after the second application stops using the recording service, or stop applying for the recording service after the second application stops using the recording service.
[0140] For example, the recorder release interface is: int adandonAppFocusWithAppFlag(Flag2, 0), from which the short service recording 0 is extracted, and the permission release information is generated accordingly. Of course, the permission release information can be generated based on the application type of the second application, the recording service occupancy status, and the recording service usage type of the second application. Then the permission release information of the second application is passed to the recording service change callback interface OnAppFocusWithAppFlagChangedListener(flag2, false, 0), and the recording service change listener void addFocusListenerWithAppFlag() installed by the first application is used to send the permission release information related to the second application to the first application, instructing the first application to resume applying for the recording service after the second application stops using the recording service. Therefore, after the first application receives the permission release information, it will resume applying for the recording service.
[0141] The operation of the first application resuming the application for the recording service is similar to the operation of the second application applying for the recording service, which will not be repeated here.
[0142] In this application, after the second application stops using the recording service, the first application is prompted to reapply for the recording service by calling the recording service change callback interface and cooperating with the recording service change listener installed by the first application. There is no need to use SDK interaction to notify the recording service application, which simplifies the cost of recording docking and ensures the security of the entire system.
[0143] If the recording service application interface has other recording requests, and the recording service release interface does not have the stop recording request, it means that other applications have seized the recording service during the recording process of the second application. At this time, the application type of the other application is extracted from the other recording request. Based on the application type of the other application, the recording service usage permission is allocated to the other application so that the other application can use the recording service; the permission allocation information of the other application is generated, and through the recording service change callback interface, in conjunction with the recording service change listener of the second application, the permission allocation information of the other application is sent to the second application so that the second application stops using the recording service. The specific operation process is similar to the operation of the second application applying for the recording service, which will not be repeated here.
[0144] The present invention is described and explained using specific examples below. Figure 3 , which is a schematic diagram of the interaction between the recording services of instant messaging applications, system voice and other applications.
[0145] After the vehicle multimedia host is turned on, the system voice will start with the system. Because the system voice must always respond to the user's voice interaction, the system voice will apply for the recording service immediately after startup, then create a recorder and start recording. At this time, the system voice will hold the recording service.
[0146] When the system is running, the user initiates a call with an instant messaging application. At this time, the instant messaging application needs to use the recording service, so the instant messaging application needs to submit a recording request, apply for the recording service first, and start recording after the application is successful.
[0147] Since in this system, only one application is allowed to hold the permission to use the recording service at the same time, the native application focus management class in the vehicle system will switch the permission to use the recording service to the instant messaging application, and the system voice will lose the permission to use the recording service; at the same time, the native application focus management class calls the recording service change callback interface, cooperates with the recording service change listener configured in the system voice, triggers the execution of the recording service change callback operation of the system voice, and obtains the permission allocation information of the instant messaging application.
[0148] The permission allocation information of the communication application includes three pieces of information: a) appFlag is: Flag2, indicating the application type of the instant messaging application; b) active is true, indicating the recording service application status; c) recording service usage type: 0, indicating a short recording service.
[0149] The system voice stops recording based on these three pieces of information and releases the recorder to prevent information from being leaked when the user is talking on an instant messaging app. Of course, if the two have the same priority, the system voice can also coexist with the instant messaging app, but the volume of the system voice is reduced.
[0150] When the instant messaging app call ends, the instant messaging app will stop recording and release the recorder.
[0151] The native application focus management class obtains a recording stop request from the recording service release interface, and accordingly reclaims the recording service use permission of the instant messaging application, so that the instant messaging application stops recording and releases the recorder.
[0152] In addition, the native application focus management class calls the recording service change callback interface, cooperates with the recording service change listener configured by the system voice, triggers the execution of the recording service change callback operation of the system voice, and obtains the permission release information of the instant messaging application.
[0153] The permission release information of the instant messaging application includes three pieces of information: a) appFlag is: Flag2, indicating the application type of the instant messaging application; b) active is false, indicating the recording service release status; c) recording service usage type: 0, indicating a short recording service.
[0154] The system voice resumes the recording service based on these 3 pieces of information.
[0155] When the system voice resumes the recording service, if other applications apply for the recording service, the native application focus management class checks the priority of the system voice and the priority of other applications for the recording service. If the priority of other applications is lower than that of the system voice, it will return failure. Otherwise, the application is successful, and the recording service change listener configured by the system voice is used to trigger the callback operation of the recording service change of the system voice. The system voice stops recording according to the permission allocation information of other applications and releases the recorder to prevent other applications from using the recording service and leaking information.
[0156] Of course, when the instant messaging application is recording, if other applications apply for recording services, the native application focus management class will still check the priority of the instant messaging application and the priority of other applications applying for recording services. If the priority of other applications is lower than that of the instant messaging application, it will return failure. Otherwise, the application will be successful and the recording service change listener configured by the instant messaging application will be cooperated to trigger the recording service change callback operation of the instant messaging application.
[0157] The above is the implementation logic of how the system responds to the switching of recording service needs between two or more applications. By adding a recording service application interface and a recording service change callback interface in the native application focus management class of the vehicle system, a recording service management strategy based on the vehicle system level is implemented through extremely simple system changes. Without the need to install the SDK in the application, it can well cope with the needs of multiple applications to preempt recording and the problem of chaotic management of multiple application recordings. It not only reduces the recording cost, but also reduces the complexity of system management, thereby meeting the scalability requirements of the system.
[0158] In the second aspect, based on the same inventive concept as the recording management method of the vehicle-mounted system provided in the embodiment of the first aspect, the embodiment of the present invention further provides a vehicle-mounted system, in which a recording service application interface and a recording service change callback interface are added to the native application focus management class of the vehicle-mounted system, see Figure 4 ,include:
[0159] The monitoring module 401 is used to monitor in real time whether the recording service application interface has a recording application request for the recording service by the second application during the process of the first application using the recording service;
[0160] An extraction module 402 is used to extract the application type of the second application from the recording application request, if any;
[0161] An allocating module 403 is used to allocate the recording service use permission to the second application based on the application type of the second application, so that the second application can use the recording service;
[0162] The generating module 404 is used to generate the permission allocation information related to the second application, and send the permission allocation information of the second application to the first application through the recording service change callback interface, so that the first application stops using the recording service.
[0163] It should be noted that the vehicle-mounted system provided by the embodiment of the present invention, wherein the specific manner in which each module performs operations has been described in detail in the method embodiment provided in the above-mentioned first aspect. The specific implementation process can refer to the method embodiment provided in the above-mentioned first aspect, and will not be elaborated in detail here.
[0164] In the third aspect, based on the same inventive concept as the recording management method of the vehicle-mounted system provided in the embodiment of the first aspect mentioned above, the embodiment of the present invention also discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0165] In the fourth aspect, based on the same inventive concept as the recording management method of the vehicle-mounted system provided in the embodiment of the first aspect mentioned above, the embodiment of the present invention also discloses an intelligent car, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the methods described above when executing the program.
[0166] Through one or more embodiments of the present invention, the present invention has the following beneficial effects or advantages:
[0167] The present invention provides a recording management method for an in-vehicle system, an in-vehicle system, a medium and an intelligent car. Secondary development is performed in the native application focus management class CarAppFocusManager of the in-vehicle system, and a recording service application interface and a recording service change callback interface are added. The recording service management strategy based on the in-vehicle system level is implemented through extremely simple system changes and application access. The need for multiple applications to preempt recording can be well met without the need to install an SDK for the application. Not only the complexity of system management is reduced, but also the recording service management cost of the system is reduced. Any application that uses the recording service can be managed extensibly, thereby meeting the scalability requirements of the system recording.
[0168] Furthermore, the solution of the present application changes the problem of chaotic management of multi-application recordings in the current in-vehicle scenario, solves the preemption and coexistence relationship of recorders between applications, and when the management of the recorder is optimized, it can avoid user privacy leakage and enhance the security of the entire system.
[0169] Furthermore, the present application scheme is of great significance in reducing system complexity, improving user experience, enhancing system stability, promoting harmonious interaction among multiple applications, and encouraging developers to follow specifications.
[0170] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0171] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A recording management method for an in-vehicle system, the method being applied to the in-vehicle system, characterized in that: A recording service application interface and a recording service change callback interface are added to the native application focus management class of the vehicle-mounted system, and the method includes: In the process of the first application using the recording service, monitoring in real time whether the recording service application interface has a recording application request of the second application for the recording service; If yes, extracting the application type of the second application from the recording application request; Based on the application type of the second application, assigning the recording service use permission to the second application so that the second application uses the recording service; Generate permission allocation information related to the second application, and send the permission allocation information of the second application to the first application through the recording service change callback interface, so that the first application stops using the recording service.
2. The method according to claim 1, characterized in that The allocating the recording service usage permission to the second application based on the application type of the second application specifically includes: Extracting the application type of the first application from the recording service stack; If it is determined that the priority of the application type of the second application is greater than or equal to the priority of the application type of the first application, the recording service usage permission is allocated to the second application.
3. The method according to claim 1, characterized in that After generating the permission allocation information related to the second application, the method further includes: storing the permission allocation information of the second application in the recording service stack; the permission allocation information of the second application at least includes: the application type of the second application and the recording service occupancy status; The permission allocation information of the first application is deleted from the recording service stack.
4. The method according to claim 1, characterized in that A recording service release interface is added to the native application focus management class; After sending the permission allocation information of the second application to the first application through the recording service change callback interface, the method further includes: In the process of the second application using the recording service, monitoring in real time whether the recording service application interface has other recording requests from other applications for recording service, and monitoring in real time whether the recording service release interface has a stop recording request from the second application; If the recording service application interface has no other recording requests, and the recording service release interface has the stop recording request, extracting the application type of the second application from the stop recording request; Based on the application type of the second application, the recording service use permission is revoked from the second application, so that the second application stops using the recording service.
5. The method according to claim 4, characterized in that After monitoring in real time whether the recording service application interface has other recording requests from other applications for recording services, and monitoring in real time whether the recording service release interface has a stop recording request from the second application, the method further includes: If the recording service application interface has the other recording request, and the recording service release interface does not have the stop recording request, extracting the application type of other applications from the other recording request; Based on the application type of the other application, assigning the recording service use permission to the other application so that the other application can use the recording service; Generate permission allocation information related to the other applications, and send the permission allocation information of the other applications to the second application through the recording service change callback interface, so that the second application stops using the recording service.
6. The method according to claim 4, characterized in that After extracting the application type of the second application from the request to stop recording, the method further includes: Extracting the recording service usage type of the second application from the recording stop request; the recording service usage type of the second application is used to instruct the first application to resume applying for the recording service after the second application stops using the recording service, or to stop applying for the recording service after the second application stops using the recording service; Generate permission release information based on the recording service usage type of the second application; The permission release information is sent to the first application through the recording service change callback interface, so that the first application resumes applying for the recording service after the second application stops using the recording service, or stops applying for the recording service after the second application stops using the recording service.
7. The method according to claim 4, characterized in that The reclaiming the recording service use permission from the second application based on the application type of the second application specifically includes: Extract the top application type from the top of the recording service stack; Comparing whether the application type of the second application is consistent with the application type of the top of the stack; If they are consistent, the recording service usage permission is revoked from the second application.
8. A vehicle-mounted system, characterized in that: The native application focus management class of the vehicle-mounted system has a recording service application interface and a recording service change callback interface added thereto. The vehicle-mounted system includes: A monitoring module, used for monitoring in real time whether the recording service application interface has a recording application request for the recording service by the second application during the process of the first application using the recording service; an extraction module, configured to extract the application type of the second application from the recording application request, if any; an allocating module, configured to allocate the recording service use permission to the second application based on the application type of the second application, so that the second application can use the recording service; The generation module is used to generate permission allocation information related to the second application, and send the permission allocation information of the second application to the first application through the recording service change callback interface, so that the first application stops using the recording service.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. An intelligent car, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.