Internationalization processing method and device of service data, equipment and medium
By using configurable management and interceptor mechanisms, the internationalized data in the unified response body is dynamically parsed and replaced, which solves the problems of insufficient system stability and low development efficiency in existing technologies, and achieves efficient and accurate internationalization processing of business data.
Patent Information
- Application Number
- CN202511834706.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, when enterprises internationalize their businesses, code-level modifications and intrusive operations lead to insufficient system stability and low development efficiency. Furthermore, they struggle to handle complex levels of response data, resulting in incomplete internationalization coverage and system compatibility issues.
By using configurable management and interceptor mechanisms, internationalized data in the unified response body can be dynamically parsed and replaced, avoiding the need to modify business code and enabling internationalized processing of business data.
It improves system stability and development efficiency, ensures the integrity and accuracy of internationalization processing, adapts to complex data structures, and reduces configuration workload and risks.
Smart Images

Figure CN121509523A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology in information technology, and in particular to a method, apparatus, device and medium for internationalizing business data. Background Technology
[0002] Against the backdrop of deep integration of the global digital economy and rapid iteration of cloud computing technology, enterprises are leveraging the core advantages of cloud computing, such as elastic scaling and resource sharing, to accelerate their international business expansion. Among these advantages, the efficient deployment and management of multilingual text and regionalized configurations are crucial for supporting the standardization and localization of global services.
[0003] In existing technologies, to adapt to different regional markets, developers need to directly embed multi-language logic into the source code of existing application systems, adjust configuration interfaces, modify business-related code, or refactor core modules. However, code-level modifications and intrusive operations tightly couple internationalized content with business code, making content updates and deployments require modifying the source code and going through a complete development, testing, and release process. This results in a long development cycle and is prone to causing system compatibility issues.
[0004] Therefore, existing technologies suffer from insufficient system stability and low development efficiency. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for internationalizing business data, in order to improve system stability and development efficiency.
[0006] In a first aspect, embodiments of this application provide a method for internationalizing business data, including:
[0007] In response to a business request initiated by the frontend, obtain the target language corresponding to the business request;
[0008] Execute the business request and generate a unified response body; the unified response body includes a business status code and a primitive value object;
[0009] The unified response body is intercepted by an interceptor, and based on the unified response body, it is determined whether internationalization processing is enabled.
[0010] If internationalization is enabled, the first internationalization data is determined based on the business status code and the target language, and the second internationalization data is determined based on the original value object and the target language.
[0011] Based on the first and second internationalization data, update the unified response body to obtain the target unified response body;
[0012] Return the target unified response body to the front end.
[0013] In one possible implementation, the first internationalization data is determined based on the business status code and the target language, including:
[0014] Based on the business status code and target language, query the first multilingual internationalization data to obtain the first query result;
[0015] The first query result is populated into the message field of the unified response body to obtain the first internationalized data.
[0016] In one possible implementation, the second internationalization data is determined based on the original value object and the target language, including:
[0017] Based on the package path of the original value object, obtain the pre-configured set of fields to be internationalized;
[0018] Iterate through the set of fields to be internationalized, and for each field in the set, query the second multilingual internationalization data based on the field name, original value, package path of the original value object and target language to obtain the second query result;
[0019] Replace the original values of the corresponding fields in the original value object with the results of the second query to obtain the second internationalized data.
[0020] In one possible implementation, the pre-configured set of fields to be internationalized is configured through a visual interface on the front end.
[0021] In one possible implementation, during the traversal, if the field is a nested object or a collection type, the internationalization logic is recursively executed on the nested object or collection type.
[0022] In one possible implementation, determining whether internationalization processing is enabled for the unified response body includes:
[0023] Extract the package path of the original value object;
[0024] Query the pre-configured internationalization rules library based on the package path;
[0025] If an internationalization rule that matches the package path and is enabled is found, then internationalization processing is enabled.
[0026] In one possible implementation, before querying the pre-configured internationalization rule base based on the package path, the method further includes:
[0027] In response to a rule configuration request initiated by the frontend, the rule configuration information is displayed on the frontend's visual interface;
[0028] In response to configuration operations on the front-end visual interface, a pre-configured internationalization rule base is configured; wherein, the configuration operations include configuration operations corresponding to the precise package path configuration and / or configuration operations corresponding to the wildcard package path.
[0029] Secondly, embodiments of this application provide an internationalization processing apparatus for business data, comprising:
[0030] The retrieval module is used to respond to business requests initiated by the front end and retrieve the target language corresponding to the business request.
[0031] The generation module is used to execute business requests and generate a unified response body; the unified response body includes a business status code and a raw value object.
[0032] The interception module is used to intercept the unified response body through an interceptor and determine whether internationalization processing is enabled based on the unified response body.
[0033] The first determination module is used to determine the first internationalized data based on the business status code and the target language if it is determined that internationalization processing is enabled, and to determine the second internationalized data based on the original value object and the target language.
[0034] The second determining module is used to update the unified response body based on the first internationalization data and the second internationalization data to obtain the target unified response body.
[0035] The return module is used to return the target unified response body to the front end.
[0036] In one possible implementation, the interception module can also be used for:
[0037] Extract the package path of the original value object.
[0038] Query the pre-configured internationalization rules library based on the package path.
[0039] If an internationalization rule that matches the package path and is enabled is found, then internationalization processing is enabled.
[0040] In one possible implementation, before querying the pre-configured internationalization rule base based on the packet path, the interception module can also be used to:
[0041] In response to a rule configuration request initiated by the frontend, the rule configuration information is displayed on the frontend's visual interface.
[0042] In response to configuration operations on the front-end visual interface, a pre-configured internationalization rule base is configured; wherein, the configuration operations include configuration operations corresponding to the precise package path configuration and / or configuration operations corresponding to the wildcard package path.
[0043] In one possible implementation, the first determining module can also be used for:
[0044] Based on the business status code and target language, query the first multilingual internationalization data to obtain the first query result.
[0045] The first query result is populated into the message field of the unified response body to obtain the first internationalized data.
[0046] In one possible implementation, the first determining module can also be used for:
[0047] Based on the package path of the original value object, obtain the pre-configured set of fields to be internationalized.
[0048] Optionally, the pre-configured set of fields to be internationalized can be configured through a visual interface on the front end.
[0049] Iterate through the set of fields to be internationalized, and for each field in the set, query the second multilingual internationalization data based on the field name, original value, package path of the original value object, and target language to obtain the second query result.
[0050] Replace the original values of the corresponding fields in the original value object with the results of the second query to obtain the second internationalized data.
[0051] In one possible implementation, the first determining module can also be used for:
[0052] During the traversal, if the pre-configured set of fields to be internationalized is a nested object or a collection type, the internationalization logic is recursively executed on the nested object or collection type.
[0053] Thirdly, embodiments of this application provide an internationalization processing device for business data, including: a memory and a processor;
[0054] The memory stores instructions that the computer executes;
[0055] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0056] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0057] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0058] This application provides a method, apparatus, device, and medium for internationalizing business data. In response to a business request initiated by the front end, the method obtains the target language corresponding to the business request; executes the business request, generating a unified response body including a business status code and an original value object; intercepts the unified response body using an interceptor, and determines whether internationalization processing is enabled based on the unified response body; if internationalization processing is enabled, it determines first internationalized data based on the business status code and the target language, and determines second internationalized data based on the original value object and the target language; updates the unified response body based on the first and second internationalized data to obtain a target unified response body; and returns the target unified response body to the front end. Compared to existing technologies, this application's method does not require modification of the business code, but only achieves internationalization processing of business data through configuration-based management combined with an interceptor mechanism, avoiding the risks introduced by code modification and improving system stability and development efficiency. Attached Figure Description
[0059] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0060] Figure 1 A schematic diagram of an internationalization processing system architecture for business data provided in this application;
[0061] Figure 2 A flowchart illustrating the internationalization process for the business data provided in this application. Figure 1 ;
[0062] Figure 3 A flowchart illustrating the internationalization process for the business data provided in this application. Figure 2 ;
[0063] Figure 4 A flowchart illustrating the internationalization process for the business data provided in this application. Figure 3 ;
[0064] Figure 5 A flowchart illustrating the internationalization process for the business data provided in this application. Figure 3 ;
[0065] Figure 6 A schematic diagram of the structure of the internationalization processing device for the business data provided in this application;
[0066] Figure 7 A schematic diagram of the structure of the internationalization processing equipment for the business data provided in this application.
[0067] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0068] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0069] It should be noted that all data involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0070] With the deep integration of the global digital economy and the rapid development of cloud computing technology, enterprises have made cloud computing a core means of international expansion, enabling flexible business expansion, resource sharing, and pay-as-you-go pricing.
[0071] In this process, enterprises need to provide multilingual support, regionalized configurations, and culturally adapted responses to global users, such as cloud platform resource names, permission role descriptions, and operation prompts.
[0072] However, in traditional internationalization deployment models, business systems need to embed multi-language logic through code modifications, such as mandatory inheritance of specific parent classes, adherence to fixed naming rules, or misuse of annotations, resulting in highly invasive code and high maintenance costs. Furthermore, each internationalization update requires a complete development, testing, and deployment process, significantly extending the business response cycle. Simultaneously, invasive code operations easily trigger system compatibility issues, increasing later maintenance costs and failing to meet the rapid iteration needs of enterprises for internationalization.
[0073] Furthermore, existing solutions often focus only on surface-level prompts within the response body, failing to handle core business data within the nested structure of the response body, resulting in incomplete internationalization coverage. This is especially problematic in cloud computing scenarios where response data frequently contains multiple nested structures, making it difficult for existing solutions to penetrate these complex layers for translation, ultimately leading to cluttered user interfaces or missing information.
[0074] To address the aforementioned issues, the core concept of this application is to dynamically parse and replace internationalized data in the unified response body through configurable management and an interceptor mechanism, thereby achieving internationalized processing of business data, avoiding risks introduced by code modifications, and improving system stability and development efficiency.
[0075] Optionally, Figure 1 This is a schematic diagram of a system architecture for internationalizing business data, provided in this application. Figure 1 As shown, the internationalization processing system architecture for business data includes at least one component: front-end, interceptor, back-end, and database.
[0076] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the above architecture. In other feasible embodiments of this application, the above architecture may include more or fewer components than illustrated, or combine some components, or split some components, or arrange different components, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of both.
[0077] In the actual implementation process, the front end responds to the user's actions and generates corresponding business requests.
[0078] The backend can respond to business requests initiated by the frontend, obtain the target language corresponding to the business request, execute the business request, and generate a unified response body. The unified response body includes a business status code and a primitive value object.
[0079] The interceptor intercepts the unified response body and determines whether internationalization is enabled based on the unified response body. If internationalization is enabled, it determines the first internationalization data based on the business status code and the target language, and determines the second internationalization data based on the original value object and the target language. Based on the first and second internationalization data, the unified response body is updated to obtain the target unified response body. The target unified response body is then returned to the front end.
[0080] The front end also includes a visual interface, which receives user commands while displaying the above content to enable interaction with the user.
[0081] The database is used to store the above content and a pre-configured internationalization rule base.
[0082] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0083] Figure 2 A flowchart illustrating the internationalization process for the business data provided in this application. Figure 1 ,like Figure 2 As shown, the method includes:
[0084] S201. In response to a business request initiated by the front end, obtain the target language corresponding to the business request.
[0085] In this embodiment, the request header of the service request includes a language identifier. By obtaining the language identifier in the service request header, the target language corresponding to the service request can be determined.
[0086] Optionally, the target language for the business request can be determined by obtaining the language identifier from the user configuration information, which carries the language identifier.
[0087] For example, the language identifier CN is Chinese (Simplified), and EN is English.
[0088] S202. Execute the business request and generate a unified response body; the unified response body includes the business status code and the original value object.
[0089] In this embodiment, the unified response body refers to the response content containing business data returned after the business request is completed; wherein, the format of the unified response body includes JSON (JavaScript Object Notation) format or XML (Extensible Markup Language) format.
[0090] The business status code is semantically encoded, representing whether the business operation result is successful or failed, and the reason for the failure; the original value object is the original business value after the business request is completed.
[0091] S203. Intercept the unified response body through the interceptor, and determine whether internationalization processing is enabled based on the unified response body.
[0092] In this embodiment, after the business request is completed, the interceptor intercepts the unified response body, performs reflection parsing on the unified response body to extract the original value object in the unified response body, as well as the packet path corresponding to the original value object.
[0093] Based on the package path corresponding to the original value object, the internationalization rules in the database are queried to determine whether internationalization processing is enabled for the unified response body. The internationalization rules are used to identify the unified response body that needs to enable internationalization processing. The internationalization rules include the original value object corresponding to the unified response body that needs to enable internationalization processing, the package path corresponding to the original value object, and the fields in the original value object that need to be internationalized.
[0094] S204. If it is determined that internationalization processing is enabled, the first internationalization data is determined based on the business status code and the target language, and the second internationalization data is determined based on the original value object and the target language.
[0095] In this embodiment, if it is determined that internationalization processing is enabled, after the business request is completed, the interceptor intercepts the unified response body, performs reflection parsing on the unified response body to extract the business status code in the unified response body, and obtains the target language corresponding to the business request.
[0096] Among them, the description text of the target language of the first internationalized data is determined according to the business status code and the target language, thereby completing the internationalization processing of the business status code.
[0097] The second internationalized data is the original value object that has already undergone internationalization processing, with its field values replaced with those of the target language. Based on the original value object and the target language, the second internationalized data is determined, thus completing the internationalization processing of the original value object.
[0098] S205. Based on the first internationalization data and the second internationalization data, update the unified response body to obtain the target unified response body.
[0099] In this embodiment, the interceptor reassembles the unified response body based on the first internationalization data and the second internationalization data, ensuring that the business status code in the unified response body is replaced with the first internationalization data and the corresponding field in the original value object is replaced with the second internationalization data, thereby obtaining the target unified response body.
[0100] S206. Return the target unified response body to the front end.
[0101] In this embodiment, the interceptor allows the target unified response body to pass through, so that the target unified response body is returned to the front end for rendering and display.
[0102] The internationalization processing method for business data provided in this application involves: responding to a business request initiated by the front end and obtaining the target language corresponding to the business request; executing the business request and generating a unified response body including a business status code and a raw value object; intercepting the unified response body through an interceptor and determining whether internationalization processing is enabled based on the unified response body; if internationalization processing is enabled, determining the first internationalization data based on the business status code and the target language, and determining the second internationalization data based on the raw value object and the target language; updating the unified response body based on the first and second internationalization data to obtain the target unified response body; and returning the target unified response body to the front end. This method employs configuration-based management and an interceptor mechanism to dynamically parse and replace the internationalization data in the unified response body, thereby achieving internationalization processing of business data, avoiding risks introduced by code modifications, and improving system stability and development efficiency.
[0103] Figure 3 A flowchart illustrating the internationalization process for the business data provided in this application. Figure 2 ,like Figure 3 As shown, in this embodiment... Figure 2 Based on the embodiments, the method for determining whether internationalization processing is enabled for the unified response body in step S203 above will be described in detail. The method includes:
[0104] S301, Extract the package path of the original value object.
[0105] In this embodiment, an interceptor is used to intercept the unified response body, and the packet path of the original value object is extracted from the unified response body through reflection technology.
[0106] S302. In response to the rule configuration request initiated by the front end, display the rule configuration information on the front end's visual interface.
[0107] In this embodiment, in response to the rule configuration request initiated by the front end, the back end queries all the rule configuration information from the pre-configured internationalization rule base in the database and returns all the rule configuration information to the front end so as to display the rule configuration information on the front end's visual interface.
[0108] The rule configuration information includes the package path of the original value object, the pre-configured set of fields to be internationalized, the associated internationalization rules, and the status of the internationalization rules, which includes whether the internationalization rules are enabled or disabled.
[0109] S303. In response to configuration operations on the front-end visual interface, configure the pre-configured internationalization rule base; wherein, the configuration operations include configuration operations corresponding to the precise package path configuration and / or configuration operations corresponding to the wildcard package path.
[0110] In this embodiment, the configuration operation corresponding to the precise package path configuration refers to the configuration operation that takes effect on one value object instance of the precise package path; the configuration operation corresponding to the wildcard package path refers to the configuration operation that takes effect on all value object instances under the wildcard package path.
[0111] S304. Query the pre-configured internationalization rule base based on the package path.
[0112] In this embodiment, the pre-configured internationalization rule base in step S303 is retrieved based on the package path of the original value object extracted in step S301.
[0113] S305. If an internationalization rule that matches the package path and is enabled is found, then internationalization processing is enabled.
[0114] In this embodiment, if an internationalization rule that matches the package path and is enabled is found in the pre-configured internationalization rule base, then internationalization processing is enabled.
[0115] Optionally, if no internationalization rule matching the package path is found, or if an internationalization rule matching the package path is found but is disabled, the unified response body is allowed to proceed directly.
[0116] The internationalization processing method for business data provided in this application automatically obtains the packet path of the original value object through reflection technology, avoiding the tediousness and errors of manually annotating the packet path of the original value object; it provides a centralized management visual interface, improving the efficiency of internationalization rule configuration and maintenance; it balances precise configuration and wildcard configuration, significantly reducing the configuration workload while ensuring accuracy; it queries the pre-configured internationalization rule base based on the packet path, ensuring the target and correctness of internationalization processing; and it achieves fine-grained control over internationalization processing based on both packet path matching and activation status, effectively improving the efficiency of internationalization processing of business data.
[0117] Figure 4 A flowchart illustrating the internationalization process for the business data provided in this application. Figure 3 ,like Figure 4 As shown, in this embodiment... Figure 2 Based on the embodiments, the method of determining the first internationalization data and the second internationalization data based on the original value object and the target language in step S204 above, if it is determined that internationalization processing is enabled, is described in detail. The method includes:
[0118] S401. Based on the business status code and target language, query the first multilingual internationalization data to obtain the first query result.
[0119] In this embodiment, the first multilingual internationalization data refers to the data source used to store the mapping relationship between business status codes and descriptive text in different languages, and the first query result refers to the descriptive text in the target language obtained by querying the first multilingual internationalization data by combining the business status code and the target language.
[0120] S402. Fill the message field of the unified response body with the first query result to obtain the first internationalized data.
[0121] In this embodiment, the interceptor fills the message field of the unified response body with the first query result. The original message field of the unified response body includes null values or description text in the default language. After filling, the message field of the unified response body is the description text in the target language. Thus, the first internationalized data is obtained, and the internationalization processing of the business status code is completed.
[0122] S403. Obtain the pre-configured set of fields to be internationalized based on the package path of the original value object.
[0123] Optionally, the pre-configured set of fields to be internationalized can be configured through a visual interface on the front end.
[0124] In this embodiment, based on the package path of the original value object, the pre-configured set of fields to be internationalized in the visualization interface is queried to identify the fields to be internationalized.
[0125] S404. Traverse the set of fields to be internationalized, and for each field in the set of fields to be internationalized, query the second multilingual internationalization data based on the field name, original value, package path of the original value object and target language to obtain the second query result.
[0126] In this embodiment, the second multilingual internationalization data refers to a database or data set that stores translated texts of the set of fields to be internationalized in different languages.
[0127] Optionally, during the iteration process, if the field is a nested object or a collection type, the internationalization logic is recursively executed on the nested object or collection type.
[0128] In this embodiment, as Figure 5 As shown:
[0129] Optionally, internationalization logic is recursively executed on nested objects, including:
[0130] S501, Extract the complete package path of the nested object.
[0131] S502. Based on the complete package path of the nested object, query the pre-configured internationalization rule base in the database to determine the set of fields to be internationalized for the nested object.
[0132] S503. Traverse the set of fields to be internationalized, and for each field in the set of fields to be internationalized, query the second multilingual internationalization data based on the field name, original value, package path of the original value object and target language to obtain the second query result.
[0133] S504. Using the nested object as the new root object, recursively execute steps S501 to S504 until the internationalization process of the entire nested object is completed.
[0134] Optionally, internationalization logic can be recursively executed on collection types, including:
[0135] S505, Iterate through each member of the collection type.
[0136] S506. If the member is a collection type, return to step S505.
[0137] S507. If the member is a basic data type, including strings and numbers, then directly query the second multilingual internationalization data based on the parent package path, the field name of the current collection field, the original value of this member, and the target language to obtain the second query result.
[0138] S508. If the member is a nested object, return to step S501.
[0139] S405. Replace the original values of the corresponding fields in the original value object with the second query results to obtain the second internationalized data.
[0140] In this embodiment, the interceptor uses reflection technology to directly replace the corresponding fields in the original value object based on the second query result obtained for each field to be internationalized in step S404 above, until all fields to be internationalized have been replaced with the corresponding second query result, thereby completing the internationalization process of business data.
[0141] The internationalization processing method for business data provided in this application automatically converts business status codes into descriptive text in the target language and accurately locates the fields to be internationalized, reducing the need for full processing and improving the efficiency of internationalization processing of business data. Through a recursive traversal strategy, it achieves targeted internationalization processing for business data of basic data types, nested objects, and collection types, effectively solving the problems of configuration redundancy and difficulty in covering complex data structures in traditional solutions, and improving the efficiency of internationalization processing of business data.
[0142] Figure 6 A schematic diagram of the structure of the internationalization processing device for business data provided in this application is shown below. Figure 6 As shown, the internationalization processing device for business data provided in this embodiment includes:
[0143] The acquisition module 601 is used to respond to business requests initiated by the front end and obtain the target language corresponding to the business request.
[0144] The generation module 602 is used to execute business requests and generate a unified response body; wherein, the unified response body includes a business status code and a raw value object.
[0145] The interception module 603 is used to intercept the unified response body through the interceptor and determine whether internationalization processing is enabled based on the unified response body.
[0146] The first determining module 604 is used to determine the first internationalized data based on the business status code and the target language if it is determined that internationalization processing is enabled, and to determine the second internationalized data based on the original value object and the target language.
[0147] The second determining module 605 is used to update the unified response body based on the first internationalization data and the second internationalization data to obtain the target unified response body.
[0148] Return module 606 is used to return the target unified response body to the front end.
[0149] In one possible implementation, the interception module 603 can also be used for:
[0150] Extract the package path of the original value object.
[0151] Query the pre-configured internationalization rules library based on the package path.
[0152] If an internationalization rule that matches the package path and is enabled is found, then internationalization processing is enabled.
[0153] In one possible implementation, before querying the pre-configured internationalization rule base based on the packet path, the interception module 603 can also be used to:
[0154] In response to a rule configuration request initiated by the frontend, the rule configuration information is displayed on the frontend's visual interface.
[0155] In response to configuration operations on the front-end visual interface, a pre-configured internationalization rule base is configured; wherein, the configuration operations include configuration operations corresponding to the precise package path configuration and / or configuration operations corresponding to the wildcard package path.
[0156] In one possible implementation, the first determining module 604 can also be used for:
[0157] Based on the business status code and target language, query the first multilingual internationalization data to obtain the first query result.
[0158] The first query result is populated into the message field of the unified response body to obtain the first internationalized data.
[0159] In one possible implementation, the first determining module 604 can also be used for:
[0160] Based on the package path of the original value object, obtain the pre-configured set of fields to be internationalized.
[0161] Optionally, the pre-configured set of fields to be internationalized can be configured through a visual interface on the front end.
[0162] Iterate through the set of fields to be internationalized, and for each field in the set, query the second multilingual internationalization data based on the field name, original value, package path of the original value object, and target language to obtain the second query result.
[0163] Replace the original values of the corresponding fields in the original value object with the results of the second query to obtain the second internationalized data.
[0164] In one possible implementation, the first determining module 604 can also be used for:
[0165] During the iteration process, if a field is a nested object or collection type, the internationalization logic is recursively executed on the nested object or collection type.
[0166] The internationalization processing device for business data provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0167] Figure 7 A schematic diagram of the structure of the internationalization processing equipment for the business data provided in this application. (See diagram below.) Figure 7 As shown, the internationalization processing device for business data provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the internationalization processing device for business data further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.
[0168] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0169] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0170] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0171] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0172] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0173] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0174] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0175] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0176] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0177] The division of units is merely a logical functional division; 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 indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0178] 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.
[0179] In addition, the functional units in the various embodiments of the present invention 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.
[0180] If a function 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 invention, or the part that contributes to the prior art, or a 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 of the various embodiments of this invention. 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.
[0181] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0182] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for internationalizing business data, characterized in that, include: In response to a business request initiated by the front end, obtain the target language corresponding to the business request; Execute the business request and generate a unified response body; wherein the unified response body includes a business status code and a raw value object; The unified response body is intercepted by an interceptor, and based on the unified response body, it is determined whether internationalization processing is enabled. If internationalization processing is enabled, then the first internationalization data is determined based on the business status code and the target language, and the second internationalization data is determined based on the original value object and the target language. Based on the first internationalization data and the second internationalization data, update the unified response body to obtain the target unified response body; The target unified response body is returned to the front end.
2. The method according to claim 1, characterized in that, The step of determining the first internationalization data based on the business status code and the target language includes: Based on the business status code and the target language, query the first multilingual internationalization data to obtain the first query result; The first query result is filled into the message field of the unified response body to obtain the first internationalized data.
3. The method according to claim 2, characterized in that, The step of determining the second internationalization data based on the original value object and the target language includes: Based on the package path of the original value object, obtain the pre-configured set of fields to be internationalized; The set of fields to be internationalized is traversed, and for each field in the set of fields to be internationalized, a second multilingual internationalization data is queried based on the field name, original value, package path of the original value object and the target language to obtain a second query result; The original values of the corresponding fields in the original value object are replaced according to the second query result to obtain the second internationalized data.
4. The method according to claim 3, characterized in that, The pre-configured set of fields to be internationalized is configured through a visual interface on the front end.
5. The method according to claim 3, characterized in that, During the traversal, if the field is a nested object or a collection type, the internationalization logic is recursively executed on the nested object or the collection type.
6. The method according to any one of claims 1 to 5, characterized in that, The step of determining whether internationalization processing is enabled for the unified response body includes: Extract the package path of the original value object; The pre-configured internationalization rule base is queried based on the package path; If an internationalization rule that matches the package path and is enabled is found, then internationalization processing is enabled.
7. The method according to claim 6, characterized in that, Before querying the pre-configured internationalization rule base based on the package path, the method further includes: In response to a rule configuration request initiated by the front end, the rule configuration information is displayed on the front end's visual interface; In response to configuration operations on the visual interface of the front end, a pre-configured internationalization rule base is configured; wherein the configuration operations include configuration operations corresponding to the precise package path configuration and / or configuration operations corresponding to the wildcard package path.
8. An internationalization processing device for business data, characterized in that, include: The acquisition module is used to respond to business requests initiated by the front end and acquire the target language corresponding to the business request. A generation module is used to execute the business request and generate a unified response body; wherein, the unified response body includes a business status code and a raw value object; The interception module is used to intercept the unified response body through an interceptor, and determine whether the unified response body has internationalization processing enabled based on the unified response body. The first determining module is used to determine first internationalized data based on the business status code and the target language if it is determined that internationalization processing is enabled, and to determine second internationalized data based on the original value object and the target language. The second determining module is used to update the unified response body based on the first internationalization data and the second internationalization data to obtain the target unified response body; The return module is used to return the target unified response body to the front end.
9. An internationalization processing device for business data, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-7.