CN112364083A - Data dictionary management method, system and storage medium based on configuration file - Google Patents

Data dictionary management method, system and storage medium based on configuration file Download PDF

Info

Publication number
CN112364083A
CN112364083A CN202011265493.3A CN202011265493A CN112364083A CN 112364083 A CN112364083 A CN 112364083A CN 202011265493 A CN202011265493 A CN 202011265493A CN 112364083 A CN112364083 A CN 112364083A
Authority
CN
China
Prior art keywords
dictionary
data
configuration
service
item
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011265493.3A
Other languages
Chinese (zh)
Inventor
明亮文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Saiante Technology Service Co Ltd
Original Assignee
Shenzhen Saiante Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Saiante Technology Service Co Ltd filed Critical Shenzhen Saiante Technology Service Co Ltd
Priority to CN202011265493.3A priority Critical patent/CN112364083A/en
Publication of CN112364083A publication Critical patent/CN112364083A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24554Unary operations; Data partitioning operations
    • G06F16/24556Aggregation; Duplicate elimination
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/157Transformation using dictionaries or tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Abstract

The invention relates to big data processing technology, and discloses a data dictionary management method based on a configuration file, which comprises the steps of obtaining a service data request; intercepting by using a tangent plane programming technology to screen out a request containing dictionary items; sending a query request to the dictionary entry container through the dictionary encoder; and the dictionary item container acquires a dictionary value corresponding to the query request, the dictionary encoder calls the CGLib dynamic generator according to the dictionary value to dynamically generate a class instance containing the dictionary value according to the dictionary value, and the class instance of the dictionary value is returned to the user. The invention also relates to a block chain technology, and the data is stored in the block chain.

Description

Data dictionary management method, system and storage medium based on configuration file
Technical Field
The invention relates to big data processing technology, in particular to a data dictionary management method, a data dictionary management system and a storage medium based on configuration files.
Background
The data dictionary is used for defining and describing data items, data structures, data streams, data storage, processing logic and the like of data, and aims to make detailed description on each element in the data flow chart, and the data dictionary is used as a simple modeling item. Objects of the same type represented by object codes and object information are called dictionary entries. During the integrated platform development process, many data dictionary entries need to be maintained. The dictionary code is stored along with the service data stream, and when the data is displayed, the dictionary code needs to be converted into dictionary information which is easy to understand by a user.
During application development, dictionary entries are typically stored using a data dictionary table, an enumerated type, or XML, among other ways. And the data dictionary items are stored in a data dictionary table, so that dictionary data change is facilitated. If the user needs to add or change the dictionary configuration items, only the data dictionary table records need to be modified, and codes do not need to be modified; however, there are problems: 1) when business data is searched, a left-connected dictionary table is needed, so that SQL maintenance becomes complicated; 2) in the dictionary coding conversion process, there are performance problems, especially, in the case of large data scale in the service data stream and the data dictionary table, the query is slow, resulting in excessive time consumption from dictionary coding to dictionary information conversion process.
In the prior art, in order to solve the above problems, all dictionary entries are loaded and directly read from a memory when a system is started in a manner of storing dictionary entries having the same type in an enumeration class, so that the dictionary code conversion speed is accelerated, but the disadvantages are as follows:
1) when the dictionary types are more, a large number of enumeration classes need to be created, and the readability is poor;
2) dynamic updating of dictionary data is not supported, and if the dictionary data is updated, the service needs to be reissued to enable modification to be effective;
3) the data dictionary items are stored in an XML mode, for example, compared with json configuration, XML has poor readability and maintainability, data in the XML is surrounded by a large number of labels, and the effective load of the data is reduced;
4) the conversion of dictionary entry encodings into dictionary entry information needs to be handled manually.
Therefore, a data dictionary management method with good readability and flexibility is needed.
Disclosure of Invention
The invention provides a data dictionary management method and system based on a configuration file and a computer readable storage medium, which mainly solve the problems of poor readability and low maintenance efficiency of dictionary items.
In order to achieve the above object, the present invention provides a data dictionary management method based on a configuration file, applied to an electronic device, the method including:
acquiring a service data request;
intercepting the acquired service data request of the user by using a tangent plane programming technology so as to screen out the service data request containing the dictionary item requirement;
sending the service data request to a dictionary encoder, and sending a query request to a dictionary item container through the dictionary encoder; the dictionary item container is used for acquiring a dictionary value corresponding to the query request and returning the dictionary value to a dictionary encoder;
and the dictionary encoder calls a CGLib dynamic generator according to the dictionary value, and the CGLib dynamic generator is used for dynamically generating a class instance containing the dictionary value according to the dictionary value and returning the class instance to a user.
Further, preferably, before the step of acquiring the service data request of the user,
the method also comprises the step of pre-configuring dictionary items in a configuration center; wherein the step of pre-configuring dictionary items in the configuration center comprises:
creating a namespace at a configuration center;
configuring a dictionary item set and a configuration specification of the dictionary item set in the namespace; wherein the set of dictionary entries includes a plurality of dictionary entries;
configuring a monitoring interface and a service interface for registering a Watch event; wherein the listening interface and the service interface both correspond to the dictionary entry set;
the json memory is configured to store update data for the set of dictionary entries.
Further, preferably, the process of storing the update data of the dictionary entry set in the json memory includes:
when the monitoring interface monitors that the dictionary item set corresponding to the monitoring interface is updated, generating a Watch event corresponding to the update, and writing the updated latest configuration data of the dictionary item set into a service interface;
reading corresponding dictionary item configuration data in a name space through the service interface, and determining corresponding dictionary attribute values;
serializing the latest configuration data and the dictionary attribute values to form dictionary entry metadata;
and storing the dictionary item metadata into a dictionary item storage container.
Further, preferably, the dictionary entry set includes KEY and VALUE, wherein,
the KEY is a unique mark of the dictionary item set in a name space;
the VALUE comprises a service table name, a service field name and a dictionary data set; and the dictionary data set is formed by combining the dictionary entry metadata in the dictionary entry storage container according to the business table name and the business segment name.
Further, preferably, the Watch event includes a dictionary entry start event and a dictionary entry set update event.
In order to achieve the above object, the present invention provides a data dictionary management method system based on configuration files, which includes a data request obtaining unit, a dictionary entry request screening unit, a dictionary entry query unit, and a dictionary value class instance generating unit; wherein the content of the first and second substances,
the data request acquisition unit is used for acquiring a service data request;
the dictionary entry request screening unit is used for intercepting the acquired service data request of the user by using a tangent plane programming technology so as to screen out the service data request containing the dictionary entry requirement;
the dictionary entry query unit is used for sending the service data request to a dictionary encoder and sending a query request to a dictionary entry container through the dictionary encoder; the dictionary item container is used for acquiring a dictionary value corresponding to the query request and returning the dictionary value to a dictionary encoder;
and the class instance generating unit of the dictionary value is used for calling a CGLib dynamic generator by the dictionary encoder according to the dictionary value, and the CGLib dynamic generator is used for dynamically generating class instances containing the dictionary value according to the dictionary value and returning the class instances to the user.
Further, it is preferable that the system further includes a dictionary entry configuration unit, configured to, before the step of obtaining the service data request of the user, pre-configure the dictionary entry in the configuration center.
Further, preferably, the dictionary entry configuration unit includes a namespace creation module, a dictionary entry set configuration module, an interface configuration module, and an update data storage module; the name space creating module is used for creating a name space in a configuration center;
the dictionary item set configuration module is used for configuring a dictionary item set and a configuration specification of the dictionary item set in the namespace; wherein the set of dictionary entries includes a plurality of dictionary entries;
the interface configuration module is used for configuring a monitoring interface and a service interface for registering the Watch event; wherein the listening interface and the service interface both correspond to the dictionary entry set;
and the update data storage module is used for configuring a json memory for storing the update data of the dictionary item set.
To achieve the above object, the present invention also provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores a program executable by the at least one processor to enable the at least one processor to perform the method of profile-based data dictionary management as described above.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements the steps of the above-mentioned method for managing a profile-based data dictionary.
According to the data dictionary management method, the data dictionary management system, the electronic device and the computer readable storage medium based on the configuration file, the dictionary items are configured in the configuration center, and the function of starting and loading the dictionary items is realized; when the dictionary item business data is read, the data containing dictionary codes are automatically converted by utilizing a dynamic programming technology, and the data containing the dictionary item information is generated. The beneficial effects are as follows:
1) the data dictionary management method based on the configuration file combines the advantages of easy maintenance, high readability and easy updating of the configuration file and the dynamic monitoring and dynamic generation technology, not only can conveniently maintain the dictionary item configuration, but also can dynamically apply the updating to the subsequent business processing flow;
2) the data dictionary management method based on the configuration file provides dictionary item management for the application micro-service in a manner of performing dictionary item configuration in the configuration file, so that the code conversion work of the dictionary item is not required to be concerned in the development process of the application micro-service, the decoupling of the dictionary item management and the service processing is realized, and the maintenance of the dictionary item is convenient;
3) the calculation processing of the dictionary items of the data dictionary management method based on the configuration file is pre-executed in the memory, and the data calculation result is cached in the memory after the calculation processing, so that the processing efficiency and the response speed are improved.
4) The dictionary item of the data dictionary management method based on the configuration file has the dynamic coding function, so that an application developer does not need to care about the conversion work of coding and only needs to concentrate on service development, the development workload is reduced, and the delivery efficiency is improved.
Drawings
FIG. 1 is a flow diagram of an embodiment of a method for profile-based data dictionary management in accordance with the present invention;
FIG. 2 is a schematic diagram of a configuration file based data dictionary management method according to the present invention;
FIG. 3 is a schematic diagram of a logical structure of a system for a data dictionary management method based on configuration files according to the present invention;
FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In order to improve the user coding efficiency, the invention provides a data dictionary management method based on a configuration file. FIG. 1 shows a flow of an embodiment of a method for profile-based data dictionary management in accordance with the present invention. Referring to fig. 1, the method may be performed by an apparatus, which may be implemented by software and/or hardware.
The data dictionary management method based on the configuration file comprises the following steps: step S110-step S140.
And S110, acquiring a service data request.
In a specific embodiment, before the step of obtaining the service data request of the user, a dictionary item is configured in advance in a configuration center; the method for pre-configuring dictionary items in the configuration center comprises the following steps: steps S10-S40.
S10, creating a namespace in the configuration center.
Specifically, a Namespace (Namespace) is created: in the micro-service system architecture, each service needing to use dictionary entries needs to create a separate Namespace in the configuration center and name the Namespace _ prop.
Specifically, requests are categorized by reflection and proxy through a generic servlet container, whereas lexicographic item class requests correspond to only a generic lexicographic item servlet container.
Since the Servlet container is not a Spring Bean, Spring AOP is not valid for methods in Servlet, in order to implement Spring AOP to intercept Servlet. The servlet container needs to be operated as follows: calling a Spring Bean method in the Servlet method, and implanting a tangent plane in the Spring Bean to achieve the function; using the Interceptor of Spring MVC to perform function cut-in on the request of the Servlet: 1) defining a Java class as an interceptor Bean; 2) bean as interceptor is declared in Dispatch-servlet.
S20, configuring a dictionary item set and a configuration specification of the dictionary item set in a namespace; wherein the set of dictionary entries includes a plurality of dictionary entries.
The dictionary entry set includes KEY and VALUE, wherein,
the KEY is a unique mark of the dictionary item set in a name space;
the VALUE comprises a service table name, a service field name and a dictionary data set; and the dictionary data set is formed by combining the dictionary entry metadata in the dictionary entry storage container according to the business table name and the business segment name.
Specifically, the dictionary item set is configured to be a plurality of dictionary items to form a dictionary item set, and the dictionary item set is configured in Namespace named custom _ prop according to the configuration management specification of the JAVA configuration file. And naming the KEY of the dictionary item set according to the self-defined service specification, and ensuring that the Namespace is only required. The VALUE of the dictionary entry set is configured by adopting a JSON structure and comprises four elements, namely a service group, a service name, a service field name and a dictionary data set.
And the service grouping is used for marking the group to which the dictionary item belongs, mainly used for realizing dictionary data aggregation of the complex multi-service module and realizing group-based storage and retrieval. The service group name is designated by a group field, and the dictionary data items of the same service group are provided with the same service group name, and are usually named by service module names for the convenience of maintenance and management. When the background program loads data, the same data blocks are loaded and merged to the same data unit according to the business grouping names so as to provide retrieval service.
The service name is used for marking the name of the service module to which the dictionary entry belongs, is a basic unit for dividing the data dictionary entry, corresponds to a service data table of the relational database, is specified through a table field, and is usually named by the name of the service data table.
The service field name, the service class used to label the dictionary entry, corresponds to the service data table field of the relational database. Through column field designation, a type of dictionary item data set is uniquely determined with a service group, a service name and a service field name.
The field set is a data set composed of dictionary entries and is defined by a fact field.
The dictionary item is stored by a Node consisting of code and name, the dictionary item code is stored in the code, and the dictionary item name is stored in the name.
S30, configuring a monitoring interface and a service interface for registering the Watch event; wherein the listening interface and the service interface both correspond to the dictionary entry set.
The Watch event comprises a dictionary item starting event and a dictionary item set updating event. That is, the listening step of the listening interface is: generating a Watch event when the intercepted application program starts or a dictionary entry update action occurs.
After the dictionary item set data is configured, the application program registers the Watch event through a configuration monitoring interface (apollloconfigchangelistener), when the application program is started or the configured dictionary items are updated, the Watch event is generated, and the latest data is pushed to the memory of the application program subscribing the event, so that the application program dynamically acquires the changed dictionary data in real time. The detailed process is as follows: and the integrated microservice configuration center completes the dictionary item set configuration according to the step S20. And injecting a Spring application context through an ApplicationContextAware interface, monitoring Namespace named as custom _ prop through a configuration monitor of a configuration center, and storing the monitored dynamic data in a memory of the Spring application context for data storage.
And S40, configuring json memory for storing the updating data of the dictionary item set.
After the dictionary entry data is updated, the listener in the above steps acquires the changed data and stores the data in the memory, for the convenience of application, the data needs to be processed and converted, and the converted data is stored in a dynamic array.
The process of storing the update data of the dictionary item set in the json memory comprises the following steps:
when the monitoring interface monitors that the dictionary item set corresponding to the monitoring interface is updated, generating a Watch event corresponding to the update, and writing the updated latest configuration data of the dictionary item set into a service interface;
reading corresponding dictionary item configuration data in a name space through the service interface, and determining corresponding dictionary attribute values; acquiring a dictionary attribute name list; the dictionary property name list is traversed and corresponding dictionary property values are then determined.
Serializing the latest configuration data and the dictionary attribute values to form dictionary entry metadata; wherein the setting process of the dictionary entry storage container: and initializing a dynamic array in the memory of the application program as a dictionary entry storage container for storing the converted dictionary configuration data. And storing the dictionary item metadata into a dictionary item storage container.
In the specific implementation process, initializing a dynamic array as a dictionary entry storage container, namely a Servlet container, for storing the converted dictionary configuration data; when a monitoring event occurs, the latest configuration data is written into a configuration service interface (Configservice), and dictionary item configuration data (Config) configured by Namespace is read in the interface; reading a data dictionary property name list (PropertyNames) in dictionary entry configuration data (Config); and traversing the dictionary attribute name list (PropertyNames), taking out dictionary attribute values according to the dictionary attribute names in dictionary item configuration data (Config), serializing the dictionary attribute values into dictionary item metadata (DictProp), and storing the dictionary item metadata (DictProp) in a dictionary item storage container. And after the data of the dictionary entry storage container is stored, merging the dictionary data set according to the name of the service table and the name of the service field so as to adapt to the split and configured scene of the large-data-volume dictionary set. And returning the class instance of the dictionary value to the user.
And S120, intercepting the acquired service data request of the user by using a tangent plane programming technology so as to screen out the service data request containing the dictionary item requirement.
Specifically, the section changing technology is an AOP transverse cutting technology; the method is independent of core services, and encapsulates logic or responsibility commonly called by service modules, so that repeated codes of a system are reduced, the coupling degree between the modules is reduced, and the future operability and maintainability are facilitated. The method comprises the steps of separating dictionary requirement business from core business logic by using an AOP tangent plane technology, configuring a tangent plane through a configuration file or annotation, and setting a filtering condition for the tangent plane, wherein the filtering condition is a method in a program, and the method for calling the tangent plane of the dictionary entry to read the dictionary entry when the methods in the program are called is equivalent to a mechanism for triggering the dictionary entry when the filtering meets the condition.
In a specific embodiment, a profile and an entry point are set through a configuration file, a trigger method associated with the entry point is set, and a mapping relation between a core service function and a trigger function is configured. Once the method call is triggered, the section is entered, and the relevant functions are executed before, after, abnormal and the like. The method comprises the following specific steps: and configuring section information for the LogAop of the log class, configuring logAopBean in the application context. aop, an aspect id is defined as a tangent plane. Defining log class, and implementing front-end, back-end, abnormal and return methods in log class. And (4) replacing the configuration file with the annotation solution, and informing the IOC container of the mapping relation among the tangent plane, the access point, the trigger function and the core service method. In the application scenario, a data request required by a dictionary is intercepted through Spring AOP.
S130, sending the service data request to a dictionary encoder, and sending a query request to a dictionary item container through the dictionary encoder; the dictionary item container is used for acquiring a dictionary value corresponding to the query request and returning the dictionary value to a dictionary encoder;
and acquiring the dictionary value encoded into the dictionary item container by using the dictionary encoder, namely acquiring the dictionary value corresponding to the dictionary request data from the dictionary item container by using the dictionary encoder. The method comprises the steps that after a dictionary encoder receives dictionary request data intercepted by AOP, a query request is sent to a dictionary item container, the dictionary item container finds out a dictionary value corresponding to the dictionary request according to the query request, and then the dictionary value is returned to the dictionary encoder.
And S140, calling a CGLib dynamic generator by the dictionary encoder according to the dictionary value, wherein the CGLib dynamic generator is used for dynamically generating a class instance containing the dictionary value according to the dictionary value and returning the class instance of the dictionary value to a user.
The dictionary encoder calls a CGLib dynamic generator according to the acquired dictionary values, and the CGLib dynamic generator dynamically generates class instances (namely, proxy embodiment) containing the dictionary values according to the dictionary values. And the dynamic proxy generator returns the generated class instance containing the dictionary value to the dictionary encoder and further returns the class instance to the user.
In a specific embodiment, after data storage is finished, when a service data request exists, a section-oriented programming technology is used for intercepting processing, and for the request containing a dictionary requirement, the logic of an encoder is called for processing. And the dictionary encoder stores the intercepted dictionary item codes in a dictionary item storage container, reads dictionary values corresponding to the dictionary codes, then calls the dynamic proxy generator, dynamically generates class instances containing the dictionary values by utilizing a dynamic proxy generation technology, and returns a response to the caller. The class instance of the dictionary value is to create a class, create an object of the class (instantiation class), and the instantiation of the class is similar to a function call mode.
The data dictionary management method based on the configuration file manages dictionary items in the configuration file, is decoupled from service codes, is easy to maintain, supports dynamic updating by utilizing an event monitoring technology, enables the updated latest dictionary item configuration to take effect without issuing service, intercepts requests with dictionary requirements through a section-oriented programming technology, searches dictionary values in a dictionary item storage container according to dictionary item codes, dynamically generates a return body containing the dictionary values by applying a dynamic proxy technology, returns a new entity to a user, avoids the need of paying attention to code conversion work of the dictionary items in the process of applying microservice development, realizes the decoupling of dictionary item management and service processing, and realizes the technical effect of improving the maintenance efficiency of the dictionary items.
FIG. 2 is a schematic diagram illustrating the method for profile-based data dictionary management according to the present invention. As shown with reference to figure 2 of the drawings,
the present invention is a principle of a data dictionary management method based on configuration files. When there is a service data request, the interception processing is carried out by using the oriented programming (AOP) technology, and the logic of the encoder is called to process the request containing the dictionary requirement. And the dictionary encoder stores the intercepted dictionary item codes in a dictionary item storage container, reads dictionary values corresponding to the dictionary codes, then calls the dynamic proxy generator, dynamically generates proxy embodiments containing the dictionary values by utilizing a dynamic proxy generation technology, and returns a response to the caller.
In a word, the invention intercepts the request with dictionary requirement by the section-oriented programming technology, searches the dictionary value in the dictionary item storage container according to the dictionary item code, dynamically generates the return body containing the dictionary value by applying the dynamic proxy technology, and returns the new entity to the user. The calculation processing of dictionary items is pre-executed in the memory through the data dictionary management method based on the configuration file, and after the calculation processing is executed, data calculation results are cached in the memory, so that the technical effects of improving the processing efficiency and the response speed are achieved.
FIG. 3 is a schematic diagram of a logical structure of a system for a data dictionary management method based on configuration files according to the present invention; as shown with reference to figure 3 of the drawings,
in order to achieve the above object, the present invention provides a data dictionary management method system 300 based on configuration files, which includes a data request obtaining unit 320, a dictionary entry request screening unit 330, a dictionary entry querying unit 340, and a dictionary value class instance generating unit 350; the data request obtaining unit 320 is configured to obtain a service data request; the dictionary entry request screening unit 330 is configured to intercept the acquired service data request of the user by using a tangent plane programming technique, so as to screen out a service data request containing a dictionary entry requirement; the dictionary entry query unit 340 is configured to send the service data request to a dictionary encoder, and send a query request to a dictionary entry container through the dictionary encoder; the dictionary item container is used for acquiring a dictionary value corresponding to the query request and returning the dictionary value to a dictionary encoder; the dictionary value class instance generating unit 350 is configured to invoke, by a dictionary encoder, a CGLib dynamic generator according to the dictionary value, where the CGLib dynamic generator is configured to dynamically generate a class instance containing a dictionary value according to the dictionary value, and return the class instance to a user.
Further, it is preferable that the method further includes a dictionary entry configuration unit 310, configured to configure the dictionary entry in advance in the configuration center before the step of acquiring the service data request of the user.
Further, preferably, the dictionary entry configuration unit 310 includes a namespace creation module, a dictionary entry set configuration module, an interface configuration module, and an update data storage module; the name space creating module is used for creating a name space in a configuration center; the dictionary item set configuration module is used for configuring a dictionary item set and a configuration specification of the dictionary item set in a name space; wherein the set of dictionary entries includes a plurality of dictionary entries; the interface configuration module is used for configuring a monitoring interface and a service interface for registering the Watch event; wherein the listening interface and the service interface both correspond to the dictionary entry set; and the update data storage module is used for configuring a json memory for storing the update of the dictionary item set. The CGLib dynamic generator dynamically generates class instances containing dictionary values.
The data dictionary management system based on the configuration file manages the dictionary items in the configuration file, is decoupled from the service codes, is easy to maintain, supports dynamic updating by utilizing an event monitoring technology, and enables the configuration of the updated latest dictionary item to take effect without issuing service. Dictionary item management is provided for the application micro-service in a mode of performing dictionary item configuration in the configuration file, so that the code conversion work of the dictionary items is not required to be concerned in the application micro-service development process, the decoupling of the dictionary item management and the service processing is realized, and the maintenance of the dictionary items is facilitated.
The invention provides a data dictionary management method based on a configuration file, which is applied to an electronic device 4.
FIG. 4 illustrates an application environment of a preferred embodiment of the method for profile-based data dictionary management in accordance with the present invention.
Referring to fig. 4, in the present embodiment, the electronic device 4 may be a terminal device having an arithmetic function, such as a server, a smart phone, a tablet computer, a portable computer, or a desktop computer.
The electronic device 4 includes: a processor 42, a memory 41, a communication bus 43, and a network interface 45.
The memory 41 includes at least one type of readable storage medium. The readable storage medium may be non-volatile or volatile. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory 41, and the like. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 4, such as a hard disk of the electronic device 4. In other embodiments, the readable storage medium may also be an external memory 41 of the electronic device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the electronic device 4.
In the present embodiment, the readable storage medium of the memory 41 is generally used for storing the configuration file based data dictionary management method program 40 and the like installed in the electronic device 4. The memory 41 may also be used to temporarily store data that has been output or is to be output.
Processor 42, which in some embodiments may be a Central Processing Unit (CPU), microprocessor or other data Processing chip, executes program code or processes data stored in memory 51, such as executing data dictionary management method program 40 based on a configuration file.
The communication bus 43 is used to realize connection communication between these components.
The network interface 44 may optionally include a standard wired interface, a wireless interface (e.g., a WI-FI interface), and is typically used to establish a communication link between the electronic apparatus 4 and other electronic devices.
Fig. 4 only shows the electronic device 4 with components 41-44, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may alternatively be implemented.
Optionally, the electronic device 4 may further include a user interface, which may include an input unit such as a Keyboard (Keyboard), a voice input device such as a microphone (microphone) or other equipment with voice recognition function, a voice output device such as a sound box, a headset, etc., and optionally may also include a standard wired interface or a wireless interface.
Optionally, the electronic device 4 may further include a display, which may also be referred to as a display screen or a display unit. In some embodiments, the display device may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an Organic Light-Emitting Diode (OLED) touch device, or the like. The display is used for displaying information processed in the electronic apparatus 4 and for displaying a visualized user interface.
Optionally, the electronic device 4 may further include a Radio Frequency (RF) circuit, a sensor, an audio circuit, and the like, which are not described in detail herein.
In the apparatus embodiment shown in FIG. 4, a memory 41, which is a type of computer storage medium, may include therein an operating system, and a configuration file-based data dictionary management method program 40; the processor 42, when executing the program 40 of the profile-based data dictionary management method stored in the memory 41, implements the following steps: acquiring a service data request of a user; intercepting the service data request by using a tangent plane programming technology, and screening out the service data request containing the dictionary item requirement; sending the service data request to a dictionary encoder, wherein the dictionary encoder sends a query request to a dictionary item container; the dictionary item container acquires a dictionary value corresponding to the query request and returns the dictionary value to a dictionary encoder; and the dictionary encoder calls a CGLib dynamic generator according to the dictionary value, the CGLib dynamic generator dynamically generates a class instance containing the dictionary value, and returns the class instance of the dictionary value to the user.
In other embodiments, the configuration file based data dictionary management method program 40 may also be divided into one or more modules, which are stored in the memory 41 and executed by the processor 42 to accomplish the present invention. The modules referred to herein are a series of computer program segments that perform particular functions. The configuration file-based data dictionary management method program 40 may be divided into a dictionary entry configuration unit 310, a data request acquisition unit 320, a dictionary entry request screening unit 330, a dictionary entry query unit 340, and a dictionary value class instance generation unit 350.
In addition, the present invention also provides a computer-readable storage medium, which mainly includes a storage data area and a storage program area, wherein the storage data area can store data created according to the use of the blockchain node, and the storage program area can store an operating system and an application program required by at least one function, the computer-readable storage medium includes a configuration file-based data dictionary management method program, and the configuration file-based data dictionary management method program implements the operation of the configuration file-based data dictionary management method when executed by a processor.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the above-mentioned method, system and electronic device for managing a data dictionary based on a configuration file, and will not be described herein again.
Generally speaking, the data dictionary management method, the data dictionary management system, the electronic device and the computer readable storage medium based on the configuration file combine the advantages of easy maintenance, high readability and easy updating of the configuration file and the dynamic monitoring and dynamic generation technology, so that the dictionary item configuration can be maintained conveniently, and the updating can be dynamically applied to the subsequent business processing flow. The calculation processing of the dictionary entries is pre-executed in the memory, and the data calculation results are cached in the memory after execution, so that the processing mode improves the response speed of the application program. The dynamic coding function of the dictionary entry is realized, so that an application developer only needs to concentrate on service development without paying attention to the conversion work of coding, the development workload is reduced, and the delivery efficiency is improved.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method 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, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above, and includes several programs for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A data dictionary management method based on configuration files is applied to an electronic device and is characterized by comprising the following steps:
acquiring a service data request;
intercepting the acquired service data request of the user by using a tangent plane programming technology so as to screen out the service data request containing the dictionary item requirement;
sending the service data request to a dictionary encoder, and sending a query request to a dictionary item container through the dictionary encoder; the dictionary item container is used for acquiring a dictionary value corresponding to the query request and returning the dictionary value to a dictionary encoder;
and the dictionary encoder calls a CGLib dynamic generator according to the dictionary value, and the CGLib dynamic generator is used for dynamically generating a class instance containing the dictionary value according to the dictionary value and returning the class instance to a user.
2. The method for managing a data dictionary based on configuration files according to claim 1, further comprising a step of pre-configuring dictionary items in a configuration center before the step of acquiring service data requests of users; wherein the step of pre-configuring dictionary items in the configuration center comprises:
creating a namespace at a configuration center;
configuring a dictionary item set and a configuration specification of the dictionary item set in the namespace; wherein the set of dictionary entries includes a plurality of dictionary entries;
configuring a monitoring interface and a service interface for registering a Watch event; wherein the listening interface and the service interface both correspond to the dictionary entry set;
the json memory is configured to store update data for the set of dictionary entries.
3. The method of claim 2, wherein the json memory storing updated data for a collection of dictionary entries comprises:
when the monitoring interface monitors that the dictionary item set corresponding to the monitoring interface is updated, generating a Watch event corresponding to the update, and writing the updated latest configuration data of the dictionary item set into a service interface;
reading corresponding dictionary item configuration data in a name space through the service interface, and determining corresponding dictionary attribute values;
serializing the latest configuration data and the dictionary attribute values to form dictionary entry metadata;
and storing the dictionary item metadata into a dictionary item storage container.
4. The method of profile-based data dictionary management according to claim 2, wherein said dictionary entry set includes KEY and VALUE, wherein,
the KEY is a unique mark of the dictionary item set in a name space;
the VALUE comprises a service table name, a service field name and a dictionary data set; and the dictionary data set is formed by combining the dictionary entry metadata in the dictionary entry storage container according to the business table name and the business segment name.
5. The method of claim 3, wherein the Watch event comprises a dictionary entry start event and a dictionary entry set update event.
6. A data dictionary management method system based on configuration files is characterized by comprising a data request acquisition unit, a dictionary item request screening unit, a dictionary item query unit and a dictionary value class instance generation unit; wherein the content of the first and second substances,
the data request acquisition unit is used for acquiring a service data request;
the dictionary entry request screening unit is used for intercepting the acquired service data request of the user by using a tangent plane programming technology so as to screen out the service data request containing the dictionary entry requirement;
the dictionary entry query unit is used for sending the service data request to a dictionary encoder and sending a query request to a dictionary entry container through the dictionary encoder; the dictionary item container is used for acquiring a dictionary value corresponding to the query request and returning the dictionary value to a dictionary encoder;
and the class instance generating unit of the dictionary value is used for calling a CGLib dynamic generator by the dictionary encoder according to the dictionary value, and the CGLib dynamic generator is used for dynamically generating class instances containing the dictionary value according to the dictionary value and returning the class instances to the user.
7. The system according to claim 6, further comprising a dictionary entry configuration unit for pre-configuring dictionary entries in a configuration center before the step of obtaining the service data request of the user.
8. The system for data dictionary management based on configuration file according to claim 6, wherein the dictionary entry configuration unit comprises a namespace creation module, a dictionary entry set configuration module, an interface configuration module and an update data storage module;
the name space creating module is used for creating a name space in a configuration center;
the dictionary item set configuration module is used for configuring a dictionary item set and a configuration specification of the dictionary item set in the namespace; wherein the set of dictionary entries includes a plurality of dictionary entries;
the interface configuration module is used for configuring a monitoring interface and a service interface for registering the Watch event; wherein the listening interface and the service interface both correspond to the dictionary entry set;
and the update data storage module is used for configuring a json memory for storing the update data of the dictionary item set.
9. An electronic device, comprising: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a program executable by the at least one processor to enable the at least one processor to perform the method of profile-based data dictionary management according to any one of claims 1 to 5.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the method for profile-based data dictionary management according to any one of claims 1 to 5.
CN202011265493.3A 2020-11-12 2020-11-12 Data dictionary management method, system and storage medium based on configuration file Pending CN112364083A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011265493.3A CN112364083A (en) 2020-11-12 2020-11-12 Data dictionary management method, system and storage medium based on configuration file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011265493.3A CN112364083A (en) 2020-11-12 2020-11-12 Data dictionary management method, system and storage medium based on configuration file

Publications (1)

Publication Number Publication Date
CN112364083A true CN112364083A (en) 2021-02-12

Family

ID=74514707

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011265493.3A Pending CN112364083A (en) 2020-11-12 2020-11-12 Data dictionary management method, system and storage medium based on configuration file

Country Status (1)

Country Link
CN (1) CN112364083A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113536767A (en) * 2021-07-05 2021-10-22 深圳市工易付电子科技有限公司 Data processing method, device, equipment, medium and computer program product
CN114637761A (en) * 2022-03-10 2022-06-17 马上消费金融股份有限公司 Business object generation method and device
CN115167891A (en) * 2022-07-07 2022-10-11 北京蓝天航空科技股份有限公司 Data updating method, device and equipment of interface control file and storage medium
CN115858012A (en) * 2022-12-30 2023-03-28 广州市易鸿智能装备有限公司 Program variable configuration method, device, electronic equipment and storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113536767A (en) * 2021-07-05 2021-10-22 深圳市工易付电子科技有限公司 Data processing method, device, equipment, medium and computer program product
CN114637761A (en) * 2022-03-10 2022-06-17 马上消费金融股份有限公司 Business object generation method and device
CN114637761B (en) * 2022-03-10 2024-03-19 马上消费金融股份有限公司 Business object generation method and device
CN115167891A (en) * 2022-07-07 2022-10-11 北京蓝天航空科技股份有限公司 Data updating method, device and equipment of interface control file and storage medium
CN115167891B (en) * 2022-07-07 2023-09-05 北京蓝天航空科技股份有限公司 Data updating method, device and equipment of interface control file and storage medium
CN115858012A (en) * 2022-12-30 2023-03-28 广州市易鸿智能装备有限公司 Program variable configuration method, device, electronic equipment and storage medium
CN115858012B (en) * 2022-12-30 2023-10-20 广州市易鸿智能装备有限公司 Program variable configuration method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112364083A (en) Data dictionary management method, system and storage medium based on configuration file
US9547601B2 (en) Custom caching
JP2718881B2 (en) Token identification system
CN107967135B (en) Calculation engine implementation method, electronic device and storage medium
US8635634B2 (en) Seamless multiple format metadata abstraction
CN110795455A (en) Dependency relationship analysis method, electronic device, computer device and readable storage medium
WO2016123921A1 (en) Http protocol-based multiple data resource data processing method and system
CN106648569B (en) Target serialization realization method and device
CN110781183A (en) Method and device for processing incremental data in Hive database and computer equipment
CN113268500B (en) Service processing method and device and electronic equipment
CN111274263A (en) Visual database change statement generation method and device and storage medium
CN111966692A (en) Data processing method, medium, device and computing equipment for data warehouse
WO2023134134A1 (en) Method and apparatus for generating association viewing model, and computer device and storage medium
CN114443015A (en) Method for generating adding, deleting, modifying and checking service interface based on database metadata
CN112000692B (en) Page query feedback method and device, computer equipment and readable storage medium
CN112416784A (en) Interface checking method, system and device based on configuration center and storage medium
CN112434037A (en) Data processing method, processing device, data processing apparatus, and storage medium
CN111339098A (en) Authority management method, data query method and device
CN115545639A (en) Financial business processing method and device, electronic equipment and storage medium
CN112347794B (en) Data translation method, device, equipment and computer storage medium
CN115905274A (en) Data processing method and device, electronic equipment and medium
CN111459933A (en) GDB data dynamic expansion method, device and storage medium
CN111881220A (en) Data operation method and device under list storage, electronic equipment and storage medium
CN111488286A (en) Method and device for independently developing Android module
CN113010196B (en) Patch screening method, device, equipment 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