Voice resource processing method and device, vehicle and storage medium
By automatically downloading and updating voice resource packages at the terminal, the problem of mismatch of the version of the voice assistant product after the USB flash drive is solved, the user experience and security are improved, and the normal use of voice applications and resource updates are realized.
Patent Information
- Application Number
- CN202411152701.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-03
AI Technical Summary
After the USB flash drive is upgraded, the version mismatch of the voice resource package version has affected the normal use of the voice assistant, lack of effective resource version management, and there are problems of security risks and poor user experience.
By providing voice resource download services on the terminal, automatically download and update voice resource packages based on target resource version information and current resource version information, cloud storage management services ensure the security and reliability of resource packages, and provide multi-threaded downloads and breakpoints. Continuing function.
It improves the automation of voice application resource updates, simplifies user operations, avoids version mismatch problems, improves user experience, and reduces user complaints and after-sales maintenance costs caused by resource updates, ensuring the security and stability of resource updates.
Smart Images

Figure CN119068877A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a voice resource processing method, a voice resource processing device, a corresponding vehicle, and a corresponding computer-readable storage medium. Background Art
[0002] Widely used voice assistant products are usually developed and implemented based on intelligent voice solutions. Intelligent voice solutions usually include two parts: intelligent voice software development kit (SDK) and intelligent voice resource package. The intelligent voice SDK provides developers with core functions such as voice recognition and voice synthesis. The intelligent voice resource package usually contains the resource files required for voice recognition and voice synthesis.
[0003] Specifically, the volume of the intelligent voice resource package is relatively large, and it is usually not packaged into the relevant application installation package (Android Package Kit, APK) of the intelligent voice. The main method used is dynamic download and update. However, the current USB flash drive upgrade solution often only considers the upgrade of the application, but ignores the synchronous update of the voice resource package. As a result, after the USB flash drive upgrade, the new voice assistant application may have a version mismatch with the current voice resource package, thus affecting the normal use of the voice assistant. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a voice resource processing method, a voice resource processing device, a corresponding vehicle and a corresponding computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
[0005] The embodiment of the present invention discloses a voice resource processing method, which is applied to a terminal. The method includes:
[0006] Responding to the running instruction of the voice application, obtaining the target resource version information and the current resource version information;
[0007] Automatically downloading a target voice resource package that conforms to the target resource version information according to the target resource version information and the current resource version information;
[0008] After the target voice resource package is downloaded, the voice application is run.
[0009] Optionally, automatically downloading a target voice resource package that complies with the target resource version information according to the target resource version information and the current resource version information includes:
[0010] When the current resource version information and the target resource version information are inconsistent, obtaining current vehicle model information;
[0011] Automatically generate a target voice resource package download request based on the current vehicle model information and the target resource version information;
[0012] Receive a target voice resource package returned by the cloud based on the target voice resource package download request.
[0013] Optionally, the automatically generating a target voice resource package download request based on the current vehicle model information and the target resource version information includes:
[0014] Automatically generating a resource package information query request for the target voice resource package based on the current vehicle model information and the target resource version information;
[0015] Receiving response data returned by the cloud based on the resource package information query request, the response data including at least one or more of the following: resource version information, a download address of a target voice resource package, a size of the target voice resource package, and a checksum value of the target voice resource package;
[0016] A target voice resource package download request is generated based on the download address of the target voice resource package.
[0017] Optionally, the automatically downloading the target voice resource package that conforms to the target resource version information further includes:
[0018] Obtaining a verification value of the target voice resource package;
[0019] If the verification value of the target voice resource package is consistent with the verification value returned by the cloud, the voice resource package corresponding to the current resource version information is deleted;
[0020] And / or, if the verification value of the target voice resource package is inconsistent with the verification value returned by the cloud, the target voice resource package that conforms to the target resource version information is automatically downloaded again.
[0021] Optionally, the target voice resource package download request includes a multi-thread download request; the automatically generating the target voice resource package download request based on the current vehicle model information and the target resource version information includes:
[0022] Acquire the resource size of the target voice resource package, and create multiple threads based on the resource size;
[0023] A first download range is set for each thread for the target voice resource package, and each thread generates a first multi-thread download request based on the first download range, the current vehicle model information and the target resource version information; wherein the resource data downloaded based on the multi-thread download request are stored in a target location in an empty file with the same size as the resource.
[0024] Optionally, the method further includes:
[0025] Recording the first download range and download progress of each thread for the target voice resource package;
[0026] After the interruption is resumed, determining a second download range of each thread based on the download progress and the first download range of the target voice resource package;
[0027] Each thread generates a second multi-thread download request based on the second download range.
[0028] Optionally, the method further includes:
[0029] Displaying an upload operation page, responding to a user's instruction to input resource package information on the upload operation page, and displaying the currently input resource package information; the resource package information includes at least one or more of the following: vehicle model information, version information, and checksum value; wherein the input of the resource package information is used to trigger the cloud to create a version file for storing version information;
[0030] In response to the user's selection instruction for the resource package upload entrance, the voice resource package to be uploaded is displayed;
[0031] In response to a user's confirmation instruction on a resource package upload entry, the voice resource package and the resource package information are uploaded to a cloud; the cloud is used to package and store the voice resource package and the version file.
[0032] The embodiment of the present invention further discloses a voice resource processing device, which is applied to a terminal, and the device includes:
[0033] A version information acquisition module, used to respond to the running instruction of the voice application program and acquire the target resource version information and the current resource version information;
[0034] A resource package download module, used for automatically downloading a target voice resource package that conforms to the target resource version information according to the target resource version information and the current resource version information;
[0035] The application program running module is used to run the voice application program after the target voice resource package is downloaded.
[0036] Optionally, the resource package download module includes:
[0037] The voice resource package download submodule is used to obtain the current vehicle model information when the current resource version information and the target resource version information are inconsistent; automatically generate a target voice resource package download request based on the current vehicle model information and the target resource version information; and receive the target voice resource package returned by the cloud based on the target voice resource package download request.
[0038] Optionally, the voice resource package download submodule includes:
[0039] The voice resource package download unit is used to automatically generate a resource package information query request for the target voice resource package based on the current vehicle model information and the target resource version information; receive response data returned by the cloud based on the resource package information query request, and the response data includes at least one or more of the following: resource version information, download address of the target voice resource package, size of the target voice resource package and verification value of the target voice resource package; based on the download address of the target voice resource package, generate a target voice resource package download request.
[0040] Optionally, the resource package download module further includes:
[0041] The resource package verification submodule is used to obtain the verification value of the target voice resource package; if the verification value of the target voice resource package is consistent with the verification value returned by the cloud, delete the voice resource package corresponding to the current resource version information; and / or, if the verification value of the target voice resource package is inconsistent with the verification value returned by the cloud, automatically download the target voice resource package that conforms to the target resource version information again.
[0042] Optionally, the target voice resource package download request includes a multi-thread download request; and the voice resource package download unit includes:
[0043] A multi-thread download sub-unit is used to obtain the resource size of the target voice resource package and create multiple threads based on the resource size; set a first download range for each thread for the target voice resource package, and each thread generates a first multi-thread download request based on the first download range, the current vehicle model information and the target resource version information; wherein the resource data downloaded based on the multi-thread download request are stored in a target location in an empty file with the same resource size.
[0044] Optionally, the voice resource package downloading unit further includes:
[0045] The breakpoint resume sub-unit is used to record the first download range and download progress of each thread for the target voice resource package; after the interruption is recovered, the second download range of each thread is determined based on the download progress and the first download range of the target voice resource package; each thread generates a second multi-thread download request based on the second download range.
[0046] Optionally, the device further comprises:
[0047] The resource package upload module is used to display the upload operation page, respond to the user's instruction to input the resource package information on the upload operation page, and display the currently input resource package information; the resource package information includes at least one or more of the following: vehicle model information, version information, and verification value; wherein the input of the resource package information is used to trigger the cloud to create a version file for storing version information; respond to the user's instruction to select the resource package upload entrance, and display the voice resource package to be uploaded; respond to the user's instruction to confirm the resource package upload entrance, and upload the voice resource package and the resource package information to the cloud; the cloud is used to package and store the voice resource package and the version file.
[0048] An embodiment of the present invention further discloses a vehicle, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements any one of the voice resource processing methods when executed by the processor.
[0049] The embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any of the voice resource processing methods is implemented.
[0050] The embodiments of the present invention include the following advantages:
[0051] In an embodiment of the present invention, through the voice resource download service provided by the terminal, before running the voice application, the target voice resource package that meets the target resource version information is automatically downloaded according to the target resource version information and the current resource version information, that is, the download and update of the voice resource package is automatically completed before the voice application is initialized, thereby improving the automation level of voice application resource update, simplifying user operations, avoiding the problem of version mismatch between the voice application and the voice resource package, ensuring the normal use of the voice application, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a schematic diagram of an application scenario of voice resource processing provided by an embodiment of the present invention;
[0053] Figure 2is a flow chart of steps of an embodiment of a method for processing voice resources of the present invention;
[0054] Figure 3 It is a schematic diagram of the process of voice resource downloading provided by an embodiment of the present invention;
[0055] Figure 4 is a flowchart of another embodiment of a voice resource processing method of the present invention;
[0056] Figure 5 It is a structural block diagram of an embodiment of a voice resource processing device of the present invention. DETAILED DESCRIPTION
[0057] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0058] The intelligent voice resource package is large in size and is usually not packaged into the intelligent voice-related application installation package. It is mainly updated through dynamic download.
[0059] However, in the related technologies of dynamic download and update, the U disk upgrade solution often only considers the upgrade of the application. After the U disk upgrade, there may be a version mismatch between the new voice assistant application and the current voice resource package, which affects the normal use of the voice assistant; and the voice assistant product lacks an effective management mechanism for resource updates. When there is a need to update the voice resource package, the user needs to manually intervene to download the voice resource package. The operation is complicated and prone to errors, and the user experience is poor. In addition, due to the lack of effective resource version management, the voice assistant may have security risks during the resource update process, such as resource package tampering, version incompatibility and other problems, posing a threat to the stability and security of the voice assistant.
[0060] The embodiment of the present invention uses the voice resource download service provided by the terminal to automatically download the target voice resource package that meets the target resource version information according to the target resource version information and the current resource version information before running the voice application, that is, automatically complete the download and update of the voice resource package before the voice application is initialized, thereby improving the automation of voice application resource updates, simplifying user operations, and improving user experience. Based on the aforementioned optimized resource update process, the problem of version mismatch between the voice application and the voice resource package is avoided, and the normal use of the voice application is guaranteed. Based on this, user complaints and after-sales maintenance costs caused by resource update problems can also be reduced. In addition, through the voice resource storage management service provided by the cloud, the security and stability of resource updates are ensured based on the communication interface and the check value, and the management of resource packages based on version files and check values ensures the security and reliability of resource packages.
[0061] Reference Figure 1 , showing a schematic diagram of an application scenario of voice resource processing provided by an embodiment of the present invention, the voice resource management service solution provided by an embodiment of the present invention involves a voice resource storage management service in the cloud and a voice resource download service in the terminal.
[0062] Among them, the voice resource storage management service in the cloud can be mainly used to upload voice resource packages; the voice resource download service of the terminal, specifically the voice resource download service attached to the voice application, can be mainly used to download voice resource packages from the cloud.
[0063] Specifically, refer to Figure 2 , shows a flow chart of a voice resource processing method embodiment of the present invention, which is applied to a terminal and may specifically include the following steps:
[0064] Step 201, responding to the running instruction of the voice application program, obtaining target resource version information and current resource version information;
[0065] The terminal can provide a voice resource package download service, which can be mainly used to provide a voice resource package that conforms to the current version for the voice application currently installed on the terminal, so that the voice application installed on the terminal can run normally.
[0066] The voice resource download service is attached to a voice application, such as a voice assistant program. The voice resource download service can be run at the very beginning of the voice assistant to automatically download and update the voice resource package before the voice application is initialized.
[0067] Specifically, the terminal may respond to the running instruction of the voice application program and use the voice resource package download service to download a voice resource package that is consistent with the current version of the currently installed voice application program.
[0068] Exemplarily, the running instruction may be automatically generated when the terminal is powered on or unlocked, or may be generated based on a user's touch start operation on a voice application, which is not limited in this embodiment of the present invention.
[0069] Step 202, automatically downloading a target voice resource package that complies with the target resource version information according to the target resource version information and the current resource version information;
[0070] The implementation process of the voice resource download service can be specifically manifested as automatically downloading the target voice resource package that meets the target resource version information according to the target resource version information and the current resource version information.
[0071] The target resource version information refers to the resource version number required by the current voice application, which can be understood as the version number corresponding to the currently installed voice application. It can be specifically determined based on the installation package APK of the voice application. In actual applications, the corresponding version number is written in the code of the voice application APK.
[0072] The current resource version information refers to the version number of the voice resource package currently used locally.
[0073] In an embodiment of the present invention, when the current resource version information is inconsistent with the target resource version information, the voice resource download service can automatically download the target voice resource package that conforms to the target resource version information.
[0074] Optionally, when the current resource version information is consistent with the target resource version information, it means that the version number of the voice resource package currently used locally by the terminal is the same as the resource version number required by the current voice application, and the voice resource package currently used locally can ensure the normal operation of the current version of the voice application.
[0075] Step 203: After the target voice resource package is downloaded, the voice application is run.
[0076] After the target voice resource package is downloaded, it means that the voice resource download service is used to ensure that the current version of the voice application on the terminal can run normally. In the above case, the voice application can be run and the initialization page of the voice application is displayed to the user.
[0077] In a preferred embodiment of the present invention, before downloading the voice resource package through the voice resource download service, the voice resource package can be uploaded to the cloud, and the cloud stores the uploaded voice resource package for subsequent downloading by the terminal.
[0078] Optionally, the voice resource package is uploaded through the voice resource storage management service provided by the cloud.
[0079] Specifically, the cloud-based voice resource storage management service can provide an upload operation page to the terminal, which allows the terminal user to fill in the resource package information of the voice resource package to be uploaded, allows the terminal user to select the voice resource package to be uploaded, and allows the terminal user to upload the voice resource package.
[0080] The implementation process of the terminal uploading the voice resource package can be specifically manifested as displaying the upload operation page. At this time, the user can input instructions for the resource package information on the upload operation page, and the currently input resource package information is displayed.
[0081] Exemplarily, the resource package information to be input may include at least one or more of the following: vehicle model information, version information, and check value. The vehicle model information may refer to the vehicle model, the version information may refer to the resource version number of the voice resource package, and the check value may refer to the MD5 value (Message-Digest algorithm 5, a cryptographic hash value), which can be used to verify the integrity and consistency of the file.
[0082] The upload operation page may provide a resource package upload entry, and the resource package upload entry is used for the terminal user to select the voice resource package to be uploaded and perform the upload operation.
[0083] Specifically, it can respond to the user's selection instruction for the resource package upload entrance, display the voice resource package to be uploaded, and realize the selection of the voice resource package to be uploaded. Then it can respond to the user's confirmation instruction for the resource package upload entrance, upload the voice resource package and resource package information to the cloud, and realize the terminal uploading the voice resource package.
[0084] In actual applications, the resource package upload entry may provide a selection control and an upload control for uploading resource packages from the terminal locally, which are respectively used for the terminal user to select the voice resource package to be uploaded and perform the upload operation, which is not limited in the embodiment of the present invention.
[0085] Optionally, the input of resource package information can be used to trigger the cloud to create a version file for storing version information; the confirmation of the resource package upload entry can be used to trigger the cloud to package and store the voice resource package and version file.
[0086] Exemplarily, the cloud-based voice resource storage management service can create a version file for recording the version number of the voice resource package, assuming it is version.txt, after the terminal user enters the resource package information, especially the version information, on the upload operation page; after the terminal user selects the voice resource package to be uploaded and performs the upload operation, the cloud-based voice resource storage management service can package the aforementioned created version file version.txt and the voice resource package to be uploaded into a compressed package, such as a zip package, and store it on the storage server.
[0087] In one embodiment of the present invention, the step 202, automatically downloading a target voice resource package that conforms to the target resource version information according to the target resource version information and the current resource version information, includes:
[0088] When the current resource version information and the target resource version information are inconsistent, the current vehicle model information is obtained; a target voice resource package download request is automatically generated based on the current vehicle model information and the target resource version information; and the target voice resource package is received from the cloud based on the target voice resource package download request.
[0089] The target resource version information refers to the resource version number required by the current voice application, assuming it is N1; the current resource version information refers to the version number of the voice resource package currently used locally, assuming it is N2.
[0090] like Figure 3 As shown, first, the resource version number N1 required by the voice application and the local version number N2 can be compared. In the case that N1 and N2 are inconsistent, the target voice resource package that meets the target resource version information can be automatically downloaded. At this time, a prompt that resources are being downloaded can also be displayed on the interface to remind the terminal user that new resources are being downloaded, so as to avoid the terminal user mistakenly believing that the voice application has failed to start while waiting for the voice application to run.
[0091] When N1 and N2 are consistent, it means that the version number of the voice resource package currently used locally on the terminal is the same as the resource version number required by the current voice application. The voice resource package currently used locally can ensure the normal operation of the current version of the voice application. At this time, the voice resource download service of the terminal can be terminated.
[0092] Optionally, the cloud-based voice resource storage management service can provide the terminal with a communication interface for obtaining resource package information, such as an HTTPS interface (Hypertext Transfer Protocol Secure, HTTPS interface refers to a network interface that uses the Hypertext Transfer Protocol Secure for communication), and the terminal can query the resource package information based on the aforementioned communication interface.
[0093] Specifically, when the terminal downloads the target voice resource package, it can first automatically generate a resource package information query request for the target voice resource package based on the current vehicle model information and the target resource version information, and send the resource package information query request to the cloud through the above-mentioned HTTPS interface; after receiving the response data returned by the cloud based on the resource package information query request, the terminal can download the target voice resource package based on the response data returned by the cloud.
[0094] The response data returned by the cloud may include at least one or more of the following: resource version information, the download address of the target voice resource package, the size of the target voice resource package, and the checksum of the target voice resource package. The resource version information may refer to the resource version number of the voice resource package; the download address may be used to indicate the storage location of the target voice resource package; and the checksum of the target voice resource package may refer to the MD5 value provided by the cloud when downloading the resource package, which may be used to verify the integrity and consistency of the file.
[0095] In an embodiment of the present invention, the terminal may generate a target voice resource package download request based on the download address of the target voice resource package.
[0096] Optionally, after downloading the target voice resource package, the verification value of the downloaded target voice resource package can be obtained, for example, by calculating the MD5 value of the downloaded target voice resource package. At this time, the verification value of the target voice resource package can be compared with the verification value returned by the cloud, that is, an MD5 comparison is performed.
[0097] In one case, if the checksum of the target voice resource package is consistent with the checksum returned by the cloud, it means that the target voice resource package has not been tampered with or damaged during the transmission process. Figure 3 As shown, at this time, the voice resource package corresponding to the current resource version information (i.e., the old voice resource package) can be deleted, and the downloaded target voice resource package (i.e., the new voice resource package) can be parsed to ensure the normal operation of the voice application while ensuring the security and reliability of the resource package.
[0098] Optionally, after parsing and obtaining the resource package information of the relevant voice resource package, that is, after the download is successful, the voice resource download service can be exited and the voice assistant initialization phase can be entered to run the voice application.
[0099] In another case, if the checksum of the target voice resource package is inconsistent with the checksum returned by the cloud, it means that the target voice resource package has been tampered with or damaged during the transmission process. At this time, the target voice resource package that meets the target resource version information can be automatically downloaded again. It should be noted that there is a limit on the number of times the target voice resource package can be retried. After the number of downloads exceeds the preset number threshold, for example, 3 times, in order to avoid falling into an infinite loop, the download of the target voice resource package is stopped, and a download failure prompt can be displayed on the terminal interface; the setting of the preset number threshold can be determined based on actual conditions, and the embodiment of the present invention does not limit this.
[0100] In actual applications, the voice resource download service downloads voice resource packages. Considering that the resource size of the voice resource package itself is large, and as the voice model resources are updated, the resource size of subsequent voice resource packages will increase. In order to improve the download efficiency, the download service provided by the embodiment of the present invention can also have the capabilities of multi-threaded downloading and breakpoint resumption.
[0101] Among them, the multi-threaded downloading method can be manifested as using the concurrent capabilities of multiple threads to simultaneously download different file parts of the resource package, and then merging the downloaded different file parts into a complete file, which is conducive to making full use of bandwidth and speeding up downloading speed; the breakpoint resumption method can be manifested as even if the network connection is interrupted during the download process, there is no need to restart the download of the entire file, and you only need to resume the download from the last interruption point.
[0102] The implementation of multi-thread download is specifically manifested in that the terminal generates a multi-thread download request to request multi-thread download of the voice resource package.
[0103] Specifically, the resource size of the target voice resource package can be obtained, and multiple threads can be created based on the resource size. Then, the first download range of the target voice resource package can be set for each thread, so that each thread can generate a first multi-threaded download request based on the first download range, current vehicle model information and target resource version information, so as to realize the download of different file parts based on the generated first multi-threaded download request.
[0104] The first multi-thread download request may refer to a general term for download requests initiated by multiple threads.
[0105] Optionally, an empty file is used as a storage container, and resource data downloaded based on multi-threaded download requests can be stored in a target location in the empty file with the same size as the resource.
[0106] Exemplarily, when the terminal downloads the target voice resource, a download task class can be created to manage information such as the download process, download files, and download progress; and initialization file operations can be performed, specifically obtaining the resource package size of the target voice resource package to be downloaded, and then creating an empty file with the same size as the resource package, so that the resource data of the corresponding download range is stored in the corresponding position in the empty file.
[0107] The number of threads created may be determined based on the resource package size of the target voice resource package and the rated maximum download amount of the thread. Specifically, the number of threads created may be calculated based on the resource package size of the target voice resource package and the rated maximum download amount of the thread.
[0108] The download range of each thread can be used to indicate the specific file part of the target voice resource package to be downloaded. For determining the download range of each thread, based on the division strategy of dividing the resource package size of the target voice resource package as evenly as possible among each thread, the file of the target voice resource package can be divided into file parts equal to the number of threads, and each thread is responsible for downloading a file part. For example, assuming that the resource package size of the target language resource package is 8MB and the number of threads created is 4, the resource package size can be divided into 4 file parts, and each thread downloads 2MB.
[0109] For the download range in the multi-threaded download request, it can be implemented by setting the Range header of the HTTP request to request different parts of the file, for example, the first thread requests bytes = 0-2097151 (i.e., the first 2MB), the second thread requests bytes = 2097152-4194303, and so on, and the embodiment of the present invention does not limit this; after the download of different file parts is implemented based on the generated first multi-threaded download request, each thread can read the response data returned by the cloud based on its thread download request, and the response data is the resource data corresponding to the requested file part. At this time, each thread can use the RandomAccessFile class to write the resource data to the target location in the empty file created above.
[0110] The breakpoint resume download method can be an extension of the multi-thread download method.
[0111] In order to achieve breakpoint resumption, the first download range and download progress of each thread for the target voice resource package can be recorded, so that after the interruption is recovered, the second download range of each thread can be determined based on the download progress and the first download range of the target voice resource package, and then each thread can generate a second multi-threaded download request based on the second download range to continue downloading different file parts based on the generated second multi-threaded download request.
[0112] The second multi-thread download request may refer to a general term for download requests initiated by multiple threads after interruption and recovery.
[0113] Exemplarily, based on the multi-threaded download capability, the number of file divisions of the target voice resource package, the size of each file part, and the download progress of each thread during downloading can be saved; after the interruption is recovered, threads can be allocated according to the aforementioned number of file divisions, and the bytes value of the Range header in the HTTP request initiated by each thread can be recalculated according to the download progress and the size of each file part to achieve breakpoint resumption, which is not limited by the embodiments of the present invention.
[0114] It should be noted that in order to avoid terminal users waiting for too long when using voice applications, the voice application on the terminal, such as the voice assistant program, can usually be set to run silently in the background when the terminal is turned on or unlocked, so that the terminal can use the voice resource download service to download the voice resource package. Before the terminal user actually uses the voice assistant program, the download and update of the voice resource package is automatically completed. The embodiments of the present invention do not limit this.
[0115] In an embodiment of the present invention, through the voice resource download service provided by the terminal, before running the voice application, the target voice resource package that meets the target resource version information is automatically downloaded according to the target resource version information and the current resource version information, that is, the download and update of the voice resource package is automatically completed before the voice application is initialized, thereby improving the automation level of voice application resource update, simplifying user operations, avoiding the problem of version mismatch between the voice application and the voice resource package, ensuring the normal use of the voice application, and improving the user experience.
[0116] Reference Figure 4 , shows a flowchart of another voice resource processing method embodiment of the present invention, which is applied to the cloud and may specifically include the following steps:
[0117] Step 401, in response to the confirmation upload instruction of the resource package upload entry, the voice resource package and the version file are packaged and stored;
[0118] The uploading of voice resource packages is achieved through the voice resource storage management service provided by the cloud.
[0119] Specifically, the cloud-based voice resource storage management service can provide an upload operation page to the terminal, which allows the terminal user to fill in the resource package information of the voice resource package to be uploaded, allows the terminal user to select the voice resource package to be uploaded, and allows the terminal user to upload the voice resource package.
[0120] The implementation process of the terminal uploading the voice resource package can be specifically manifested as displaying the upload operation page. At this time, the user can input instructions for the resource package information on the upload operation page, and the currently input resource package information is displayed.
[0121] Exemplarily, the resource package information to be input may include at least one or more of the following: vehicle model information, version information, and check value. The vehicle model information may refer to the vehicle model, the version information may refer to the resource version number of the voice resource package, and the check value may refer to the MD5 value (Message-Digest algorithm 5, a cryptographic hash value), which can be used to verify the integrity and consistency of the file.
[0122] The upload operation page may provide a resource package upload entry, and the resource package upload entry is used for the terminal user to select the voice resource package to be uploaded and perform the upload operation.
[0123] Specifically, it can respond to the user's selection instruction for the resource package upload entrance, display the voice resource package to be uploaded, and realize the selection of the voice resource package to be uploaded. Then it can respond to the user's confirmation instruction for the resource package upload entrance, upload the voice resource package and resource package information to the cloud, and realize the terminal uploading the voice resource package.
[0124] In actual applications, the resource package upload entry may provide a selection control and an upload control for uploading resource packages from the terminal locally, which are respectively used for the terminal user to select the voice resource package to be uploaded and perform the upload operation, which is not limited in the embodiment of the present invention.
[0125] Optionally, the input of resource package information can be used to trigger the cloud to create a version file for storing version information; the confirmation of the resource package upload entry can be used to trigger the cloud to package and store the voice resource package and version file.
[0126] Exemplarily, the cloud-based voice resource storage management service can create a version file for recording the version number of the voice resource package, assuming it is version.txt, after the terminal user enters the resource package information, especially the version information, on the upload operation page; after the terminal user selects the voice resource package to be uploaded and performs the upload operation, the cloud-based voice resource storage management service can package the aforementioned created version file version.txt and the voice resource package to be uploaded into a compressed package, such as a zip package, and store it on the storage server.
[0127] Step 402: respond to the target voice resource package download request sent by the terminal and return the target voice resource package to the terminal.
[0128] Optionally, the cloud-based voice resource storage management service can provide the terminal with a communication interface for obtaining resource package information, such as an HTTPS interface (Hypertext Transfer Protocol Secure, HTTPS interface refers to a network interface that uses the Hypertext Transfer Protocol Secure for communication), and the terminal can query the resource package information based on the aforementioned communication interface.
[0129] Specifically, when the terminal downloads the target voice resource package, it can first automatically generate a resource package information query request for the target voice resource package based on the current vehicle model information and the target resource version information, and send the resource package information query request to the cloud through the above-mentioned HTTPS interface; after receiving the response data returned by the cloud based on the resource package information query request, the terminal can download the target voice resource package based on the response data returned by the cloud.
[0130] The response data returned by the cloud may include at least one or more of the following: resource version information, the download address of the target voice resource package, the size of the target voice resource package, and the checksum of the target voice resource package. The resource version information may refer to the resource version number of the voice resource package; the download address may be used to indicate the storage location of the target voice resource package; and the checksum of the target voice resource package may refer to the MD5 value provided by the cloud when downloading the resource package, which may be used to verify the integrity and consistency of the file.
[0131] In an embodiment of the present invention, the terminal may generate a target voice resource package download request based on the download address of the target voice resource package returned by the cloud, and the cloud may return the target voice resource package corresponding to the target voice resource package download request.
[0132] In actual applications, the voice resource download service downloads voice resource packages. Considering that the resource size of the voice resource package itself is large, and as the voice model resources are updated, the resource size of subsequent voice resource packages will increase. In order to improve the download efficiency, the download service provided by the embodiment of the present invention can also have the capabilities of multi-threaded downloading and breakpoint resumption.
[0133] The target voice resource package download request received by the cloud may include a multi-thread download request. Specifically, each multi-thread download request, that is, the Range header of each HTTP request may be set with different bytes, and the cloud may respond to the thread download request carrying bytes and return the resource data of the corresponding file part in the target voice resource package to the terminal, so that each thread downloads the corresponding file part, and the file parts downloaded by all threads are used to integrate into the complete file of the target voice resource package.
[0134] In an embodiment of the present invention, through the voice resource download service provided by the terminal, before running the voice application, according to the target resource version information and the current resource version information, the target voice resource package that meets the target resource version information is automatically downloaded, that is, the download and update of the voice resource package is automatically completed before the voice application is initialized, thereby improving the automation of voice application resource updates, simplifying user operations, and improving user experience. Based on the aforementioned optimized resource update process, the problem of version mismatch between the voice application and the voice resource package is avoided, and the normal use of the voice application is guaranteed. Based on this, user complaints and after-sales maintenance costs caused by resource update problems can also be reduced. In addition, through the voice resource storage management service provided by the cloud, the security and stability of resource updates are ensured based on the communication interface and the check value, and the management of resource packages based on version files and check values ensures the security and reliability of resource packages.
[0135] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0136] Reference Figure 5 , shows a structural block diagram of an embodiment of a voice resource processing device of the present invention, which is applied to a terminal and may specifically include the following modules:
[0137] The version information acquisition module 501 is used to respond to the running instruction of the voice application program and acquire the target resource version information and the current resource version information;
[0138] The resource package downloading module 502 is used to automatically download the target voice resource package that conforms to the target resource version information according to the target resource version information and the current resource version information;
[0139] The application program running module 503 is used to run the voice application program after the target voice resource package is downloaded.
[0140] In one embodiment of the present invention, the resource package download module 502 may include the following submodules:
[0141] The voice resource package download submodule is used to obtain the current vehicle model information when the current resource version information and the target resource version information are inconsistent; automatically generate a target voice resource package download request based on the current vehicle model information and the target resource version information; and receive the target voice resource package returned by the cloud based on the target voice resource package download request.
[0142] In one embodiment of the present invention, the voice resource package download submodule may include the following units:
[0143] The voice resource package download unit is used to automatically generate a resource package information query request for the target voice resource package based on the current vehicle model information and the target resource version information; receive response data returned by the cloud based on the resource package information query request, and the response data includes at least one or more of the following: resource version information, download address of the target voice resource package, size of the target voice resource package and verification value of the target voice resource package; based on the download address of the target voice resource package, generate a target voice resource package download request.
[0144] In an embodiment of the present invention, the resource package download module 502 may further include the following submodules:
[0145] The resource package verification submodule is used to obtain the verification value of the target voice resource package; if the verification value of the target voice resource package is consistent with the verification value returned by the cloud, delete the voice resource package corresponding to the current resource version information; and / or, if the verification value of the target voice resource package is inconsistent with the verification value returned by the cloud, automatically download the target voice resource package that conforms to the target resource version information again.
[0146] In an embodiment of the present invention, the target voice resource package download request includes a multi-thread download request; the voice resource package download unit may include the following subunits:
[0147] A multi-thread download sub-unit is used to obtain the resource size of the target voice resource package and create multiple threads based on the resource size; set a first download range for each thread for the target voice resource package, and each thread generates a first multi-thread download request based on the first download range, the current vehicle model information and the target resource version information; wherein the resource data downloaded based on the multi-thread download request are stored in a target location in an empty file with the same resource size.
[0148] In one embodiment of the present invention, the voice resource package downloading unit may further include the following units:
[0149] The breakpoint resume sub-unit is used to record the first download range and download progress of each thread for the target voice resource package; after the interruption is recovered, the second download range of each thread is determined based on the download progress and the first download range of the target voice resource package; each thread generates a second multi-thread download request based on the second download range.
[0150] In an embodiment of the present invention, the device provided by the embodiment of the present invention may further include the following modules:
[0151] The resource package upload module is used to display the upload operation page, respond to the user's instruction to input the resource package information on the upload operation page, and display the currently input resource package information; the resource package information includes at least one or more of the following: vehicle model information, version information, and verification value; wherein the input of the resource package information is used to trigger the cloud to create a version file for storing version information; respond to the user's instruction to select the resource package upload entrance, and display the voice resource package to be uploaded; respond to the user's instruction to confirm the resource package upload entrance, and upload the voice resource package and the resource package information to the cloud; the cloud is used to package and store the voice resource package and the version file.
[0152] In an embodiment of the present invention, the voice resource processing device provided by the embodiment of the present invention uses the voice resource download service provided by the terminal to automatically download the target voice resource package that meets the target resource version information according to the target resource version information and the current resource version information before running the voice application, that is, the download and update of the voice resource package are automatically completed before the voice application is initialized, thereby improving the automation level of voice application resource update, simplifying user operations, avoiding the problem of version mismatch between the voice application and the voice resource package, ensuring the normal use of the voice application, and improving the user experience.
[0153] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0154] An embodiment of the present invention further provides a vehicle, comprising:
[0155] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, each process of the above-mentioned voice resource processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0156] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned voice resource processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0157] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0158] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0159] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0160] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0161] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0162] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional 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 embodiments of the present invention.
[0163] Finally, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0164] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0165] A speech resource processing method, a speech resource processing device, a corresponding vehicle and a corresponding computer-readable storage medium provided by the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for processing voice resources, characterized in that: Applied to a terminal, the method comprises: Responding to the running instruction of the voice application, obtaining the target resource version information and the current resource version information; Automatically downloading a target voice resource package that conforms to the target resource version information according to the target resource version information and the current resource version information; After the target voice resource package is downloaded, the voice application is run.
2. The method according to claim 1, characterized in that The step of automatically downloading a target voice resource package that conforms to the target resource version information according to the target resource version information and the current resource version information includes: When the current resource version information and the target resource version information are inconsistent, obtaining current vehicle model information; Automatically generate a target voice resource package download request based on the current vehicle model information and the target resource version information; Receive a target voice resource package returned by the cloud based on the target voice resource package download request.
3. The method according to claim 2, characterized in that The automatically generating a target voice resource package download request based on the current vehicle model information and the target resource version information includes: Automatically generating a resource package information query request for the target voice resource package based on the current vehicle model information and the target resource version information; Receiving response data returned by the cloud based on the resource package information query request, the response data including at least one or more of the following: resource version information, a download address of a target voice resource package, a size of the target voice resource package, and a checksum value of the target voice resource package; A target voice resource package download request is generated based on the download address of the target voice resource package.
4. The method according to claim 1 or 2, characterized in that: The automatic downloading of the target voice resource package that conforms to the target resource version information also includes: Obtaining a verification value of the target voice resource package; If the verification value of the target voice resource package is consistent with the verification value returned by the cloud, the voice resource package corresponding to the current resource version information is deleted; And / or, if the verification value of the target voice resource package is inconsistent with the verification value returned by the cloud, the target voice resource package that conforms to the target resource version information is automatically downloaded again.
5. The method according to claim 2, characterized in that: The target voice resource package download request includes a multi-thread download request; the automatically generating the target voice resource package download request based on the current vehicle model information and the target resource version information includes: Acquire the resource size of the target voice resource package, and create multiple threads based on the resource size; A first download range is set for each thread for the target voice resource package, and each thread generates a first multi-thread download request based on the first download range, the current vehicle model information and the target resource version information; wherein the resource data downloaded based on the multi-thread download request are stored in a target location in an empty file with the same size as the resource.
6. The method according to claim 5, characterized in that The method further comprises: Recording the first download range and download progress of each thread for the target voice resource package; After the interruption is resumed, determining a second download range of each thread based on the download progress and the first download range of the target voice resource package; Each thread generates a second multi-thread download request based on the second download range.
7. The method according to claim 1, characterized in that The method further comprises: Displaying an upload operation page, responding to a user's instruction to input resource package information on the upload operation page, and displaying the currently input resource package information; the resource package information includes at least one or more of the following: vehicle model information, version information, and checksum value; wherein the input of the resource package information is used to trigger the cloud to create a version file for storing version information; In response to the user's selection instruction for the resource package upload entrance, the voice resource package to be uploaded is displayed; In response to a user's confirmation instruction on a resource package upload entry, the voice resource package and the resource package information are uploaded to a cloud; the cloud is used to package and store the voice resource package and the version file.
8. A voice resource processing device, characterized in that: Applied to a terminal, the device comprises: A version information acquisition module, used to respond to the running instruction of the voice application program and acquire the target resource version information and the current resource version information; A resource package downloading module, used for automatically downloading a target voice resource package that conforms to the target resource version information according to the target resource version information and the current resource version information; The application program running module is used to run the voice application program after the target voice resource package is downloaded.
9. A vehicle, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the voice resource processing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the voice resource processing method according to any one of claims 1 to 7 is implemented.
