Voice module firmware upgrading method and device, equipment and storage medium
By dividing functional modules in home appliances and adopting firmware upgrade methods with different upgrade methods, the problems of long upgrade cycle and high failure rate of voice module firmware in the existing technology are solved, and a more efficient upgrade process and user experience improvement are achieved.
Patent Information
- Application Number
- CN202310749371.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2024-12-24
AI Technical Summary
During the firmware upgrade process of voice modules of existing home appliances, the firmware package development, joint debugging and testing cycles are long and take up a large space, resulting in a long upgrade time and a high probability of failure, affecting the user experience.
Different functional modules are divided according to the service conditions of each component of the voice module, and the firmware is independently packaged, and different upgrade methods are adopted according to the target module type during upgrade, sharing Flash space, saving bandwidth and storage space.
It reduces the time for firmware development, testing and joint debugging, reduces the time required for a single upgrade, improves user satisfaction, and meets the needs of frequent upgrades of voice modules.
Smart Images

Figure CN119179507A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of voice technology, and specifically relates to a voice module firmware upgrade method, device, equipment and storage medium. Background Art
[0002] With the continuous improvement of science and technology and the continuous growth of user needs, users have higher and higher requirements for home appliances. Many existing home appliances are equipped with voice functions, which are usually realized by the cooperation of the voice module set in the home appliance and the cloud server.
[0003] In actual applications, the voice function of home appliances needs to be continuously upgraded and optimized to adapt to a variety of application scenarios and user needs. The upgrade and optimization of the voice function of home appliances is usually achieved by upgrading the firmware of the voice module. Existing voice modules are generally upgraded using a single firmware package that integrates all the functions of the entire voice module, that is, all the firmware of the voice module is replaced at one time during the upgrade.
[0004] However, the development, debugging, and testing cycle of such firmware packages is long and they occupy a large amount of space, resulting in long upgrade times and a high probability of upgrade failure, which seriously affects the user experience. Summary of the invention
[0005] The present application provides a voice module firmware upgrade method, device, equipment and storage medium.
[0006] In a first aspect, the present application provides a method for upgrading voice module firmware, wherein the voice module includes a main function module and multiple sub-function modules, and the method includes:
[0007] Obtain a firmware upgrade file sent by a server, wherein the firmware upgrade file includes upgrade information and an upgrade package, wherein the upgrade information is used to indicate a target module to be upgraded;
[0008] Storing the upgrade package in the target Flash space;
[0009] According to the type of the target module to be upgraded, the upgrade is performed through the upgrade package in the Flash space, wherein the main function module and the sub-function module are upgraded in different ways.
[0010] Optionally, the target module is a first sub-function module, the first sub-function module is a non-configuration module, the upgrade package includes a first dynamic library, and the first dynamic library is obtained by encapsulating the upgrade program of the sub-function module;
[0011] The step of upgrading the module by using the upgrade package in the Flash space according to the type of the target module to be upgraded includes:
[0012] If the target module is a first sub-function module, obtaining a second dynamic library associated with the target module in the program running area;
[0013] In the program running area, the first dynamic library is replaced by the second dynamic library, the voice module is restarted, and the association relationship between the first dynamic library and the target module is re-established.
[0014] Optionally, the target module is a main function module, and the upgrade package is a new firmware package that packages the software required for the upgrade;
[0015] The step of upgrading the module by using the upgrade package in the Flash space according to the type of the target module to be upgraded includes:
[0016] If the target module is a main function module, the main function module is upgraded using the new firmware package.
[0017] Optionally, the target module is a second sub-function module, the second sub-function module is a configuration module, and the upgrade package includes a first configuration file; and the upgrading through the upgrade package in the Flash space according to the type of the target module to be upgraded includes:
[0018] If the target module is a second sub-function module, obtaining a second configuration file associated with the target module from a configuration file storage location in the Flash space;
[0019] In the configuration file storage location of the Flash space, the first configuration file replaces the second configuration file, the voice module is restarted, and the association relationship between the first configuration file and the target module is re-established.
[0020] Optionally, before storing the upgrade package in the target Flash space, the method further includes:
[0021] According to the historical upgrade process of the voice module, the size of the first Flash space occupied by the upgrade of the main function module and the size of the second Flash space occupied by the upgrade of each sub-function module are obtained;
[0022] According to the first Flash space size and the plurality of second Flash space sizes, determining a maximum third Flash space size among the first Flash space size and the plurality of second Flash space sizes;
[0023] The target Flash space is determined according to the size of the third Flash space.
[0024] Optionally, determining the target Flash space according to the third Flash space includes:
[0025] Acquiring spatial extension information, where the spatial extension information includes an extension coefficient or an extension margin;
[0026] A target Flash space is determined according to the space expansion information and the third Flash space, so that a size of the target Flash space is larger than that of the third Flash space.
[0027] Optionally, the multiple sub-functional modules include a basic communication module, a network communication module, and a speech recognition front-end algorithm module, and the main functional module is used to implement the application business function of the voice module and coordinate the mutual communication between the sub-functional modules.
[0028] In a second aspect, the present application provides a voice module firmware upgrade device, wherein the voice module includes a main function module and multiple sub-function modules, and the device includes:
[0029] An acquisition module, used to acquire a firmware upgrade file sent by a server, wherein the firmware upgrade file includes upgrade information and an upgrade package, and the upgrade information is used to indicate a target module to be upgraded;
[0030] A storage module, used for storing the upgrade package in the target Flash space;
[0031] An upgrade module is used to upgrade the target module to be upgraded through the upgrade package in the Flash space according to the type of the target module to be upgraded, wherein the main function module and the sub-function module are upgraded in different ways.
[0032] In a third aspect, the present application provides a voice chip device, including: a memory and at least one processor;
[0033] The memory is used to store computer programs;
[0034] The at least one processor is configured to run the computer program stored in the memory to implement the method according to the first aspect.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon;
[0036] When the computer program is executed by a processor, the method according to the first aspect is implemented.
[0037] The voice module firmware upgrade method provided in the present application divides different functional modules according to the business conditions of each component of the voice module, and the firmware required for each functional module is independently packaged. During the firmware upgrade, different functional modules are upgraded separately, and different modules share the same Flash space during the firmware upgrade. The target upgrade method to be adopted for this upgrade is determined according to the type of the target functional module indicated by the upgrade information in the upgrade file, and the upgrade is performed through the upgrade package in the Flash space according to the firmware upgrade code corresponding to the target upgrade method, thereby saving the bandwidth occupied by transmitting the upgrade file and the Flash space for storing the upgrade package, reducing the time required for new firmware development, testing, and joint debugging, meeting the frequent upgrade needs of the voice module under the premise of low bit error rate and low cost, reducing the time required for a single upgrade, and thus improving user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0039] Figure 1 Schematic diagram of the voice module upgrade method provided in this application Figure 1 ;
[0040] Figure 2 Schematic diagram of the voice module upgrade method provided in this application Figure 2 ;
[0041] Figure 3 A structural diagram of a voice module firmware upgrade device provided in this application;
[0042] Figure 4 A schematic diagram of the structure of a voice chip device provided in this application.
[0043] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein, for example.
[0046] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0047] With the continuous improvement of science and technology and the continuous growth of user needs, users have higher and higher requirements for home appliances. Many existing home appliances are equipped with voice functions, which are usually realized by the cooperation of the voice module set in the home appliance and the cloud server.
[0048] In actual applications, the voice function of home appliances needs to be continuously upgraded and optimized to adapt to a variety of application scenarios and user needs. The upgrade and optimization of the voice function of home appliances is usually achieved by upgrading the firmware of the voice module. Existing voice modules are generally upgraded with a single firmware package that integrates all the functions of the entire voice module, that is, all the firmware of the voice module is replaced at one time during the upgrade. In order to achieve increasingly complex voice functions, the firmware of existing voice modules often needs to include program logic code, audio signal processing algorithm code, speech recognition model data, corpus, audio data, etc.
[0049] This results in that when such a firmware upgrade method is used to upgrade the firmware of the voice module, the firmware package size is usually large, the development, joint debugging, and testing cycles required are long, the upgrade time is long, the probability of upgrade failure is high, and a large amount of Flash space is occupied, which seriously affects the user experience. In view of the above problems, the present invention proposes the following technical concept: different functional modules are divided according to the business situations of each component of the voice module, and the firmware required for each functional module is independently packaged. When the voice module firmware is upgraded, the functional modules that need to be upgraded are also different because of different functional requirements. In some upgrade scenarios, only some functional modules need to be upgraded, that is, only the firmware corresponding to the said some functional modules need to be upgraded, and the remaining firmware does not need to be adjusted. In the face of such a scenario, the firmware package used only needs to include the upgraded firmware of the said some functional modules, and during the upgrade process, the firmware that needs to be changed only includes the firmware corresponding to the said some functional modules. Therefore, in the face of such an upgrade scenario, the firmware upgrade method provided by the present invention upgrades the firmware corresponding to the target module according to the target module indicated by the upgrade information in the upgrade file, and adopts different firmware upgrade methods for different types of target modules, which can effectively save the bandwidth occupied by transmitting the upgrade file and the Flash space for storing the upgrade package, meet the upgrade requirements of the voice module under the premise of low bit error rate and low cost, and improve user satisfaction. Microcontroller Unit (MCU), also known as single chip microcomputer or single chip microcomputer, is a chip-level computer that appropriately reduces the frequency and specifications of the central processing unit, and integrates peripheral interfaces such as memory, counter, USB, A / D conversion, UART, PLC, DMA, and even LCD drive circuits on a single chip to form a chip-level computer, which can perform different combination controls for different applications. MCU can be seen in mobile phones, PC peripherals, remote controls, automotive electronics, industrial stepper motors, and robot arm control. Compared with embedded microprocessors, the biggest features of microcontrollers are single-chip, small size, low power consumption, and high reliability. Microcontrollers are the mainstream of the embedded system industry. Embedded System on Chip (SoC) is a system chip that integrates system performance on a single chip. It usually contains one or more microprocessor IP cores, and one or more DSP IP cores can be added according to needs, corresponding peripheral special function modules, and a certain capacity of memory, etc., and is designed and integrated on the chip according to the performance required by the application to become a system operating chip. Its main feature is that the embedded system can run on various types of microprocessors, has good compatibility, and the kernel of the operating system is small and has good effects. The voice module upgrade method provided in the present application is applied to a voice chip device that implements its voice function through an MCU, and its embedded on-chip system includes an operating system and a file system. The MCU responsible for implementing its voice function is collectively referred to as a voice module, and its firmware is stored in the Flash space of the voice chip.
[0050] Figure 1 Schematic diagram of the process of the voice module firmware upgrade method provided in the embodiment of the present application Figure 1 The voice module includes a main function module and multiple sub-function modules, such as Figure 1 As shown, the voice module firmware upgrade method provided in the embodiment of the present application includes:
[0051] S101: Acquire a firmware upgrade file sent by a server, wherein the firmware upgrade file includes upgrade information and an upgrade package, and the upgrade information is used to indicate a target module to be upgraded.
[0052] The target module may be a main function module or a sub-function module, and the upgrade package format corresponding to the main function module is different from the upgrade package format corresponding to the sub-function module.
[0053] The upgrade information may be, for example, a plurality of pre-set upgrade type identifiers. The firmware upgrade program pre-sets the correspondence between various upgrade type identifiers and target functional modules. The target module to be upgraded corresponding to the upgrade type identifier may be determined based on the correspondence.
[0054] Specifically, the voice chip device receives a firmware upgrade instruction sent by the server, and determines whether an upgrade is needed at this time according to the firmware upgrade instruction; if so, the chip boot program is executed, a connection is established with the server, and a firmware upgrade file sent by the server is received.
[0055] It is understandable that since the upgrade is performed in a module-by-module manner, the upgrade file for each upgrade only contains the upgrade information and upgrade package of the target module for this upgrade, which can effectively save the bandwidth occupied by transmitting the upgrade file and the time required for transmitting the upgrade file.
[0056] S102: storing the upgrade package in the target Flash space.
[0057] Specifically, the voice chip device starts to execute the firmware upgrade program, obtains the starting address of the target Flash space, and stores the upgrade package in the firmware upgrade file into the target Flash space according to the starting address.
[0058] S103: Upgrading the module through the upgrade package in the Flash space according to the type of the target module to be upgraded.
[0059] Among them, the main function module and the sub-function module are upgraded in different ways.
[0060] It is understandable that, since the main function module and the sub-function module are responsible for different functions, their firmware are independently packaged and their firmware forms are also different. When upgrading different forms of firmware, different firmware upgrade methods need to be adopted. Therefore, different upgrade methods need to be adopted for the main function module and the sub-function module according to the type of the target module to be upgraded.
[0061] Specifically, the voice chip device reads the upgrade information in the upgrade file, determines the target upgrade method to be adopted for this upgrade according to the type of the target functional module indicated by the upgrade information, and performs the upgrade according to the firmware upgrade code corresponding to the target upgrade method.
[0062] The voice module firmware upgrade method provided in the embodiment of the present application divides different functional modules according to the business conditions of each component of the voice module, and the firmware required for each functional module is independently packaged. When upgrading the firmware, different functional modules are upgraded separately, and the target upgrade method to be adopted for this upgrade is determined according to the type of target functional module indicated by the upgrade information in the upgrade file, and the upgrade is performed through the upgrade package in the Flash space according to the firmware upgrade code corresponding to the target upgrade method, thereby saving the bandwidth occupied by transmitting the upgrade file and the Flash space for storing the upgrade package, reducing the time required for new firmware development, testing, and joint debugging, meeting the frequent upgrade needs of the voice module under the premise of low bit error rate and low cost, reducing the time required for a single upgrade, and thus improving user satisfaction.
[0063] Figure 2 Schematic diagram of the process of the voice module firmware upgrade method provided in the embodiment of the present application Figure 2 The voice module includes a main function module and multiple sub-function modules, such as Figure 2 As shown, the voice module firmware upgrade method provided in the embodiment of the present application includes:
[0064] S201: Acquire a firmware upgrade file sent by a server, wherein the firmware upgrade file includes upgrade information and an upgrade package, wherein the upgrade information is used to indicate a target module to be upgraded;
[0065] The implementation method of step S201 is similar to that of step S101, and will not be described in detail in this embodiment.
[0066] S202: According to the historical upgrade process of the voice module, obtain the size of the first Flash space occupied by the upgrade of the main function module and the size of the second Flash space occupied by the upgrade of each sub-function module.
[0067] Among them, different modules share the same Flash space during firmware upgrade.
[0068] It is understandable that when upgrading the firmware, the target module for each upgrade may be different. Since the upgrade is performed in a module-by-module manner, the upgrade file for each upgrade only contains the upgrade information and upgrade package of the target module for this upgrade. Therefore, different modules can share the same Flash space when upgrading the firmware. That is, the same Flash space for storing the upgrade package can be used by multiple different modules at different times. Therefore, the size of the Flash space for storing the upgrade package only needs to meet the maximum space occupied by the upgrade package of a single functional module to meet the upgrade requirements, effectively saving hardware resources.
[0069] Specifically, the voice chip device reads the upgrade log of the voice module, and obtains the first Flash space size occupied by the upgrade of the main function module and the second Flash space size occupied by the upgrade of each sub-function module recorded in the upgrade log.
[0070] S203: Determine a maximum third Flash space size among the first Flash space size and the multiple second Flash space sizes according to the first Flash space size and the multiple second Flash space sizes.
[0071] Specifically, the voice chip device compares the first Flash space size with multiple second Flash space sizes, and determines the largest third Flash space size therein.
[0072] S204: Determine a target Flash space according to the third Flash space.
[0073] It is understandable that the target Flash space size for storing the firmware upgrade package needs to meet the maximum space required by the upgrade package of a single functional module, so the largest third Flash space size in the historical upgrade process can be used as a reference to determine the target Flash space size for storing the firmware upgrade package during this firmware upgrade. The target Flash space size can be equal to the third Flash space size, or it can be greater than the third Flash space size, that is, it can be considered that the target Flash space size meets the needs of this firmware upgrade package.
[0074] Optionally, space extension information is acquired, and a target Flash space is determined according to the space extension information and the third Flash space, so that a size of the target Flash space is larger than that of the third Flash space.
[0075] Wherein, the spatial extension information includes an extension coefficient or an extension margin;
[0076] It can be understood that the target Flash space size can be equal to the third Flash space size. To further ensure that there is sufficient storage space for the upgrade package, it can also be larger than the third Flash space size. Based on actual experience, a certain margin relative to the third Flash space size can be set for the size of the target Flash space to ensure that the upgrade is successful. Therefore, the space expansion information of the voice chip device can be set to set a certain margin for the size of the target Flash space.
[0077] Specifically, the voice chip device reads the space expansion information, and if the space expansion information is an expansion coefficient, calculates the product of the expansion coefficient and the size of the third Flash space, and uses the product as the size of the target Flash space; if the space expansion information is an expansion margin, calculates the sum of the expansion margin and the size of the third Flash space, and uses the sum as the size of the target Flash space. According to the size of the target Flash space, determine a Flash space in the free Flash space as the target Flash space, whose space size is equal to the size of the target Flash space, and obtain the starting address of the target Flash space.
[0078] S205: Store the upgrade package in the target Flash space.
[0079] The implementation method of step S205 is similar to that of step S102, and will not be described in detail in this embodiment.
[0080] S206: Upgrading the module through the upgrade package in the Flash space according to the type of the target module to be upgraded.
[0081] Specifically, the voice chip device reads the upgrade information in the upgrade file, determines the target upgrade method to be adopted for this upgrade according to the type of the target functional module indicated by the upgrade information, and calls the firmware upgrade code corresponding to the target upgrade method for upgrade according to the preset correspondence between different target upgrade methods and different firmware upgrade codes.
[0082] The upgrade information in the upgrade file may be, for example, different upgrade type identifiers. Different upgrade type identifiers correspond to different target module identifiers, and different functional modules belong to different types. The corresponding relationship is shown in the following table:
[0083] Upgrade Type Corresponding functional modules Module Type 0 Main function module Main function module 1 Sub-function module 1 Sub-function module, non-configuration module 2 Sub-function module 2 Sub-function module, non-configuration module 3 Sub-function module 3 Sub-function module, non-configuration module 4 Sub-function module 4 Sub-function module, configuration module
[0084] The voice chip device reads the upgrade type identifier in the upgrade file, determines the type of the target functional module for this upgrade based on the preset correspondence between the upgrade type identifier and the functional module, and then determines the target upgrade method for this upgrade. According to the preset correspondence between different target upgrade methods and different firmware upgrade codes, the firmware upgrade code corresponding to the target upgrade method is called for upgrading.
[0085] If the target module is the first sub-function module and the first sub-function module is not a configuration module, execute step S207; if the target module is the main function module, execute step S209; if the target module is the second sub-function module and the second sub-function module is a configuration module, execute step S210.
[0086] S207: If the target module is a first sub-function module, and the first sub-function module is not a configuration module, a second dynamic library associated with the target module is obtained in the program running area.
[0087] Wherein, when the target module is the first sub-functional module, the upgrade package includes a first dynamic library, and the first dynamic library is obtained by encapsulating the upgrade program of the sub-functional module.
[0088] Dynamic library is also called dynamic link library (DLL). DLL is a library containing code and data that can be used by multiple programs at the same time. DLL is not an executable file. Dynamic linking provides a way for a process to call functions that are not part of its executable code. The executable code of a function is located in a DLL, which contains one or more functions that have been compiled, linked, and stored separately from the processes that use them. DLL also helps to share data and resources. Multiple applications can access the contents of a single copy of the DLL in memory at the same time. Dynamic library files have the suffix .so under Linux embedded systems.
[0089] It can be understood that since the main function module and the sub-function module are responsible for different functions, their firmware are independently packaged and the forms of their firmware are also different. As multiple sub-function modules of non-configuration modules, their corresponding firmware are multiple dynamic libraries stored in the same Flash space. The dynamic library stores the program code required to execute the corresponding sub-function module. The Flash space does not divide the firmware storage locations of different sub-modules into memory partitions, but distinguishes them through different dynamic libraries and stores them in the same Flash space. Compared with the memory partitioning method, it occupies less Flash space.
[0090] When the firmware of the sub-function module is upgraded, the upgrade package used is a new dynamic library packaged with the adjusted program code. When the target module is the first sub-function module and the first sub-function module is not a configuration module, the firmware that needs to be upgraded is only the firmware corresponding to the sub-function module, that is, the dynamic library corresponding to the sub-function module, and the dynamic library is dynamically loaded into the memory when the program is running. Therefore, it is only necessary to simply replace the original dynamic library with the new dynamic library, that is, obtain the second dynamic library associated with the target module in the program running area, and replace the second dynamic library with the first dynamic library, restart the voice module, and re-establish the association between the first dynamic library and the target module to complete the upgrade without changing other storage contents in the Flash space of the voice chip.
[0091] Specifically, after the verification is passed, the voice chip device reads the dynamic library list of the voice module, and determines the second dynamic library identifier corresponding to the target module based on the correspondence between the preset dynamic library and the sub-function module, and obtains the file path of the second dynamic library in the file directory of the voice module based on the dynamic library identifier.
[0092] Continuing with the above example, the voice chip device reads the upgrade type identifier in the upgrade file, where the upgrade type identifier in the upgrade file is sub-function module 2. Based on the preset correspondence between the upgrade type identifier and the function module, it is determined that the type of the target function module for this upgrade is a sub-function module, and the first sub-function module is a non-configuration module. The target upgrade method for this upgrade is then determined. The dynamic library list of the voice module is read, and based on the preset correspondence between the dynamic library and the sub-function module, the second dynamic library file name corresponding to the target module is determined to be lib2.so. Based on the dynamic library file name, the file path of the dynamic library named lib2.so is obtained in the file directory of the voice module.
[0093] S208: In the program running area, the first dynamic library is replaced by the second dynamic library, the voice module is restarted, and the association relationship between the first dynamic library and the target module is re-established.
[0094] Specifically, the voice chip device searches for and deletes the second dynamic library according to the file path of the second dynamic library, writes the first dynamic library into the file indicated by the file path of the second dynamic library, and specifies the search path of the first dynamic library as the file path of the second dynamic library; restarts the voice module, and the upgrade is completed.
[0095] Continuing with the above example, the voice chip device finds and deletes the second dynamic library according to the file path of the dynamic library named lib2.so, and recreates a dynamic library named lib2.so, whose content is the content of the first dynamic library, and specifies the search path of the newly created dynamic library named lib2.so as the file path of the second dynamic library; restarts the voice module, and the upgrade is completed.
[0096] S209: If the target module is a main function module, the main function module is upgraded using the new firmware package.
[0097] The upgrade package is a new firmware package that packages the software required for the upgrade;
[0098] It is understandable that, since the main function module and the sub-function module are responsible for different functions, their firmware are independently packaged and their firmware forms are also different. As a main function module, its corresponding firmware is the system software stored in the same Flash space as the sub-function module, which is used to realize the application business functions of the voice module and coordinate the mutual communication between the sub-function modules; when the firmware of the main function module is upgraded, the upgrade package used is a new firmware package that packages the software required for the upgrade. When the target module is the main function module, the firmware that needs to be upgraded is the firmware corresponding to the main function module, that is, the system software of the voice module, so the main function module upgrade process needs to be executed at this time.
[0099] Specifically, after the verification is passed, the voice chip enters the power-off process and is reset. After the reset is successful, the Bootloader code is executed to perform a firmware upgrade on the main function module according to the system software in the upgrade package.
[0100] S210: If the target module is a second sub-function module, and the second sub-function module is a configuration module, a second configuration file associated with the target module is obtained from a configuration file storage location in the Flash space.
[0101] Among them, the configuration module is used to design switches for each functional item of the voice module to configure whether each function is enabled and effective. The upgrade package includes a first configuration file, which is a new dynamic configuration file packaged with the switch information of each functional item of the adjusted voice module.
[0102] It can be understood that, since the main function module and the sub-function module are responsible for different functions, their firmwares are independently packaged and their firmware forms are also different. As a sub-function module of the configuration module, its corresponding firmware is a configuration file stored in the same Flash space by the sub-function module, and the configuration file stores the switch information of each function item of the voice module to configure whether each function is enabled and effective; when the configuration module firmware is upgraded, the upgrade package used is a new dynamic configuration file packaged with the switch information of each function item of the voice module after adjustment. When the target module is the first sub-function module and the first sub-function module is the configuration module, the firmware that needs to be upgraded is only the firmware corresponding to the configuration module, that is, the configuration file corresponding to the configuration module, and the configuration file is dynamically loaded into the memory when the configuration program is executed, so it is only necessary to simply replace the original configuration file with the new configuration file, that is, obtain the second configuration file associated with the target module at the configuration file storage, and replace the second configuration file with the first configuration file at the configuration file storage, and restart the voice module, and re-establish the association between the first configuration file and the target module.
[0103] Specifically, after the verification is passed, the voice chip device determines the second configuration file identifier corresponding to the configuration module according to the correspondence between the preset configuration file and the configuration function module, and obtains the file path of the second configuration file from the file directory of the voice module according to the second configuration file identifier.
[0104] S211: In the configuration file storage location of the Flash space, the first configuration file is used to replace the second configuration file, the voice module is restarted, and the association relationship between the first configuration file and the target module is re-established.
[0105] Specifically, the voice chip device searches for and deletes the second configuration file according to the file path of the second configuration file, writes the first configuration into the file indicated by the file path of the second configuration file, and specifies the search path of the first configuration file as the file path of the second configuration file; restarts the voice module, and the upgrade is completed.
[0106] Optionally, the multiple sub-functional modules include a basic communication module, a network communication module, and a speech recognition front-end algorithm module, and the main functional module is used to implement the application business function of the voice module and coordinate the mutual communication between the sub-functional modules.
[0107] Among them, the basic communication module is used to realize the serial communication of the voice module and the access of the voice module to the cloud server; the network communication module is used for the Wi-Fi connection of the voice module, network configuration and other basic functions; the voice recognition front-end algorithm module is used to realize the voice module's processing of voice signals and voice recognition algorithms.
[0108] Optionally, when each module of the voice module needs to be upgraded, each module of the voice module can be upgraded separately in multiple times; if there is sufficient free Flash space, the new firmware corresponding to all functional modules can also be packaged into a whole firmware package for upgrading. The implementation method is similar to steps S207 to S211, and this embodiment will not be repeated here.
[0109] Optionally, the Flash space includes a data backup area: this area stores backup data of each module of the voice module, which is the same as the original firmware content corresponding to each module; when performing a voice module firmware upgrade, if an abnormality occurs in the upgrade process and causes the upgrade to fail, the system can read data from the backup area to start the system after it is powered on again and restore the backup area content to the storage location corresponding to the original target module to ensure that the voice module can still operate normally after the upgrade fails.
[0110] The firmware upgrade method provided in the embodiment of the present application determines the target Flash space size for storing the upgrade package based on the historical upgrade process of the voice module. On the premise of ensuring that the target Flash space size meets the needs of this firmware upgrade package, the Flash space size occupied by the upgrade package is saved as much as possible.
[0111] The firmware upgrade method provided in the embodiment of the present application is upgraded through the upgrade package in the Flash space according to the type of the target module to be upgraded, wherein if the target module is a first sub-function module, the first sub-function module is not a configuration module, the upgrade package is a dynamic library obtained by encapsulating the upgrade program of the sub-function module, and the first dynamic library replaces the second dynamic library; if the target module is a main function module, the main function module is upgraded through the new firmware package, and the upgrade package is a new firmware package in which the software required for the upgrade is packaged; if the target module is a second sub-function module, the second sub-function module is a configuration module, the upgrade package includes a first configuration file, and the first configuration file replaces the second configuration file, which effectively reduces the size of the upgrade file, saves the transmission bandwidth during the upgrade and the Flash space required for storing the upgrade file, reduces the time required for new firmware development, testing, and joint debugging, meets the frequent upgrade needs of the voice module under the premise of low bit error rate and low cost, reduces the time required for a single upgrade, and thereby improves user satisfaction.
[0112] Figure 3 A structural diagram of a voice module firmware upgrade device provided in an embodiment of the present application, wherein the voice module includes a main function module and multiple sub-function modules, such as Figure 3 As shown, the voice module firmware upgrade device includes: an acquisition module 301, a storage module 302, and an upgrade module 303.
[0113] The acquisition module 301 is used to acquire a firmware upgrade file sent by a server, wherein the firmware upgrade file includes upgrade information and an upgrade package, and the upgrade information is used to indicate a target module to be upgraded;
[0114] The storage module 302 is used to store the upgrade package in the target Flash space;
[0115] The upgrade module 303 is used to upgrade the target module to be upgraded through the upgrade package in the Flash space according to the type of the target module to be upgraded, wherein the main function module and the sub-function module are upgraded in different ways.
[0116] Optionally, the target module is a first sub-function module, the first sub-function module is a non-configuration module, the upgrade package includes a first dynamic library, the first dynamic library is obtained by encapsulating the upgrade program of the sub-function module, and the acquisition module 301 is specifically used to acquire a second dynamic library associated with the target module in the program running area when the target module is the first sub-function module and the upgrade package includes the first dynamic library;
[0117] The upgrade module 303 is specifically used to replace the second dynamic library with the first dynamic library in the program running area, restart the voice module, and re-establish the association relationship between the first dynamic library and the target module.
[0118] Optionally, the target module is a main function module, the upgrade package is a new firmware package that packages the software required for the upgrade, and the upgrade module 303 is specifically used to upgrade the main function module through the new firmware package when the target module is the main function module.
[0119] Optionally, the target module is a second sub-function module, the second sub-function module is a configuration module, the upgrade package includes a first configuration file, and the acquisition module 301 is specifically used to acquire a second configuration file associated with the target module from a configuration file storage location in the Flash space when the target module is the second sub-function module and the second sub-function module is a configuration module;
[0120] The upgrade module 303 is specifically used to replace the second configuration file with the first configuration file in the configuration file storage location of the Flash space, restart the voice module, and re-establish the association relationship between the first configuration file and the target module.
[0121] Optionally, different modules share the same Flash space during firmware upgrade, and the acquisition module 301 is further used to acquire the size of the first Flash space occupied by the upgrade of the main function module and the size of the second Flash space occupied by the upgrade of each sub-function module according to the historical upgrade process of the voice module;
[0122] The storage module 302 is specifically configured to determine a maximum third Flash space size among the first Flash space size and the multiple second Flash space sizes according to the first Flash space size and the multiple second Flash space sizes; and determine a target Flash space according to the third Flash space size.
[0123] Optionally, the acquisition module 301 is specifically used to acquire spatial extension information, where the spatial extension information includes an extension coefficient or an extension margin;
[0124] The storage module 302 is specifically configured to determine a target Flash space according to the space expansion information and the third Flash space, so that the size of the target Flash space is larger than that of the third Flash space.
[0125] Figure 4 A schematic diagram of the structure of a voice chip device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the voice chip device 400 includes: at least one processor 401 and a memory 402; in addition, the voice chip device 400 may also have a communication interface 404 for receiving and sending instructions.
[0126] Wherein, the memory 401, the processor 402 and the communication interface 404 are connected via a bus 403;
[0127] The computer program is stored in the memory 401 and is configured to be executed by the processor 402 to implement the present application. Figure 1-Figure 2 The voice module firmware upgrade method provided by any corresponding embodiment;
[0128] Figure 4 The voice chip device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment, and its implementation principle and technical effect are similar and will not be repeated here.
[0129] In addition, this embodiment also provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to implement the voice module firmware upgrade method of the above embodiment.
[0130] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0131] 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, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0133] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform some steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0134] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0135] So far, the technical solution of the present application has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments, and the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application 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 replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A voice module firmware upgrade method, characterized in that: The voice module includes a main function module and multiple sub-function modules, and the method includes: Obtain a firmware upgrade file sent by a server, wherein the firmware upgrade file includes upgrade information and an upgrade package, wherein the upgrade information is used to indicate a target module to be upgraded; Storing the upgrade package in the target Flash space; According to the type of the target module to be upgraded, the upgrade is performed through the upgrade package in the Flash space, wherein the main function module and the sub-function module are upgraded in different ways.
2. The method according to claim 1, characterized in that The target module is a first sub-function module, the first sub-function module is a non-configuration module, the upgrade package includes a first dynamic library, and the first dynamic library is obtained by encapsulating the upgrade program of the sub-function module; The step of upgrading the module by using the upgrade package in the Flash space according to the type of the target module to be upgraded includes: If the target module is a first sub-function module, obtaining a second dynamic library associated with the target module in the program running area; In the program running area, the first dynamic library is replaced by the second dynamic library, the voice module is restarted, and the association relationship between the first dynamic library and the target module is re-established.
3. The method according to claim 1, characterized in that The target module is a main function module, and the upgrade package is a new firmware package that packages the software required for the upgrade; The step of upgrading the module by using the upgrade package in the Flash space according to the type of the target module to be upgraded includes: If the target module is a main function module, the main function module is upgraded using the new firmware package.
4. The method according to claim 1, characterized in that: The target module is a second sub-function module, the second sub-function module is a configuration module, and the upgrade package includes a first configuration file; and the upgrading is performed according to the type of the target module to be upgraded through the upgrade package in the Flash space, including: If the target module is a second sub-function module, obtaining a second configuration file associated with the target module from a configuration file storage location in the Flash space; In the configuration file storage location of the Flash space, the first configuration file replaces the second configuration file, the voice module is restarted, and the association relationship between the first configuration file and the target module is re-established.
5. The method according to claim 1, characterized in that Different modules share the same Flash space during firmware upgrade. Before storing the upgrade package in the target Flash space, the method further includes: According to the historical upgrade process of the voice module, the size of the first Flash space occupied by the upgrade of the main function module and the size of the second Flash space occupied by the upgrade of each sub-function module are obtained; According to the first Flash space size and the plurality of second Flash space sizes, determining a maximum third Flash space size among the first Flash space size and the plurality of second Flash space sizes; According to the size of the third Flash space, a target Flash space is determined.
6. The method according to claim 5, characterized in that The step of determining a target Flash space according to the third Flash space includes: Acquiring spatial extension information, where the spatial extension information includes an extension coefficient or an extension margin; A target Flash space is determined according to the space expansion information and the third Flash space, so that a size of the target Flash space is larger than that of the third Flash space.
7. The method according to claim 1, characterized in that The multiple sub-function modules include a basic communication module, a network communication module, and a voice recognition front-end algorithm module. The main function module is used to implement the application business functions of the voice module and coordinate the mutual communication between the sub-function modules.
8. A voice module firmware upgrade device, characterized in that: The voice module includes a main function module and a plurality of sub-function modules, and the device includes: An acquisition module, used to acquire a firmware upgrade file sent by a server, wherein the firmware upgrade file includes upgrade information and an upgrade package, and the upgrade information is used to indicate a target module to be upgraded; A storage module, used for storing the upgrade package in a target Flash space, wherein different modules share the same Flash space during firmware upgrade; An upgrade module is used to upgrade the target module to be upgraded through the upgrade package in the Flash space according to the type of the target module to be upgraded, wherein the main function module and the sub-function module are upgraded in different ways.
9. A voice chip device, characterized in that: include: memory and at least one processor; The memory is used to store computer programs; The at least one processor is configured to execute the computer program stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon; When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
