Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
Fig. 1 is a main schematic diagram of a data processing method according to an embodiment of the present invention.
As shown in fig. 1, the data processing method according to the embodiment of the present invention mainly includes steps S101 to S104 as follows.
Step S101: a multi-lingual field value of at least one business field of a business model is received, the business model including a replica storage field.
The multilingual field value of at least one business field of the business model is entered by the entering party, which is the user who enters the data (field value). The input party can input the field value which accords with the self business vocabulary translation rule according to the business requirement. For example, an english field value of a certain business field is "item", which is translated into "material" according to the standard international translation in the prior art, whereas according to the embodiment of the present invention, it is assumed that the input party is a client in the production field, and when a chinese field value of the business field is input, the chinese field value can be input into "product" according to the business vocabulary translation rule in the production field. Therefore, the business data content can be customized and translated according to the client intention, so that the input field value accords with the business vocabulary translation rule and is suitable for specific business requirements.
The at least one service field may be all service fields of the service model or may be a part of the service fields of the service model. The entering party can choose to enter one or more fields of the business model with multi-language field values according to needs.
The server may receive the multi-lingual field value of at least one of the business fields of the business model through a multi-lingual control (e.g., a multi-lingual js (javascript) control) of the front-end page. The multilingual control comprises an editing state and a browsing state, and the input party can input the multilingual field value in the editing state.
Before receiving the multilingual field value of at least one service field of the service model, the identifier of the entering party may be associated with the preselected language information to determine the language in which the entering party enters the multilingual field value of the at least one service field, wherein the preselected language includes the language used by the requesting party. The requesting party is a user requesting to acquire the service data.
The identity of the entering party may be the identity of the entering party. The pre-selected language may include a local language of the input party, a local language of the request party, and may further include one or more other languages that the input party needs to add. After the identifier of the input party is associated with the preselected language information, the input party can input the field value of the service field by using any one or more languages in the preselected languages. The embodiment of the invention can establish the association between any number of languages and the identifier of the input party, so that the input party can use any number of languages to perform input operation.
Step S102: and storing the multilingual field value of the at least one service field in a copy storage field.
Specifically, according to the language type of the multilingual field value, the field name of at least one business field and the multilingual field value are stored in the copy storage field according to the mapping relationship between each field name and the corresponding field value.
The copy storage field is a JSON-type field that is automatically added in the service model, such as a multicast field, which can store a copy of the multilingual field value of the service field. The value of the multicast field is null before storing the multilingual field value of any entered service field, and is JSON code segment after storing the multilingual field value of the service field.
For example, the field name of at least one service field is: name and type _ name, the language category of the multi-language field value is Chinese (CN) and English (EN), the Chinese character segment value of the name is 'X company', and the English field value is 'X mall'; if the chinese field value of type _ name is "fund debit note" and the english field value is "application for credit", the copy storage field stores the following contents:
when the language category needs to be expanded subsequently, for example, the field values of Japanese (JP) are added to the business fields of the name and the type _ name, the japanese field values of the two business fields are stored in the mulilanguage field, and correspondingly, the JSON code corresponding to "JP" is added to the value of the mulilanguage field, wherein the field values include the field name and the type _ name, and the japanese field value.
The service model may include, in addition to the name and type _ name service fields, other fields where there is no multi-lingual requirement, such as a time service field indicating time, and these fields where there is no multi-lingual requirement may be extended to multi-lingual. For example, when the current time service field only has a chinese field value and is expanded to have a chinese field value and an english field value, the entering party may enter the english field value on the front page and store the english field value in the multicast field of the service model, and accordingly, the following contents (for example only) are added to the code segments corresponding to "CN" and "EN" in the values of the multicast field: "time": 2016 [ 9/1/9/2016 ] and "time": September 1st, 2016 ".
The embodiment of the invention can support the user to arbitrarily expand the language category and the field with the multi-language requirement according to the service requirement, and the expansion only needs to modify the value of the copy storage field without modifying the structure of the service model, thereby having convenient operation, reducing the cost of the subsequent service expansion and reducing the development cost. In addition, the multilingual field value copies of the business fields are stored through the JSON type fields, and the storage space of the multilingual field values can be dynamically allocated, namely, the storage space of the database is occupied after the multilingual field value copies are stored, a database table for storing the input data does not need to be generated in advance, and the storage resources of the database are saved.
Step S103: and inquiring the field value of each business field of one language stored in the copy storage field according to the request of the requester.
In one embodiment, after the requester logs in the browser to submit a request, the server may obtain information about the local language and the region where the requester is located from the requester browser, and then the server queries the field values of the service fields of one of the stored languages from the copy storage field, where the one of the stored languages is the local language of the requester.
In another embodiment, before the requester submits the request, the setting may also be changed to change the local language to another language, so that one of the languages is correspondingly changed to another language by the requester.
When the embodiment of the invention searches the multi-language field value, the query can be carried out in the copy storage field, thus having higher query efficiency and query speed.
Step S104: and returning all service field values of the service model to the requester, wherein all the service field values comprise the field values of all the service fields in one language, which are obtained by inquiring from the copy storage field.
The following describes a data processing method according to an embodiment of the present invention, taking document data processing as an example.
In a document data processing scene, a business system single person (called a system single person for short) is an input party, a document auditor (called an auditor for short) is a request party, a document model is a business model, one document model corresponds to one document, the document comprises a plurality of contents, and the document is input with each content. In some cases, the language of the producing person is different from the language of the auditor, as shown in fig. 2, (a) in fig. 2 is an english document entered by the producing person in the united states, and (b) in fig. 2 is a chinese document returned to the auditor in china. The embodiment of the invention enables related words in the English document to be translated into proper Chinese according to the word translation rules of the document in the service field, meets the requirement of multi-language customized translation according to the client intention, supports arbitrary language increase when an auditor needs to use other languages for auditing, solves the problem that the existing scheme is limited by languages, and reduces the development cost when a user can conveniently maintain language information.
FIG. 3 is a schematic view of a document data processing flow according to an embodiment of the present invention.
As shown in fig. 3, the information administrator opens the client language management interface, and adds preselected languages, such as chinese-CN, english-EN, etc., as needed, where the added languages may include the local language of the system administrator, the local language of the auditor, and may also include one or more other languages that the system administrator needs to add, and when the system administrator and the auditor have requirements for expanding the languages, the information administrator may be provided with requirements for adding languages, so as to meet the requirements for unlimited expansion of the languages of the client;
the language management interface of the client calls a language management service to establish association between preselected language information and client information (namely, the identifier of the single maker) and store the association relationship between the preselected language information and the client information into a language model of the client, wherein the language management service can be realized by java codes and is used for being called by a front-end web interface (such as the language management interface of the client), the language can be newly added and modified through the service, and the language can be distributed to a user (such as the single maker or an auditor);
the system single person opens a browser to request a multi-language document page, a server can acquire information of the system single person, such as language, region and the like through the browser of the system single person, the information of the language, the region and the like is usually the current local language and the region of the system single person, and the system single person can change the information of the local language, the region and the like by himself;
the multilingual receipt page calls a client language query service to acquire the languages which can be used by the user from the client language model, wherein the client language query service can be realized by java codes and is used for being called by a front-end web interface (such as the multilingual receipt page), and the language information which can be used by the current client (such as the user) can be queried by calling the service;
the multi-language receipt page returns the receipt page of the language of the single making person to the single making person according to the region and language information of the single making person, the language of the single making person is usually the local language of the single making person, and the receipt page of the language of the single making person is called the local language receipt page of the single making person or called the local language receipt page of the single making person for short;
the system person makes an order through an entry interface management module, the entry interface management module is a module for executing the function of inputting a front-end page (a local language document page of the system person), the making of the order is to use a multilingual JS control to input multilingual field values of one or more business fields of a document model (namely the business model of fig. 3), and Chinese and English contents (field values) are simultaneously input according to the business fields of the document model;
the business document storage service is called by the single-person local document making page, wherein the business document storage service can be realized through java codes and is called by a front-end web interface (such as the single-person local document making page), and the business document recorded by a single person can be stored in a background database through the service;
and the business document storage service calls a business entry model conversion module to bind and store the dynamic multilingual model and the document model, wherein the document model comprises a JSON type multilingual field which can store multilingual copies aiming at different business fields of the current document model. The dynamic multilingual model is called a multilingual model for short, and is formed by the value of the multilingual field in the document model. The business entry model conversion module is used for storing the multilingual field values of the input receipt into the copy storage field according to the language categories and the mapping relation between the field names and the field values to obtain a dynamic multilingual model, and binding and storing the dynamic multilingual model and the receipt model through a java algorithm. As shown in fig. 4, in a bill model (which is only an example of a business model), in addition to CN (chinese) and EN (english), other languages may be further extended to existing multi-language fields (name and type _ name), and in addition to the name and type _ name fields, other business fields may also be extended to multi-language. Therefore, on the premise of not changing a business model, a user can freely customize fields on the document in multiple languages, so that the document content can be really translated according to business meanings in a document international application scene;
after receiving the request of the auditor, the service entry model conversion module is further configured to query the dynamic multilingual model and the service model, analyze the mutilanguage field in the document model through a java algorithm, and, with reference to the example of fig. 4, for example, perform entry selection on the name and type _ name fields in the dynamic multilingual model according to the language of the auditor, and then return all service field values of the data model to the service document query service, where the service field values include field values of the name and type _ name fields corresponding to the language of the auditor in the dynamic multilingual model, and field values of the service fields without multilingual requirements in the document model. The server can acquire information such as the language and the region of an auditor from a browser end of the auditor, the language of the auditor is usually the current local language of the auditor, the auditor can manually change the information such as the local language and the region, the business document query service can be realized through java codes and is used for a front-end web interface (such as a local language document page of the auditor) to call, and the business documents can be queried from a database through the service;
the business document inquiry service returns document data (field names and field values) to a local language document page of an auditor;
the local language document page of the auditor displays document data according to the language of the auditor through a vocabulary entry interface display module (used for executing a document data display function), so that the auditor can conveniently audit the document through the local language document page of the auditor.
According to the data processing flow of the embodiment of the invention, the business content and the multilingual vocabulary entry can be bound on the front-end page through the multilingual JS control, the back-end server binds the business content and the multilingual vocabulary entry through the Java algorithm, and the database carries out multilingual infinite expansion and persistence through the JSON dynamic multilingual model.
Fig. 5 is a schematic diagram of main blocks of a data processing apparatus according to an embodiment of the present invention.
As shown in fig. 5, the data processing apparatus 500 according to the embodiment of the present invention mainly includes: a receiving module 501, a storage module 502, a query module 503, and an output module 504.
A receiving module 501, configured to receive a multi-lingual field value of at least one business field of a business model, where the business model includes a copy storage field.
The multilingual field value of at least one business field of the business model is entered by the entering party. The data processing apparatus 500 may further comprise an association module for: and establishing association between the identifier of the input party and the preselected language information to determine the language used by the input party to input the multilingual field value of at least one service field, wherein the preselected language comprises the language used by the requesting party.
A storage module 502, configured to store the multilingual field value of at least one service field in a duplicate storage field.
The storage module 502 may be specifically configured to: and storing the field name of at least one service field and the multilingual field value in a copy storage field according to the language type of the multilingual field value and the mapping relation between each field name and the corresponding field value.
And the storing module 502 may store the multilingual field value of at least one service field in a JSON-type field.
The query module 503 is configured to query, according to a request of a requester, field values of the service fields in one of the stored languages from the copy storage field.
And the output module 504 is configured to return all service field values of the service model to the requesting party, where all service field values include field values of service fields in one language obtained by querying from the replica storage field.
In addition, the detailed implementation of the data processing apparatus in the embodiment of the present invention has been described in detail in the above data processing method, and therefore, the repeated content will not be described again.
Fig. 6 shows an exemplary system architecture 600 of a data processing method or data processing apparatus to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the data processing method provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the data processing apparatus is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing a terminal device or server of an embodiment of the present application. The terminal device or the server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program executes the above-described functions defined in the system of the present application when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a receiving module, a storage module, an inquiry module and an output module. Where the names of these modules do not in some cases constitute a limitation of the module itself, for example, a receiving module may also be described as a "module for receiving multi-lingual field values for at least one business field of a business model".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving a multilingual field value for at least one business field of a business model, the business model including a replica storage field; storing a multilingual field value of the at least one business field in the replica storage field; according to the request of a requester, inquiring the field value of each service field of one language stored in the copy storage field; and returning all service field values of the service model to the requester, wherein all the service field values comprise field values of all service fields in one language, which are obtained by inquiring from the copy storage field.
According to the technical scheme of the embodiment of the invention, the multilingual field value of at least one service field of a service model is received, and the service model comprises a copy storage field; storing the multilingual field value of the at least one service field in a copy storage field; according to the request of a requester, inquiring the field value of each service field of one language from the copy storage field; and returning all service field values of the service model to the requester, wherein all the service field values comprise the field values of all the service fields in one language, which are obtained by inquiring from the copy storage field. The requirement of increasing languages in an unlimited manner can be met, a user can conveniently expand the fields and the language quantity of multiple languages to be input according to the requirement, the model structure is not required to be modified, the application expansion cost is reduced, in addition, the translation service data content can be customized according to the client intention, the input field value accords with the service vocabulary translation rule, and the specific service requirement is met.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.