CN104850386A - Software system internationalization resource processing method - Google Patents

Software system internationalization resource processing method Download PDF

Info

Publication number
CN104850386A
CN104850386A CN201410009375.4A CN201410009375A CN104850386A CN 104850386 A CN104850386 A CN 104850386A CN 201410009375 A CN201410009375 A CN 201410009375A CN 104850386 A CN104850386 A CN 104850386A
Authority
CN
China
Prior art keywords
service end
resource
file
content
internationalized resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410009375.4A
Other languages
Chinese (zh)
Inventor
罗勇
陈文娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai United Imaging Healthcare Co Ltd
Wuhan United Imaging Healthcare Co Ltd
Original Assignee
Shanghai United Imaging Healthcare Co Ltd
Wuhan United Imaging Healthcare Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai United Imaging Healthcare Co Ltd, Wuhan United Imaging Healthcare Co Ltd filed Critical Shanghai United Imaging Healthcare Co Ltd
Priority to CN201410009375.4A priority Critical patent/CN104850386A/en
Publication of CN104850386A publication Critical patent/CN104850386A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a software system internationalization resource processing method. The method comprises the following steps that a client side initiates an internationalization resource processing request to a service end; the service end receives the request and compares a hash value of the internationalization resource file in the service end and a hash value of the internationalization resource file in the client side; if the hash values of the internationalization resource files in the client side and in the service end are unequal, the internationalization resource file is downloaded from the service end to the client side; if the hash values of the internationalization resource files in the client side and in the service end are equal, the internationalization resource file is loaded from a buffer memory of the client side; and the client side analyzing the downloaded the internationalization resource file and cache the file at the client side. With adoption of the technical scheme, visual interface operation resource files are provided, and sharing and mutual use of internationalization information of the service end and the client side are also realized.

Description

A kind of disposal route of internationalizing software system resource
Technical field
The present invention relates to field of information processing, particularly relate to a kind of disposal route of internationalizing software system resource.
Background technology
Along with the raising day by day of economic globalization degree, Software Industry gradually adopts the standard of international uniform.In the design and development process of software systems, how to realize International Software, enable software systems process multilingual and cultural custom, meet the demand of different regions, different client, become the problem that Software Industry is urgently to be resolved hurrily.
At present, internationalizing software system is all generally the internationalized resources being stored different language by properties file, and properties file stores on the server.When client initiates request, service end, according to the language form parameter in client-requested, provides the Basic national topographic map resource file of correspondence to client downloads; The resource grace of download is shown in put and judges whether to need to upgrade resource file according to version number in the buffer by client.There is following drawback in this method: the data layout of (1) properties file is that key-it is right to be worth, widely different with the content format of common text files, not easily read, also inconveniently directly to inquire about rapidly, increase newly, revise, content in deleted file, concerning the personnel not having program development experience, be difficult to revise properties file content quickly and accurately according to demand; (2) error message of service end, authorization information and log information are generally all deposited in word properties file, and the internationalization process inside client script is generally all placed in the script definition of client, service end and client are that the different internationalization of two covers realizes, thus there is internationalized resources content and can not reuse and re-define, increase workload and later maintenance difficulty steps on problem; (3) version number of resource file and version number's binding of whole software, when software release upgrade, even if properties file content is without any change, all clients also can from service end again downloaded resources file, take more network broadband, affect the experience of user; (4) internationalized resources file is stored on hard disk, if desired backs up, and needs in a manual fashion or the program of writing more complicated completes.
Summary of the invention
The problem of the present invention's solution is to provide the disposal route of a kind of internationalizing software system resource of method, not only provides visual interface operation resource file, automated back-up internationalized resources content, also realizes the shared and mutual use of service end and client internationalization information.
In order to solve the problem, the invention provides a kind of disposal route of internationalizing software system resource, comprising the steps:
(1) client initiates the request of the described internationalized resources of process to service end;
(2) described service end receives described request, and is compared in the cryptographic hash of described client by the file of the cryptographic hash of the file of described internationalized resources in described service end and described internationalized resources;
(3) if the cryptographic hash of described internationalized resources file in described client and service end is unequal, then from described service end, described internationalized resources file is downloaded to described client; If the cryptographic hash of described internationalized resources file in described client and service end is equal, then from the buffer memory of described client, load described internationalized resources file;
(4) the internationalized resources file of described download is resolved by described client, and is buffered in described client.
The disposal route of a kind of internationalizing software system resource described above, wherein, before client initiates request to service end, determine the cryptographic hash of described internationalized resources, its process is:
(1) set up resource data table, described resource data table is for storing the content of described internationalized resources;
(2) content of all described internationalized resources in described resource data table is carried out visual;
(3) according to language classification rule, the internationalized resources content of inquiry described request, and write resource file;
(4) cryptographic hash of described resource file is calculated, and by described cryptographic hash stored in database.
The disposal route of a kind of internationalizing software system resource described above, wherein, the content of described internationalized resources is language classification, resource language and internationalized resources value.
The disposal route of a kind of internationalizing software system resource described above, wherein, carrying out visual process to the content of all described internationalized resources in described resource data table is: inquire contents all in described resource data table by query sentence of database; Element on described all the elements and visualization interface is bound, and show described all the elements on described visualization interface.
The disposal route of a kind of internationalizing software system resource described above, wherein, described cryptographic hash is MD5 cryptographic hash.
The disposal route of a kind of internationalizing software system resource described above, wherein, according to the rule of definition, the resource file content of internationalized resources described in timed backup.
The disposal route of a kind of internationalizing software system resource described above, wherein, when described service end receives described request, read the resource file content of described internationalized resources, and be buffered in described service end, and replace the international content of need corresponding in described service end by the content in internationalized resources file.
The disposal route of a kind of internationalizing software system resource described above, wherein, needs international content to be log information in described service end, the character string constant in information, warning message, error message and the described service end page in described service end.
The disposal route of a kind of internationalizing software system resource described above, wherein, according to the content of the internationalized resources of described parsing, described client is replaced in described client end interface needs the content shown that internationalizes.
Compared with prior art, the present invention, by comparing the cryptographic hash of the internationalized resources file of client and service end, judges whether internationalized resources file has renewal, avoids client repeated downloads internationalized resources, releases network broadband, improve the experience of user;
Further, introduce resource data table, save language classification, resource language and internationalized resources value, and adopt visualization interface, conveniently increase newly, revise, delete and retrieval internationalized resources file content, facilitate user to configure internationalization content rapidly;
Further, service end and client share identical resource file, reach the unified definition of service end and client resource file, public, reduce repeated work, save maintenance cost;
Further, database mode is adopted to store internationalized resources file content, by the strategy of database, regular automated back-up.
Accompanying drawing explanation
Figure 1 shows that the schematic flow sheet of the disposal route of a kind of internationalizing software system resource of the embodiment of the present invention;
Figure 2 shows that the schematic flow sheet of the cryptographic hash of embodiment of the present invention determination internationalized resources.
Embodiment
Set forth a lot of detail in the following description so that fully understand the present invention.But the present invention can be much different from alternate manner described here to implement, those skilled in the art can when without prejudice to doing similar popularization when intension of the present invention, therefore the present invention is by the restriction of following public concrete enforcement.
Secondly, the present invention utilizes schematic diagram to be described in detail, and when describing the embodiment of the present invention in detail, for ease of illustrating, described schematic diagram is example, and it should not limit the scope of protection of the invention at this.
Be described in detail below in conjunction with the disposal route of drawings and Examples to a kind of internationalizing software system resource of the present invention.As shown in Figure 1, first, perform step S1, client initiates the request of the described internationalized resources of process to service end to embodiment of the present invention internationalizing software system method for processing resource.Wherein, described client determines the cryptographic hash of described internationalized resources before initiating request to described service end, and as shown in Figure 2, first, perform step S201, set up resource data table, described resource data table is for storing the content of described internationalized resources.Wherein, the content of described internationalized resources is language classification, resource language and internationalized resources value.Particularly, in the present embodiment, described language classification, resource language and internationalized resources value are carried out one_to_one corresponding, such as: language classification is zh-CN, and resource code name and resource value are respectively Country.China and China; Language classification is en-US, and resource code name and resource value are respectively Country.China and China; Language classification is zh-CN, and resource code name and resource value are respectively Country.America and the U.S.; Language classification is en-US, and resource code name and resource value are respectively Country.America and America.
Then, perform step S202, the content of all described internationalized resources in described resource data table is carried out visual.Particularly, carrying out visual process to the content of all described internationalized resources in described resource data table is: inquire contents all in described resource data table by query sentence of database; Element on described all the elements and visualization interface is bound, and show described all the elements on described visualization interface.In the present embodiment, by SQL (the Structure QueryLanguage of database, Structured Query Language (SQL)) inquire contents all in the resource data table defined in described step S201, by all the elements in the resource data table in described inquiry and element (the resource code name on visualization interface, resource value, language classification) binding, described visualization interface shows the content inquired in described resource data table.Then, to the every bar data in form on described interface, according to the actual needs, Edit button and delete button is clicked, the data that editor and deletion are presented in the resource data table that described interface represents.The right of form on described visualization interface is provided with three Text Entry, the resource code name of typing required for user, resource value and language classification can be inputted in described Text Entry, click save button, the data of above-mentioned input in Text Entry are saved in resource data table; Click reset button, empty all values in described Text Entry.
Then, step S203 is performed, according to language classification rule, the internationalized resources content of inquiry described request, and write resource file.Particularly, in the present embodiment, use Structured Query Language (SQL) statement, go out the internationalized resources content of described request according to language classification Querying by group.Then, by the method for the IO interface of C# operation file, by above-mentioned result (form of described result is " resource code name=resource value ") the write resource file inquired.Described resource file is a kind of text, and according to key-be worth right mode to store content, suffix is called .properties, and file designation mode is " language .properties ".In the present embodiment, based on the content in above-mentioned resource data table, derive and generate " en-US.properties " and " zh-CN.properties " two resource files.
Then, perform step S204, calculate the cryptographic hash of described resource file, and by described cryptographic hash stored in database.Wherein, described cryptographic hash is MD5 cryptographic hash.Due to keyed Hash function computationally the unlikely hash that finds be the input that two of identical value are different, namely the cryptographic hash of two groups of data only just can be mated when the data of correspondence are also mated; A small amount of change of data can produce unpredictable a large amount of change in cryptographic hash.Therefore, in the present embodiment, adopt MD5 hash algorithm, the cryptographic hash size of described MD5 algorithm is 128.Particularly, the MD5 cryptographic hash of two resource files " en-US.properties " and " zh-CN.properties " obtained in step S203 is calculated by MD5 hash algorithm, and by described result of calculation stored in database, as the version number of .properties file.
In the present embodiment, when client initiates request to service end, the resource file of described request will be related in the content of pages of described service end, add inlet identity version information parameter, and the MD5 cryptographic hash of the described resource file generated in step S204 is replaced the resource file version information in the content of pages of described service end.
Then, perform step S2, described service end receives described request, and is compared in the cryptographic hash of described client by the file of the cryptographic hash of the file of described internationalized resources in described service end and described internationalized resources.If the cryptographic hash of described internationalized resources file in described client and service end is unequal, then performs step S3, from described service end, download described internationalized resources file to described client; If the cryptographic hash of described internationalized resources file in described client and service end is equal, then performs step S4, from the buffer memory of described client, load described internationalized resources file.
Wherein, described in described service end process, the process of internationalized resources is: when described service end receives described request, read the resource file content of described internationalized resources, and be buffered in described service end, and replace the international content of need corresponding in described service end by the content in described internationalized resources file.Particularly, in the present embodiment, the method of described service end by calling, all contents in above-mentioned resource file " en-US.properties " and " zh-CN.properties " are all read out, from the above, the content format of described resource file is " key=value (key=value) " form.Then, the described each row of data read out is split, after fractionation, using the key value of the key in described resource file as Dictionary, using the value in described resource file as the value value in Dictionary, and described each row of data is all put into Dictionary, described Dictionary is buffered in described service end, by the resource file content caching of described internationalized resources in described service end.
Particularly, international content is needed to be log information in described service end in described service end, information, warning message, the character string constant in error message and the page.Such as current request service needs to write nationality's information in journal file, if the language parameter in request is " zh-CN ", now can inquire about " Country.China " in the Dictinary in service end buffer memory, to inquire " China ", and be written to service end journal file, if the language parameter of current request is " en-US ", so the result inquired " China " can be write journal file by service end.The process of internationalized resources described in client process is: after service end receives described request, version number (corresponding with cryptographic hash) corresponding for internationalized resources in described request is returned to described client, and the .properties version number in the .properties version number about described asked internationalized resources file that described service end returns by described client and described client-cache compares.If described version number is equal, then directly from the buffer memory of described client, load requested resource file; If described version number is unequal, then from described server, download up-to-date .properties file.
Then, perform step S5, the internationalized resources file of described download is resolved by described client, and is buffered in described client.Particularly, in the present embodiment, after client has downloaded asked .properties file from its buffer memory or service end, client is all read out contents all in resource file by JavaScript, and construct the Dictionary object of similar functions in and service end, there is Key and Value attribute the inside, then, the each row of data read out is split, after fractionation, using the key value of the key in described resource file as Dictionary, using the value value of the value in described resource file as Dictionary, and each row of data is all put into Dictionary, in client, Dictionary is cached, call for after described client.
In addition, according to the content of the internationalized resources of described parsing, described client is replaced in described client end interface needs the content shown that internationalizes.In the present embodiment, for the above-mentioned described option of choosing the nationality about the reminding user of the page, need to replace its content to display.Particularly, when client-requested parameter is " zh-CN ", client obtains the internationalized resources content of buffer memory in above-mentioned steps S5, and return " China " character string, then described prompting nationality option will show " China "; If described request parameter is " en-US ", client obtains the internationalized resources content of buffer memory in above-mentioned steps S5, and described prompting nationality option will show " China ".
From the above, service end and client resolve identical resource file, be buffered in described service end and client respectively, thus the content-defined of all resource files can be used completely mutually in described service end and client, without the need to defining the different rule of two covers, reduce maintenance and the development amount in later stage.
In addition, described internationalized resources content is deposited in a database, and therefore, by the scheduler task of database, according to definition rule, described in automated back-up, resource file content, prevents loss of data.In the present embodiment, according to " year+moon+day+hour+point+second .sql " naming method, name backup after resource file.
Although the present invention with preferred embodiment openly as above; but it is not for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; the Method and Technology content of above-mentioned announcement can be utilized to make possible variation and amendment to technical solution of the present invention; therefore; every content not departing from technical solution of the present invention; the any simple modification done above embodiment according to technical spirit of the present invention, equivalent variations and modification, all belong to the protection domain of technical solution of the present invention.

Claims (9)

1. a disposal route for internationalizing software system resource, is characterized in that, comprises the steps:
(1) client initiates the request of the described internationalized resources of process to service end;
(2) described service end receives described request, and is compared in the cryptographic hash of described client by the file of the cryptographic hash of the file of described internationalized resources in described service end and described internationalized resources;
(3) if the cryptographic hash of described internationalized resources file in described client and service end is unequal, then from described service end, described internationalized resources file is downloaded to described client; If the cryptographic hash of described internationalized resources file in described client and service end is equal, then from the buffer memory of described client, load described internationalized resources file;
(4) the internationalized resources file of described download is resolved by described client, and is buffered in described client.
2. the disposal route of a kind of internationalizing software system resource as claimed in claim 1, is characterized in that, before client initiates request to service end, determine the cryptographic hash of described internationalized resources, its process is:
(1) set up resource data table, described resource data table is for storing the content of described internationalized resources;
(2) content of all described internationalized resources in described resource data table is carried out visual;
(3) according to language classification rule, the internationalized resources content of inquiry described request, and write resource file;
(4) cryptographic hash of described resource file is calculated, and by described cryptographic hash stored in database.
3. the disposal route of a kind of internationalizing software system resource as claimed in claim 2, it is characterized in that, the content of described internationalized resources is language classification, resource language and internationalized resources value.
4. the disposal route of a kind of internationalizing software system resource as claimed in claim 2, it is characterized in that, carrying out visual process to the content of all described internationalized resources in described resource data table is: inquire contents all in described resource data table by query sentence of database; Element on described all the elements and visualization interface is bound, and show described all the elements on described visualization interface.
5. the disposal route of a kind of internationalizing software system resource as claimed in claim 2, it is characterized in that, described cryptographic hash is MD5 cryptographic hash.
6. the disposal route of a kind of internationalizing software system resource as claimed in claim 2, is characterized in that, according to the rule of definition, and the resource file content of internationalized resources described in timed backup.
7. the disposal route of a kind of internationalizing software system resource as claimed in claim 1, it is characterized in that, when described service end receives described request, read the resource file content of described internationalized resources, and be buffered in described service end, and replace the international content of need corresponding in described service end by the content in described internationalized resources file.
8. the disposal route of a kind of internationalizing software system resource as claimed in claim 7, it is characterized in that, international content is needed to be log information in described service end in described service end, the character string constant in information, warning message, error message and the described service end page.
9. the disposal route of a kind of internationalizing software system resource as claimed in claim 1, is characterized in that, according to the content of the internationalized resources of described parsing, described client replaces in described client end interface the content of the display that needs to internationalize.
CN201410009375.4A 2014-01-09 2014-01-09 Software system internationalization resource processing method Pending CN104850386A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410009375.4A CN104850386A (en) 2014-01-09 2014-01-09 Software system internationalization resource processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410009375.4A CN104850386A (en) 2014-01-09 2014-01-09 Software system internationalization resource processing method

Publications (1)

Publication Number Publication Date
CN104850386A true CN104850386A (en) 2015-08-19

Family

ID=53850052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410009375.4A Pending CN104850386A (en) 2014-01-09 2014-01-09 Software system internationalization resource processing method

Country Status (1)

Country Link
CN (1) CN104850386A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677415A (en) * 2016-01-06 2016-06-15 网易(杭州)网络有限公司 Hot updating method and device
CN105786498A (en) * 2016-02-25 2016-07-20 广州阿里巴巴文学信息技术有限公司 Method and device for modifying application and electronic device
CN106230907A (en) * 2016-07-22 2016-12-14 华南理工大学 A kind of big data visualization method of social security and system
CN114116045A (en) * 2021-11-05 2022-03-01 广州海鹚网络科技有限公司 International service method and platform for acquiring data based on SDK asynchronous thread

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101566946A (en) * 2008-04-25 2009-10-28 北京闻言科技有限公司 Method for flexibly supporting software multi-language version
CN102053853A (en) * 2010-12-30 2011-05-11 北京像素软件科技股份有限公司 Version updating method of online game
CN103257973A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and system for updating browser cache
CN103412914A (en) * 2013-08-05 2013-11-27 广州仙海网络科技有限公司 Network client side

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101566946A (en) * 2008-04-25 2009-10-28 北京闻言科技有限公司 Method for flexibly supporting software multi-language version
CN102053853A (en) * 2010-12-30 2011-05-11 北京像素软件科技股份有限公司 Version updating method of online game
CN103257973A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and system for updating browser cache
CN103412914A (en) * 2013-08-05 2013-11-27 广州仙海网络科技有限公司 Network client side

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677415A (en) * 2016-01-06 2016-06-15 网易(杭州)网络有限公司 Hot updating method and device
CN105677415B (en) * 2016-01-06 2020-07-17 网易(杭州)网络有限公司 Hot update method and device
CN105786498A (en) * 2016-02-25 2016-07-20 广州阿里巴巴文学信息技术有限公司 Method and device for modifying application and electronic device
CN106230907A (en) * 2016-07-22 2016-12-14 华南理工大学 A kind of big data visualization method of social security and system
CN106230907B (en) * 2016-07-22 2019-05-14 华南理工大学 A kind of social security big data method for visualizing and system
CN114116045A (en) * 2021-11-05 2022-03-01 广州海鹚网络科技有限公司 International service method and platform for acquiring data based on SDK asynchronous thread

Similar Documents

Publication Publication Date Title
US9558218B2 (en) Truncating data associated with objects in a multi-tenant database
US11163906B2 (en) Adaptive redaction and data releasability systems using dynamic parameters and user defined rule sets
US20140365523A1 (en) Push subscriptions
CN109522751B (en) Access right control method and device, electronic equipment and computer readable medium
CN109542875B (en) Configuration file generation method and device
US11500836B2 (en) Systems and methods of creation and deletion of tenants within a database
CN104881466A (en) Method and device for processing data fragments and deleting garbage files
CN111818175B (en) Enterprise service bus configuration file generation method, device, equipment and storage medium
US20150113011A1 (en) File system directory attribute correction
CN110162412B (en) Method and device for performing data operation on client
CN104850386A (en) Software system internationalization resource processing method
US20240232421A1 (en) Data Certification Process for Cloud Database Platform
CN111753019B (en) Data partitioning method and device applied to data warehouse
CN110888847A (en) Recycle bin system and file recycling method
JP6242087B2 (en) Document management server, document management method, computer program
CN113761565A (en) Data desensitization method and apparatus
CN104361094A (en) Storage method and device for file in search result, and browser client
CN114840608B (en) Distributed data access method, device and storage medium
CN107526530B (en) Data processing method and device
CN112988857B (en) Service data processing method and device
CN111585897B (en) Request route management method, system, computer system and readable storage medium
CN115203672A (en) Information access control method and device, computer equipment and medium
CN115905274A (en) Data processing method and device, electronic equipment and medium
JP5887236B2 (en) Business document processing apparatus, business document processing method, and business document processing program
JP5783010B2 (en) Index management program, index management device, and search system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150819