Language package distribution method and device, equipment and medium
By responding to the client's language switching request, obtaining the region to which it belongs and determining the language pack to be allocated, the problem of language packs taking up a large amount and long download time in the prior art is solved, and more efficient language pack allocation is achieved.
Patent Information
- Application Number
- CN202411847382.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, applications store a large number of language packs, resulting in large memory usage and long download and rendering time.
By responding to the client's language switching request, obtain the client's region, and determine the language packet to be allocated based on the language packet identification of the region and the language packet identification pointed to by the request, and send it to the client.
The language package allocation method has been refined, reducing the number of language packages that the client needs to store, and improving the efficiency and accuracy of language package allocation.
Smart Images

Figure CN119806702A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a language package distribution method, device, equipment and medium. Background Art
[0002] With the rapid development of science and technology, the number of applications is increasing and gradually developing towards globalization. Therefore, it is necessary to install language packs in different languages for the applications to facilitate users of different languages.
[0003] Currently, by storing language packs of different languages on the client, the client can switch the language of the application according to the different language packs.
[0004] However, each application stores a large number of language packs, the language pack files occupy too much memory and take a long time to download and render. Summary of the invention
[0005] The present invention provides a language package allocation method, device, equipment and medium to improve the accuracy of language package allocation.
[0006] In a first aspect, an embodiment of the present invention provides a method for allocating a language package, the method comprising:
[0007] In response to a language switching request of a client to be assigned, obtaining a region corresponding to the client to be assigned;
[0008] Determining the language package to be allocated to the client to be allocated according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request;
[0009] The language package to be allocated is sent to the client to be allocated.
[0010] In a second aspect, an embodiment of the present invention further provides a language package distribution device, the device comprising:
[0011] A region acquisition module, configured to obtain the region corresponding to the client to be assigned in response to a language switching request of the client to be assigned;
[0012] A language package determination module, configured to determine the language package to be allocated to the client to be allocated according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request;
[0013] The language package sending module is used to send the language package to be distributed to the client to be distributed.
[0014] In a third aspect, an embodiment of the present invention further provides a language package distribution device, the language package distribution device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the language package allocation method according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions. The computer instructions are used to enable a processor to implement the language package allocation method of any embodiment of the present invention when executed.
[0019] The technical solution of the embodiment of the present invention obtains the region to which the client to be assigned belongs by responding to a language switching request of the client to be assigned; determines the language package to be assigned of the client to be assigned according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request; sends the language package to be assigned to the client to be assigned, and assigns the language package to be assigned to different clients according to different regions, thereby refining the language package allocation method and improving the language package allocation efficiency.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a language package allocation method provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flow chart of a language package allocation method provided according to Embodiment 2 of the present invention;
[0024] Figure 3 is a structural diagram of a language package distribution device provided according to an embodiment of the present invention;
[0025] Figure 4 It is a structural diagram of a language package distribution device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] In the technical solution of the embodiment of the present invention, the acquisition, storage and application of the language switching request etc. involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0029] Embodiment 1
[0030] Figure 1 This is a flow chart of a language pack distribution method provided in Embodiment 1 of the present invention. The embodiment of the present invention is applicable to the situation of language pack distribution, and the method can be executed by a language pack distribution device, and the language pack distribution device can be implemented in the form of hardware and / or software.
[0031] See also Figure 1 The language pack distribution method shown includes:
[0032] S101. In response to a language switching request of a client to be assigned, obtaining a region corresponding to the client to be assigned.
[0033] The language pack may be a program or file set that can convert the original display language of the software or system into another language, so as to meet the needs of different users for different language interfaces and facilitate users with different language backgrounds to use the software or operating system. The client to be assigned may be the client to which the language pack is assigned. The language switching request may be a language switching command sent by the client to be assigned.
[0034] Specifically, one region corresponds to at least one IP address. The client to be assigned sends a language switching request to the server. After receiving the language switching request sent by the client to be assigned, the server identifies the language switching request, obtains the IP address corresponding to the language switching request, and determines the region corresponding to the IP address based on the IP address corresponding to the language switching request, thereby obtaining the region corresponding to the client to be assigned.
[0035] S102: Determine the language package to be allocated to the client to be allocated according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request.
[0036] The language pack identifier may be used to describe the language corresponding to the language pack.
[0037] Specifically, one region corresponds to at least one language pack identifier. The correspondence between the region and the language pack identifier can be generated in advance. According to the region to which the client to be assigned belongs, a query is performed in the correspondence between the pre-set region and the language pack identifier to determine the language pack identifier corresponding to the region. According to the language switching request, the language pack identifier that the application to be assigned expects can be switched can be determined. According to the language pack identifier corresponding to the region, the languages available in the region to which the client to be assigned belongs are determined. According to the language pack identifier pointed to by the language switching request, the language required by the user corresponding to the client to be assigned can be determined. According to the language pack identifier corresponding to the region and the language pack identifier pointed to by the language switching request, the identifier of the language pack to be assigned corresponding to the client to be assigned is determined, and according to the identifier of the language pack to be assigned, the language pack to be assigned of the client to be assigned is determined, and the language pack that the server needs to assign to the client to be assigned can be determined, so that the client to be assigned can switch the language of the application according to the language pack to be assigned.
[0038] S103: Send the language package to be allocated to the client to be allocated.
[0039] Specifically, the language packages to be allocated for different client requirements are different. For different clients to be allocated, the server can send the language packages to be allocated for different clients to be allocated. The sending method can be based on HTTP protocol, FTP protocol or DHCP protocol, etc., which is not limited in the embodiment of the present invention.
[0040] The technical solution of the embodiment of the present invention obtains the region corresponding to the client to be assigned by responding to the language switching request of the client to be assigned; determines the language package to be assigned of the client to be assigned according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request; sends the language package to be assigned to the client to be assigned, and assigns the language package to be assigned to different clients according to different regions, thereby refining the language package allocation method and improving the language package allocation efficiency.
[0041] Embodiment 2
[0042] Figure 2 This is a flow chart of a language package allocation method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment of the present invention optimizes and improves the language package allocation operation.
[0043] Further, "determine the language pack to be allocated of the client to be allocated according to the language pack identifier corresponding to the region and the language pack identifier pointed to by the language switching request" is refined into "according to the region, query in the language pack public library to obtain at least one regional language pack identifier corresponding to the region to which the client to be allocated belongs; identify the language switching request to obtain language pack information corresponding to the language switching request, the language pack information including: application identifier, version identifier and at least one target language; determine the language pack to be allocated of the client to be allocated according to the language pack identifiers of each region and the language pack information corresponding to the language switching request" to improve the operation of language pack allocation.
[0044] It should be noted that for the parts not described in detail in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.
[0045] See also Figure 2 The language pack distribution method shown includes:
[0046] S201. In response to a language switching request of a client to be assigned, obtaining a region corresponding to the client to be assigned.
[0047] S202: According to the region, query the language pack public library to obtain at least one regional language pack identifier corresponding to the region to which the client to be allocated belongs.
[0048] The language pack common library is used to store language packs. There is a language pack common library. Each client to be allocated can obtain at least one language pack from the language pack common library. The regional language pack identifier can be used to describe the language pack corresponding to a region. A region can correspond to at least one regional language pack identifier.
[0049] Specifically, at least one index table is stored in the language pack common library. The index table stores the correspondence between at least one region, at least one language pack identifier and at least one language pack file, and at least one language pack file is also stored in the language pack common library. According to the region to which the client to be assigned belongs, at least one language pack identifier corresponding to the region can be queried in the language pack common library, and each language pack identifier is determined as at least one regional language pack identifier corresponding to the region to which the client to be assigned belongs. The query method includes, but is not limited to: sequential search algorithm, binary search algorithm, hash search algorithm, tree table search algorithm or block search algorithm, etc., which is not limited in the embodiments of the present invention.
[0050] S203: Identify the language switching request and obtain language package information corresponding to the language switching request, where the language package information includes: an application identifier, a version identifier, and at least one target language.
[0051] The application identifier may be an application program for which language switching is to be performed. The version identifier may be an identifier of a version of an application program. The target language may be a target language required by the client to be allocated, and there may be at least one target language.
[0052] Specifically, different versions of an application may correspond to different target languages. When a user wants to switch the language corresponding to an application, the user may input the desired language into the application. The input method includes, but is not limited to, mouse selection, keyboard input, or voice input, etc. The embodiment of the present invention does not limit this. After the application receives the desired language input by the user, it combines the language information with the application identifier and version identifier corresponding to the application to generate a language switching request and send it to the server. The server receives the language switching request and identifies the language switching request to obtain the application identifier, version identifier, and at least one target language. The identification method may be: a fully connected neural network, a convolutional neural network, a recurrent neural network, or a generative adversarial neural network, etc.
[0053] S204: Determine the language package to be allocated to the client to be allocated according to the language package identifier of each region and the language package information corresponding to the language switching request.
[0054] Specifically, a comparison is made based on the language pack identifier of each region and the target language in the language pack information corresponding to the language switching request. If the type of the language pack identifier of each region is greater than the type of the target language, it indicates that a new language pack has been added to the region, and the newly added language pack will be allocated to the client to be allocated; if the type of the language pack identifier of each region is less than or equal to the type of the target language, it indicates that no new language pack has been added to the region, and it is not necessary to allocate the newly added language pack to the client to be allocated. It can be determined whether the existing language pack of the client to be allocated has updated information, and the updated information will be packaged and determined as the language pack to be allocated for the client to be allocated.
[0055] S205: Send the language package to be allocated to the client to be allocated.
[0056] The embodiment of the present invention obtains at least one regional language pack identifier corresponding to the region to which the client to be assigned belongs by querying in a language pack public library according to the region; identifies a language switching request to obtain language pack information corresponding to the language switching request, the language pack information including: an application identifier, a version identifier and at least one target language; determines the language pack to be assigned of the client to be assigned according to the regional language pack identifier and the language pack information corresponding to the language switching request, and can determine the language data to be assigned to the client to be assigned according to different language switching requests, without having to send all the language data to the client in advance, thereby saving the memory space of the client.
[0057] Optionally, the language package to be allocated of the client to be allocated is determined according to the language package information corresponding to the language package identifier of each region and the language switching request, including: comparing the target languages in the language package information corresponding to the language package identifier of each region and the language switching request to obtain language package comparison information, the language package comparison information including: comparison result and new result; if the comparison result is a new language identifier, then the type of language package to be allocated corresponding to the client to be allocated is determined to be a full language package type; if the comparison result is that no new language package identifier is added, then the type of language package to be allocated corresponding to the client to be allocated is determined to be an incremental language package type; according to the type of language package to be allocated and the language package information corresponding to the language switching request, the language package to be allocated of the client to be allocated is determined.
[0058] Among them, the language package comparison information may be description information of the comparison result of each regional language package identifier and each target language in the language package information corresponding to the language switching request. The comparison result may be the comparison result of each regional language package identifier and each target language in the language package information corresponding to the language switching request. The newly added result may be whether there are remaining regional language package identifiers compared with each target language in the language package information corresponding to the language switching request and description information of each remaining regional language package identifier. The full language package type may be used to describe that there are remaining regional language package identifiers compared with each target language in the language package information corresponding to the language switching request. The incremental language package type may be used to describe that there are no remaining regional language package identifiers compared with each target language in the language package information corresponding to the language switching request.
[0059] Specifically, the target languages in the language pack information corresponding to the language pack identifiers of each region and the language switching request are compared to obtain language pack comparison information, which includes: comparison results and new addition results; if the comparison result is a new language pack identifier, it indicates that the client to be assigned is a new user, and the types of the language pack identifiers of each region include the remaining regional language pack identifiers in addition to the target languages, then the language packs corresponding to the remaining regional language pack identifiers need to be sent to the client to be assigned, and the type of the language pack to be assigned corresponding to the client to be assigned is determined to be a full language pack type; if the comparison result is that no new language pack identifier is added, it indicates that the client to be assigned is an old user, and no language pack needs to be sent to the client to be assigned, and only the update data corresponding to the existing language pack in the client to be assigned needs to be packaged to obtain the language pack to be assigned, and the type of the language pack to be assigned corresponding to the client to be assigned is determined to be an incremental language pack type. The target language can be empty.
[0060] By comparing the target languages in the language pack identifiers of each region and the language pack information corresponding to the language switching request, the language pack comparison information is obtained, and the language pack comparison information includes: comparison results and new results; if the comparison result is a new language identifier, the type of the language pack to be allocated corresponding to the client to be allocated is determined to be a full language pack type; if the comparison result is that there is no new language pack identifier, the type of the language pack to be allocated corresponding to the client to be allocated is determined to be an incremental language pack type; according to the type of the language pack to be allocated and the language pack information corresponding to the language switching request, the language pack to be allocated of the client to be allocated is determined, different types of the language pack to be allocated are determined according to different comparison results, and the language pack to be allocated is allocated according to different types of the language pack to be allocated, thereby refining the language pack allocation method and improving the accuracy of language pack allocation.
[0061] Optionally, the type of language package to be allocated is a full language package type. According to the type of language package to be allocated and the language package information corresponding to the language switching request, the language package to be allocated of the client to be allocated is determined, including: determining at least one new language package identifier according to the new results in the language package comparison information; according to each new language package identifier, querying in the language package public library to obtain the language package file corresponding to each new language package identifier; and determining each language package file as the language package to be allocated of the client to be allocated.
[0062] The language pack file can be used to describe the language pack corresponding to the language pack identifier. Each language pack includes at least one character string and a translation character string corresponding to each character string in the same language as the language pack identifier.
[0063] Specifically, at least one newly added language package identifier is determined according to the newly added result in the language package comparison information, that is, the language package identifier of the language package that the client to be allocated does not have is determined. According to the index relationship between each newly added language package identifier and the language package public library, the language package file corresponding to each newly added language package identifier is queried in the language package public library, each language package file is determined as the language package to be allocated to the client to be allocated, and each language package file is sent to the client to be allocated.
[0064] By determining at least one new language pack identifier based on the new results in the language pack comparison information; querying and obtaining the language pack files corresponding to each new language pack identifier in the language pack public library according to each new language pack identifier; determining each language pack file as a language pack to be allocated to the client to be allocated, and sending each language pack file corresponding to each new language pack identifier to the client to be allocated, the language pack can be dynamically allocated without having to download all the language packs locally in advance, thereby reducing memory usage.
[0065] Optionally, the type of language package to be allocated is an incremental language package type. According to the type of language package to be allocated and the language package information corresponding to the language switching request, the language package to be allocated of the client to be allocated is determined, including: obtaining at least one library string translation pair corresponding to at least one regional language package identifier corresponding to the region to which the client to be allocated belongs; according to each regional language package identifier, querying in a language package public library to obtain at least one basic string translation pair corresponding to at least one regional language package identifier; comparing each basic string translation pair with each library string translation pair to obtain a string comparison result; according to the string comparison result, determining at least one incremental string pair and generating an incremental file, and determining the incremental file as the language package to be allocated of the client to be allocated.
[0066] Among them, a string translation pair refers to a collection of strings and the translation texts corresponding to the strings. A string translation pair corresponds to a string and the translation text corresponding to the string. The library string translation pair can be used to describe the string translation pairs in the language packs already in the client to be assigned. The basic string translation pair can be used to describe the string translation pairs in the language pack corresponding to the regional language pack identifier in the language pack public library. The string comparison result can be the result of comparing each basic string translation pair with each library string translation pair. The incremental string pair can be a string translation pair that is different for the same language, when the language pack corresponding to the language pack public library is different from the language pack corresponding to the client to be assigned. The incremental file can describe the collection of each incremental string.
[0067] Specifically, the types of languages required by the client to be assigned have not increased, so there is no need to assign a new language pack to the client to be assigned. It is only necessary to package the newly added string translation pairs in the language public library and send them to the client to be assigned. One region corresponds to at least one regional language pack. The regional language pack corresponds to the regional language pack identifier one by one. At least one regional language pack identifier corresponding to the region to which the client to be assigned belongs is obtained, and the regional language pack corresponding to each regional language pack identifier is searched according to each regional language pack identifier. A regional language pack includes at least one library string translation pair. According to each regional language pack identifier, a language pack in the public library corresponding to at least one regional language pack identifier is queried in the language pack public library, and at least one basic string translation pair is determined according to the language pack in each public library. Each basic string translation pair is compared with each library string translation pair to obtain a string comparison result. For the same language, the string translation pairs in the language pack in the public library corresponding to the language and the existing language pack corresponding to the client to be assigned are compared, and the string translation pairs in the public library that are different from those in the client to be assigned are determined as incremental string pairs and an incremental file is generated, and the incremental file is determined as the language pack to be assigned for the client to be assigned.
[0068] The method comprises the following steps: obtaining at least one library string translation pair corresponding to at least one regional language pack identifier corresponding to the region to which the client to be allocated belongs; querying at least one basic string translation pair corresponding to at least one regional language pack identifier in a language pack public library according to each regional language pack identifier; comparing each basic string translation pair with each library string translation pair to obtain a string comparison result; determining at least one incremental string pair and generating an incremental file according to the string comparison result, determining the incremental file as the language pack to be allocated of the client to be allocated, and only sending the newly updated strings in the public library to the client to be allocated, without reallocating the language pack, thereby saving the memory space of the client to be allocated.
[0069] Optionally, sending the language package to be allocated to the client to be allocated includes: packaging the language package to be allocated to obtain a compressed file corresponding to the language package to be allocated; obtaining a client address corresponding to the client to be allocated; and sending the compressed file to the client address so that the client to be allocated stores the compressed file locally for application rendering.
[0070] The compressed file may be a file generated by compressing the language package to be allocated. The client address may be an IP address corresponding to the client to be allocated.
[0071] Specifically, a packaging function module can be preset. After the language package to be allocated is generated, the packaging function module is triggered, and the packaging function module packages the language package to be allocated to obtain a compressed file corresponding to the language package to be allocated. The client address corresponding to the client to be allocated is obtained; the compressed file is sent to the client address, so that the client to be allocated stores the compressed file locally for application rendering. There are two ways for the client to use the string after decompressing the compressed file locally: one is to use code to set it explicitly, that is, call setText or setTitle, etc.; the other is to use the attribute in the XML layout file to directly reference the string resource. For the method of using code to set it explicitly, all explicit call processes will be intercepted through the custom resource wrapper (ResourceWrapper) class, and the string resources to be used will be replaced with the resources in the language package. For the string resources referenced in the layout, the custom creation view (LayoutInflater.Factory2) interface will be used to intercept the creation process of all pages, and then the attributes of all controls that use string resources will be retrieved and explicitly set through code to replace the language string.
[0072] The language package to be allocated is packaged to obtain a compressed file corresponding to the language package to be allocated; the client address corresponding to the client to be allocated is obtained; the compressed file is sent to the client address so that the client to be allocated stores the compressed file locally for application rendering. The language package to be allocated can be compressed and transmitted, which reduces the amount of transmitted data and improves transmission efficiency.
[0073] Optionally, the language pack public library stores the correspondence between the region identifier, the application identifier, the version identifier and the public language pack and at least one public language pack, and the language pack public library is configured on a public server.
[0074] Specifically, the language pack common library stores the correspondence between the region identifier, application identifier, version identifier and common language pack and at least one common language pack. Each client to be allocated can query the correspondence between the region identifier, application identifier, version identifier and common language pack from the language pack common library, and can obtain the common language pack. The client to be allocated can access the language pack common library through a secret key. The language pack common library is configured on a public server, and each client to be allocated can send a language switching request to the public server, and the public server can send a language pack to each language pack to be allocated according to the language switching request.
[0075] The language pack common library stores the correspondence between the region identifier, application identifier, version identifier and common language pack and at least one common language pack, and the language pack common library is configured on a common server, which is beneficial to the consistency of resources received by each client to be allocated.
[0076] Embodiment 3
[0077] Figure 3 This is a schematic diagram of the structure of a language package distribution device provided in Embodiment 3 of the present invention. The embodiment of the present invention is applicable to the situation of language package distribution, the device can execute the language package distribution method, and the device can be implemented in the form of hardware and / or software.
[0078] See also Figure 3 The language package distribution device shown includes: a region acquisition module 301, a language package determination module 302 and a language package sending module 303, wherein:
[0079] The region acquisition module 301 is used to obtain the region corresponding to the client to be assigned in response to the language switching request of the client to be assigned;
[0080] The language package determination module 302 is used to determine the language package to be allocated to the client to be allocated according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request;
[0081] The language package sending module 303 is used to send the language package to be distributed to the client to be distributed.
[0082] The technical solution of the embodiment of the present invention obtains the region corresponding to the client to be assigned by responding to the language switching request of the client to be assigned; determines the language package to be assigned of the client to be assigned according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request; sends the language package to be assigned to the client to be assigned, and assigns the language package to be assigned to different clients according to different regions, thereby refining the language package allocation method and improving the language package allocation efficiency.
[0083] Optionally, the language package determination module 302 includes:
[0084] A region identification acquisition unit, configured to query a language pack public library according to the region to which the client to be assigned belongs to obtain at least one region language pack identification corresponding to the region to which the client to be assigned belongs;
[0085] An information identification unit, used to identify the language switching request and obtain language package information corresponding to the language switching request, wherein the language package information includes: an application identifier, a version identifier and at least one target language;
[0086] The language package determining unit is used to determine the language package to be allocated to the client to be allocated according to the language package identifier of each region and the language package information corresponding to the language switching request.
[0087] Optionally, a language package determination unit includes:
[0088] The comparison information acquisition subunit is used to compare the target languages in the language pack information corresponding to the language pack identifiers of each region and the language switching request to obtain language pack comparison information, which includes: comparison results and newly added results;
[0089] The full type determination subunit is used to determine that the type of the language package to be allocated corresponding to the client to be allocated is a full language package type if the comparison result is a newly added language identifier;
[0090] The incremental type determination subunit is used to determine that the type of the language package to be allocated corresponding to the client to be allocated is an incremental language package type if the comparison result is that no new language package identifier is added;
[0091] The multi-dimensional information analysis subunit is used to determine the language package to be allocated to the client to be allocated according to the type of the language package to be allocated and the language package information corresponding to the language switching request.
[0092] Optional, multi-dimensional information analysis subunit, specifically used for:
[0093] The type of the language package to be allocated is a full language package type, and at least one new language package identifier is determined according to the new addition result in the language package comparison information;
[0094] According to each newly added language pack identifier, the language pack file corresponding to each newly added language pack identifier is searched in the language pack public library;
[0095] Each language pack file is determined as a language pack to be allocated to the client to be allocated.
[0096] Optional, multi-dimensional information analysis subunit, specifically used for:
[0097] The type of the language pack to be allocated is an incremental language pack type, and at least one library string translation pair corresponding to at least one regional language pack identifier corresponding to the region to which the client to be allocated belongs is obtained;
[0098] According to the language pack identifiers of each region, querying in a language pack public library to obtain at least one basic string translation pair corresponding to at least one regional language pack identifier;
[0099] Compare each base string translation pair with each library string translation pair to obtain a string comparison result;
[0100] According to the string comparison result, at least one incremental string pair is determined and an incremental file is generated, and the incremental file is determined as the language package to be allocated to the client to be allocated.
[0101] Optionally, the language packet sending module 303 is specifically used to:
[0102] Packaging the language package to be allocated to obtain a compressed file corresponding to the language package to be allocated;
[0103] Get the client address corresponding to the client to be assigned;
[0104] The compressed file is sent to the client address, so that the client to be assigned stores the compressed file locally for application rendering.
[0105] Optionally, the language pack public library stores the correspondence between the region identifier, the application identifier, the version identifier and the public language pack and at least one public language pack, and the language pack public library is configured on a public server.
[0106] The language package distribution device provided in the embodiment of the present invention can execute the language package distribution method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the language package distribution method.
[0107] Embodiment 4
[0108] Figure 4 A schematic diagram of the structure of a language package distribution device 400 that can be used to implement an embodiment of the present invention is shown.
[0109] like Figure 4 As shown, the language pack distribution device 400 includes at least one processor 401, and a memory connected to the at least one processor 401, such as a read-only memory (ROM) 402, a random access memory (RAM) 403, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 401 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 402 or the computer program loaded from the storage unit 408 to the random access memory (RAM) 403. In RAM403, various programs and data required for the operation of the language pack distribution device 400 can also be stored. The processor 401, ROM402 and RAM403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0110] A number of components in the language pack distribution device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the language pack distribution device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0111] Processor 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. Processor 501 performs the various methods and processes described above, such as a language package allocation method.
[0112] In some embodiments, the language pack distribution method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the language pack distribution device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the processor 401, one or more steps of the language pack distribution method described above may be performed. Alternatively, in other embodiments, the processor 401 may be configured to perform the language pack distribution method in any other appropriate manner (e.g., by means of firmware).
[0113] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0115] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0116] To provide interaction with a user, the systems and techniques described herein may be implemented on a language pack distribution device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the language pack distribution device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0117] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0118] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS (Virtual Private Server) services.
[0119] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0120] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for allocating a language package, characterized in that: The method comprises: In response to a language switching request of a client to be assigned, obtaining a region corresponding to the client to be assigned; Determining the language package to be allocated to the client to be allocated according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request; The language package to be allocated is sent to the client to be allocated.
2. The method according to claim 1, characterized in that The determining the language package to be allocated to the client to be allocated according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request includes: According to the region, querying in a language package public library to obtain at least one regional language package identifier corresponding to the region to which the client to be assigned belongs; Identify the language switching request and obtain language package information corresponding to the language switching request, wherein the language package information includes: an application identifier, a version identifier, and at least one target language; The language package to be allocated to the client to be allocated is determined according to the language package identifiers of the respective regions and the language package information corresponding to the language switching request.
3. The method according to claim 2, characterized in that The determining the language package to be allocated to the client to be allocated according to the language package identifiers of the respective regions and the language package information corresponding to the language switching request includes: Compare each of the target languages in the language pack information corresponding to each of the regional language pack identifiers and the language switching request to obtain language pack comparison information, the language pack comparison information including: comparison results and newly added results; If the comparison result is a newly added language identifier, determining that the type of the language package to be allocated corresponding to the client to be allocated is a full language package type; If the comparison result is that there is no new language package identifier, determining that the type of the language package to be allocated corresponding to the client to be allocated is an incremental language package type; The language package to be allocated to the client to be allocated is determined according to the type of the language package to be allocated and the language package information corresponding to the language switching request.
4. The method according to claim 3, characterized in that The type of the language package to be allocated is a full language package type, and determining the language package to be allocated of the client to be allocated according to the type of the language package to be allocated and the language package information corresponding to the language switching request includes: Determining at least one new language package identifier according to the new results in the language package comparison information; According to each of the newly added language pack identifiers, querying in the language pack public library to obtain the language pack files corresponding to each of the newly added language pack identifiers; Each of the language package files is determined as a language package to be allocated to the client to be allocated.
5. The method according to claim 3, characterized in that: The type of the language package to be allocated is an incremental language package type, and determining the language package to be allocated of the client to be allocated according to the type of the language package to be allocated and the language package information corresponding to the language switching request includes: Obtaining at least one library string translation pair corresponding to at least one regional language pack identifier corresponding to the region to which the client to be allocated belongs; According to each of the regional language package identifiers, querying in the language package public library to obtain at least one basic string translation pair corresponding to at least one regional language package identifier; Comparing each of the base string translation pairs with each of the library string translation pairs to obtain a string comparison result; According to the string comparison result, at least one incremental string pair is determined and an incremental file is generated, and the incremental file is determined as the language package to be allocated to the client to be allocated.
6. The method according to claim 1, characterized in that The sending the to-be-allocated language package to the to-be-allocated client includes: Packaging the language package to be allocated to obtain a compressed file corresponding to the language package to be allocated; Obtaining a client address corresponding to the client to be assigned; The compressed file is sent to the client address, so that the client to be distributed stores the compressed file locally for application rendering.
7. The method according to claim 2, characterized in that: The language package public library stores the region identifier, the application identifier, the version identifier, the correspondence between the public language packages, and at least one public language package. The language package public library is configured on a public server.
8. A language pack distribution device, characterized in that: The device comprises: A region acquisition module, configured to obtain the region corresponding to the client to be assigned in response to a language switching request of the client to be assigned; A language package determination module, configured to determine the language package to be allocated to the client to be allocated according to the language package identifier corresponding to the region and the language package identifier pointed to by the language switching request; The language package sending module is used to send the language package to be distributed to the client to be distributed.
9. A language package distribution device, characterized in that: The language package distribution device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the language package allocation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the language package allocation method according to any one of claims 1 to 7 when executed.