CN114676686A - Data dictionary processing method, translation method and related device - Google Patents

Data dictionary processing method, translation method and related device Download PDF

Info

Publication number
CN114676686A
CN114676686A CN202210595749.XA CN202210595749A CN114676686A CN 114676686 A CN114676686 A CN 114676686A CN 202210595749 A CN202210595749 A CN 202210595749A CN 114676686 A CN114676686 A CN 114676686A
Authority
CN
China
Prior art keywords
translation
annotation
data dictionary
mapping
translation mapping
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.)
Granted
Application number
CN202210595749.XA
Other languages
Chinese (zh)
Other versions
CN114676686B (en
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.)
Hundsun Technologies Inc
Original Assignee
Hundsun Technologies Inc
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 Hundsun Technologies Inc filed Critical Hundsun Technologies Inc
Priority to CN202210595749.XA priority Critical patent/CN114676686B/en
Publication of CN114676686A publication Critical patent/CN114676686A/en
Application granted granted Critical
Publication of CN114676686B publication Critical patent/CN114676686B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the invention provides a data dictionary processing method, a translation method and a related device, belonging to the field of data processing, wherein the data dictionary processing method comprises the following steps: processing a query interface on a service end based on the created general annotation and the translation mapping annotation, creating a dynamic tangent point, limiting the processing range of a transmission layer of the query interface, creating a translation mapping interface, and programming towards the interface to obtain a translation implementation class, so that a dynamic tangent plane is generated based on the general annotation, the translation mapping annotation and the translation implementation class, and then binding tangent plane logic of the dynamic tangent plane and the dynamic tangent point to realize generation of an intervention layer on the service end. The method comprises the steps that a server side of an interference pre-layer carries out translation mapping on a return result to be returned of a query interface to obtain translated target data, translation mapping can be realized without changing internal logic of the query interface, and the problem of code redundancy can be solved.

Description

Data dictionary processing method, translation method and related device
Technical Field
The invention relates to the field of data processing, in particular to a data dictionary processing method, a translation method and a related device.
Background
When the client queries the server data, because part of the data is dictionary data and the client needs the mapped dictionary value, the client needs to translate the dictionary data transmitted by the server to acquire the target information.
At present, in order to realize the translation of dictionary data, each interface needs to develop codes to realize the translation of dictionary data, so that the code redundancy of the client is serious.
Disclosure of Invention
In view of the above, the present invention provides a data dictionary processing method, a translation method and a related apparatus, which can solve the problem that the code redundancy is serious due to the dictionary data translation performed by the client.
In order to achieve the above object, the embodiments of the present invention adopt the following technical solutions.
In a first aspect, the following technical solutions are adopted in the embodiments of the present invention.
A method of data dictionary processing, the method comprising:
processing a query interface on a server side based on the created general annotation and the translation mapping annotation;
creating a dynamic tangent point, and limiting the processing range of a transmission layer of the query interface;
creating a translation mapping interface and programming the interface to obtain a translation implementation class;
generating a dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class, and binding tangent plane logic of the dynamic tangent plane and the dynamic tangent point to realize generation of an intervention layer at the server;
the interference layer is used for performing translation mapping on the data dictionary to be returned by the query interface to generate target data matched with the translation mapping annotation.
Further, the step of processing the query interface on the server based on the created general annotation and the translation mapping annotation includes:
creating a general annotation;
creating at least one translation mapping annotation according to the translation content required, wherein the translation mapping annotation comprises a dictionary number and a field name to be translated;
combining the general annotation and the translation mapping annotation to obtain a combined annotation;
and using the combined annotation on a query interface of a server.
Further, the translation implementation classes are in one-to-one correspondence with the translation mapping annotations;
the step of generating a dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class comprises:
and acquiring the translation mapping annotation according to the general annotation, and calling the translation implementation class.
Further, the step of creating a dynamic tangent point and defining a processing range of a transport layer of the query interface includes:
taking the uppermost layer of the transmission layer of the query interface with the combined annotation as a service range to create a dynamic tangent point;
wherein the uppermost layer comprises a controller layer and/or an rpc outermost layer.
Further, the step of binding the facet logic of the dynamic facet to the dynamic tangent point includes:
and matching the section logic of the dynamic section with the dynamic tangent point, and exposing the section logic of the dynamic section to an application program framework for binding.
In a second aspect, an embodiment of the present invention provides a server, which adopts the following technical solutions.
A server, the server comprising a query interface and an intervention layer generated by the data dictionary processing method according to the first aspect.
In a third aspect, an embodiment of the present invention provides a data dictionary translation method, which adopts the following technical solution.
A data dictionary translation method implemented on the basis of the server according to the second aspect, the method comprising:
receiving a query request sent by a client through the query interface, and generating a return result in response to the query request;
and performing translation mapping of a data dictionary on the return result through the interference pre-layer to obtain target data, and sending the target data to the client.
Further, the step of performing translation mapping of a data dictionary on the returned result through the intervention layer to obtain target data includes:
finding out a field value corresponding to the mapping field name to be translated from the return result;
inquiring a data dictionary corresponding to the dictionary number from a database of the server;
finding out text information corresponding to the field value from the data dictionary;
and combining the return result, the field value and the text information to obtain target data.
In a fourth aspect, an embodiment of the present invention provides a data dictionary processing apparatus, which adopts the following technical solution.
A data dictionary processing device comprises a creating module and a binding module;
the creating module is used for processing a query interface on a server side based on the created general annotation and the translation mapping annotation, creating a dynamic tangent point, limiting the processing range of a transmission layer of the query interface, creating a translation mapping interface, and programming in an interface-oriented manner to obtain a translation implementation class;
the binding module is used for generating a dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class, and binding tangent plane logic of the dynamic tangent plane with the dynamic tangent point so as to generate an intervention layer at the server side;
the interference layer is used for performing translation mapping on the data dictionary to be returned by the query interface to generate target data matched with the translation mapping annotation.
In a fifth aspect, an embodiment of the present invention provides an electronic device, which adopts the following technical solutions.
An electronic device comprising a processor and a memory, the memory storing a computer program executable by the processor, the processor being executable to implement a data dictionary processing method as described in the first aspect or to implement a data dictionary translation method as described in the third aspect.
In a sixth aspect, an embodiment of the present invention provides a storage medium, which adopts the following technical solutions.
A storage medium having stored thereon a computer program which, when executed by a processor, implements a data dictionary processing method as described in the first aspect, or implements a data dictionary translation method as described in the third aspect.
According to the data dictionary processing method, the translation method and the related device provided by the embodiment of the invention, based on the created general annotation and the translation mapping annotation, the query interface of the service end is processed, the dynamic tangent point is created, the interface-oriented programming is carried out, the dynamic tangent plane is generated based on the general annotation, the translation mapping annotation and the translation implementation class, and the tangent plane logic of the dynamic tangent plane is bound with the dynamic tangent point, so that the intervention layer is added to the query interface of the service end, the service end can translate the data dictionary to be returned in the intervention layer, and the client does not need to translate the returned result, so that the problem that the dictionary data translation is carried out by the client and the code redundancy is serious can be solved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a schematic diagram of interaction between a server and a client provided by an embodiment of the present invention.
Fig. 2 is a flowchart illustrating one of the data dictionary translation methods according to the embodiment of the present invention.
Fig. 3 is a second flowchart illustrating a data dictionary translation method according to an embodiment of the present invention.
FIG. 4 illustrates a logical diagram of the translation mapping process provided by an embodiment of the present invention.
Fig. 5 is a flowchart illustrating one of the data dictionary processing methods according to the embodiment of the present invention.
Fig. 6 shows a schematic flow chart of a part of the sub-steps of step S201 in fig. 5.
Fig. 7 shows a component relationship diagram of the interference layer provided by the embodiment of the invention.
Fig. 8 is a block diagram illustrating a data dictionary processing apparatus according to an embodiment of the present invention.
Fig. 9 is a block diagram of an electronic device according to an embodiment of the present invention.
Reference numerals: 100-a server; 110-a query interface; 120-dry pre-layer; 130-a client; 140-data dictionary processing means; 150-a creation module; 160-a binding module; 170-electronic device.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
When the client queries the server data, because part of the data is dictionary data (i.e., data that needs to be translated according to a data dictionary), and the client needs a dictionary value after mapping, the client needs to translate the dictionary data transmitted by the server to acquire the target information.
For example, the client needs to query the exchange where the securities a are located, the data returned by the server is shown in table 1, the data dictionary corresponding to the exchange is shown in table 2, and the result which needs to be displayed actually is shown in table 3.
TABLE 1
Securities name Exchange
Securities A 1
Securities B 2
TABLE 2
Dictionary sub-item numbering Corresponding dictionary value
1 Great sea securities exchange
2 Deep certificate stock exchange
TABLE 3
Security name Exchange
Securities A SHANGHAI STOCK EXCHANGE
Securities B Deep certificate stock exchange
Currently, for the above situation, there are two schemes for translating the data returned by the server. One is that: the internal logic of each query interface of the server is changed, and translation is performed on the server side, that is, the server needs to map the dictionary data in the exchange column into the corresponding dictionary value, see table 4.
TABLE 4
Securities name Transaction (old) Exchange
Securities A 1 SHANGHAI STOCK EXCHANGE
Securities B 2 Deep certificate stock exchange
The other scheme is as follows: and the server side continues to return the previous data, the client side requests a new dictionary interface to acquire the data dictionary in the table 2, then the dictionary columns in the table 1 are circulated, and corresponding dictionary values are searched and mapped one by one, namely, the client side develops and performs dictionary translation mapping work.
For the first scheme, each interface has at least one data dictionary column, so all interfaces need to translate the at least one data dictionary column, and the workload of the server is large. Even if a plurality of interfaces have the same data dictionary columns, a plurality of sets of the same codes are developed for dictionary mapping, and the code redundancy of the server side is serious and time and labor are wasted. The interface only needs to do business development work within the interface range, but because the translation mapping of the dictionary needs to be considered, additional code logic is added, so that the code logic is disordered and the structure is unclear. Moreover, because some new dictionary value fields after translation mapping need to be added into the object, the object used by the interface and even the database script are polluted downwards.
In the second scheme, the client needs to call at least one additional data dictionary interface besides calling one interface request, thereby occupying network bandwidth and reducing efficiency. Moreover, the client needs to perform service development work, i.e. perform translation and mapping work on the data dictionary columns, which increases the development burden of the client, affects the rendering efficiency when the front-end table is displayed, and when the data volume is large, the situation of obvious page blockage can occur.
In view of the above, embodiments of the present invention provide a data dictionary processing scheme and a translation scheme to improve the above problems. Hereinafter, the above-described scheme will be described.
In one embodiment, referring to fig. 1, a server 100 is provided, where the server 100 includes a query interface 110 and an intervention layer 120 generated by using the data dictionary processing method provided in the present invention, and the intervention layer 120 is located between the query interface 110 of the server 100 and a client 130.
And the intervention layer 120 is configured to translate the data dictionary to be returned by the query interface 110, and generate target data matched with the translation mapping annotation. The intervention layer 120 is developed by using an annotation mechanism in accordance with the section programming.
The client 130 initiates a query request to the query interface 110 of the server 100, the server 100 generates a return result (the return result may be in the form shown in table 1, and is data typical of a data word) in response to the query request, and the query interface 110 waits to return the return result. After the query interface 110 obtains the returned result, the intervention layer 120 performs translation mapping on the returned result to obtain the target data.
It should be appreciated that the target data is data that the client 130 does not need to do translation mapping any more, e.g., in the form of data in table 4.
The server 100 refers to a terminal device that transmits data to the inquiring party, and may be, but is not limited to, a server, a main control server, and a main control device.
In the server 100, the intervention layer 120 only performs translation mapping processing on a return result to be returned by the query interface 110 of the server 100, and does not affect the internal logic of the server 100 (does not change the original logic of the query interface 110). Because the annotation mechanism is developed facing to the section, redundant codes are not generated, dictionary translation mapping logic is not needed to be concerned, and the problems of redundancy of codes of the server 100, disordered code logic, and pollution of interface processing objects and databases in the conventional data dictionary translation method can be solved. And after the client 130 receives the target data, the mapping does not need to be translated, so that the problems of code redundancy and low rendering efficiency of the client 130 can be solved.
To describe in more detail, in an embodiment, referring to fig. 2, a data dictionary translation method is provided, and the data dictionary translation method is implemented based on the server 100 in fig. 1, and includes the following steps.
S101, receiving a query request sent by a client through a query interface, and responding to the query request to generate a return result.
And S102, performing translation mapping on the returned result through the interference pre-layer to obtain target data, and sending the target data to the client.
The intervention layer 120 includes a combined annotation consisting of a generic annotation and a translation mapping annotation, which is used on the query interface 110 of the server 100.
The number of the translation mapping annotations is at least one, and each translation mapping annotation comprises a dictionary number and a field name to be translated. It should be understood that the translation map annotations have different content between two.
The dictionary number in the translation mapping annotation refers to a data dictionary used for translating and mapping the name of the mapping field to be translated.
In the data dictionary translation method, the interference layer 120 performs translation mapping on a return result to be returned by the query interface 110 to obtain target data, the target data is sent to the client 130, and the client 130 can directly render and display the target data after receiving the target data, so that code redundancy of the client 130 can be greatly reduced, and rendering efficiency is improved. Meanwhile, due to the arrangement of the interference layer 120, the server 100 does not need to change each query interface 110, so that the problem of code redundancy of the server 100 can be improved.
In one embodiment, the translation map annotation may be in the form of: @ data dictionary translation mapping notes (dictionary number: exchange dictionary number, mapping field name to be translated: exchange). In this case, the table 2 may be a data dictionary corresponding to the dictionary number in the translation mapping annotation, and the exchange in the table 1 is the name of the mapping field to be translated.
Further, in order to facilitate understanding to further describe the above step S102, referring to fig. 3, S102 may include the following sub-steps.
S102-1, finding out the field value corresponding to the name of the mapping field to be translated from the returned result.
For example, the returned result is table 1, the name of the mapping field to be translated in the mapping annotation to be translated is called an exchange, and at this time, the field values corresponding to the name of the mapping field to be translated are 1 and 2.
S102-2, the data dictionary corresponding to the dictionary number is inquired from the database of the server.
The database of the server 100 stores a plurality of data dictionaries, and each data dictionary has its own unique dictionary number.
And according to the dictionary number in the translation mapping annotation, the data dictionary specified by the translation mapping annotation can be searched from the database.
S102-3, finding out text information corresponding to the field value from the data dictionary.
For example, when the data dictionary is table 2, the field values corresponding to the names of the mapping fields to be translated are 1 and 2, i.e. the dictionary sub-entry numbers in the table, the contents of the text information corresponding to the dictionary values in table 2 are found.
And S102-4, combining the returned result, the field value and the text information to obtain target data.
For example, the returned result is table 1 and the target data is table 4.
Through the above steps S102-1 to S102-4, translation of the returned result is realized.
Referring to FIG. 4, a logic diagram of the translation mapping process of the above steps S102-1 to S102-4 is shown, which is detailed as follows.
(1) And determining a field value corresponding to the mapping field name to be translated according to the returned result and the mapping field name to be translated in the translation mapping annotation.
(2) And determining a data dictionary according to the dictionary number in the translation mapping annotation, and performing translation mapping on the field value according to the data dictionary to obtain the text information corresponding to the field value.
(3) And adding the text information to the returned result to obtain the target data.
In order to understand the principle of the data dictionary translation method more deeply and to explain the principle that the data dictionary translation method does not affect the internal processing logic of the query interface 110 of the server 100, in one embodiment, a data dictionary processing method is provided, and the data dictionary processing method includes: for the query interface 110 of the server 100, a comment mechanism is utilized, and a facet-oriented programming is developed to add an intervention layer 120 on the query interface 110 of the server 100. The intervention layer 120 is configured to perform translation mapping on a data dictionary to be returned by the query interface 110, and generate target data matched with the translation mapping annotation. Therefore, the server 100 can perform data dictionary translation processing on the return result of the query interface 110 by adopting the data dictionary translation method provided above.
In more detail, referring to fig. 5, the data dictionary processing method includes the following steps, which are exemplified by the server 100 in fig. 1 as an execution subject of the following steps.
S201, based on the created general annotation and the translation mapping annotation, the query interface 110 on the server 100 is processed.
S202, creating a dynamic tangent point, and defining a processing range for the transport layer of the query interface 110.
A cut point may be understood as a condition, and at runtime, a dynamic cut point will examine the value of the method/class's entries to match the corresponding method.
S203, creating a translation mapping interface and programming the interface to obtain a translation implementation class.
It should be understood that the translation implementation class refers to a program for performing data dictionary translation mapping, and each translation content may correspond to one translation implementation class, or multiple translation contents may correspond to one translation implementation class.
S204, based on the general annotation, the translation mapping annotation and the translation implementation class, a dynamic tangent plane is generated, and the tangent plane logic and the dynamic tangent point of the dynamic tangent plane are bound, so that the generation of the intervention layer 120 at the server 100 is realized.
At present, a conventional method (i.e. the first existing solution introduced above) requires the server 100 to change all interfaces, i.e. internal logic of the interfaces needs to be changed to obtain translated data, which results in serious code redundancy of the server 100, and additional code logic is required, which easily causes confusion of code logic and pollution to objects or database scripts used by the interfaces.
The data dictionary processing method provided in this embodiment processes the query interface 110 of the server 100 based on the created general annotation and the translation mapping annotation, creates a dynamic tangent point, faces to the interface programming, generates a dynamic tangent plane based on the general annotation, the translation mapping annotation, and the translation implementation class, and further binds the tangent plane logic of the dynamic tangent plane to the dynamic tangent point, so as to add the intervention layer 120 to the query interface 110 of the server 100, so that the server 100 can translate the data dictionary to be returned in the intervention layer 120, and the client 130 is not required to translate the returned result, thereby being capable of solving the problem that the dictionary data translation is performed by the client 130 and the server 100, and the code redundancy is serious.
Moreover, since the intervention layer 120 is added to the query interface 110 of the server 100 through the above steps S201 to S204, only the information in the service range of the transport layer of the query interface 110 is processed, so that the internal logic of the query interface 110 is not changed, and further, the code logic is not disturbed and the object or database script used by the interface is not polluted.
To facilitate understanding, the above step S201 is described in more detail, and referring to fig. 6, the step S201 may include the following steps.
S201-1, creating a general annotation.
The server 100 may store various creating rules of the annotation, so that the general annotation can be created by calling the creating rules of the general annotation.
Annotations may be viewed as an extended template to a class/method, each class/method annotating different parameters for the class/method according to rules in the annotation class, where applicable, the various parameters and values annotated in the different classes/methods may be obtained.
In this embodiment, the general annotation is used to generalize a certain parameter or value.
S201-2, according to the needed translation content, creating at least one translation mapping annotation.
Similarly, the annotation creation rule may be invoked to create a translation mapping annotation.
The translation mapping annotation comprises a dictionary number and a mapping field name to be translated. For example, the translation map annotation may be in the form of: @ data dictionary translation mapping notes (dictionary number: exchange dictionary number, mapping field name to be translated: exchange).
Various translation mapping annotations can be created by combining the dictionary numbers and the names of the mapping fields to be translated.
S201-3, combining the general annotation and the translation mapping annotation to obtain a combined annotation.
By combined annotation is meant that one annotation is annotated to another annotation, which is generally divided into meta-annotations and combined annotations. Meta-annotation refers to an annotation that can be annotated to another annotation. The combined annotation refers to an annotated annotation, and the combined annotation has the function of meta-annotation thereon.
In this embodiment, it may be: the general annotation is a combined annotation and the translation mapping annotation is a meta-annotation. When the two are combined, the resulting annotation may be referred to as a combined annotation. In actual application, the general annotation can be used as meta-annotation, and the translation mapping annotation can be used as combined annotation.
The combined annotation obtained after the combination of the general annotation and the translation mapping annotation has the functions of the general annotation and the translation mapping annotation.
S201-4, the combined annotation is used on the query interface 110 of the server 100.
The combined annotation is used on the query interface 110 of the server 100, i.e. the function of adding the combined annotation to the query interface 110 of the server 100.
Through the above steps S201-1 to S201-4, a generalization and translation function is added to the query interface 110 of the server 100 in an annotation manner.
For ease of understanding, the above step S202 is described in more detail, and the step S202 may be implemented as follows: the uppermost layer of the transport layer of the query interface 110 with the combined annotations is taken as the business scope to create the dynamic tangent point.
Since the tangent point corresponds to a condition, the above manner can also be understood as: the uppermost layer of the transport layer of the query interface 110 with the combined annotation is taken as a condition. If the query interface 110 does not combine annotations, then it does not process them.
The top layer includes, but is not limited to, the controller layer and/or the rpc outermost layer, that is, the processing result to be returned by the query interface 110. The particular top layer is which layer, as determined by the communication protocol supported by the query interface 110.
Meanwhile, since it is a dynamic tangent point, the contents of the annotation are mapped according to the value of the processing result (i.e. the returned result to be returned by the query interface 110) at the top layer of the transmission layer and the translation.
Further, in creating the dynamic tangent point, the type of data processed may be limited, i.e., the type of processing added.
For S204, generating the dynamic tangent plane according to different devices of the translation mapping class may be implemented in different implementations.
When one kind of translation content corresponds to one translation mapping class, that is, the translation implementation class corresponds to one translation mapping annotation, the generation of the dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class in S204 can be realized in the following manner:
and acquiring a translation mapping annotation according to the general annotation, and calling a translation implementation class.
Due to the combination of the general annotation and the translation mapping annotation, the translation mapping annotation can be obtained according to the general annotation (the translation mapping annotation indicates the translation content), and then the translation implementation class is called to prepare the translation implementation program, so that a processing process is prepared, namely a dynamic tangent plane is generated.
It should be understood that when one translation implementation class corresponds to multiple translation mapping annotations, a dynamic tangent plane may also be generated in the manner described above.
After the dynamic tangent plane is generated, a complete translation process (generating the intervention layer 120) can be generated by combining (i.e., binding) the dynamic tangent point (i.e., the limited service range) with the process.
In detail, the binding of the section logic and the dynamic tangent point of the dynamic section in step S204 is implemented by: and matching the section logic of the dynamic section with the dynamic section, and exposing the section logic of the dynamic section to an application program framework for binding.
The program frame may be spring, or may be a Struts frame, Hibernate frame, or the like, and is not specifically limited in this embodiment.
Referring to fig. 7, in order to generate a component relationship diagram of the intervention layer 120 based on the data dictionary processing method, the intervention layer 120 includes components such as a general annotation, a translation mapping annotation, a dynamic tangent point, a dynamic tangent plane, and a translation implementation class. The dynamic tangent plane depends on the general annotation and the translation mapping annotation, the general annotation generalizes the returned result, the dynamic tangent point determines the processing range of the data after the general annotation, and the translation implementation class calls the dynamic tangent plane to implement the translation mapping.
It should be noted that the intervention layer 120 generated by the data dictionary processing method is not limited to the above contents, and in the actual application process, the development may be performed according to the actual requirements, for example, determining a new service range, adding new translation mapping contents, and the like.
Through the data dictionary processing method, the intervention layer 120 can be generated at the server 100, so that the server 100 can implement the data dictionary translation method to translate the return interface of the query interface 110 into the target data and send the target data to the target data.
The data dictionary processing method abstracts a uniform processing frame (namely, the intervention layer 120) based on the logic processing of the steps S201-S204, and the generated intervention layer 120 performs data dictionary mapping on the return data of the query interface 110 of the server 100, thereby solving the problems of code redundancy and code logic confusion of the server 100 in the existing method.
Because the server 100 with the intervention layer 120 processes the return result of the query interface 110 by using the data dictionary translation method to obtain the target data, the target data can be directly displayed on the client 130 without the translation of the client 130, the performance of the client 130 can be improved, and the rendering efficiency can be improved.
The interference layer 120 generated by the data dictionary processing method is clear in hierarchy and simple in logic, and the query interface 110 of the server 100 does not need to be greatly modified, so that the problem of large workload of the server 100 can be solved.
It should be noted that the inventive concept provided by the above embodiments is not limited to the field, and can also be applied to other fields.
It should be understood that although the various steps in the flowcharts of fig. 2-6 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-6 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
Based on the inventive concept of the above data dictionary processing method, in one embodiment, as shown in fig. 8, there is provided a data dictionary processing apparatus 140, which includes a creating module 150 and a binding module 160.
The creating module 150 is configured to process the query interface 110 on the server 100 based on the created general annotation and the translation mapping annotation, create a dynamic tangent point, limit a processing range of a transport layer of the query interface 110, create a translation mapping interface, and program the translation mapping interface in an interface-oriented manner to obtain a translation implementation class.
The binding module 160 is configured to generate a dynamic tangent plane based on the general annotation, the translation mapping annotation, and the translation implementation class, and bind the tangent plane logic and the dynamic tangent point of the dynamic tangent plane to implement generation of the intervention layer 120 at the server 100.
The intervention layer 120 is configured to perform translation mapping on a data dictionary to be returned by the query interface 110, and generate target data matched with the translation mapping annotation.
In the data dictionary processing apparatus 140, the creating module 150 processes the query interface 110 of the server 100 based on the created general annotation and the translation mapping annotation, creates a dynamic tangent point, and programs interface-oriented, and the binding module 160 generates a dynamic tangent plane based on the general annotation, the translation mapping annotation, and the translation implementation class, and further binds the tangent plane logic of the dynamic tangent plane to the dynamic tangent point, so as to add the intervention layer 120 in the query interface 110 of the server 100, so that the server 100 can translate the data dictionary to be returned in the intervention layer 120, and the client 130 is not required to translate the returned result, thereby improving the problem that the dictionary data translation is performed between the client 130 and the server 100, and the code redundancy is serious.
For specific definition of the data dictionary processing device 140, reference may be made to the definition of the data dictionary processing method above, and details are not repeated here. The respective modules in the data dictionary processing apparatus 140 described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules may be embedded in the hardware or independent of the processor in the electronic device 170, or may be stored in the memory in the electronic device 170 in the software form, so that the processor calls and executes operations corresponding to the modules.
In one embodiment, an electronic device 170 is provided, and the internal structure of the electronic device 170 may be as shown in fig. 9. The electronic device 170 includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device 170 is configured to provide computing and control capabilities. The memory of the electronic device 170 includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the electronic device 170 is used for performing wired or wireless communication with an external terminal, and the wireless communication may be implemented through WIFI, an operator network, Near Field Communication (NFC), or other technologies. The computer program is executed by a processor to implement a data dictionary processing method. The display screen of the electronic device 170 may be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device 170 may be a touch layer covered on the display screen, a key, a trackball or a touch pad arranged on the housing of the electronic device 170, or an external keyboard, a touch pad or a mouse.
In an embodiment, the server 100 may be configured as shown in fig. 9, that is, the electronic device 170 in fig. 9 is the server 100, and when executed by a processor, the computer program implements a data dictionary translation method.
It will be understood by those skilled in the art that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration associated with the inventive arrangements, and does not constitute a limitation on the electronic device 170 to which the inventive arrangements are applied, and that a particular electronic device 170 may include more or less components than those shown, or some components may be combined, or have a different arrangement of components.
In one embodiment, the data dictionary apparatus provided by the present invention can be implemented in the form of a computer program, which can be run on the electronic device 170 shown in fig. 9. The memory of the electronic device 170 may store therein various program modules constituting the data dictionary apparatus, such as the creation module 150 and the binding module 160 shown in fig. 8. The computer program constituted by the respective program modules causes the processor to execute the steps in the data dictionary processing method of the respective embodiments of the present invention described in this specification.
For example, the electronic device 170 shown in fig. 9 may perform steps S201-S203 through the creation module 150 in the data dictionary processing apparatus 140 shown in fig. 8. The electronic device 170 may perform step S204 through the binding module 160.
In one embodiment, an electronic device 170 is provided comprising a memory storing a computer program and a processor implementing the following steps when the computer program is executed: processing the query interface 110 on the server 100 based on the created general annotation and the translation mapping annotation; creating dynamic tangent points, and limiting the processing range of the transmission layer of the query interface 110; creating a translation mapping interface and programming the interface to obtain a translation implementation class; generating a dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class, and binding tangent plane logic and dynamic tangent points of the dynamic tangent plane to realize generation of an intervention layer 120 at the server 100; the intervention layer 120 is configured to perform translation mapping on the data dictionary to be returned by the query interface 110, and generate target data matched with the translation mapping annotation.
In one embodiment, the processor, when executing the computer program, further performs the steps of: creating a general annotation; creating at least one translation mapping annotation according to the translation content required, wherein the translation mapping annotation comprises a dictionary number and a field name to be translated; combining the general annotation and the translation mapping annotation to obtain a combined annotation; the combined annotation is used on the query interface 110 of the server 100.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and acquiring a translation mapping annotation according to the general annotation, and calling a translation implementation class.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: processing the query interface 110 on the server 100 based on the created general annotation and the translation mapping annotation; creating a dynamic tangent point, and limiting the processing range of the transmission layer of the query interface 110; creating a translation mapping interface and programming the interface to obtain a translation implementation class; generating a dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class, and binding tangent plane logic and dynamic tangent points of the dynamic tangent plane to realize generation of an intervention layer 120 at the server 100; the intervention layer 120 is configured to perform translation mapping on the data dictionary to be returned by the query interface 110, and generate target data matched with the translation mapping annotation.
In one embodiment, an electronic device 170 is provided, which includes a memory and a processor, the memory stores a computer program, and when the electronic device 170 is the server 100, the processor executes the computer program to implement the following steps: receiving a query request sent by the client 130 through a query interface, and generating a return result in response to the query request; through the interference layer, the returned result is subjected to translation mapping of the data dictionary to obtain target data, and the target data is sent to the client 130.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a query request sent by the client 130 through a query interface, and generating a return result in response to the query request; and performing translation mapping on the returned result by the interference pre-layer to obtain target data, and sending the target data to the client 130.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing an electronic device 170 (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method of data dictionary processing, the method comprising:
processing a query interface on a server side based on the created general annotation and the translation mapping annotation;
creating a dynamic tangent point, and limiting the processing range of a transmission layer of the query interface;
creating a translation mapping interface and programming the interface to obtain a translation implementation class;
generating a dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class, and binding tangent plane logic of the dynamic tangent plane with the dynamic tangent point to generate an intervention layer at the server;
the interference layer is used for performing translation mapping on the data dictionary to be returned by the query interface to generate target data matched with the translation mapping annotation.
2. The data dictionary processing method according to claim 1, wherein the step of processing the query interface on the server side based on the created general annotation and the translation mapping annotation includes:
creating a general annotation;
creating at least one translation mapping annotation according to the translation content required, wherein the translation mapping annotation comprises a dictionary number and a field name to be translated;
combining the general annotation and the translation mapping annotation to obtain a combined annotation;
and using the combined annotation on a query interface of a server.
3. The data dictionary processing method of claim 2, wherein the translation implementation classes are in one-to-one correspondence with the translation mapping annotations;
the step of generating a dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class comprises:
and acquiring the translation mapping annotation according to the general annotation, and calling the translation implementation class.
4. The data dictionary processing method according to claim 2 or 3, wherein the step of creating a dynamic tangent point, defining a processing range to a transport layer of the query interface, comprises:
taking the uppermost layer of the transmission layer of the query interface with the combined annotation as a service range to create a dynamic tangent point;
wherein the uppermost layer comprises a controller layer and/or an rpc outermost layer.
5. The data dictionary processing method according to any one of claims 1 to 3, wherein the step of binding the tangent plane logic of the dynamic tangent plane and the dynamic tangent point includes:
and matching the section logic of the dynamic section with the dynamic tangent point, and exposing the section logic of the dynamic section to an application program framework for binding.
6. A server, characterized in that the server comprises a query interface and an intervention layer generated by the data dictionary processing method according to any one of claims 1 to 5.
7. A data dictionary translation method, based on the server implementation of claim 6, the method comprising:
receiving a query request sent by a client through the query interface, and generating a return result in response to the query request;
and performing translation mapping of a data dictionary on the return result through the interference pre-layer to obtain target data, and sending the target data to the client.
8. The data dictionary translation method of claim 7, wherein the intervention layer includes translation mapping annotations, the translation mapping annotations including dictionary numbers and mapping field names to be translated;
the step of performing translation mapping of a data dictionary on the return result through the intervention layer to obtain target data comprises the following steps:
finding out a field value corresponding to the mapping field name to be translated from the return result;
querying a data dictionary corresponding to the dictionary number from a database of the server;
searching out text information corresponding to the field value from the data dictionary;
and combining the return result, the field value and the text information to obtain target data.
9. The data dictionary processing device is characterized by comprising a creating module and a binding module;
the creating module is used for processing a query interface on a server side based on the created general annotation and the translation mapping annotation, creating a dynamic tangent point, limiting the processing range of a transmission layer of the query interface, creating a translation mapping interface, and programming in an interface-oriented manner to obtain a translation implementation class;
the binding module is used for generating a dynamic tangent plane based on the general annotation, the translation mapping annotation and the translation implementation class, and binding the tangent plane logic of the dynamic tangent plane with the dynamic tangent point so as to realize generation of an intervention layer at the server;
the interference layer is used for performing translation mapping on the data dictionary to be returned by the query interface to generate target data matched with the translation mapping annotation.
10. An electronic device comprising a processor and a memory, the memory storing a computer program executable by the processor, the processor being executable to implement the data dictionary processing method of any one of claims 1-5 or to implement the data dictionary processing method of claim 7 or 8.
11. A storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements a data dictionary processing method as claimed in any one of claims 1 to 5, or implements a data dictionary translation method as claimed in claim 7 or 8.
CN202210595749.XA 2022-05-30 2022-05-30 Data dictionary processing method, translation method and related device Active CN114676686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210595749.XA CN114676686B (en) 2022-05-30 2022-05-30 Data dictionary processing method, translation method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210595749.XA CN114676686B (en) 2022-05-30 2022-05-30 Data dictionary processing method, translation method and related device

Publications (2)

Publication Number Publication Date
CN114676686A true CN114676686A (en) 2022-06-28
CN114676686B CN114676686B (en) 2022-10-21

Family

ID=82080687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210595749.XA Active CN114676686B (en) 2022-05-30 2022-05-30 Data dictionary processing method, translation method and related device

Country Status (1)

Country Link
CN (1) CN114676686B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048478A (en) * 2023-03-07 2023-05-02 智慧眼科技股份有限公司 Dictionary escape method, device, equipment and computer readable storage medium
CN116701517A (en) * 2023-07-04 2023-09-05 舟谱数据技术南京有限公司 Method and device for realizing export interface based on tangent plane

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190370370A1 (en) * 2018-06-04 2019-12-05 International Business Machines Corporation Autonomous generation of a graph query language interface on top of an application programming interface
US10572607B1 (en) * 2018-09-27 2020-02-25 Intuit Inc. Translating transaction descriptions using machine learning
CN111611241A (en) * 2020-04-29 2020-09-01 平安科技(深圳)有限公司 Dictionary data operation method and device, readable storage medium and terminal equipment
CN112035858A (en) * 2020-08-28 2020-12-04 中国建设银行股份有限公司 API access control method, device, equipment and medium
CN113495765A (en) * 2021-09-07 2021-10-12 深圳易来智能有限公司 Business data filling method and device, storage medium and electronic device
CN113835692A (en) * 2021-09-27 2021-12-24 湖南快乐阳光互动娱乐传媒有限公司 Dictionary data processing method and device, electronic equipment and computer storage medium
CN114020250A (en) * 2021-10-09 2022-02-08 济南浪潮智投智能科技有限公司 Dictionary translation implementation method and system based on AOP, electronic device and storage medium
CN114218315A (en) * 2021-12-16 2022-03-22 平安壹钱包电子商务有限公司 Interface generation method and device, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190370370A1 (en) * 2018-06-04 2019-12-05 International Business Machines Corporation Autonomous generation of a graph query language interface on top of an application programming interface
US10572607B1 (en) * 2018-09-27 2020-02-25 Intuit Inc. Translating transaction descriptions using machine learning
CN111611241A (en) * 2020-04-29 2020-09-01 平安科技(深圳)有限公司 Dictionary data operation method and device, readable storage medium and terminal equipment
CN112035858A (en) * 2020-08-28 2020-12-04 中国建设银行股份有限公司 API access control method, device, equipment and medium
CN113495765A (en) * 2021-09-07 2021-10-12 深圳易来智能有限公司 Business data filling method and device, storage medium and electronic device
CN113835692A (en) * 2021-09-27 2021-12-24 湖南快乐阳光互动娱乐传媒有限公司 Dictionary data processing method and device, electronic equipment and computer storage medium
CN114020250A (en) * 2021-10-09 2022-02-08 济南浪潮智投智能科技有限公司 Dictionary translation implementation method and system based on AOP, electronic device and storage medium
CN114218315A (en) * 2021-12-16 2022-03-22 平安壹钱包电子商务有限公司 Interface generation method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SONG,YEONGKIL等: "《Semi-automatic construction of a named entity dictionary for entity-based sentiment analysis in social media》", 《MULTIMEDIA TOOLS AND APPLICATIONS》 *
丁振凡: "《基于注解方式的Spring面向切面编程研究》", 《计算机时代》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048478A (en) * 2023-03-07 2023-05-02 智慧眼科技股份有限公司 Dictionary escape method, device, equipment and computer readable storage medium
CN116048478B (en) * 2023-03-07 2023-05-30 智慧眼科技股份有限公司 Dictionary escape method, device, equipment and computer readable storage medium
CN116701517A (en) * 2023-07-04 2023-09-05 舟谱数据技术南京有限公司 Method and device for realizing export interface based on tangent plane

Also Published As

Publication number Publication date
CN114676686B (en) 2022-10-21

Similar Documents

Publication Publication Date Title
CN114676686B (en) Data dictionary processing method, translation method and related device
CN108156022B (en) Service calling method and device and electronic equipment
JP4991040B2 (en) Interpreting command scripts using local and extended storage for command indexing
US10380139B2 (en) SQL interceptor for use with third party data analytics packages
US6636855B2 (en) Method, system, and program for accessing stored procedures in a message broker
CN110162524B (en) Configuration data management method, device, computer equipment and storage medium
AU2005202285A1 (en) Method, system, and apparatus for providing access to workbook models through remote function calls
KR20100014305A (en) Integrating enterprise search systems with custom access control application programming interfaces
EP2380089B1 (en) Extensibility for web based diagram visualization
CN111818175B (en) Enterprise service bus configuration file generation method, device, equipment and storage medium
CN104536987A (en) Data query method and device
CN113177021A (en) Data export method and device for different data sources
KR20160138498A (en) System and method for supporting data type conversion in a heterogeneous computing environment
CN116737677A (en) Resource processing method, device, computer equipment and readable storage medium
CN104317935A (en) Method and system for generating HTML (hypertext markup language) pages from XML (extensible markup language) bill files in batches
CN113032820B (en) File storage method, access method, device, equipment and storage medium
US11151094B1 (en) Cluster gateway to multiple filesystems
CN114186958A (en) Method, computing device and storage medium for exporting list data as spreadsheet
CN110196877B (en) Data display method, device, computer equipment and storage medium
US10579722B1 (en) Structured metadata for dynamic data encapsulation
CN112597105A (en) Processing method of file associated object, server side equipment and storage medium
CN111373365A (en) Pattern syntax
WO2016167249A1 (en) Access control device, and access control method
CN114764406B (en) Database query method and related device
US12001503B2 (en) System and method for delivering application metadata

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant