Identification resource compilation method, electronic device and storage medium
By compiling recognition resources during the initialization phase of the SDK and judging the user terminal status during the compilation process, the problem of unavailable offline voice functions caused by long compilation time of recognition resources in vehicle scenarios is solved, achieving more efficient resource compilation and better performance. user experience.
Patent Information
- Application Number
- CN202111435241.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-11-29
AI Technical Summary
In car-mounted scenarios, large corpus leads to a long compilation time for identification resources, and users cannot use offline voice functions during the compilation process, affecting the user experience.
New identification resources are compiled during the SDK initialization stage, and after the compilation is successful, determine whether the user terminal is in a dialogue, determine the follow -up processing of the resource based on the judgment results to ensure that the offline voice function is available during the compilation process.
It reduces the number of compilations of offline recognition resources, ensures that all corpora except new corpora can be used normally, shortens the effective time of new recognition resources, and reduces users' perception of the time slice of recognition resource compilation and generation.
Smart Images

Figure CN114064679B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of resource compilation, and in particular relates to a resource identification compilation method, an electronic device and a storage medium. Background Art
[0002] With the enrichment of voice functions, the corpus in offline conversations is increasing, especially in in-vehicle scenarios, where the corpus has basically reached the level of several thousand items. On car computers with insufficient performance, it takes dozens of seconds to compile this amount of recognition corpus resources each time. During these dozens of seconds, users cannot use offline voice (including corpus that has not changed), which greatly affects their offline voice experience.
[0003] When the vocabulary is updated, if you are not in a conversation, the recognition resources will be compiled and generated immediately. During the compilation process, offline recognition cannot be used until the compilation is completed. If you are not in a conversation, the SDK will wait until the conversation ends before compiling. During the compilation process, the compilation ends directly and the voice offline function cannot be used.
[0004] The defect is that the voice offline function cannot be used during the compilation process. This defect is not prominent and not noticeable when there is less corpus. However, as the scenarios become richer and the corpus becomes more and more, users can clearly perceive the problem of not being able to use the voice time slice. Summary of the invention
[0005] The embodiments of the present invention provide a resource identification compilation method, an electronic device and a storage medium, which are used to solve at least one of the above technical problems.
[0006] In a first aspect, an embodiment of the present invention provides an identification resource compilation method for a user terminal, comprising: when a new identification resource needs to be compiled, using a new resource partition to compile the new identification resource, and placing the successfully compiled resource in the new resource partition; in response to the end of the compilation, judging whether the user terminal is in a conversation, and determining the subsequent processing of the successfully compiled resource based on the judgment result.
[0007] In a second aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the identification resource compilation method of any embodiment of the present invention.
[0008] In a third aspect, an embodiment of the present invention further provides a computer program product, wherein the computer program product comprises a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes the steps of the resource identification compilation method of any embodiment of the present invention.
[0009] The method, electronic device and storage medium of the present application can greatly reduce the number of compilation times of offline recognition resources by compiling new recognition resources in the SDK initialization stage. Furthermore, new resource partitions are used to compile new recognition resources, and it is determined whether the user terminal is in a conversation. The subsequent processing of the successfully compiled resources is determined based on the judgment result, so that the offline voice function of the new recognition resources can be used normally during the compilation process, and it is ensured that all corpora except the new corpora can be used normally. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0011] Figure 1 A flowchart of a resource identification and compilation method provided by an embodiment of the present invention;
[0012] Figure 2 A flowchart of another resource identification and compilation method provided by an embodiment of the present invention;
[0013] Figure 3 A partition resource compilation flow chart of a specific example of a resource identification compilation method provided by an embodiment of the present invention;
[0014] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0016] Please refer to Figure 1, which shows a flowchart of an embodiment of the identification resource compilation method of the present application. The identification resource compilation method of this embodiment can be applied to user terminals with voice dialogue functions, such as vehicle-mounted terminals, smart speakers, various service terminals, etc.
[0017] like Figure 1 As shown, in step 101, when a new identified resource needs to be compiled, a new resource partition is used to compile the new identified resource, and the successfully compiled resource is placed in the new resource partition;
[0018] In step 102, in response to the completion of the compilation, it is determined whether the user terminal is in a session, and the subsequent processing of the successfully compiled resources is determined according to the determination result.
[0019] In this embodiment, for step 101, the identification resource compilation device detects that when a new identification resource needs to be compiled, a new resource partition is used to compile the new identification resource, and the successfully compiled resource is placed in the new resource partition. For example, a new resource partition is opened up, and parallel compilation is performed in the new resource partition folder, and the successfully compiled resources are first placed in the new resource partition. Among them, through parallel compilation, the effective time of the new identification resource can be shortened, and the user's perception of the time slice generated by the identification resource compilation is reduced.
[0020] Then, for step 102, the resource compilation device identifies whether the user terminal is in a conversation in response to the completion of the compilation, and determines the subsequent processing of the successfully compiled resources based on the judgment result. For example, if the user terminal is not in a conversation, the successfully compiled resources are updated to the usage path corresponding to the successfully compiled resources. If the user terminal is in a conversation, the successfully compiled resources are updated to the usage path corresponding to the successfully compiled resources after waiting for the user terminal to complete the conversation.
[0021] The method of this embodiment compiles new recognition resources by using new resource partitions, further determines whether the user terminal is in a conversation, and determines the subsequent processing of the successfully compiled resources based on the judgment result, thereby ensuring that the offline voice function of the new recognition resources can be used normally during the compilation process, and ensuring that all corpora except the new corpora can be used normally.
[0022] Further references Figure 2 , which shows a flowchart of another resource identification compilation method provided by an embodiment of the present application. Figure 1 A flowchart of the steps further defined in the process of "determining subsequent processing of the successfully compiled resources according to the judgment result".
[0023] like Figure 2As shown, in step 201, if the user terminal is in a session, a flag bit indicating that the identification resource needs to be updated is set;
[0024] In step 202, in response to the end of the session, the new identification resource is updated to the mark position.
[0025] In this embodiment, for step 201, the identification resource compiling device determines that the user terminal is in a session, and sets a flag bit indicating that the identification resource needs to be updated under the usage path corresponding to the new identification resource.
[0026] Then, for step 202, in response to the end of the session, the identification resource compiling device updates the new identification resource to the mark position.
[0027] The method of this embodiment sets a mark that requires updating of recognition resources when the user terminal is in a conversation, and waits for the user terminal to complete the conversation before updating the new recognition resources to the mark, so that the offline voice function can be used normally during the compilation process of the new recognition resources.
[0028] In the method described in the above embodiment, determining the subsequent processing of the successfully compiled resource according to the judgment result includes:
[0029] If the user terminal is not in a session, the new identification resource is updated to the usage path corresponding to the new identification resource.
[0030] In the method described in the above embodiment, after determining the subsequent processing of the successfully compiled resource according to the judgment result, the method further includes:
[0031] In response to the update being completed, the successfully compiled resources in the new resource partition are deleted.
[0032] The method of this embodiment deletes the successfully compiled resources in the new resource partition after the update is completed, thereby reducing the memory usage of the user terminal and improving the fluency of the user terminal.
[0033] In the method described in the above embodiment, the method is used in the SDK use phase, wherein, in the SDK initialization phase, the method further includes:
[0034] Based on the obtained product ID and product version information, determine whether a new identification resource compilation operation is required, for example, determine whether the product version information of the user terminal is consistent with the latest product version information. If not, a new identification resource compilation operation is required.
[0035] The method of this embodiment can greatly reduce the number of compilations of offline recognition resources by compiling new recognition resources during the SDK initialization phase, and ensure that the offline voice function can be used normally during the compilation of new recognition resources.
[0036] In the method described in the above embodiment, the external factors that trigger the identification resource compilation method include: the user actively calling updatevocab, dynamically switching productID and dynamically updating the product version.
[0037] In the method of any one of the above embodiments, the compiling the new identification resource using the new resource partition includes:
[0038] Open a new resource partition to compile new identification resources, for example, delete the new resource partition after the new identification resources are updated, or open a new resource partition when compiling new identification resources for the first time; or
[0039] The new identification resource is compiled using the pre-set partition for compiling the new identification resource. For example, after the new identification resource is updated, the new identification resource in the new resource partition is deleted.
[0040] In the method described in the above embodiment, the conversation is an offline voice conversation.
[0041] It should be noted that the above method steps are not used to limit the execution order of each step. In fact, some steps may be executed simultaneously or in the opposite order to the specified step order, and this application has no limitation on this.
[0042] The following describes some problems encountered by the inventor in the process of implementing the present invention and a specific embodiment of the solution finally determined, so that those skilled in the art can better understand the solution of the present application.
[0043] In the process of implementing this application, the inventor found that the defects in the prior art are mainly caused by the following reasons:
[0044] With the enrichment of voice functions, the corpus in offline conversations is increasing, especially in in-vehicle scenarios, where the corpus has basically reached the level of several thousand items. On car computers with insufficient performance, it takes dozens of seconds to compile this amount of recognition corpus resources each time. During these dozens of seconds, users cannot use offline voice (including corpus that has not changed), which greatly affects their offline voice experience.
[0045] The inventors also found that artificial intelligence voice is still in its infancy. With the enrichment of scenarios and the continuous improvement of user experience demand, offline statements will only increase and the time to generate recognition resources will become longer and longer.
[0046] The solution of this application is designed and optimized mainly from the following aspects:
[0047] During the SDK initialization phase, the product and version are determined to confirm whether the recognition resources need to be recompiled. During the SDK usage phase, when new recognition resources need to be compiled, a new resource partition is opened up and compilation begins. Compilation is done in parallel in the partition folder, and successfully compiled resources are placed in the partition first. After compilation, it is determined whether the session is currently offline. If so, a flag is set for updating the recognition resources. When the session ends, the latest resources in the partition are updated to the usage path. After the update is complete, the resources in the partition are deleted. If the session is currently silent, the latest resources in the partition are immediately updated to the usage path. After the update is complete, the resources in the partition are deleted.
[0048] This makes it possible to optimize the judgment logic of the SDK for compiling recognition resources and reduce the number of compilations during the SDK initialization phase. During the SDK usage phase, this solves the problem that the offline voice function cannot be used during the compilation process of recognition resources under the existing solution, ensuring the normal use of all corpora except new corpora. During the conversation process, the partitioned parallel compilation solution shortens the effective time of new recognition resources and reduces the user's perception of the time slice for compiling and generating recognition resources.
[0049] Please refer to Figure 3 , which shows a partition resource compilation flow chart of a specific example of the identification resource compilation method provided by an embodiment of the present invention.
[0050] like Figure 3 As shown, step 1: SDK initialization phase, determine whether to start a new solution.
[0051] Step 2: After confirming the new plan, determine whether the compilation operation of the identification resources is required based on the product ID and product version information.
[0052] Step 3: After confirming that new identification resources need to be compiled, open up a new resource partition and start compiling. Compile in parallel in the partition folder and place the successfully compiled resources in the partition first.
[0053] Step 4: After the compilation is completed, determine whether it is currently in an offline conversation. If it is in a conversation, set the mark bit of the identified resources that need to be updated. When the conversation ends, update the latest resources in the partition to the use path. After the update is completed, delete the resources in the partition. If it is currently in a silent state, immediately update the latest resources in the partition to the use path. After the update is completed, delete the resources in the partition.
[0054] The inventors found that a deeper effect was achieved during the process of implementing the present invention:
[0055] Effect 1: During the SDK initialization phase, the number of compilations of offline recognition resources is greatly reduced. This effect is achieved through step 2 (determining whether recognition resource compilation is required based on product ID and product version information). This technology not only optimizes the number of SDK compilations, but also reduces the performance requirements during the SDK initialization phase, speeding up SDK initialization.
[0056] Effect 2: During the SDK usage phase, the problem that offline speech function cannot be used during the compilation process of recognition resources under the existing solution is solved, ensuring the normal use of all corpora except new corpora;
[0057] This effect is achieved through Figure 3 Step 4 (after compilation is completed, determine whether it is currently in an offline conversation. If it is in a conversation, set the mark that needs to update the recognition resources. When the conversation ends, update the latest resources in the partition to the use path. After the update is completed, delete the resources in the partition; if it is currently in a silent state, then immediately update the latest resources in the partition to the use path. After the update is completed, delete the resources in the partition). This technical point not only solves the problem that the SDK cannot speak when compiling new offline recognition resources; it will bring more meaning in different usage scenarios: for example, in the vehicle-mounted car computer scenario, the stable use of voice also improves driving safety.
[0058] In some other embodiments, the present invention also provides a non-volatile computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the resource identification compilation method in any of the above method embodiments;
[0059] As an implementation mode, the non-volatile computer storage medium of the present invention stores computer executable instructions, and the computer executable instructions are configured as follows:
[0060] When a new identified resource needs to be compiled, a new resource partition is used to compile the new identified resource, and the successfully compiled resource is placed in the new resource partition;
[0061] In response to the completion of the compilation, it is determined whether the user terminal is in a session, and subsequent processing of the successfully compiled resources is determined according to the determination result.
[0062] The non-volatile computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the resource identification compilation device, etc. In addition, the non-volatile computer-readable storage medium may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the non-volatile computer-readable storage medium may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the resource identification compilation device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0063] An embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes any one of the above-mentioned resource identification and compilation methods.
[0064] Figure 4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 4 As shown, the device includes: one or more processors 410 and a memory 420, Figure 4 A processor 410 is taken as an example. The device for identifying a resource compilation method may further include: an input device 430 and an output device 440. The processor 410, the memory 420, the input device 430 and the output device 440 may be connected via a bus or other means. Figure 4 In the example, the bus connection is used. The memory 420 is the above-mentioned non-volatile computer-readable storage medium. The processor 410 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 420, that is, the resource compilation method of the above-mentioned method embodiment is realized. The input device 430 can receive input digital or character information, and generate key signal input related to the user setting and function control of the communication compensation device. The output device 440 may include a display device such as a display screen.
[0065] The above product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0066] As an implementation mode, the electronic device is applied to a resource identification compilation device, and is used for a client, and includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can:
[0067] When a new identified resource needs to be compiled, a new resource partition is used to compile the new identified resource, and the successfully compiled resource is placed in the new resource partition;
[0068] In response to the completion of the compilation, it is determined whether the user terminal is in a session, and subsequent processing of the successfully compiled resources is determined according to the determination result.
[0069] The electronic device of the embodiment of the present application exists in various forms, including but not limited to:
[0070] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0071] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0072] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0073] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0074] (5) Other electronic devices with data interaction functions.
[0075] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0076] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for compiling identification resources, used in a user terminal, comprising: When a new identified resource needs to be compiled, a new resource partition is used to compile the new identified resource, and the successfully compiled resource is placed in the new resource partition; In response to the completion of the compilation, determining whether the user terminal is in a conversation, and determining subsequent processing of the successfully compiled resources according to the determination result, wherein the conversation is an offline voice conversation; The subsequent processing of the successfully compiled resources determined according to the judgment result includes: if the user terminal is in a conversation, setting a mark that the identification resource needs to be updated; in response to the end of the conversation, updating the new identification resource to the mark; if the user terminal is not in a conversation, updating the new identification resource to the usage path corresponding to the new identification resource.
2. The method according to claim 1, after determining the subsequent processing of the successfully compiled resource according to the judgment result, the method further comprises: In response to the completion of the update, the successfully compiled resources in the new resource partition are deleted.
3. The method according to claim 1 is used in the SDK use phase, wherein: During the SDK initialization phase, the method further includes: Based on the obtained product ID and product version information, it is determined whether a new identification resource compilation operation is required.
4. The method according to claim 1, wherein: The external factors that trigger the identification resource compilation method include: the user actively calling updatevocab, the dynamic switching of productID and the dynamic update of product version.
5. The method according to any one of claims 1 to 4, wherein: The compiling of the new identification resource using the new resource partition includes: Open a new resource partition to compile the new identified resource; or The new identification resource is compiled using a pre-set partition for compiling the new identification resource.
6. An electronic device, comprising: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method described in any one of claims 1 to 5.
7. A 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 5 are implemented.
Citation Information
Patent Citations
Device and method for updating vehicle controller firmware
CN110187904A
Intelligent backup and restoring system and method for implementing the same
US6205527B1