Report language switching method and related equipment
By assigning a unique identifier to each cell in the report template and managing content using a multilingual terminology database, the problems of storage redundancy and low query efficiency in multilingual reporting systems are solved, enabling real-time and accurate language switching and simplified operation.
Patent Information
- Application Number
- CN202511740267.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-06
AI Technical Summary
Existing technologies in multilingual reporting systems suffer from redundant database storage space and low query loading efficiency. Furthermore, modifications to template layouts or styles are complex and can easily lead to inconsistencies between different language versions.
By assigning a unique identifier to each cell in the report template and storing them in association based on the template identifier, language identifier, and cell identifier, a multilingual term database is used to achieve cell-level content management, reducing redundant storage and improving query efficiency.
It reduces database storage space usage, improves query and loading efficiency, enables real-time fine-grained switching of multilingual reports, avoids content misalignment and operational complexity, and enhances the system's flexibility and reliability.
Smart Images

Figure CN121480461A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method and related equipment for switching report languages. Background Technology
[0002] Reporting systems are tools used for data display and analysis in enterprise information management. Especially in multilingual work environments, reports need to support real-time generation and switching of multiple languages to meet the reading and data entry needs of different users. Typically, a report consists of multiple rows and columns of cells, each carrying a fixed header or content text. In multilingual scenarios, reporting systems need to have the ability to render and interact with the same set of data using different language formats.
[0003] Existing technologies typically achieve multilingual support by storing complete report templates in different languages. This means that a single report template is saved in different languages, and these templates are linked using template and language identifiers. When a user needs to view a report in a different language, they can switch languages by loading the entire template in the corresponding language.
[0004] However, storing a complete template separately for each language leads to data redundancy. As the size of the templates and the number of languages increase, database storage space is heavily consumed, and query and loading efficiency decreases. Secondly, if the layout or style of a report in a certain language template needs to be modified, the operation must be repeated manually on templates in all languages. This is not only highly complex but also prone to causing inconsistencies between different language versions. Summary of the Invention
[0005] Based on the above problems, this application provides a method and related equipment for switching report languages, with the aim of reducing database storage pressure and improving query and loading efficiency.
[0006] Firstly, embodiments of this application provide a method for switching report languages, including:
[0007] Retrieve the cell content entered in the report template for the current language;
[0008] Each cell identifier and its corresponding cell content in the current report template are stored in the multilingual term database, with the language identifier of the current language associated with the template identifier of the report template.
[0009] In response to the report interface operation of switching from the first language to the second language, the corresponding second language term dataset is retrieved from the multilingual term database based on the template identifier of the current report and the language identifier of the second language.
[0010] Based on the cell identifiers in the second language terminology dataset, the cell contents of the second language terminology dataset are filled into the corresponding cells of the report template to display the second language table format.
[0011] In one embodiment, before storing the identifier of each cell in the current report template and its corresponding cell content, and the language identifier of the current language associated with the template identifier of the report template, in a multilingual terminology database, the method further includes:
[0012] In response to the save operation of the report template, the table structure of the report template is traversed;
[0013] Incremental cell identifier allocation is performed on cells in the table structure that have not yet been assigned an identifier, so that each cell has a one-to-one corresponding cell identifier.
[0014] In one embodiment, storing the identifier of each cell in the current report template and its corresponding cell content, and associating the language identifier of the current language with the template identifier of the report template in a multilingual terminology database, includes:
[0015] Each cell identifier and its corresponding cell content in the current report template are combined, and the language identifier of the current language and the template identifier of the report template are combined to form a cell term record.
[0016] Using the template identifier, the cell identifier, and the language identifier as a joint key, data writing operations are performed on the multilingual term database based on the term records in each cell.
[0017] In one embodiment, using the template identifier, the cell identifier, and the language identifier as a composite key, a data writing operation is performed on the multilingual term database based on each cell term record, including:
[0018] Using the composite key formed by the template identifier, the cell identifier, and the language identifier as an index, search the multilingual term database to see if a cell term record corresponding to the composite key already exists;
[0019] If it exists, update the cell entry record in the existing multilingual term database;
[0020] If it does not exist, the cell term record will be stored as a new record in the multilingual term database.
[0021] In one embodiment, the step of responding to a report interface operation that switches from a first language to a second language, and retrieving the corresponding second language term dataset from the multilingual term database based on the template identifier of the current report and the language identifier of the second language, includes:
[0022] In response to the report interface operation of switching from the first language to the second language, the template identifier of the current report and the language identifier of the second language are used as joint query conditions to filter out the target term records corresponding to the template identifier and the language identifier of the second language.
[0023] The obtained target term records are parsed, and the cell identifiers and corresponding cell contents in each target term record are constructed into a key-value pair mapping structure.
[0024] All key-value pair mapping structures are encapsulated into data objects for page population and output as a second language term dataset.
[0025] In one embodiment, the step of filling the cell content of the second language terminology dataset into the corresponding cell of the report template according to the cell identifier in the second language terminology dataset to display the second language table format includes:
[0026] For each cell in the report template, the matching cell content is searched in the second language term dataset using its cell identifier;
[0027] The matched cell content is filled into the corresponding cells, and the front-end cell value is updated to refresh the second language table display.
[0028] In one embodiment, after filling the cell content of the second language term dataset into the corresponding cell of the report template according to the cell identifier in the second language term dataset to display the second language table format, the method further includes:
[0029] If a change in the table structure of the report template is detected, a new cell identifier is assigned to the newly added cell, and the cell entry record in the multilingual glossary database is updated synchronously for the cells affected by the table structure change.
[0030] In one embodiment, before obtaining the cell content entered for the current language in the report template, the method further includes:
[0031] Presents a report interface that includes a multilingual switching control, wherein the multilingual switching control is configured with multiple language options;
[0032] Before the operation of switching from a first language to a second language in response to the report interface operation, and querying the corresponding second language term dataset from the multilingual term database based on the template identifier of the current report and the language identifier of the second language, the method further includes:
[0033] Receive interaction events between the report interface and the multilingual switching control, wherein the interaction events carry a language identifier of the selected second language;
[0034] Based on the interaction event, a language switching instruction is generated to switch from the current first language to the second language, thereby triggering the report interface operation to switch from the first language to the second language.
[0035] Secondly, embodiments of this application also provide a report language switching device, including:
[0036] The cell content retrieval unit is used to retrieve the cell content entered in the report template for the current language.
[0037] The term storage unit is used to store the identifier of each cell in the current report template and its corresponding cell content, wherein the language identifier of the current language is associated with the template identifier of the report template and stored in the multilingual term database;
[0038] The language switching unit is used to respond to the report interface operation of switching from the first language to the second language, and to query the corresponding second language term dataset from the multilingual term database according to the template identifier of the current report and the language identifier of the second language.
[0039] The report interface update unit is used to fill the cell content in the second language term dataset into the corresponding cell of the report template according to the cell identifier in the second language term dataset, so as to display the second language table.
[0040] Thirdly, embodiments of this application also provide a computer device, including:
[0041] Central processing unit, memory, input / output interfaces;
[0042] The memory is either a short-term storage memory or a persistent storage memory;
[0043] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform any of the above-described report language switching methods.
[0044] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it performs the report language switching method described in any of the above-mentioned embodiments.
[0045] Fifthly, embodiments of this application also provide a computer program product having a computer program / instruction stored thereon, which, when executed by a processor, is used to implement the report language switching method described in any of the above-mentioned embodiments.
[0046] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0047] This application manages content in different languages within the same report template by assigning a cell identifier to each cell in the report template and storing them in association based on the template identifier, language identifier, and cell identifier. Unlike existing technologies that copy and switch entire tables by language, this application stores and maps multilingual content at the cell level. This eliminates the need to reload the entire table template when switching languages; instead, it retrieves the corresponding term dataset based on the current report's template identifier and language identifier, and then refills the content back into the template according to the cell identifier, enabling real-time, fine-grained language switching. This technical solution avoids the redundancy caused by repeated storage of multilingual report templates in existing technologies, significantly reducing database storage space usage. Furthermore, because multilingual content is managed independently at the cell level, database query pressure is reduced, and full template rendering is unnecessary during language switching, improving response speed and operational efficiency. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0049] Figure 1 A schematic diagram of a system architecture provided for an embodiment of this application;
[0050] Figure 2 A flowchart illustrating a report language switching method provided in this application embodiment;
[0051] Figure 3 This is a schematic diagram of a report language switching interface provided in an embodiment of this application;
[0052] Figure 4 A schematic diagram of a report interface for displaying Chinese language tables, provided for an embodiment of this application;
[0053] Figure 5 A schematic diagram of a report interface for displaying an English language table, provided as an embodiment of this application;
[0054] Figure 6 A schematic diagram of a report language switching device provided in this application embodiment;
[0055] Figure 7 This is a schematic diagram of a computer device structure provided in an embodiment of this application. Detailed Implementation
[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] The method provided in this application embodiment can be applied to, for example, Figure 1 In the system architecture shown, terminal 102 communicates with server 101 via a network, and data storage system 100 stores data that server 101 needs to process or requires. Data storage system 100 can be integrated onto server 101 or located on the cloud or other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, such as smartwatches, smart bracelets, and head-mounted devices. Server 101 can be implemented using a standalone server or a server cluster composed of multiple servers. In this embodiment, data storage system 100 can be a standalone physical storage server, a distributed storage system composed of multiple storage nodes, or a cloud storage system providing services such as object storage, relational databases, cache databases, cloud databases, and cloud storage. For example, data storage system 100 can be implemented using a distributed file system (such as HDFS), NoSQL databases (such as MongoDB and Redis), relational databases (such as MySQL and PostgreSQL), or cloud storage services; the specific type of data storage system 100 can be flexibly configured according to the actual deployment environment and business needs, but is not limited to the above examples.
[0058] The data storage system 100 can be used to store data associated with report templates, language entries, and cell identifiers, including a multilingual dictionary database to support the multilingual switching capabilities of this application. The multilingual dictionary database can be implemented as an independent logical database within the data storage system 100, or as a functional module of an existing database within the data storage system 100. The multilingual dictionary database is primarily used to persistently store the association information of template identifiers, cell identifiers, language identifiers, and corresponding cell content, in order to construct fine-grained cross-language dictionary mapping relationships. This ensures that, while maintaining the original template structure, rapid switching between different language table formats can be achieved through a combination of cell identifiers, template identifiers, and language identifiers.
[0059] Specifically, the multilingual term database can be implemented using relational databases, key-value databases, or distributed storage clusters. For example, in a relational database scenario, a term table containing template ID, cell ID, language ID, and content fields can be defined through a table structure, and a composite index based on "template ID + cell ID + language ID" can be created to optimize query performance. In a key-value database scenario, high-concurrency read and write access can be achieved using "template ID: cell ID: language ID" as the key-value format. The data storage system 100 can further cooperate with a caching system (such as Redis) to accelerate frequently accessed term data, thereby achieving millisecond-level term retrieval and front-end refresh when a user triggers a language switch.
[0060] Terminal 102 is used to receive the interactive interface and display content of the application deployed on server 101, and can perform operations such as editing and language switching on report templates.
[0061] Server 101 is deployed with a corresponding server-side application for performing the report language switching provided in this application. Specifically, it retrieves the cell content input for the current language in the report template; associates and stores the identifier of each cell in the current report template with its corresponding cell content, and the language identifier of the current language with the template identifier of the report template, in a multilingual vocabulary database; in response to a report interface operation switching from the first language to the second language, it queries the corresponding second language vocabulary dataset from the multilingual vocabulary database based on the template identifier of the current report and the language identifier of the second language; and, based on the cell identifiers in the second language vocabulary dataset, it fills the corresponding cells in the report template with the cell content from the second language vocabulary dataset to display the second language table format. Server 101 can return the template rendering data after language switching to terminal 102 in real time for user viewing and interaction.
[0062] It should be noted that the method provided in this application can be executed independently on the server side, independently on the terminal device side, or jointly by the terminal device and the server. For example, the terminal can generate cell identifiers locally and send them to the server, the server performs multilingual data storage and query operations, and the terminal receives and renders the corresponding language table format. Figure 1 The system architecture shown in the embodiments is intended to more clearly illustrate the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0063] The method of this application will be further described in detail below, and some specific possible implementation examples will be provided.
[0064] This application provides a method for switching report languages, such as... Figure 2 As shown, the method includes steps S201-S204.
[0065] S201: Retrieve the cell content entered in the report template for the current language;
[0066] In this embodiment, the current language is the language selected by the user in the current report interface. It is understood that the report template contains multiple cells, each used to store header text, descriptive information, or data field labels. When the user edits the report template, the text content of each cell entered by the user is collected through the front-end editing component or report rendering engine, and the identity of the cell being edited is confirmed by the cell identifier. This cell identifier can be an auto-incrementing number or an identifier generated based on preset rules to avoid the risk of the identifier becoming invalid due to changes in rows and columns caused by relying on cell coordinates.
[0067] S202: Store the identifier of each cell in the current report template and its corresponding cell content, as well as the language identifier of the current language and the template identifier of the report template, in the multilingual term database;
[0068] Template identifiers are used to distinguish different templates globally; language identifiers can be language type codes that follow industry standards, such as "zh-CN" representing Simplified Chinese; cell identifiers are used to identify the cell location entity within the template, and can be codes generated according to preset rules, such as Universally Unique Identifiers (UUIDs) or combined IDs (identifiers) generated based on the template identifier and row / column index of the report template. Cell identifiers are bound to attributes such as the cell's position and format within the template, but are independent of the specific language content, thus achieving separation between cell identifiers and cell language content. In actual storage, the above four-tuple information—template identifier, cell identifier, language identifier, and cell content obtained from step S201—can be stored as a complete term record in the multilingual term database.
[0069] S203: In response to the report interface operation of switching from the first language to the second language, query the corresponding second language vocabulary dataset from the multilingual vocabulary database based on the template identifier of the current report and the language identifier of the second language;
[0070] If the language switching control (such as a drop-down menu) on the report interface triggers a switch from the first language to the second language, the system retrieves the current report template identifier and the language identifier corresponding to the user's selected language. The first language represents the current display language before the switch, and the second language represents the intended target language. Then, using the current report template identifier and the language identifier of the user-selected second language as query conditions, a structured query statement (such as an SQL query) is submitted to the multilingual glossary database to retrieve the stored glossary records. The resulting dataset is the set of all cell glossary records that simultaneously satisfy the specified template and the specified target language.
[0071] S204: Based on the cell identifiers in the second language terminology dataset, fill the cell contents of the second language terminology dataset into the corresponding cells of the report template to display the second language table format.
[0072] The system iterates through each cell of the current report template and searches for matching records in the second language vocabulary dataset based on the cell identifier. When a matching vocabulary is found, the vocabulary content is written to the target cell, thus replacing the language content. If no matching vocabulary is found in a cell, the original content can be retained, the cell can be left blank, or the cell can be processed according to preset rules. After the population operation is complete, the updated cell content is synchronized to the front-end rendering layer, so that the report interface immediately displays the corresponding language table format, enabling real-time switching and display of multilingual reports.
[0073] Upon receiving the second language terminology dataset returned in step S203, the system begins iterating through each cell in the current report template. For each cell, its unique cell identifier is read and used as the lookup key to perform a matching search within the second language terminology dataset to locate the content that should be displayed in the target language. When a match is found, the second language text content from the dataset is filled into the cell, and a command is immediately sent to the report's front-end rendering engine to update the cell's display value.
[0074] This application embodiment splits the content of each cell in the report into multiple term records and stores them together using the template identifier, language identifier, and cell identifier of the report template. This allows the table structure of the template to be separated from the language content in the template table, thereby reducing data redundancy in multilingual report templates and reducing database storage usage. Since the entire process only involves replacing text content without reloading the entire template file or changing the report structure, real-time switching in user visual perception can be achieved, ultimately presenting the second language report format completely on the user's report interface.
[0075] In one embodiment, before storing the identifier of each cell in the current report template and its corresponding cell content, and the language identifier of the current language and the template identifier of the report template in the multilingual term database, the method further includes: in response to the save operation of the report template, traversing the table structure of the report template; incrementally assigning cell identifiers to cells in the table structure that have not yet been assigned identifiers, so that each cell has a one-to-one corresponding cell identifier.
[0076] In response to a save operation on the report template, a traversal of the overall table structure of the current report template is performed to establish an enumerable set of cell nodes. The save operation can be triggered by the user clicking the save button on the report interface, or it can be an automatic save operation executed at preset time intervals according to a predefined strategy. The save operation essentially saves the current table structure of the report interface; the table structure can be understood as a data model defining the layout and composition of the report template in memory or persistent storage; the table structure includes a two-dimensional cell matrix composed of rows and columns, where each cell can contain specific text content or be empty. By traversing the table structure of the report model, each cell is accessed sequentially from top to bottom and from left to right, analyzing whether each cell already has a corresponding cell identifier, thereby identifying the set of identified cells with assigned cell identifiers and the set of unidentified cells without assigned cell identifiers. For example, in a 3×3 sample report template, if the first column, first row A1 and the first column, second row A2 already have cell labels while the remaining cells do not, the traversal phase will output two sets: {A1(ID=C001), A2(ID=C002)} and {A3, B1, ..., C3}.
[0077] After obtaining the set of unidentified cells, incremental cell identifier allocation is performed on this set. Incremental allocation means that only cells without assigned identifiers are given new identifiers, while cells with assigned identifiers retain their original identifiers. For example, in the 3×3 template above, C003, C004, ..., C009 are generated sequentially for A3, B1...C3 and stored in the table structure of the report template. At this point, each cell has a unique identifier.
[0078] In traditional multilingual reporting, cell identification and language-specific text content are typically determined by row and column coordinates. For example, in a report template, the cell displaying the product name might initially be located at B2. Traditional methods associate the Chinese and English text of the product name with cell B2 respectively, retrieving the value from B2 when switching languages (i.e., obtaining the text content corresponding to the user's selected language). However, if the user adjusts the report template structure, such as inserting a new column before column B that moves the original B2 cell to C2, the traditional reporting system will still look up the corresponding language text content based on the old coordinates B2. This results in the product name not displaying correctly in C2, while B2 may display incorrect text or be empty, leading to language switching errors, content misalignment, or data inconsistencies. As the number of column, row, or area adjustments increases, these misalignments and maintenance costs accumulate exponentially, severely impacting the reliability and maintainability of multilingual reports. Furthermore, in traditional technology, in order to ensure that the cell content can be displayed correctly and to avoid the above problems, it is necessary to manually check and correct the report template corresponding to each language. However, this is prone to new errors such as misfilling or omission, and the time cost is also high.
[0079] In contrast, this application decouples cell identity from table coordinates by assigning a unique and stable cell identifier to each cell. Taking the product name as an example, its initial position is B2, corresponding to the cell identifier cellid=C_1001. This application binds the product name entries in each language to cellid=C_1001, rather than binding them to the B2 coordinate. When a new column is added before column B, causing the cell position to change from B2 to C2, cellid=C_1001 remains unchanged. That is, the cell identifier corresponding to cell C2 is updated to cellid=C_1001. This accurately matches the cell content for the corresponding language and correctly fills it into the new position C2, thus avoiding content misalignment problems caused by table structure adjustments. Therefore, this application's solution maintains the stability and consistency of multilingual text content mapping even when the template structure changes dynamically, effectively reducing maintenance costs and improving the accuracy, flexibility, and reliability of report language switching.
[0080] To ensure that cell terminology records from different templates, cells, and languages can be effectively distinguished and accurately retrieved, in one embodiment, each cell identifier and its corresponding cell content in the current report template, along with the language identifier of the current language and the template identifier of the report template, are associated and stored in a multilingual terminology database. This includes: constructing each cell identifier and its corresponding cell content in the current report template, along with the language identifier of the current language and the template identifier of the report template, into a cell terminology record; and using the template identifier, cell identifier, and language identifier as a composite key, performing data writing operations on the multilingual terminology database based on each cell terminology record.
[0081] Once each cell in the established report template has a cell identifier, the text content entered in each cell under the current language is extracted as the cell content, such as the table header name, field description, or data label text. Simultaneously, the template identifier of the current template and the language identifier corresponding to the current language are read. The cell identifier, cell content, template identifier, and language identifier are combined to form a structured data item. This data item is a complete cell term record. A cell term record can be understood as the smallest data carrier at the database level representing all the text content of a specific cell under a specific language; that is, the text content of a cell in a template corresponding to a specific language. For example, if the template ID is T001, the cell ID is C005, the language is Chinese (zh-CN), and the cell content is "income," then the constructed cell term record could be in the format (T001, C005, zh-CN, income).
[0082] After obtaining the aforementioned cell term records, a data write operation is performed on the multilingual term database using the template identifier, cell identifier, and language identifier as a composite key. This ensures that each cell term record is globally independent within the database and does not conflict with other cell term records. The composite key is a unique identifier composed of multiple fields, used at the database level to ensure that no two records simultaneously have the same template identifier, cell identifier, and language identifier, thereby avoiding the problem of duplicate or overwritten cell term records.
[0083] To avoid data confusion or overwriting errors between different languages, templates, and cells, in one embodiment, a composite key is used for template identifier, cell identifier, and language identifier. Data writing operations are performed on the multilingual vocabulary database based on each cell's vocabulary record. This includes: using the composite key formed by template identifier, cell identifier, and language identifier as an index, searching whether the multilingual vocabulary database already contains a cell vocabulary record corresponding to the composite key; if it exists, updating the existing cell vocabulary record in the multilingual vocabulary database; if it does not exist, storing the cell vocabulary record as a new record in the multilingual vocabulary database.
[0084] Based on the foregoing embodiments, it can be understood that the composite key constructed from the combination of template identifier, cell identifier, and language identifier can avoid the risk of record confusion or overwriting errors in scenarios involving multiple templates, multiple languages, and structural changes. Therefore, before writing data, this composite key can be used as an index to perform a retrieval operation in the multilingual term database to determine whether a matching cell term record already exists, thereby logically distinguishing between updating existing cell term record content and adding new cell term record content. For example, when the composite key is (T001, C005, zh-CN), the term record is first located in the multilingual term database based on this composite key to determine whether the cell with cellid C005 under template T001 already has an existing cell term record content in the Chinese language.
[0085] If the search results show that a cell entry record that perfectly matches the current union key already exists in the multilingual dictionary database, it means that the cell under this template already has content in that language version. In this case, the original cell entry record will be overwritten and updated based on the latest user input or updated content, thereby ensuring that when a user modifies a language entry, the multilingual dictionary database always retains the latest content of the current version.
[0086] Conversely, if no corresponding cell term record is found in the multilingual term database using the composite key, the current cell term record is written as a completely new record to the multilingual term database. This new cell term record includes a template identifier, cell identifier, language identifier, and the user-inputted text content field (i.e., cell content), and is persistently stored as a newly added data item in the multilingual term database. This eliminates the need for manual maintenance of the database structure or manual configuration of mapping logic when the report template table structure or content changes, significantly improving the automation and intelligence of multilingual data management in report templates.
[0087] To quickly and accurately obtain cell content data corresponding to the target language, in one embodiment, in response to a report interface operation switching from a first language to a second language, the corresponding second language term dataset is retrieved from a multilingual term database based on the template identifier of the current report and the language identifier of the second language. This includes: in response to a report interface operation switching from a first language to a second language, using the template identifier of the current report and the language identifier of the second language as joint query conditions, filtering out target term records corresponding to the template identifier and the language identifier of the second language; parsing the fields of the obtained target term records, constructing a key-value pair mapping structure between the cell identifier and the corresponding cell content in each target term record; and encapsulating all key-value pair mapping structures into data objects for page filling, outputting the second language term dataset.
[0088] In this embodiment, after detecting a user's interface operation switching from a first language to a second language, the system first uses the template identifier corresponding to the current report and the language identifier corresponding to the second language selected by the user as joint query conditions to perform conditional filtering on the cell term records already stored in the multilingual term database, in order to retrieve and locate all target term records that match both the template identifier and the language identifier. For example, if it detects that a report with the report template ID T_Financial has been switched from Chinese (zh-CN) to Japanese (ja-JP), a database query statement with the query condition WHERE template_id='T_Financial' AND locale_id='ja-JP' will be generated and executed, thereby filtering out all term records in Japanese under that template.
[0089] Subsequently, the retrieved target term records undergo field parsing processing, including extracting the cell identifier field (cellid) and the cell content field (content) from each term record, and constructing a key-value pair mapping structure between them. The cell identifier serves as the key, and the cell content serves as the value corresponding to the cell identifier, forming a one-to-one mapping structure. For example, if a target term record is: Template T001, cellid=C_1005, Language=en-US, Content=Product Name, then the key-value pair mapping structure can be constructed as {C_1005:“Product Name”}.
[0090] Finally, all key-value pair mapping structures are uniformly encapsulated into a single data object, which can be in the form of a JSON object or a dictionary structure. This data object is then returned to the front-end page or rendering engine as a second-language term dataset, thereby enabling the report content to be displayed quickly and accurately when switching to the target language without changing the template structure.
[0091] To avoid interface delays caused by redrawing or re-rendering the entire table in traditional technologies, in one embodiment, the cell content in the second language terminology dataset is filled into the corresponding cell of the report template according to the cell identifier in the second language terminology dataset to display the second language table format. This includes: for each cell in the report template, searching for matching cell content in the second language terminology dataset based on its cell identifier; filling the matching cell content into the corresponding cell; and updating the front-end cell value to refresh the display of the second language table format.
[0092] In this embodiment, after obtaining the second language term dataset from the multilingual term database, the cell identifier (e.g., cellid) corresponding to each cell in the current report template is used as the search key to perform a matching search operation in the previously obtained second language term dataset. For example, hash mapping or key-value pair lookup can be used to quickly locate term records in the second language dataset that match the cell identifier in the current report template. If a match is successful, it means that the cell already has cell content in the target language that is available for retrieval. For instance, if the desired second language is English, the current cell identifier is C_1002, and the cell content in the first language (assuming Chinese) of the current report template is product category, and the English content corresponding to C_1002 in the second language term dataset is matched as "Product Category," then "Product Category" can be further added to the cell corresponding to C_1002. Finally, the content of the successfully matched cells is written to the cell corresponding to the cell identifier, and the display value of that cell on the front-end page is updated synchronously, thereby completing the refresh of the second language table template. It is important to note that the table display refresh only affects the content level; the template structure, style, and functional logic remain unchanged. Therefore, the entire language switching process is highly real-time and visually consistent, enabling real-time switching of multilingual reports based on cell identifiers and improving the user experience of reports in multilingual scenarios.
[0093] To avoid the risk of data mapping failure caused by frequent adjustments to the report template structure, in one embodiment, after filling the cell content in the second language term dataset into the corresponding cell of the report template according to the cell identifier in the second language term dataset to display the second language table, the method further includes: if a change in the table structure of the report template is detected, assigning a new cell identifier to the newly added cell, and synchronously updating the cell term record in the multilingual term database for the cells involved in the table structure change.
[0094] In this embodiment, click events for each cell or save button can be monitored, or user editing operations on the report template can be monitored to detect whether the current report template structure has changed compared to previous versions. For newly added cells resulting from changes in the table structure, the incremental identifier allocation operation can be performed as described in the foregoing embodiments, and will not be repeated here.
[0095] After assigning identifiers to new cells, it is also necessary to synchronously update the cell terminology records related to the structural changes to the multilingual terminology database. For newly added cells, if the user has already entered text content in a certain language during this edit, a new cell terminology record will be constructed based on its new cell identifier, its template identifier, and its current language identifier, and added to the multilingual terminology database.
[0096] For existing cells affected by cell merging, splitting, or relocation, the corresponding term records in the multilingual term database are modified or rebuilt according to their identifier changes (e.g., a new ID needs to be assigned to the new sub-cells due to splitting). For example, in the original report template, a cell with cellid C_1008 is used to display total assets; if the user splits this cell into two sub-cells to display current assets and non-current assets when editing the template, new cell identifiers C_2001 and C_2002 need to be generated for the two sub-cells respectively during traversal, and the multilingual term record corresponding to the original C_1008 needs to be split into two independent records, stored as (C_2001, zh-CN, current assets) and (C_2002, zh-CN, non-current assets) respectively.
[0097] Conversely, if a user merges the cell with cellid C_2105 (displaying sales expenses) and the cell with cellid C_2106 (displaying administrative expenses) into a single total cell to display the total expenses, a new identifier C_3001 needs to be generated for the merged cell, and the term record (C_3001, zh-CN, total expenses) needs to be reconstructed. Simultaneously, the term content corresponding to the original cell identifiers C_2105 and C_2106 should be transferred to historical storage or marked as invalid, and not rendered in the current report interface. Thus, this embodiment of the application can maintain the accuracy and continuity of the correspondence between cell identifiers and multilingual cell content even when the report template undergoes structural changes such as merging, splitting, or repositioning, avoiding problems such as content misalignment or loss, and ensuring high reliability of the multilingual report template after editing.
[0098] To further enhance the usability and flexibility of the multilingual reporting system, in one embodiment, before obtaining the cell content input for the current language in the report template, the method further includes: presenting a report interface containing a multilingual switching control, wherein the multilingual switching control is configured with multiple language options;
[0099] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the report language switching interface provided in an embodiment of this application. Figure 3 As shown, the report interface typically integrates a language switching control (such as...) in the toolbar.Figure 3 The "Multilingual Report Template" and its language selection dropdown list (within the main text) are used to switch the report language. This language switching control can display multiple preset language options, such as Simplified Chinese, English, and French. Users can select a language through this control to trigger the report language switching method.
[0100] Before responding to a report interface operation that switches from a first language to a second language, and querying the corresponding second language term dataset from a multilingual term database based on the template identifier of the current report and the language identifier of the second language, the method in this application embodiment further includes: receiving an interaction event between the report interface and the multilingual switching control, wherein the interaction event carries the language identifier of the selected second language; and generating a language switching instruction to switch from the current first language to the second language based on the interaction event, so as to trigger the report interface operation to switch from the first language to the second language.
[0101] When a user clicks the language selection control and selects the target language from the dropdown list to switch languages (for example, if the current report interface displays Simplified Chinese, and the user selects English in the language selection control), the front end receives the corresponding interaction event and parses the selected language identifier (such as zh-CN, en-US, fr-FR, etc.) from the event. By listening to this interaction event, the user's intent to switch languages can be determined. For example, in... Figure 3 In the interface shown, when the user clicks to select English, an interactive event with the en-US identifier is generated.
[0102] After receiving the interaction event, the server backend parses it and converts it into a language switching instruction. This instruction represents a request to refresh the interface from the current first language (e.g., Simplified Chinese) to the target second language (e.g., English). For example, this language switching instruction includes at least the template identifier of the current report template, the language identifier of the first language corresponding to the text content of the current report interface cells, and the language identifier of the second language selected by the user. This allows the server backend to query all cell entries related to the second language under the current report template based on the template identifier and the language identifier of the second language, and complete the second language table update. Please refer to [reference needed]. Figure 4 and Figure 5 , Figure 4 , Figure 5 These are schematic diagrams showing the report interfaces for displaying Chinese and English language versions, respectively. Figure 4 In the balance sheet interface shown in Chinese, after the user selects English via the language switch control, the report interface quickly completes the cell content mapping and update, switching the report interface to English. Figure 5The Statement of Financial Position shown here instantly replaces the content of each column of cells with the corresponding English text, thus enabling rapid switching of the report language.
[0103] To implement the report language switching method of this application embodiment, this application embodiment also provides a report language switching device, such as... Figure 6 As shown, the device includes:
[0104] Cell content acquisition unit 601 is used to acquire the cell content entered in the report template for the current language;
[0105] The term storage unit 602 is used to store the identifier of each cell in the current report template and its corresponding cell content, wherein the language identifier of the current language is associated with the template identifier of the report template and stored in the multilingual term database.
[0106] The language switching unit 603 is used to respond to the report interface operation of switching from the first language to the second language, and to query the corresponding second language term dataset from the multilingual term database according to the template identifier of the current report and the language identifier of the second language.
[0107] The report interface update unit 604 is used to fill the cell content in the second language term dataset into the corresponding cell of the report template according to the cell identifier in the second language term dataset, so as to display the second language table.
[0108] In one embodiment, the device further includes a cell identifier allocation unit; the cell identifier allocation unit is specifically configured to: in response to the save operation of the report template, traverse the table structure of the report template; and incrementally allocate cell identifiers to cells in the table structure that have not yet been assigned identifiers, so that each cell has a one-to-one corresponding cell identifier.
[0109] In one embodiment, the term storage unit 602 is specifically used to: construct a cell term record by storing each cell identifier and its corresponding cell content in the current report template, wherein the language identifier of the current language and the template identifier of the report template are used as a joint key; and perform data writing operations on the multilingual term database based on each cell term record, using the template identifier, the cell identifier and the language identifier as a joint key.
[0110] In one embodiment, the term storage unit 602 is specifically used to: use the composite key formed by the template identifier, the cell identifier and the language identifier as an index to search whether the multilingual term database already has a cell term record corresponding to the composite key; if it exists, update the cell term record that already exists in the multilingual term database; if it does not exist, store the cell term record as a new record in the multilingual term database.
[0111] In one embodiment, the language switching unit 603 is specifically configured to: respond to a report interface operation that switches from a first language to a second language, using the template identifier of the current report and the language identifier of the second language as joint query conditions, filter out target term records corresponding to the template identifier and the language identifier of the second language; perform field parsing on the obtained target term records, construct a key-value pair mapping structure by connecting the cell identifier and the corresponding cell content in each target term record; and encapsulate all key-value pair mapping structures into data objects for page filling, outputting them as a second language term dataset.
[0112] In one embodiment, the report interface update unit 604 is specifically used to: for each cell in the report template, search for matching cell content in the second language term dataset using its cell identifier; fill the matching cell content into the corresponding cell, and update the front-end cell value to refresh the second language table display.
[0113] In one embodiment, after filling the cell content of the second language term dataset into the corresponding cell of the report template according to the cell identifier in the second language term dataset to display the second language table, the method further includes: if a change in the table structure of the report template is detected, assigning a new cell identifier to the newly added cell, and synchronously updating the cell term record in the multilingual term database for the cells involved in the table structure change.
[0114] In one embodiment, the device further includes: an interface display unit; the interface display unit is specifically used to: present a report interface including a multilingual switching control, wherein the multilingual switching control is configured with multiple language options;
[0115] The language switching unit 603 is specifically configured to: receive an interaction event between the report interface and the multilingual switching control, wherein the interaction event carries a language identifier of the selected second language; and generate a language switching instruction to switch from the current first language to the second language based on the interaction event, so as to trigger the report interface operation to switch from the first language to the second language.
[0116] It should be noted that the report language switching device provided in the above embodiments is only illustrated by the division of the above program modules when switching report languages. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the report language switching device and the report language switching method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0117] Based on the hardware implementation of the above program modules, and in order to implement the report language switching method provided in this application embodiment, this application embodiment also provides a computer device, such as... Figure 7 As shown, the computer device 700 includes:
[0118] Central processing unit 701, memory 702, and input / output interface 703;
[0119] The memory 702 is a short-term storage memory or a persistent storage memory;
[0120] The central processing unit 701 is configured to communicate with the memory 702 and execute instructions in the memory 702 to perform any of the above-mentioned report language switching methods.
[0121] Of course, in practical applications, the various components in the computer device 700 are coupled together through a bus system 704. It is understood that the bus system 704 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 7 The general designated all buses as Bus System 704.
[0122] The memory 702 in this embodiment is used to store various types of data to support the operation of the computer device 700. Examples of such data include any computer program used to operate on the computer device 700.
[0123] It is understood that when the processor in the computer device described above executes the computer program, it can also realize the functions of each unit in the corresponding device embodiments described above, which will not be repeated here. Exemplarily, the computer program can be divided into one or more modules / units, one or more modules / units are stored in memory and executed by the processor to complete the various embodiments of this application. One or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device. For example, the computer program can be divided into units in the aforementioned computer device, and each unit can implement the specific functions described in the corresponding computer device above.
[0124] Computer equipment can be desktop computers, laptops, handheld computers, and cloud servers, among other computing devices. Computer equipment may include, but is not limited to, processors and memory. Those skilled in the art will understand that processors and memory are merely examples of computer equipment and do not constitute a limitation on the computer equipment. It may include more or fewer components, or combinations of certain components, or different components. For example, computer equipment may also include input / output devices, network access devices, buses, etc.
[0125] A processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of a computer device, connecting all parts of the computer device through various interfaces and lines.
[0126] Memory can be used to store computer programs and / or modules. The processor performs various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on terminal usage, etc. Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital cards (SD), flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0127] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, performs any of the above-described report language switching methods.
[0128] This application also provides a computer program product that stores a computer program / instruction thereon. When the computer program / instruction is executed by a processor, it is used to implement the report language switching method described in the first aspect or any specific implementation of the first aspect of this application.
[0129] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0132] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0133] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for switching report languages, characterized in that, include: Retrieve the cell content entered in the report template for the current language; Each cell identifier and its corresponding cell content in the current report template are stored in the multilingual term database, with the language identifier of the current language associated with the template identifier of the report template. In response to the report interface operation of switching from the first language to the second language, the corresponding second language term dataset is retrieved from the multilingual term database based on the template identifier of the current report and the language identifier of the second language. Based on the cell identifiers in the second language terminology dataset, the cell contents of the second language terminology dataset are filled into the corresponding cells of the report template to display the second language table format.
2. The method according to claim 1, characterized in that, Before storing the identifier of each cell in the current report template and its corresponding cell content, and the language identifier of the current language associated with the template identifier of the report template, in the multilingual terminology database, the method further includes: In response to the save operation of the report template, the table structure of the report template is traversed; Incremental cell identifier allocation is performed on cells in the table structure that have not yet been assigned an identifier, so that each cell has a one-to-one corresponding cell identifier.
3. The method according to claim 1, characterized in that, The step of storing the identifier of each cell in the current report template and its corresponding cell content, and associating the language identifier of the current language with the template identifier of the report template in the multilingual terminology database, includes: Each cell identifier and its corresponding cell content in the current report template are combined, and the language identifier of the current language and the template identifier of the report template are combined to form a cell term record. Using the template identifier, the cell identifier, and the language identifier as a joint key, data writing operations are performed on the multilingual term database based on the term records in each cell.
4. The method according to claim 3, characterized in that, Using the template identifier, the cell identifier, and the language identifier as a composite key, data writing operations are performed on the multilingual term database based on each cell term record, including: Using the composite key formed by the template identifier, the cell identifier, and the language identifier as an index, search the multilingual term database to see if a cell term record corresponding to the composite key already exists; If it exists, update the cell entry record in the existing multilingual term database; If it does not exist, the cell term record will be stored as a new record in the multilingual term database.
5. The method according to claim 1, characterized in that, The operation of switching the report interface from the first language to the second language, in response to the current report's template identifier and the second language's language identifier, retrieves the corresponding second language term dataset from the multilingual term database, including: In response to the report interface operation of switching from the first language to the second language, the template identifier of the current report and the language identifier of the second language are used as joint query conditions to filter out the target term records corresponding to the template identifier and the language identifier of the second language. The obtained target term records are parsed, and the cell identifiers and corresponding cell contents in each target term record are constructed into a key-value pair mapping structure. All key-value pair mapping structures are encapsulated into data objects for page population and output as a second language term dataset.
6. The method according to claim 1, characterized in that, The step of filling the corresponding cells in the report template with the cell content from the second language terminology dataset according to the cell identifiers in the second language terminology dataset to display the second language table format includes: For each cell in the report template, the matching cell content is searched in the second language term dataset using its cell identifier; The matched cell content is filled into the corresponding cells, and the front-end cell value is updated to refresh the second language table display.
7. The method according to claim 1, characterized in that, After filling the corresponding cells of the report template with the cell contents from the second language terminology dataset according to the cell identifiers in the second language terminology dataset to display the second language table format, the method further includes: If a change in the table structure of the report template is detected, a new cell identifier is assigned to the newly added cell, and the cell entry record in the multilingual glossary database is updated synchronously for the cells affected by the table structure change.
8. The method according to claim 1, characterized in that, Before retrieving the cell content entered in the report template for the current language, the method further includes: Presents a report interface that includes a multilingual switching control, wherein the multilingual switching control is configured with multiple language options; Before the operation of switching from a first language to a second language in response to the report interface operation, and querying the corresponding second language term dataset from the multilingual term database based on the template identifier of the current report and the language identifier of the second language, the method further includes: Receive interaction events between the report interface and the multilingual switching control, wherein the interaction events carry a language identifier of the selected second language; Based on the interaction event, a language switching instruction is generated to switch from the current first language to the second language, thereby triggering the report interface operation to switch from the first language to the second language.
9. A computer device, characterized in that, include: Central processing unit, memory, and input / output interfaces; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the method as described in any one of claims 1 to 8.
11. A computer program product having a computer program / instructions stored thereon, characterized in that, When executed by a processor, the computer program / instructions are used to implement the method as described in any one of claims 1 to 8.