Word bank management and switching method of multi-language single-chip microcomputer
By adopting incremental ordering entry code management method in microcontrollers, the entry description content is divided into storage areas and mapping areas, and efficient multilingual switching is achieved, which solves the problems of microcontroller resource limitation and cumbersome operation, and improves language switching Efficiency and resource utilization.
Patent Information
- Application Number
- CN202411825459.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-12-12
AI Technical Summary
The Flash and RAM space of the microcontroller is limited, resulting in low size and retrieval speed of the language lexicon, and it is necessary to manually replace the entries in the code one by one. The operation is time-consuming and cumbersome, making it difficult to achieve efficient multilingual switching.
Using incremental sorting of entries, the entries and their description content are divided into storage areas and mapping areas, and the index is realized through entries, supporting USB drive import and online import, simplifying the language switching process, and only need to be sorted and imported. The vocabulary file can complete the language switching.
It improves the efficiency of multilingual switching, reduces resource usage, simplifies operational processes and implementation complexity, and users can flexibly update the vocabulary to achieve more efficient system language management.
Smart Images

Figure CN119292730A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of word library matching and multi-language switching based on a single-chip microcomputer, and in particular refers to a word library management and switching method for a multi-language single-chip microcomputer. Background Art
[0002] Microcontrollers are usually programmed using C language, which makes it difficult to search and identify the language.
[0003] Generally speaking, the Flash and RAM space of a single-chip microcomputer is limited, and the operating efficiency is low. There are high requirements for the size and retrieval speed of the language vocabulary. In addition, due to space limitations, the single-chip microcomputer cannot store too many vocabulary. Therefore, when adding a new language to the single-chip microcomputer, it is faced with the problem of manually replacing the entries in the code one by one, which is time-consuming and cumbersome. Summary of the invention
[0004] The purpose of the present invention is to provide a vocabulary management and switching method for a multi-language single-chip microcomputer to solve the problems existing in the prior art, and is particularly suitable for single-chip microcomputers with limited resources to achieve efficient vocabulary management and switching.
[0005] In order to achieve the above object, the solution of the present invention is: A vocabulary management and switching method for a multi-language single-chip microcomputer, comprising: Step 1: sort all the terms that need to be displayed in a certain language system, assign a unique corresponding term code to each term, the term codes are sorted in ascending order and are not repeated, and these terms and their term codes are uniformly summarized into a vocabulary file in a preset format; Step 2: Bind the corresponding description content displayed on the page or function in the program with the corresponding word barcode in the word library; Step 3, import the word library file into the program chip of the single-chip microcomputer; the program chip is divided into two areas, including a word storage area and a word mapping area; The entry storage area is used to store description content. The Flash address in the entry storage area represents the description of the corresponding entry when the program is running; The entry mapping area is used to store the mapping relationship between the entry barcode and the Flash address in the entry storage area; Step 4: The single chip microcomputer searches for the corresponding word code in the word mapping area, and then determines the word storage address to implement the word indexing; Step 5. When the system needs to switch to a new language, there is no need to replace the entries in the page or function one by one. Just return to step 1, summarize all the entries and their barcodes in the new language vocabulary into a vocabulary file in a preset format and then import them into the system's microcontroller. The microcontroller re-executes step 3 to complete the language switch. During this period, the binding relationship between the barcode and the description content remains unchanged.
[0006] In the step 3, the entry storage area and the entry mapping area are replaced by U disk import, online import and upgrade import to realize the import of the vocabulary file, and the program is not modified.
[0007] Between step 4 and step 5, when it is necessary to synchronize the entry content with the host computer, the single-chip microcomputer transmits the entry code and its corresponding relationship to the host computer through communication, so that the host computer can keep consistent with the display content of the single-chip microcomputer through the entry code.
[0008] After adopting the above technical solution, the present invention has the following technical effects: (1) It can improve the efficiency of multi-language switching. Specifically, by centrally managing the vocabulary, when the system needs to switch languages, there is no need to replace the entries in the pages and functions one by one, which greatly simplifies the operation process. Instead, all entries need to be sorted and unified into a vocabulary file in a preset format, and then imported into the system to complete the language replacement; (2) It can reduce resource usage. By optimizing the storage and unified management of the vocabulary, only one vocabulary needs to be retained on a single machine to meet multi-language requirements, reducing the usage of FLASH and RAM. (3) It can simplify implementation complexity. Through the USB flash drive import, online import and upgrade import functions, users can flexibly update the vocabulary and achieve more efficient system language management. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 The flowchart of a specific embodiment of the present invention. DETAILED DESCRIPTION
[0010] In order to further explain the technical solution of the present invention, the present invention is described in detail below through specific embodiments.
[0011] refer to Figure 1 The figure shows a flowchart of a single-chip multi-language system, including the following contents: ·Multi-language word libraries are imported through "language.csv" or other formats of files; How the imported word library is stored in the on-chip Flash; How the microcontroller (EMS in the figure) matches the entries in the vocabulary; How does the host computer obtain the entry information of the vocabulary based on the word barcode?
[0012] Specifically, the present invention discloses a vocabulary management and switching method for a multi-language single-chip microcomputer, comprising: Step 1: Arrange all the entries that need to be displayed in a certain language (based on the frequency of use, such as Chinese in China), assign a unique corresponding barcode to each entry, the barcodes are sorted in ascending order and are not repeated, and these entries and their barcodes are uniformly summarized in the language.csv or other preset format of the word library file; in this embodiment, please refer to the attached Figure 1 , the preset format includes two columns: the term code (Code) and the term description (Describe); Step 2. Bind the corresponding description (Describe) content displayed on the page or function in the program to the corresponding word barcode in the word library; for example, the description content corresponding to the word barcode 735 is "battery overvoltage alarm value". If the battery protection parameter page in the code needs to display the Chinese description of the setting content "battery overvoltage alarm value", the word barcode 735 can be used instead of "battery overvoltage alarm value"; Step 3, import the word library file into the program chip of the single-chip microcomputer; the program chip is divided into two areas, including a word storage area and a word mapping area; The entry storage area is used to store description content; the Flash address in the entry storage area represents the description of the corresponding entry when the program is running; for example, if the program wants to read the description of "battery overvoltage alarm value", it only needs to read the address content in 0x08008513; The entry mapping area is used to store the mapping relationship between the entry code and the Flash address in the entry storage area; for example, the entry code of "battery overvoltage alarm value" is 735, and the corresponding mapping address is 0x08008513; Step 4: The microcontroller searches for the corresponding word code in the word mapping area, and then determines the word storage address to implement word indexing; for example, the address content in 0x08008513 can be obtained in the word mapping area through the word code 735, and then the word indexing is implemented; Step 5. When the system needs to switch to a new language, there is no need to replace the entries in the page or function one by one. Just return to step 1, summarize all the entries and their barcodes in the new language vocabulary into language.csv or other vocabulary files in a preset format, and then import them into the system's microcontroller. The microcontroller re-executes step 3 to complete the language switch. During this period, the binding relationship between the barcode and the description content remains unchanged, so there is no need to change the code.
[0013] Through the above scheme, the present invention can improve the efficiency of multi-language switching. Specifically, by centrally managing the vocabulary, when the system needs to switch languages, there is no need to replace the entries in the pages and functions one by one, which greatly simplifies the operation process. Instead, all the entries only need to be sorted and unified into "language.csv" or other formats of files, and then imported into the system to complete the language replacement; the present invention can reduce resource usage. By optimizing the vocabulary storage and unified management, only one vocabulary needs to be retained on a single-sided machine to meet multi-language requirements, reducing the usage of FLASH and RAM; the present invention can simplify the implementation complexity. Through the U disk import, online import and upgrade import functions, users can flexibly update the vocabulary to achieve more efficient system language management.
[0014] Specific embodiments of the present invention are shown below.
[0015] In the above step 3, the word library file can be imported by replacing the word storage area and the word mapping area through U disk import, online import and upgrade import, without modifying the program.
[0016] Between the above steps 4 and 5, when it is necessary to synchronize the entry content with the host computer, the single-chip microcomputer transmits the entry code and its corresponding relationship to the host computer through communication, so that the host computer can keep consistent with the display content of the single-chip microcomputer through the entry code.
[0017] The above embodiments and drawings do not limit the product form and style of the present invention. Any appropriate changes or modifications made by ordinary technicians in the relevant technical field should be deemed to be within the patent scope of the present invention.
Claims
1. A method for managing and switching the word library of a multi-language single-chip microcomputer, characterized in that include: Step 1: sort all the terms that need to be displayed in a certain language system, assign a unique corresponding term code to each term, the term codes are sorted in ascending order and are not repeated, and these terms and their term codes are uniformly summarized into a vocabulary file in a preset format; Step 2: Bind the corresponding description content displayed on the page or function in the program with the corresponding word barcode in the word library; Step 3, import the word library file into the program chip of the single-chip microcomputer; the program chip is divided into two areas, including a word storage area and a word mapping area; The entry storage area is used to store description content. The Flash address in the entry storage area represents the description of the corresponding entry when the program is running; The entry mapping area is used to store the mapping relationship between the entry barcode and the Flash address in the entry storage area; Step 4: The single chip microcomputer searches for the corresponding word code in the word mapping area, and then determines the word storage address to implement the word indexing; Step 5. When the system needs to switch to a new language, there is no need to replace the entries in the page or function one by one. Just return to step 1, summarize all the entries and their barcodes in the new language vocabulary into a vocabulary file in a preset format and then import them into the system's microcontroller. The microcontroller re-executes step 3 to complete the language switch. During this period, the binding relationship between the barcode and the description content remains unchanged.
2. The method for managing and switching the vocabulary of a multi-language single-chip computer according to claim 1, characterized in that include: In the step 3, the entry storage area and the entry mapping area are replaced by U disk import, online import and upgrade import to realize the import of the vocabulary file, and the program is not modified.
3. The method for managing and switching the vocabulary of a multi-language single-chip microcomputer according to claim 1, characterized in that include: Between step 4 and step 5, when it is necessary to synchronize the entry content with the host computer, the single-chip microcomputer transmits the entry code and its corresponding relationship to the host computer through communication, so that the host computer can keep consistent with the display content of the single-chip microcomputer through the entry code.
Citation Information
Patent Citations
Word bank editing method and system for voice conversation platform
CN108959436A
Method for automatically switching multiple languages for intelligent wearable system
CN114330248A
Implementation method and equipment for low-cost embedded multi-language database
CN117149744A
Webpack-based method and device for realizing multiple languages of website
CN117667081A
Operation method and apparatus for input method program, and electronic device and storage medium
WO2024222525A1