A transcoding method and device for multi-source data dictionary

Through the multi-source data dictionary transcoding method, the mapping configuration information of preset fields and data dictionary codes and the combination of data dictionary are solved, and the timeliness, cost and feasibility of data dictionary transcoding in EXCEL import and export are achieved efficiently , easy-to-maintain transcoding process.

CN112100987BActive Publication Date: 2024-11-19CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011031694.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-27
Publication Date
2024-11-19
Estimated Expiration
2040-09-27

AI Technical Summary

Technical Problem

In the prior art, the data dictionary transcoding imported and exported by EXCEL has timeliness, cost and feasibility problems. Hard coding leads to an increase in the number of codes and is difficult to maintain. Centralized management of data dictionaries brings economic and technical costs, and the old system access cache Inadequate ability.

Method used

Using the multi-source data dictionary transcoding method, by obtaining the fields and data to be transcoding, and using the combined data dictionary to implement transcoding based on the mapping configuration information of the preset fields and data dictionary codes, avoiding the complexity of hard coding and centralized management. improves transcoding efficiency and maintainability.

Benefits of technology

Improves the flexibility and scalability of the data dictionary, reduces development costs, avoids the complexity of hard coding and centralized management, and realizes efficient data transcoding, making it easy to maintain and expand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112100987B_ABST
    Figure CN112100987B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for transcoding a multi-source data dictionary, the method comprising: obtaining a field to be transcoded and data corresponding to the field to be transcoded; obtaining a data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and mapping configuration information between the field and the data dictionary code; the mapping configuration information between the field and the data dictionary code is preset; obtaining transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and a combined data dictionary; wherein the combined data dictionary is pre-generated based on a field configuration table, the field configuration table is preset and includes multiple different data dictionary sources. The device is used to execute the above method. The method and device for transcoding a multi-source data dictionary provided by the embodiments of the present invention improve the efficiency of transcoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a transcoding method and device for a multi-source data dictionary. Background Art

[0002] With the development of information systems, there are more and more ways of system interaction. However, as a common file format, EXCEL conforms to the operating habits of a large number of users. The EXCEL import and export function is still an important and indispensable function of the system.

[0003] In order to meet the requirements of saving storage space and facilitating management, the data stored in the database table is often stored in the form of code, and in the exported EXCEL, the specific meaning of the code needs to be displayed to facilitate user understanding. Therefore, in the process of EXCEL import and export, it is necessary to map and transcode the abstract code through the data dictionary. In the prior art, hard coding technology can be used to achieve transcoding. In the code of EXCEL import and export, each EXCEL document, each SHEET page, and each column attribute are specifically coded. For the columns that need to be transcoded, the corresponding data dictionary acquisition method is specified in a hard-coded manner. However, the use of hard coding will cause each EXCEL import and export code to be specific, resulting in a significant increase in the amount of code. It is necessary to repeat the coding for each EXCEL. Because the code is scattered, it is difficult to maintain in the future, which affects the maintainability of the system. Transcoding can also be achieved through a centrally managed data dictionary. A separate cache server is used to uniformly load the data dictionary. During the EXCEL import and export process, transcoding is uniformly performed through the data dictionary. Centrally managed data dictionaries will cause the following problems: (1) Timeliness issues: Because a centralized data dictionary is used, the data dictionary needs to be loaded uniformly. However, due to the different timeliness of data dictionaries, on the one hand, data with low timeliness requirements may be frequently loaded, and on the other hand, it may not meet the transcoding needs of data with high timeliness requirements. (2) Cost issues: EXCEL import and export itself is a relatively basic and simple function of the system. Centrally managing data dictionaries will undoubtedly bring economic, time, and technical costs to the data set. For example, according to timeliness requirements, all data dictionaries are concentrated in the cache. On the one hand, the introduction of the cache itself will bring costs. On the other hand, if the timed update mode is adopted, the timeliness requirements may not be met. If the data source is actively pushed, data may be lost. The old system needs to be transformed to centrally manage the data dictionary, and the transformation requires investment. (3) Feasibility issues: If the data source of the data dictionary contains some old systems, it does not have the ability to access the cache. Summary of the invention

[0004] In view of the problems in the prior art, an embodiment of the present invention provides a method and device for transcoding a multi-source data dictionary, which can at least partially solve the problems in the prior art.

[0005] In one aspect, the present invention provides a method for transcoding a multi-source data dictionary, comprising:

[0006] Obtain a field to be transcoded and data corresponding to the field to be transcoded;

[0007] According to the field to be transcoded and the mapping configuration information between the field and the data dictionary code, the data dictionary code corresponding to the field to be transcoded is obtained; the mapping configuration information between the field and the data dictionary code is preset;

[0008] According to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary, the transcoded data corresponding to the field to be transcoded is obtained; wherein the combined data dictionary is pre-generated based on a field configuration table, and the field configuration table is preset and includes multiple different data dictionary sources.

[0009] In another aspect, the present invention provides a transcoding device for a multi-source data dictionary, comprising:

[0010] An acquisition unit, used to acquire a field to be transcoded and data corresponding to the field to be transcoded;

[0011] An obtaining unit, configured to obtain a data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and mapping configuration information between the field and the data dictionary code; the mapping configuration information between the field and the data dictionary code is preset;

[0012] A transcoding unit is used to obtain transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and a combined data dictionary; wherein the combined data dictionary is pre-generated based on a field configuration table, and the field configuration table is preset and includes multiple different data dictionary sources.

[0013] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the multi-source data dictionary transcoding method described in any of the above embodiments when executing the program.

[0014] In yet another aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the multi-source data dictionary transcoding method described in any of the above embodiments.

[0015] The multi-source data dictionary transcoding method and device provided in the embodiment of the present invention obtain the field to be transcoded and the data corresponding to the field to be transcoded, obtain the data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and the mapping configuration information between the field and the data dictionary code, obtain the transcoded data of the data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary, and realize data transcoding through the pre-generated combined data dictionary, without considering the complexity of the multi-source data dictionary, thereby improving the efficiency of transcoding. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. 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. In the drawings:

[0017] Figure 1 It is a flowchart of a transcoding method for a multi-source data dictionary provided by an embodiment of the present invention.

[0018] Figure 2 It is a flowchart of a transcoding method for a multi-source data dictionary provided by another embodiment of the present invention.

[0019] Figure 3 It is a flowchart of a transcoding method of a multi-source data dictionary provided by another embodiment of the present invention.

[0020] Figure 4 It is a flowchart of a transcoding method of a multi-source data dictionary provided in yet another embodiment of the present invention.

[0021] Figure 5 It is a flowchart of a method for transcoding a multi-source data dictionary provided in another embodiment of the present invention.

[0022] Figure 6 It is a structural schematic diagram of a transcoding device for a multi-source data dictionary provided by an embodiment of the present invention.

[0023] Figure 7 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.

[0025] In order to facilitate the understanding of the technical solution provided by the present application, the relevant terms of the technical solution of the present application are explained below. Multi-source data dictionary: a data dictionary from multiple different sources, for example, a data dictionary comes from an enumeration file, a database, an online transaction interface, etc. Encoding: converting the meaning of a code value into a code value; Decoding: converting a code value into the meaning of a code value.

[0026] Figure 1 FIG. 1 is a flow chart of a method for transcoding a multi-source data dictionary provided by an embodiment of the present invention. Figure 1 As shown, the transcoding method of a multi-source data dictionary provided by an embodiment of the present invention includes:

[0027] S101, obtaining a field to be transcoded and data corresponding to the field to be transcoded;

[0028] Specifically, when transcoding is required, the server can obtain the field to be transcoded and the data corresponding to the field to be transcoded. The transcoding refers to converting the code value into the corresponding code value meaning, or converting the code value meaning into the corresponding code value. When encoding, the data corresponding to the field to be transcoded is the code value meaning, and when decoding, the data corresponding to the field to be transcoded is the code value. The execution subject of the transcoding method of the multi-source data dictionary provided in the embodiment of the present invention includes but is not limited to the server.

[0029] For example, when importing data from an EXCEL file into a database, the meaning of the code values ​​in the EXCEL file needs to be converted into corresponding code values. When exporting data from a database into an EXCEL file, the code values ​​in the database need to be converted into corresponding code value meanings.

[0030] S102, obtaining a data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and mapping configuration information between the field and the data dictionary code; the mapping configuration information between the field and the data dictionary code is preset;

[0031] Specifically, after obtaining the field to be transcoded, the server can query the data dictionary code corresponding to the field to be transcoded in the mapping configuration information between the field and the data dictionary code according to the field to be transcoded, and can obtain the data dictionary code corresponding to the field to be transcoded. The mapping configuration information between the field and the data dictionary code is preset, including the field and the data dictionary code, and the field and the data dictionary code correspond one to one. The field and the data dictionary code are set according to actual needs, and the embodiment of the present invention does not limit it.

[0032] S103. Obtain transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded, and the combined data dictionary; wherein the combined data dictionary is pre-generated based on a field configuration table, and the field configuration table is preset and includes multiple different data dictionary sources.

[0033] Specifically, after obtaining the data dictionary code corresponding to the field to be transcoded, the server can call the combined data dictionary through the interface of the combined data dictionary, input the data dictionary code corresponding to the field to be transcoded and the data corresponding to the field to be transcoded, and obtain the transcoded data of the data corresponding to the field to be transcoded from the combined data dictionary. If the data corresponding to the field to be transcoded is a code value, then the transcoded data of the data corresponding to the field to be transcoded is the meaning of the code value; if the data corresponding to the field to be transcoded is the meaning of the code value, then the transcoded data of the data corresponding to the field to be transcoded is the code value. Wherein, the combined data dictionary is pre-generated based on the field configuration table, and the field configuration table is preset and includes multiple different data dictionaries.

[0034] The transcoding method of the multi-source data dictionary provided in the embodiment of the present invention obtains the field to be transcoded and the data corresponding to the field to be transcoded, obtains the data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and the mapping configuration information between the field and the data dictionary code, obtains the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary, and realizes data transcoding through the pre-generated combined data dictionary, without considering the complexity of the multi-source data dictionary, thereby improving the efficiency of transcoding. In addition, the combined data dictionary is easy to expand and maintain.

[0035] On the basis of the above embodiments, further, the data corresponding to the field to be transcoded is a code value; accordingly, obtaining the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded, and the combined data dictionary includes:

[0036] The code value meaning corresponding to the code value is obtained by searching in the combined data dictionary according to the data dictionary code and the code value.

[0037] Specifically, the data corresponding to the field to be transcoded is a code value, so the meaning of the code value needs to be obtained during the transcoding process. The server can call the combined data dictionary through the interface of the combined data dictionary, input the data dictionary code corresponding to the field to be transcoded and the code value, and query the combined data dictionary to obtain the meaning of the code value corresponding to the code value.

[0038] On the basis of the above embodiments, further, the data corresponding to the field to be transcoded is a code value meaning; accordingly, obtaining the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary includes:

[0039] According to the data dictionary code and the meaning of the code value, a code value corresponding to the meaning of the code value is obtained by searching in the combined data dictionary.

[0040] Specifically, the data corresponding to the field to be transcoded is a code value meaning, so the code value needs to be obtained during the transcoding process. The server can call the combined data dictionary through the interface of the combined data dictionary, input the data dictionary code corresponding to the field to be transcoded and the code value meaning, and query the combined data dictionary to obtain the code value corresponding to the code value meaning.

[0041] Figure 2 is a flow chart of a method for transcoding a multi-source data dictionary provided by another embodiment of the present invention, such as Figure 2 As shown, based on the above embodiments, further, generating the combined data dictionary based on the field configuration table includes:

[0042] S201, traversing each configuration element of the field configuration table, and obtaining a branch data dictionary corresponding to the data dictionary code of each configuration element according to each configuration element and a branch data dictionary generation rule; wherein each configuration element includes the data dictionary code, data dictionary source type information and keywords;

[0043] Specifically, the field configuration table includes multiple configuration elements, each of which includes a data dictionary code, data dictionary source type information and a keyword, and the keyword is related to the data dictionary source type information. The server traverses each configuration element of the field configuration table, processes each configuration element one by one, and obtains a branch data dictionary corresponding to the data dictionary code of each configuration element according to each configuration element and the branch data dictionary generation rule.

[0044] S202: Combine the data dictionary codes and their corresponding branch data dictionaries into the combined data dictionary.

[0045] Specifically, after obtaining the branch data dictionary corresponding to the data dictionary code of each configuration element, the server establishes the combined data dictionary according to each data dictionary code and the branch data dictionary corresponding to each data dictionary code. The combined data dictionary includes each data dictionary code and the corresponding branch data dictionary, which can be expressed as <data dictionary code, branch data dictionary>. The branch data dictionary to be called can be queried through the data dictionary code, and the code value or the meaning of the code value can be obtained from the branch data dictionary.

[0046] Figure 3 FIG. 1 is a flow chart of a method for transcoding a multi-source data dictionary provided by another embodiment of the present invention. Figure 3 As shown, on the basis of the above embodiments, further, the data dictionary source type information included in the configuration element includes an enumeration file, and the keyword is the class name of the enumeration file; accordingly, according to each configuration element and the branch data dictionary generation rule, obtaining the branch data dictionary corresponding to the data dictionary code includes:

[0047] S301, according to the class name of the enumeration file, obtaining the enumeration constant corresponding to the class name of the enumeration file;

[0048] Specifically, the data dictionary source type information included in the configuration element includes an enumeration file, and the keyword included in the configuration element is the class name of the enumeration file. The server can obtain the enumeration constant corresponding to the class name of the enumeration file by reflection according to the class name of the enumeration file. Among them, the access address of the enumeration file can be stored in the data dictionary source type information, and can also be obtained by querying the enumeration file. It is set according to actual needs and is not limited in the embodiments of the present invention.

[0049] S302: The class name of the enumeration file and the enumeration constant corresponding to the class name of the enumeration file are used to form a branch data dictionary corresponding to the data dictionary code.

[0050] Specifically, after obtaining the enumeration constant corresponding to the class name of the enumeration file, the server may form a branch data dictionary corresponding to the data dictionary code by combining the class name of the enumeration file and the enumeration constant corresponding to the class name of the enumeration file.

[0051] Figure 4 FIG. 1 is a flow chart of a method for transcoding a multi-source data dictionary provided by another embodiment of the present invention. Figure 4 As shown, on the basis of the above embodiments, further, the data dictionary source type information included in the configuration element includes a database, and the keyword is a key value of the data dictionary in the database; accordingly, according to each configuration element and the branch data dictionary generation rule, obtaining the branch data dictionary corresponding to the data dictionary code includes:

[0052] S401, obtaining data records corresponding to the key values ​​in the data dictionary in the database;

[0053] Specifically, the data dictionary source type information included in the configuration element includes a database, and the keyword is the key value of the data dictionary in the database. The server can query and obtain the data record corresponding to the key value according to the key value of the data dictionary in the database. Among them, the key value can be a key value of a special SQL. The access address of the database can be stored in the data dictionary source type information, and can also be obtained by querying the database. It is set according to actual needs and is not limited in the embodiments of the present invention.

[0054] S402: The key values ​​of the data dictionary in the database and the data records corresponding to the key values ​​are combined to form a branch data dictionary corresponding to the data dictionary code.

[0055] Specifically, after obtaining the data record corresponding to the key value, the server may combine the key value of the data dictionary in the database and the data record corresponding to the key value into a branch data dictionary corresponding to the data dictionary code.

[0056] Figure 5 FIG. 1 is a flow chart of a method for transcoding a multi-source data dictionary provided by another embodiment of the present invention. Figure 5 As shown, based on the above embodiments, further, the data dictionary source type information included in the configuration element includes an online transaction interface, and the keyword is a field value of the data dictionary in the online transaction interface; accordingly, according to each configuration element and the branch data dictionary generation rule, obtaining the branch data dictionary corresponding to the data dictionary code includes:

[0057] S501, obtaining a response message of the field value according to the field value of the data dictionary in the online transaction interface and the online transaction interface;

[0058] Specifically, the data dictionary source type information included in the configuration element includes an online transaction interface, and the keyword is a field value of the data dictionary in the online transaction interface. The server can call the online transaction interface to query the data corresponding to the field value, and can obtain a response message of the field value through the online transaction interface. The response message includes the data corresponding to the field value, and the data corresponding to the field value includes a code value of the data dictionary and the meaning of the code value.

[0059] S502: Generate a branch data dictionary corresponding to the data dictionary code according to the response message of the field value.

[0060] Specifically, after obtaining the response message of the field value, the server can obtain the data corresponding to the field value from the response message, and the data corresponding to the field value and the field value constitute the branch data dictionary corresponding to the data dictionary code.

[0061] The online transaction interface is equivalent to a special implementation for a specific online transaction interface. The processing logic is more flexible and can be performed for each online transaction interface. Some special processing logic can be implemented internally. It is recommended to use it when the online transaction interfaces are quite different and the processing logic is quite different. Among them, the transaction name of the online transaction interface and the data dictionary code value and the code value meaning corresponding field in the response message can be specified in the method of obtaining the source classification. The keyword only needs to include the query field value in the request message.

[0062] On the basis of the above embodiments, further, the data dictionary source type information included in the configuration element includes a multiple online transaction interface, and the keyword is a transaction name, a query keyword field and a corresponding field value in the multiple online transaction interface; accordingly, the branch data dictionary corresponding to the data dictionary code is obtained according to each configuration element and the branch data dictionary generation rule, including:

[0063] The multiple online transaction interface, the transaction name, the query keyword field and the corresponding field value, to obtain a return message;

[0064] A branch data dictionary corresponding to the data dictionary code is generated according to the returned message.

[0065] Specifically, the data dictionary source type information included in the configuration element includes multiple online transaction interfaces, and the keywords are transaction names, query keyword fields, and corresponding field values ​​in the multiple online transaction interfaces. The server obtains the online transaction interface corresponding to the transaction name from the multiple connection transaction interfaces according to the transaction name, and then calls the online transaction interface corresponding to the transaction name to query the query keyword field and the field value corresponding to the query keyword field, and obtains the return message of the query keyword field and the corresponding field value. The multiple online transaction interfaces refer to multiple online transaction interfaces with similar processing logic, and each online transaction interface has a unique corresponding transaction name.

[0066] After obtaining the return message of the query keyword field and the corresponding field value, the server can obtain the data corresponding to the query keyword field and the corresponding field value from the return message. The transaction name, query keyword field and the corresponding field value, and the data corresponding to the query keyword field and the corresponding field value constitute the branch data dictionary corresponding to the data dictionary code.

[0067] The multiple online trading interfaces adopt the factory mode, and the internal implementation logic is more complex. When the processing logic of different online trading interfaces is similar, this mode can be used to improve code reuse. It is recommended to use it when there are many online trading interfaces but more reusable logic.

[0068] Wherein, in the case where the data dictionary source type information includes multiple online transaction interfaces, the keyword can also be the transaction name of the online transaction interface + the query keyword field and field value in the request message + the data dictionary code value and the code value meaning corresponding field in the response message, and the keywords can be separated by special separators. It is understandable that in the case where the data dictionary source type information includes multiple online transaction interfaces, the keyword can be set according to the actual situation, and the embodiment of the present invention does not limit it.

[0069] The following takes the transcoding between an EXCEL file and a database as an example to illustrate the implementation process of the transcoding method of a multi-source data dictionary provided by an embodiment of the present invention. Before transcoding, the data dictionary code mapping configuration is performed on the transcoded field to obtain the mapping configuration information between the field and the data dictionary code. The mapping configuration operation between the field and the data dictionary code occurs before the first transcoding between the EXCEL file and the database. When transcoding is performed later, the mapping configuration information between the field and the data dictionary code that has been configured can be used, or after a new field appears, the mapping configuration of the new field and the data dictionary code is added to the original mapping configuration information between the field and the data dictionary code, and the updated mapping configuration information between the field and the data dictionary code is applied.

[0070] Import the data in the EXCEL file into the database, that is, perform the encoding operation. Obtain the corresponding data dictionary code according to a field in the EXCEL file, then call the combined data dictionary interface, input the data dictionary code and the code value meaning corresponding to the field, obtain the branch data dictionary corresponding to the data dictionary code from the combined data dictionary according to the data dictionary code, and then query the branch data dictionary according to the code value meaning to obtain the code value corresponding to the code value meaning. Repeat the above encoding operation process until all the data in the EXCEL file are imported into the database.

[0071] Exporting the data in the database to an EXCEL file is called decoding. Obtain the corresponding data dictionary code according to a field included in the data to be exported from the database, then call the combined data dictionary interface, input the data dictionary code and the code value corresponding to the field, obtain the branch data dictionary corresponding to the data dictionary code from the combined data dictionary according to the data dictionary code, and then query the branch data dictionary according to the code value to obtain the meaning of the code value corresponding to the code value. Repeat the above decoding operation process until all the data to be exported from the database are exported to the EXCEL file.

[0072] The multi-source data dictionary transcoding method provided by the embodiment of the present invention has the following advantages:

[0073] (1) The flexibility of the data dictionary is enhanced through configuration, and data dictionaries from multiple sources are effectively integrated into the system. It also has strong scalability and maintainability. When adding data dictionaries from more sources in the future, it only needs to increase the data dictionary source configuration and the data dictionary acquisition implementation method.

[0074] (2) It provides a unified transcoding interface so that data dictionary users (such as EXCEL import and export) do not need to consider the complexity of multi-source data dictionaries, thus achieving high functional cohesion.

[0075] (3) There is no need to build a new independent centralized data dictionary cache server, and the development and implementation costs are relatively low.

[0076] (4) The transcoding involved in EXCEL import and export is implemented through configuration, avoiding hard coding and improving code reuse. If the transcoding of a certain field needs to be added later, only the configuration needs to be modified, which has strong scalability and maintainability.

[0077] Figure 6 FIG. 1 is a schematic diagram of a structure of a transcoding device for a multi-source data dictionary provided by an embodiment of the present invention. Figure 6 As shown, the transcoding device of the multi-source data dictionary provided by the embodiment of the present invention includes an acquisition unit 601, an obtaining unit 602 and a transcoding unit 603, wherein:

[0078] The acquisition unit 601 is used to acquire the field to be transcoded and the data corresponding to the field to be transcoded; the acquisition unit 602 is used to obtain the data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and the mapping configuration information between the field and the data dictionary code; the mapping configuration information between the field and the data dictionary code is preset; the transcoding unit 603 is used to obtain the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary; wherein the combined data dictionary is pre-generated based on the field configuration table, and the field configuration table is preset and includes multiple different data dictionary sources.

[0079] Specifically, when transcoding is required, the acquisition unit 601 can acquire the field to be transcoded and the data corresponding to the field to be transcoded. The transcoding refers to converting the code value into the corresponding code value meaning, or converting the code value meaning into the corresponding code value. When encoding, the data corresponding to the field to be transcoded is the code value meaning, and when decoding, the data corresponding to the field to be transcoded is the code value.

[0080] After obtaining the field to be transcoded, the obtaining unit 602 can query the data dictionary code corresponding to the field to be transcoded in the mapping configuration information between the field and the data dictionary code according to the field to be transcoded, and can obtain the data dictionary code corresponding to the field to be transcoded. The mapping configuration information between the field and the data dictionary code is preset, including the field and the data dictionary code, and the field and the data dictionary code correspond one to one. The field and the data dictionary code are set according to actual needs, and the embodiment of the present invention does not limit it.

[0081] After obtaining the data dictionary code corresponding to the field to be transcoded, the transcoding unit 603 can call the combined data dictionary through the interface of the combined data dictionary, input the data dictionary code corresponding to the field to be transcoded and the data corresponding to the field to be transcoded, and can query and obtain the transcoded data of the data corresponding to the field to be transcoded from the combined data dictionary. If the data corresponding to the field to be transcoded is a code value, then the transcoded data of the data corresponding to the field to be transcoded is the meaning of the code value; if the data corresponding to the field to be transcoded is the meaning of the code value, then the transcoded data of the data corresponding to the field to be transcoded is the code value. Wherein, the combined data dictionary is pre-generated based on the field configuration table, and the field configuration table is preset and includes multiple different data dictionaries.

[0082] The transcoding device of the multi-source data dictionary provided by the embodiment of the present invention obtains the field to be transcoded and the data corresponding to the field to be transcoded, obtains the data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and the mapping configuration information between the field and the data dictionary code, obtains the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary, and realizes data transcoding through the pre-generated combined data dictionary, without considering the complexity of the multi-source data dictionary, thereby improving the efficiency of transcoding. In addition, the combined data dictionary is easy to expand and maintain.

[0083] The embodiments of the apparatus provided in the embodiments of the present invention can be specifically used to execute the processing flow of the above-mentioned method embodiments, and its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.

[0084] Figure 7 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 7As shown, the electronic device may include: a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 communicate with each other through the communication bus 704. The processor 701 may call the logic instructions in the memory 703 to execute the following method: obtaining a field to be transcoded and data corresponding to the field to be transcoded; obtaining a data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and the mapping configuration information between the field and the data dictionary code; the mapping configuration information between the field and the data dictionary code is preset; obtaining transcoded data corresponding to the data of the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary; wherein the combined data dictionary is pre-generated based on the field configuration table, the field configuration table is preset and includes multiple different data dictionary sources.

[0085] In addition, the logic instructions in the above-mentioned memory 703 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0086] The present embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining a field to be transcoded and data corresponding to the field to be transcoded; obtaining a data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and mapping configuration information between the field and the data dictionary code; the mapping configuration information between the field and the data dictionary code is preset; obtaining transcoded data of the data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and a combined data dictionary; wherein the combined data dictionary is pre-generated based on a field configuration table, and the field configuration table is preset and includes multiple different data dictionary sources.

[0087] The present embodiment provides a computer-readable storage medium, which stores a computer program, and the computer program enables the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: obtaining a field to be transcoded and data corresponding to the field to be transcoded; obtaining a data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and the mapping configuration information between the field and the data dictionary code; the mapping configuration information between the field and the data dictionary code is preset; obtaining transcoded data of the data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and a combined data dictionary; wherein the combined data dictionary is pre-generated based on a field configuration table, and the field configuration table is preset and includes multiple different data dictionary sources.

[0088] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0089] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0090] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0092] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0093] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for transcoding a multi-source data dictionary, characterized in that: include: Obtain a field to be transcoded and data corresponding to the field to be transcoded; Obtaining the data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and the mapping configuration information between the field and the data dictionary code; The mapping configuration information between the fields and the data dictionary codes is preset; According to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary, the transcoded data corresponding to the field to be transcoded is obtained; wherein the combined data dictionary is pre-generated based on a field configuration table, the field configuration table is preset and includes a plurality of different data dictionary sources; the field configuration table includes a plurality of configuration elements, each configuration element includes a data dictionary code and data dictionary source type information; Wherein, obtaining the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded, and the combined data dictionary comprises: The called branch data dictionary is queried through the data dictionary code, and the code value or the meaning of the code value is queried from the branch data dictionary as the transcoded data of the data corresponding to the field to be transcoded.

2. The method according to claim 1, characterized in that The data corresponding to the field to be transcoded is a code value; accordingly, obtaining the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded, and the combined data dictionary includes: The code value meaning corresponding to the code value is obtained by searching in the combined data dictionary according to the data dictionary code and the code value.

3. The method according to claim 1, characterized in that The data corresponding to the field to be transcoded is a code value meaning; accordingly, obtaining the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded and the combined data dictionary includes: According to the data dictionary code and the meaning of the code value, a code value corresponding to the meaning of the code value is obtained by searching in the combined data dictionary.

4. The method according to any one of claims 1 to 3, characterized in that: Generating the combined data dictionary based on the field configuration table includes: Traversing each configuration element of the field configuration table, and obtaining a branch data dictionary corresponding to the data dictionary code according to each configuration element and a branch data dictionary generation rule; wherein each configuration element includes the data dictionary code, data dictionary source type information and keywords; The combined data dictionary is established according to each data dictionary code and the corresponding branch data dictionary.

5. The method according to claim 4, characterized in that The data dictionary source type information included in the configuration element includes an enumeration file, and the keyword is the class name of the enumeration file; accordingly, the branch data dictionary corresponding to the data dictionary code is obtained according to each configuration element and the branch data dictionary generation rule, including: According to the class name of the enumeration file, obtaining the enumeration constant corresponding to the class name of the enumeration file; The class name of the enumeration file and the enumeration constant corresponding to the class name of the enumeration file are used to form a branch data dictionary corresponding to the data dictionary code.

6. The method according to claim 4, characterized in that The data dictionary source type information included in the configuration element includes a database, and the keyword is a key value of the data dictionary in the database; accordingly, obtaining the branch data dictionary corresponding to the data dictionary code according to each configuration element and the branch data dictionary generation rule includes: According to the key value of the data dictionary in the database, obtaining the data record corresponding to the key value; The key values ​​of the data dictionary in the database and the data records corresponding to the key values ​​are combined to form a branch data dictionary corresponding to the data dictionary code.

7. The method according to claim 4, characterized in that The data dictionary source type information included in the configuration element includes an online transaction interface, and the keyword is a field value of the data dictionary in the online transaction interface; accordingly, the branch data dictionary corresponding to the data dictionary code is obtained according to each configuration element and the branch data dictionary generation rule, including: According to the field value of the data dictionary in the online transaction interface and the online transaction interface, obtaining a response message of the field value; A branch data dictionary corresponding to the data dictionary code is generated according to a response message of the field value.

8. The method according to claim 4, characterized in that The data dictionary source type information included in the configuration element includes a multiple online transaction interface, and the keyword is a transaction name, a query keyword field, and a corresponding field value in the multiple online transaction interface; accordingly, the branch data dictionary corresponding to the data dictionary code is obtained according to each configuration element and the branch data dictionary generation rule, including: The multiple online transaction interface, the transaction name, the query keyword field and the corresponding field value, to obtain a return message; A branch data dictionary corresponding to the data dictionary code is generated according to the returned message.

9. A transcoding device for a multi-source data dictionary, characterized in that: include: An acquisition unit, used to acquire a field to be transcoded and data corresponding to the field to be transcoded; An obtaining unit, configured to obtain a data dictionary code corresponding to the field to be transcoded according to the field to be transcoded and mapping configuration information between the field and the data dictionary code; The mapping configuration information between the fields and the data dictionary codes is preset; a transcoding unit, configured to obtain transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded, and a combined data dictionary; wherein the combined data dictionary is pre-generated based on a field configuration table, the field configuration table is preset and includes a plurality of different data dictionary sources; the field configuration table includes a plurality of configuration elements, each configuration element includes a data dictionary code and data dictionary source type information; Wherein, obtaining the transcoded data corresponding to the field to be transcoded according to the data dictionary code, the data corresponding to the field to be transcoded, and the combined data dictionary comprises: The called branch data dictionary is queried through the data dictionary code, and the code value or the meaning of the code value is queried from the branch data dictionary as the transcoded data of the data corresponding to the field to be transcoded.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.