CN117762984A - Data acquisition method, device, electronic equipment and storage medium - Google Patents
Data acquisition method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117762984A CN117762984A CN202311590576.3A CN202311590576A CN117762984A CN 117762984 A CN117762984 A CN 117762984A CN 202311590576 A CN202311590576 A CN 202311590576A CN 117762984 A CN117762984 A CN 117762984A
- Authority
- CN
- China
- Prior art keywords
- dictionary
- dictionary information
- annotation
- conversion
- data acquisition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 238000006243 chemical reaction Methods 0.000 claims abstract description 115
- 238000013507 mapping Methods 0.000 claims abstract description 28
- 238000004900 laundering Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 12
- 238000013075 data extraction Methods 0.000 claims description 5
- 238000011161 development Methods 0.000 abstract description 26
- 230000007246 mechanism Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 238000011001 backwashing Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011010 flushing procedure Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a data acquisition method, a data acquisition device, electronic equipment and a storage medium, and belongs to the technical field of computers. The data acquisition method comprises the following steps: receiving a dictionary conversion request, and determining target dictionary information items; performing annotation marks on the target dictionary information items to obtain target dictionary information items of the annotation marks; performing dictionary information inquiry in an internal memory database by taking the target dictionary information item of the annotation mark as an inquiry condition to obtain dictionary information corresponding to the inquiry condition; and performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request. The invention improves the data access speed by inquiring dictionary information in the memory data, realizes the uniformity and accuracy of multi-code value conversion mapping by adopting annotation marks and annotation interpretation, can greatly reduce development workload, improve development efficiency and code robustness, and can provide rapid and accurate dictionary inquiry and conversion service.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data acquisition method, apparatus, electronic device, and storage medium.
Background
In a relational database, information is stored in a code value form, but dictionary information items with specific meanings are actually needed to be displayed, so that association query is needed in the database, each dictionary item to be displayed needs to be subjected to additional association query, a large number of table associations are generated when the dictionary items to be converted are more, the query efficiency is seriously affected, the query efficiency is low due to low access speed of the database based on a disk, errors are possibly caused due to the problem of the query efficiency, and customization development is needed for different dictionary items, so that the development workload is greatly increased.
Disclosure of Invention
The invention provides a data acquisition method, a device, electronic equipment and a storage medium, which are used for solving the defects that in the prior art, information is stored in a code value form, but dictionary information items with specific meanings are actually needed to be displayed, so that the related query is needed in a database, the query efficiency is seriously influenced, the query efficiency is low due to low access speed of the database based on a disk, errors are possibly caused due to the problem of the query efficiency, and the development workload is greatly increased due to the fact that customization development is needed for different dictionary items.
In a first aspect, the present invention provides a data acquisition method, including:
receiving a dictionary conversion request, and determining target dictionary information items;
performing annotation marks on the target dictionary information items to obtain target dictionary information items of the annotation marks;
performing dictionary information inquiry in an internal memory database by taking the target dictionary information item of the annotation mark as an inquiry condition to obtain dictionary information corresponding to the inquiry condition;
and performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
According to the data acquisition method provided by the invention, the method further comprises the following steps:
if the dictionary information does not exist in the memory database, acquiring the dictionary information from a relational database according to the query condition;
and if the dictionary information exists in the relational database, outputting the dictionary information, and storing the dictionary information into the memory database.
According to the data acquisition method provided by the invention, the method further comprises the following steps:
dictionary information corresponding to the dictionary to be converted is stored in the memory database in advance.
According to the data acquisition method provided by the invention, the dictionary information corresponding to the dictionary to be converted is stored in the memory database in advance, and the method comprises the following steps:
determining a dictionary which needs to be converted;
annotating the dictionary to be converted to obtain dictionary information items of the annotating mark;
according to the dictionary information items of the annotation marks, dictionary information corresponding to the dictionary to be converted is obtained;
and storing dictionary information corresponding to the dictionary to be converted in the memory database.
According to the data acquisition method provided by the invention, the dictionary to be converted is marked with notes to obtain dictionary information items of the notes, and the method comprises the following steps:
carrying out annotation marking on the dictionary to be converted by using a preset annotation marking template to obtain dictionary information items of the annotation marking;
wherein the annotation tag template is used to indicate at least one of: a single dictionary type for dictionary conversion, multiple dictionary types for dictionary conversion, physical attributes specified by dictionary entries, whether dictionary-converted content is to be replaced into current physical attributes, whether content is to be returned in key-desc, customized parameters, and whether to read from cache.
According to the data acquisition method provided by the invention, the annotation interpretation and mapping are carried out on the dictionary information to obtain the conversion result corresponding to the dictionary conversion request, and the method comprises the following steps:
and annotating, explaining and converting the dictionary information by adopting a Java reflection mode to obtain a conversion result corresponding to the dictionary conversion request.
According to the data acquisition method provided by the invention, the receiving dictionary conversion request, determining target dictionary information items, comprises the following steps:
receiving a money laundering case information inquiry request, and acquiring inquiry parameters carried in the money laundering case information inquiry request;
determining target dictionary information items according to the query parameters;
the annotating, interpreting and mapping the dictionary information to obtain a conversion result corresponding to the dictionary conversion request, including:
and annotating, explaining and converting the dictionary information in a Java reflection mode to obtain a query result corresponding to the money-back case information query request.
In a second aspect, the present invention provides a data acquisition apparatus comprising:
the conversion total control module is used for receiving the dictionary conversion request and determining target dictionary information items;
the annotation mark module is used for carrying out annotation marks on the target dictionary information items to obtain target dictionary information items of the annotation marks;
the data extraction module is used for carrying out dictionary information inquiry in the memory database by taking the target dictionary information item of the annotation mark as an inquiry condition to obtain dictionary information corresponding to the inquiry condition;
and the annotation interpretation module is used for performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the data acquisition method according to the first aspect when executing the program.
In a fourth aspect, the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the data acquisition method according to the first aspect.
In a fifth aspect, the present invention provides a computer program product comprising a computer program which, when executed by a processor, implements the data acquisition method according to the first aspect.
The invention provides a data acquisition method, a data acquisition device, electronic equipment and a storage medium, wherein a target dictionary information item is determined by receiving a dictionary conversion request; annotating the target dictionary information item to obtain the target dictionary information item of the annotating mark; performing dictionary information inquiry in the memory database by taking target dictionary information items of the annotation marks as inquiry conditions to obtain dictionary information corresponding to the inquiry conditions; the dictionary information is annotated and mapped to obtain a conversion result corresponding to the dictionary conversion request, the data access speed is improved by inquiring the dictionary information in the memory data, the unification and the accuracy of multi-code value conversion mapping are realized by adopting annotation marks and annotation interpretation, the customized development of different dictionary items is not needed, the development workload can be greatly reduced, the development efficiency is improved, the code robustness is improved, and the rapid and accurate dictionary inquiry and conversion service can be provided.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a data acquisition method according to an embodiment of the present invention;
FIG. 2 is a second flowchart of a data acquisition method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data acquisition device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an interaction flow for performing dictionary conversion based on the data acquisition device according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a schematic flow chart of a data acquisition method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps: step 110, step 120, step 130 and step 140. The method flow steps are only one possible implementation of the invention. The method comprises the following steps:
step 110, receiving a dictionary conversion request, and determining target dictionary information items;
it will be appreciated that the dictionary conversion request is for requesting dictionary conversion. According to the dictionary conversion request, target dictionary information items which need to be converted are determined.
Among them, dictionary information items refer to a data structure for storing and retrieving data, which may also be called key-value pairs (key-value) or maps (map). The dictionary information item is composed of a unique key and a value associated therewith. Dictionary information items provide an efficient way to store and retrieve data. By associating keys with values, the corresponding values can be quickly looked up from the keys without traversing the entire dataset. Such data structures are commonly used in applications that build databases, caches, configuration files, etc., as well as to process and manage various types of data. For example, assuming that it is intended to store name and age information of students, this can be achieved using dictionary information items. Wherein the student's name is used as a key and the age is used as a corresponding value. By means of the query key, the age information of the corresponding student can be obtained quickly.
Dictionary information items are a data structure for storing and retrieving data, consisting of keys and values associated therewith, providing an efficient way of data access.
By receiving the dictionary conversion request, parsing the dictionary conversion request, the target dictionary information item can be determined.
120, annotating the target dictionary information item to obtain an annotated target dictionary information item;
it can be appreciated that the annotation mode is used to tag the target dictionary information item to obtain the target dictionary information item of the annotation tag.
Specifically, the annotation in the embodiment of the present invention refers to Java annotation (animation), also called metadata, a description of a code level. It is a feature introduced by JDK1.5 and later versions, at the same level as class, interface, enumeration. It may be declared in front of packages, classes, fields, methods, local variables, method parameters, etc. to describe, annotate these elements.
The invention can ensure the uniformity and the accuracy of the multi-code value conversion mapping by abstracting the dictionary conversion into the annotation.
130, carrying out dictionary information query in a memory database by taking target dictionary information items of the annotation marks as query conditions to obtain dictionary information corresponding to the query conditions;
the memory database refers to a database which is directly operated by putting data in a memory. Compared with a magnetic disk, the read-write speed of the memory database is higher by several orders of magnitude, and compared with the access from the magnetic disk, the access of the data stored in the memory can greatly improve the application performance.
Storing dictionary information in an in-memory database may provide faster queries.
And carrying out dictionary information inquiry in an in-memory database by taking the target dictionary information item of the annotation mark as an inquiry condition, so that dictionary information corresponding to the inquiry condition can be obtained.
And 140, performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
And finally, performing annotation interpretation and mapping on the obtained dictionary information, thereby obtaining a conversion result corresponding to the dictionary conversion request.
Specifically, annotation interpretation and mapping in the embodiments of the present invention is implemented by a Java reflection (reflection) mechanism. The Java reflection mechanism refers to the ability to examine classes, interfaces, methods, and properties at runtime. Through the reflection mechanism, information of the class, a method for calling the class and an attribute for accessing the class can be obtained at the running time, and an object can be dynamically created, a method can be dynamically called and an array can be processed. For example, in the running state of the program, an object of any one class may be constructed, a class to which any one object belongs may be known, a member variable and a method of any one class may be known, and an attribute and a method of any one object may be called. This function of dynamically acquiring program information and dynamically calling an object is called a reflection mechanism of the Java language.
The following are some of the main functions and applications of the Java reflection mechanism: obtaining information of a class: information such as the name of the class, the parent class, the interface implemented, the constructors, methods, fields, etc. can be obtained by reflection. Dynamically creating an object: instances of classes can be created dynamically using reflection without the need to determine a specific class name at compile time. The method for calling the class comprises the following steps: methods of calling classes may be through reflection, including public methods, private methods, static methods, and so on. Access class attributes: values of fields (attributes) of the class, including private fields, may be accessed and modified using a reflection mechanism. Processing an array: an array may be created by reflection, the length of the array acquired, and the elements in the array accessed. The reflection mechanism adds greater flexibility and dynamics to the Java language so that programs can obtain, query and manipulate class information at runtime without requiring all type details to be determined at compile time.
According to the embodiment of the invention, the dictionary information is subjected to annotation interpretation and mapping by using a Java reflection mechanism, and specifically, the attribute in the Java entity is subjected to dictionary mapping in a Java reflection mode according to the annotation parameter, so that a conversion result corresponding to the dictionary conversion request is obtained.
According to the data acquisition method provided by the invention, the target dictionary information item is determined by receiving the dictionary conversion request; annotating the target dictionary information item to obtain the target dictionary information item of the annotating mark; performing dictionary information inquiry in the memory database by taking target dictionary information items of the annotation marks as inquiry conditions to obtain dictionary information corresponding to the inquiry conditions; the dictionary information is annotated and mapped to obtain a conversion result corresponding to the dictionary conversion request, the data access speed is improved by inquiring the dictionary information in the memory data, the unification and the accuracy of multi-code value conversion mapping are realized by adopting annotation marks and annotation interpretation, the customized development of different dictionary items is not needed, the development workload can be greatly reduced, the development efficiency is improved, the code robustness is improved, and the rapid and accurate dictionary inquiry and conversion service can be provided.
It should be noted that each embodiment of the present application may be freely combined, permuted, or executed separately, and does not need to rely on or rely on a fixed execution sequence.
In some embodiments, the method further comprises:
if the dictionary information does not exist in the memory database, acquiring the dictionary information from a relational database according to the query condition;
and if the dictionary information exists in the relational database, outputting the dictionary information, and storing the dictionary information into the memory database.
It can be understood that, dictionary information is queried in the memory database by taking the target dictionary information item of the annotation mark as a query condition, and if the dictionary information does not exist in the memory database, the dictionary information is acquired in the relational database according to the query condition.
A relational database, among other things, refers to a database that employs a relational model to organize data, which stores data in rows and columns for the user to understand, a series of rows and columns of the relational database are called tables, and a set of tables forms the database. The user retrieves the data in the database by querying, which is an executable code that defines certain areas in the database. A relational model can be understood simply as a two-dimensional tabular model, and a relational database is a data set consisting of two-dimensional tables and relationships between them.
And if the dictionary information exists in the relational database, outputting the dictionary information, and storing the dictionary information in the memory database in a specific format so as to allow the subsequent request to extract data.
The dictionary information is extracted from the relational database, not in each required step, but in the memory database, the corresponding dictionary information is only queried in the relational database when the corresponding dictionary information is not acquired in the memory database, so that the data query efficiency can be effectively improved, and rapid and accurate dictionary query and conversion service can be further provided.
In some embodiments, the method further comprises:
dictionary information corresponding to the dictionary to be converted is stored in the memory database in advance.
It will be appreciated that, in order to implement rapid dictionary lookup, dictionary information corresponding to the dictionary that needs to be translated may be stored in advance in the in-memory database.
Specifically, the storing dictionary information corresponding to the dictionary to be converted in the memory database in advance includes:
determining a dictionary which needs to be converted;
annotating the dictionary to be converted to obtain dictionary information items of the annotating mark;
according to the dictionary information items of the annotation marks, dictionary information corresponding to the dictionary to be converted is obtained;
and storing dictionary information corresponding to the dictionary to be converted in the memory database.
Firstly, determining a dictionary which needs to be converted; the dictionary that needs to be translated is determined based on customer needs.
Then, annotating the dictionary to be converted to obtain dictionary information items of the annotating mark;
further, according to the dictionary information item of the annotation mark, dictionary information corresponding to the dictionary to be converted is obtained;
and finally, storing dictionary information corresponding to the dictionary to be converted in the memory database.
The dictionary storage design provided by the embodiment of the invention is shown in table 1.
Table 1 dictionary memory design
In the embodiment of the invention, the dictionary which needs to be converted is determined; annotating the dictionary to be converted to obtain dictionary information items of the annotating mark; according to the dictionary information items of the annotation marks, dictionary information corresponding to the dictionary to be converted is obtained; and storing the dictionary information corresponding to the dictionary to be converted in the memory database, so that the dictionary information can be directly inquired in the memory data later, and quick and accurate dictionary inquiry and conversion service can be provided.
In some embodiments, the annotating the dictionary to be converted to obtain dictionary information items of the annotating tag includes:
carrying out annotation marking on the dictionary to be converted by using a preset annotation marking template to obtain dictionary information items of the annotation marking;
wherein the annotation tag template is used to indicate at least one of: a single dictionary type for dictionary conversion, multiple dictionary types for dictionary conversion, physical attributes specified by dictionary entries, whether dictionary-converted content is to be replaced into current physical attributes, whether content is to be returned in key-desc, customized parameters, and whether to read from cache.
The annotation marks provided by the invention are as follows:
wherein:
* Single dictionary type for @ analysis value dictionary conversion
* Configuration of mybatis map-underscore-to-camera-case by default will transcode content set to field_desc
* Configuration of mybatis map-underscore-to-camera-case, true defaults to set transcoded content to fieldDesc
* Multiple dictionary types for @ Annotation values dictionary conversion
* Designating @ Annotation target dictionary items into an entity attribute
* Whether or not the dictionary-converted content is replaced in the current entity attribute @ Annotation replace
* The @ Annotation withKey returns content in key-desc form
* Customized parameters @ Annotation params
* Whether or not @ Annotation fromCache is read from the cache
That is, the annotation tag template is used to indicate at least one of: a single dictionary type for dictionary conversion, multiple dictionary types for dictionary conversion, entity attributes specified by dictionary entries, whether dictionary-converted content is to be replaced into current entity attributes, whether content is to be returned in the form of key-descriptive information (key-desc), customized parameters, and whether to be read from cache.
When the method is implemented, an annotation mark module is preset in the entity class in the code, and the dictionary to be converted is subjected to annotation mark through the annotation mark module, so that dictionary information items of the annotation mark are obtained.
The code of the annotation tag module is as follows:
@Data
public class ParamsBean{
@paramType(value=”controlMeasureType”,replace=true,fromCache=false)
private String field1;
@paramType(value=”controlMeasureType”,replace=true,fromCache=false)
private String field2;
@paramType(value=”controlMeasureType”,withKey=true,fromCach e=false)
private String field3;
Private String field3Desc;
@paramType(value=”controlMeasureType”,replace=true,withKey=true,params=”N”,fromCache=false)
private String field4;
@paramType(value=”controlMeasureType”,target=
“field6”,fromCache=false)
private String field5;
@paramType(value={”controlMeasureType”,”controlMeasureType”,},replace=true)
private String field6;
}
in the embodiment of the invention, the unification and the accuracy of the multi-code value conversion mapping are realized by adopting a set of universal annotation mark mode, the customized development for different dictionary items is not needed, the development workload can be greatly reduced, the development efficiency is improved, the code robustness is improved, and meanwhile, the rapid and accurate dictionary inquiry and conversion service can be provided.
In some embodiments, the performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request includes:
and annotating, explaining and converting the dictionary information by adopting a Java reflection mode to obtain a conversion result corresponding to the dictionary conversion request.
Specifically, when the dictionary information is subjected to annotation interpretation and conversion in a Java reflection mode, class names of Java which are transmitted in method parameters, all dictionary information obtained in a memory database and corresponding languages are adopted. And obtaining corresponding configuration information through annotation marks preset by attributes in the java entity class. And screening corresponding dictionary items in all dictionary information according to the configuration information and the value of the marked java entity class attribute, and backfilling the screened dictionary items into the java entity class according to the corresponding language setting. Repeating the steps until all annotation marks are completely interpreted, namely completing conversion.
In the embodiment of the invention, the dictionary information is annotated and interpreted and converted in a Java reflection mode, so that the uniformity and the accuracy of multi-code value conversion mapping are realized, the customized development for different dictionary items is not needed, the development workload can be greatly reduced, the development efficiency is improved, the code robustness is improved, and meanwhile, the rapid and accurate dictionary inquiry and conversion service can be provided.
In some embodiments, the receiving a dictionary conversion request, determining a target dictionary information item, includes:
receiving a money laundering case information inquiry request, and acquiring inquiry parameters carried in the money laundering case information inquiry request;
determining target dictionary information items according to the query parameters;
the annotating, interpreting and mapping the dictionary information to obtain a conversion result corresponding to the dictionary conversion request, including:
and annotating, explaining and converting the dictionary information in a Java reflection mode to obtain a query result corresponding to the money-back case information query request.
The data acquisition method provided by the embodiment of the invention can be applied to the anti-money laundering service scene. In the money back-flushing business scenario, a large number of money back-flushing case information entry queries are involved. In a relational database, case information is stored in a code value form, but dictionary information items with specific meanings are needed for business display, so that association inquiry needs to be carried out in the database, each dictionary item needing to be displayed needs to be subjected to additional association inquiry, and when the number of dictionary items needing to be converted is large, a large number of table associations are generated, so that inquiry efficiency is seriously influenced. And the development is customized aiming at different dictionary items, so that the development workload is greatly increased. In order to solve the above-mentioned problems, the data acquisition method provided by the embodiment of the present invention may be adopted.
Fig. 2 is a second flowchart of a data acquisition method according to an embodiment of the invention. As shown in fig. 2, the data acquisition method includes:
step 210, receiving a money back-washing case information inquiry request, and acquiring inquiry parameters carried in the money back-washing case information inquiry request;
step 220, determining target dictionary information items according to the query parameters;
230, annotating the target dictionary information item to obtain an annotated target dictionary information item;
step 240, carrying out dictionary information query in a memory database by taking the target dictionary information item of the annotation mark as a query condition to obtain dictionary information corresponding to the query condition;
step 250, if the dictionary information does not exist in the memory database, acquiring the dictionary information from a relational database according to the query condition;
step 260, if the dictionary information exists in the relational database, outputting the dictionary information and storing the dictionary information into the memory database;
and 270, annotating, explaining and converting the dictionary information in a Java reflection mode to obtain a query result corresponding to the money-back case information query request.
Optionally, the data acquisition method further includes:
dictionary information corresponding to the dictionary to be converted is stored in the memory database in advance.
Optionally, storing dictionary information corresponding to the dictionary to be converted in the memory database in advance includes:
determining a dictionary which needs to be converted;
annotating the dictionary to be converted to obtain dictionary information items of the annotating mark;
according to the dictionary information items of the annotation marks, dictionary information corresponding to the dictionary to be converted is obtained;
and storing dictionary information corresponding to the dictionary to be converted in the memory database.
Optionally, the annotating the dictionary to be converted to obtain dictionary information items of the annotating mark includes:
carrying out annotation marking on the dictionary to be converted by using a preset annotation marking template to obtain dictionary information items of the annotation marking;
wherein the annotation tag template is used to indicate at least one of: a single dictionary type for dictionary conversion, multiple dictionary types for dictionary conversion, physical attributes specified by dictionary entries, whether dictionary-converted content is to be replaced into current physical attributes, whether content is to be returned in key-desc, customized parameters, and whether to read from cache.
According to the data acquisition method provided by the invention, the query parameters carried in the anti-money laundering case information query request are determined by receiving the anti-money laundering case information query request, and the target dictionary information item is determined according to the query parameters; annotating the target dictionary information item to obtain the target dictionary information item of the annotating mark; performing dictionary information inquiry in the memory database by taking target dictionary information items of the annotation marks as inquiry conditions to obtain dictionary information corresponding to the inquiry conditions; the dictionary information is annotated and mapped to obtain the query result corresponding to the money laundering case information query request, the data access speed is improved by querying the dictionary information in the memory data, the unification and the accuracy of multi-code value conversion mapping are realized by adopting annotation marks and annotation interpretation, the customized development of different dictionary items is not needed, the development workload can be greatly reduced, the development efficiency is improved, the code robustness is improved, and meanwhile, the quick and accurate dictionary query and conversion service can be provided, and the money laundering case information query efficiency is improved.
The data acquisition device provided by the invention is described below, and the data acquisition device described below and the data acquisition method described above can be referred to correspondingly to each other.
Fig. 3 is a schematic structural diagram of a data acquisition device according to an embodiment of the present invention. As shown in fig. 3, the data acquisition device includes:
the conversion total control module 310 is configured to receive a dictionary conversion request and determine a target dictionary information item;
the annotation mark module 320 is configured to perform annotation mark on the target dictionary information item to obtain a target dictionary information item of the annotation mark;
the data extraction module 330 is configured to perform dictionary information query in the memory database using the target dictionary information item of the annotation tag as a query condition, so as to obtain dictionary information corresponding to the query condition;
and the annotation interpretation module 340 is configured to interpret and map the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
Optionally, the data extraction module 330 is further configured to:
if the dictionary information does not exist in the memory database, acquiring the dictionary information from a relational database according to the query condition;
and if the dictionary information exists in the relational database, outputting the dictionary information, and storing the dictionary information into the memory database.
Optionally, the data acquisition device further includes:
the preprocessing module is used for storing dictionary information corresponding to the dictionary to be converted in the memory database in advance.
Optionally, storing dictionary information corresponding to the dictionary to be converted in the memory database in advance includes:
determining a dictionary which needs to be converted;
annotating the dictionary to be converted to obtain dictionary information items of the annotating mark;
according to the dictionary information items of the annotation marks, dictionary information corresponding to the dictionary to be converted is obtained;
and storing dictionary information corresponding to the dictionary to be converted in the memory database.
Optionally, the annotating the dictionary to be converted to obtain dictionary information items of the annotating mark includes:
carrying out annotation marking on the dictionary to be converted by using a preset annotation marking template to obtain dictionary information items of the annotation marking;
wherein the annotation tag template is used to indicate at least one of: a single dictionary type for dictionary conversion, multiple dictionary types for dictionary conversion, physical attributes specified by dictionary entries, whether dictionary-converted content is to be replaced into current physical attributes, whether content is to be returned in key-desc, customized parameters, and whether to read from cache.
Optionally, the annotation interpretation module 340 is configured to:
and annotating, explaining and converting the dictionary information by adopting a Java reflection mode to obtain a conversion result corresponding to the dictionary conversion request.
Optionally, the conversion master module 310 is configured to:
receiving a money laundering case information inquiry request, and acquiring inquiry parameters carried in the money laundering case information inquiry request;
determining target dictionary information items according to the query parameters;
the annotation interpretation module 340 is configured to interpret and convert the dictionary information in a Java reflection manner, so as to obtain a query result corresponding to the money-back case information query request.
It should be noted that, the data acquisition device provided in this embodiment of the present invention can implement all the method steps implemented in the data acquisition method embodiment, and can achieve the same technical effects, and the same parts and beneficial effects as those of the method embodiment in this embodiment are not described in detail herein.
Fig. 4 is a schematic diagram of an interaction flow for performing dictionary conversion based on the data acquisition device according to an embodiment of the present invention. As shown in fig. 4, the conversion master control module receives the dictionary conversion request and determines target dictionary information items; the annotation mark module carries out annotation mark on the target dictionary information item to obtain a target dictionary information item of the annotation mark; the data extraction module takes the target dictionary information item of the annotation mark as a query condition to perform dictionary information query in a memory database, so as to obtain dictionary information corresponding to the query condition; if the dictionary information does not exist in the memory database, acquiring the dictionary information from a relational database according to the query condition; and if the dictionary information exists in the relational database, outputting the dictionary information, and storing the dictionary information into the memory database. And the annotation interpretation module carries out annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
The data acquisition device provided by the invention determines target dictionary information items by receiving a dictionary conversion request; annotating the target dictionary information item to obtain the target dictionary information item of the annotating mark; performing dictionary information inquiry in the memory database by taking target dictionary information items of the annotation marks as inquiry conditions to obtain dictionary information corresponding to the inquiry conditions; the dictionary information is annotated and mapped to obtain a conversion result corresponding to the dictionary conversion request, the data access speed is improved by inquiring the dictionary information in the memory data, the unification and the accuracy of multi-code value conversion mapping are realized by adopting annotation marks and annotation interpretation, the customized development of different dictionary items is not needed, the development workload can be greatly reduced, the development efficiency is improved, the code robustness is improved, and the rapid and accurate dictionary inquiry and conversion service can be provided.
Fig. 5 illustrates a physical schematic diagram of an electronic device, as shown in fig. 5, which may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a data acquisition method comprising: receiving a dictionary conversion request, and determining target dictionary information items; performing annotation marks on the target dictionary information items to obtain target dictionary information items of the annotation marks; performing dictionary information inquiry in an internal memory database by taking the target dictionary information item of the annotation mark as an inquiry condition to obtain dictionary information corresponding to the inquiry condition; and performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) 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, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of performing the data acquisition method provided by the methods described above, the method comprising: receiving a dictionary conversion request, and determining target dictionary information items; performing annotation marks on the target dictionary information items to obtain target dictionary information items of the annotation marks; performing dictionary information inquiry in an internal memory database by taking the target dictionary information item of the annotation mark as an inquiry condition to obtain dictionary information corresponding to the inquiry condition; and performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the data acquisition method provided by the above methods, the method comprising: receiving a dictionary conversion request, and determining target dictionary information items; performing annotation marks on the target dictionary information items to obtain target dictionary information items of the annotation marks; performing dictionary information inquiry in an internal memory database by taking the target dictionary information item of the annotation mark as an inquiry condition to obtain dictionary information corresponding to the inquiry condition; and performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A method of data acquisition, comprising:
receiving a dictionary conversion request, and determining target dictionary information items;
performing annotation marks on the target dictionary information items to obtain target dictionary information items of the annotation marks;
performing dictionary information inquiry in an internal memory database by taking the target dictionary information item of the annotation mark as an inquiry condition to obtain dictionary information corresponding to the inquiry condition;
and performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
2. The data acquisition method of claim 1, wherein the method further comprises:
if the dictionary information does not exist in the memory database, acquiring the dictionary information from a relational database according to the query condition;
and if the dictionary information exists in the relational database, outputting the dictionary information, and storing the dictionary information into the memory database.
3. The data acquisition method of claim 1, wherein the method further comprises:
dictionary information corresponding to the dictionary to be converted is stored in the memory database in advance.
4. The data acquisition method according to claim 3, wherein storing dictionary information corresponding to a dictionary to be converted in advance in the in-memory database includes:
determining a dictionary which needs to be converted;
annotating the dictionary to be converted to obtain dictionary information items of the annotating mark;
according to the dictionary information items of the annotation marks, dictionary information corresponding to the dictionary to be converted is obtained;
and storing dictionary information corresponding to the dictionary to be converted in the memory database.
5. The method of claim 4, wherein annotating the dictionary to be converted to obtain dictionary information items for the annotation tags comprises:
carrying out annotation marking on the dictionary to be converted by using a preset annotation marking template to obtain dictionary information items of the annotation marking;
wherein the annotation tag template is used to indicate at least one of: a single dictionary type for dictionary conversion, multiple dictionary types for dictionary conversion, physical attributes specified by dictionary entries, whether dictionary-converted content is to be replaced into current physical attributes, whether content is to be returned in key-desc, customized parameters, and whether to read from cache.
6. The method of claim 1, wherein performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request includes:
and annotating, explaining and converting the dictionary information by adopting a Java reflection mode to obtain a conversion result corresponding to the dictionary conversion request.
7. The data acquisition method according to claim 1, wherein the receiving a dictionary conversion request, determining a target dictionary information item, comprises:
receiving a money laundering case information inquiry request, and acquiring inquiry parameters carried in the money laundering case information inquiry request;
determining target dictionary information items according to the query parameters;
the annotating, interpreting and mapping the dictionary information to obtain a conversion result corresponding to the dictionary conversion request, including:
and annotating, explaining and converting the dictionary information in a Java reflection mode to obtain a query result corresponding to the money-back case information query request.
8. A data acquisition device, comprising:
the conversion total control module is used for receiving the dictionary conversion request and determining target dictionary information items;
the annotation mark module is used for carrying out annotation marks on the target dictionary information items to obtain target dictionary information items of the annotation marks;
the data extraction module is used for carrying out dictionary information inquiry in the memory database by taking the target dictionary information item of the annotation mark as an inquiry condition to obtain dictionary information corresponding to the inquiry condition;
and the annotation interpretation module is used for performing annotation interpretation and mapping on the dictionary information to obtain a conversion result corresponding to the dictionary conversion request.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the data acquisition method of any one of claims 1 to 7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the data acquisition method according to any one of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311590576.3A CN117762984A (en) | 2023-11-24 | 2023-11-24 | Data acquisition method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311590576.3A CN117762984A (en) | 2023-11-24 | 2023-11-24 | Data acquisition method, device, electronic equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117762984A true CN117762984A (en) | 2024-03-26 |
Family
ID=90309420
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311590576.3A Pending CN117762984A (en) | 2023-11-24 | 2023-11-24 | Data acquisition method, device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117762984A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119066089A (en) * | 2024-08-19 | 2024-12-03 | 北京火山引擎科技有限公司 | Database processing method, device and storage medium |
-
2023
- 2023-11-24 CN CN202311590576.3A patent/CN117762984A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119066089A (en) * | 2024-08-19 | 2024-12-03 | 北京火山引擎科技有限公司 | Database processing method, device and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11698918B2 (en) | System and method for content-based data visualization using a universal knowledge graph | |
| US11030242B1 (en) | Indexing and querying semi-structured documents using a key-value store | |
| US8417714B2 (en) | Techniques for fast and scalable XML generation and aggregation over binary XML | |
| CN111708805B (en) | Data query method, device, electronic device and storage medium | |
| CN110597844B (en) | Unified access method for heterogeneous database data and related equipment | |
| US9785725B2 (en) | Method and system for visualizing relational data as RDF graphs with interactive response time | |
| US8209361B2 (en) | Techniques for efficient and scalable processing of complex sets of XML schemas | |
| CN112579610A (en) | Multi-data source structure analysis method, system, terminal device and storage medium | |
| US8073843B2 (en) | Mechanism for deferred rewrite of multiple XPath evaluations over binary XML | |
| JP2018067279A (en) | Device, program, and method for recognizing data property | |
| US20070239742A1 (en) | Determining data elements in heterogeneous schema definitions for possible mapping | |
| CN118093632B (en) | Graph database query method and device based on large language model and graph structure | |
| CN111159215B (en) | Mapping method and device for Java class and relational database and computing equipment | |
| US20100030727A1 (en) | Technique For Using Occurrence Constraints To Optimize XML Index Access | |
| US10489024B2 (en) | UI rendering based on adaptive label text infrastructure | |
| US9053207B2 (en) | Adaptive query expression builder for an on-demand data service | |
| US11409959B2 (en) | Representation learning for tax rule bootstrapping | |
| CN113988004B (en) | Report display method, device, computer equipment and storage medium | |
| CN118606438A (en) | Data analysis method, device, computer equipment, readable storage medium and program product | |
| CN108694172B (en) | Information output method and device | |
| CN117762984A (en) | Data acquisition method, device, electronic equipment and storage medium | |
| CN117010358A (en) | Message card generation method, device, computer equipment and storage medium | |
| CN119226380A (en) | Database code extraction method and system based on fast screening of large language model | |
| CN115062055B (en) | A data table processing method, device, equipment and storage medium | |
| CN113468258B (en) | Heterogeneous data conversion method, heterogeneous data conversion device and storage medium |
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 |