Data dictionary management method, system and storage medium based on configuration file
By configuring dictionary items in the configuration center and using section programming and dynamic generation technology, the problems of poor readability and low maintenance efficiency of data dictionary items are solved, and dynamic updates and efficient data processing are achieved.
Patent Information
- Application Number
- CN202011265493.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-12
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2040-11-12
AI Technical Summary
In the prior art, data dictionary items have poor readability, low maintenance efficiency, and do not support dynamic updates, resulting in performance problems and maintenance complexity during large-scale data processing.
The data dictionary management method based on configuration files is adopted, and the dynamic conversion and update of dictionary items are achieved by preconfiguring dictionary items in the configuration center and using facet programming technology and dynamic generation technology.
It improves the readability and maintenance efficiency of dictionary items, supports dynamic updates, reduces development workload, improves delivery efficiency, and improves data processing performance and response speed.
Smart Images

Figure CN112364083B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to big data processing technology, and in particular to a data dictionary management method, system and storage medium based on configuration files. Background Art
[0002] Data dictionary refers to the definition and description of data items, data structures, data flows, data storage, processing logic, etc. Its purpose is to provide detailed descriptions of each element in the data flow diagram. The data dictionary is used for simple modeling projects. Objects of the same type represented by object codes and object information are called dictionary items. In the process of integrated platform development, many data dictionary items need to be maintained. The dictionary code is saved with the business data flow. When displaying data, the dictionary code needs to be converted into dictionary information that is easy for users to understand.
[0003] In the process of application development, dictionary items are usually stored in data dictionary tables, enumeration types, or XML. Storing data dictionary items in data dictionary tables facilitates dictionary data changes. If users need to add or change dictionary configuration items, they only need to modify the data dictionary table records without modifying the code; however, there are problems: 1) When querying business data, it is necessary to left-link the dictionary table, which makes SQL maintenance complicated; 2) There are performance issues in the dictionary code conversion process, especially when the business data flow and the data scale in the data dictionary table are large, the query is slow, resulting in too much time consumed in the process of converting from dictionary code to dictionary information.
[0004] In the prior art, in order to solve the above problem, by storing dictionary items of the same type in an enumeration class, all dictionary items are loaded when the system starts, and the memory is directly read, so that the dictionary encoding conversion speed is accelerated. However, the disadvantages are as follows:
[0005] 1) When there are many dictionary types, a large number of enumeration classes need to be created, which is poor in readability;
[0006] 2) Dynamic update of dictionary data is not supported. If dictionary data is updated, the service needs to be republished for the modification to take effect;
[0007] 3) Use XML to store data dictionary items. For example, XML has poor readability and maintainability compared to JSON configuration. The data in XML is surrounded by a large number of tags, which reduces the data payload.
[0008] 4) The conversion from dictionary item encoding to dictionary item information needs to be manually processed.
[0009] Therefore, there is an urgent need for a data dictionary management method with good readability and flexibility. Summary of the invention
[0010] The present invention provides a data dictionary management method, system and computer-readable storage medium based on configuration files, which mainly solve the problems of poor readability and low maintenance efficiency of dictionary items.
[0011] To achieve the above object, the present invention provides a data dictionary management method based on a configuration file, which is applied to an electronic device, and the method comprises:
[0012] Get business data request;
[0013] Use aspect programming technology to intercept and process the acquired business data requests of users to filter out business data requests containing dictionary item requirements;
[0014] Sending the service data request to a dictionary encoder, and issuing a query request to a dictionary item container through the dictionary encoder; wherein the dictionary item container is used to obtain a dictionary value corresponding to the query request, and return the dictionary value to the dictionary encoder;
[0015] The dictionary encoder calls the CGLib dynamic generator according to the dictionary value, and the CGLib dynamic generator is used to dynamically generate a class instance containing the dictionary value according to the dictionary value, and return the class instance to the user.
[0016] Further, preferably, before the step of obtaining the user's service data request,
[0017] The method further includes the step of pre-configuring dictionary items in a configuration center; wherein the step of pre-configuring dictionary items in a configuration center includes:
[0018] Create a namespace in the configuration center;
[0019] Configuring a dictionary item set and a configuration specification of the dictionary item set in the namespace; wherein the dictionary item set includes a plurality of dictionary items;
[0020] Configure a listening interface and a service interface for registering Watch events; wherein both the listening interface and the service interface correspond to the dictionary item set;
[0021] Configure json memory to store updated data of dictionary item collection.
[0022] Further, preferably, the process of updating data of the JSON memory storage dictionary item set includes:
[0023] When the monitoring interface monitors that the corresponding dictionary item set is updated, a Watch event corresponding to the update is generated, and the latest configuration data of the updated dictionary item set is written into the service interface;
[0024] Read the corresponding dictionary item configuration data in the namespace through the service interface to determine the corresponding dictionary attribute value;
[0025] Serialize the latest configuration data and dictionary attribute values to form dictionary item metadata;
[0026] The dictionary item metadata is stored in a dictionary item storage container.
[0027] Further, preferably, the dictionary item set includes KEY and VALUE, wherein:
[0028] The KEY is a unique identifier of the dictionary item set in the namespace;
[0029] The VALUE includes a business table name, a business field name and a dictionary data set; the dictionary data set is formed by merging dictionary item metadata in a dictionary item storage container according to the business table name and the business segment name.
[0030] Further, preferably, the Watch event includes a dictionary item start event and a dictionary item set update event.
[0031] To achieve the above-mentioned purpose, the present invention provides a data dictionary management method system based on a configuration file, 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,
[0032] The data request acquisition unit is used to acquire a service data request;
[0033] The dictionary item request screening unit is used to intercept and process the acquired user's business data request by using aspect programming technology to screen out the business data request containing the dictionary item requirement;
[0034] The dictionary item query unit is used to send the service data request to the dictionary encoder, and send a query request to the dictionary item container through the dictionary encoder; wherein the dictionary item container is used to obtain a dictionary value corresponding to the query request and return the dictionary value to the dictionary encoder;
[0035] The class instance generation unit of the dictionary value is used for the dictionary encoder to call the CGLib dynamic generator according to the dictionary value. The CGLib dynamic generator is used to dynamically generate a class instance containing the dictionary value according to the dictionary value, and return the class instance to the user.
[0036] Furthermore, preferably, it also includes a dictionary item configuration unit, which is used to pre-configure dictionary items in the configuration center before the step of obtaining the user's business data request.
[0037] Further, preferably, the dictionary item configuration unit includes a namespace creation module, a dictionary item set configuration module, an interface configuration module and an update data storage module; the namespace creation module is used to create a namespace in the configuration center;
[0038] The dictionary item set configuration module is used to configure a dictionary item set and a configuration specification of the dictionary item set in the namespace; wherein the dictionary item set includes a plurality of dictionary items;
[0039] The interface configuration module is used to configure a listening interface and a service interface for registering Watch events; wherein both the listening interface and the service interface correspond to the dictionary item set;
[0040] The update data storage module is used to configure the json memory to store the update data of the dictionary item set.
[0041] To achieve the above-mentioned purpose, the present invention also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a program executable by the at least one processor, and the program is executed by the at least one processor so that the at least one processor can execute the data dictionary management method based on the configuration file as described above.
[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-mentioned data dictionary management method based on the configuration file.
[0043] The data dictionary management method, system, electronic device and computer-readable storage medium based on configuration files proposed by the present invention realize the function of starting to load dictionary items by configuring dictionary items in the configuration center; when reading dictionary item business data, the data containing the dictionary code is automatically converted by using dynamic programming technology to generate data containing dictionary item information. The beneficial effects are as follows:
[0044] 1) The data dictionary management method based on configuration files of the present invention combines the advantages of easy maintenance, high readability and easy updating of configuration files with dynamic monitoring and dynamic generation technologies, which can not only conveniently maintain the configuration of dictionary items, but also dynamically apply such updates to subsequent business processing flows;
[0045] 2) The data dictionary management method based on configuration files of the present invention provides dictionary item management for application microservices by configuring dictionary items in configuration files, so that there is no need to pay attention to the encoding conversion of dictionary items during the development of application microservices, and decoupling of dictionary item management from business processing is achieved, which is convenient for the maintenance of dictionary items;
[0046] 3) The calculation processing of the dictionary items in the data dictionary management method based on the configuration file of the present invention is pre-executed in the memory, and the data calculation results are cached in the memory after execution, which improves the processing efficiency and response speed.
[0047] 4) The dictionary items of the configuration file-based data dictionary management method of the present invention have a dynamic coding function, so that application developers do not need to worry about coding conversion and only need to focus on business development, thereby reducing development workload and improving delivery efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A flowchart of an embodiment of a data dictionary management method based on a configuration file of the present invention;
[0049] Figure 2 It is a schematic diagram of the principle of the data dictionary management method based on configuration files of the present invention;
[0050] Figure 3 A schematic diagram of the logical structure of the data dictionary management method system based on configuration files of the present invention;
[0051] Figure 4 is a schematic structural diagram of an embodiment of an electronic device of the present invention;
[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0054] In order to improve user coding efficiency, the present invention provides a data dictionary management method based on configuration files. Figure 1 The flow chart of the embodiment of the data dictionary management method based on the configuration file of the present invention is shown. Figure 1 As shown, the method can be executed by a device, and the device can be implemented by software and / or hardware.
[0055] The data dictionary management method based on the configuration file includes: step S110 to step S140.
[0056] S110: Obtain business data request.
[0057] In a specific embodiment, before the step of obtaining the user's service data request, dictionary items are pre-configured in the configuration center; the method of pre-configuring dictionary items in the configuration center includes: steps S10-S40.
[0058] S10. Create a namespace in the configuration center.
[0059] Specifically, create a namespace: In the microservice system architecture, each service that needs to use dictionary items needs to create a separate Namespace in the configuration center and name it custom_prop.
[0060] Specifically, through a general servlet container, requests are classified through reflection and proxy, and dictionary item class requests only correspond to one general dictionary item servlet container.
[0061] Because the servlet container is not a Spring Bean, Spring AOP is invalid for methods in Servlet. In order to implement Spring AOP to intercept Servlet, the following operations need to be performed on the servlet container: call the Spring Bean method in the Servlet method, and achieve this function by implanting aspects in the Spring Bean; use Spring MVC's interceptor Interceptor to perform functional intervention on Servlet requests: 1) define the Java class as the interceptor Bean; 2) declare the Bean as the interceptor in Dispatch-servlet.xml.
[0062] S20. Configure a dictionary item set and a configuration specification of the dictionary item set in a namespace; wherein the dictionary item set includes a plurality of dictionary items.
[0063] The dictionary item set includes KEY and VALUE, where:
[0064] The KEY is a unique identifier of the dictionary item set in the namespace;
[0065] The VALUE includes a business table name, a business field name and a dictionary data set; the dictionary data set is formed by merging dictionary item metadata in a dictionary item storage container according to the business table name and the business segment name.
[0066] Specifically, the configuration dictionary item set is composed of multiple dictionary items, which form a set of dictionary item sets. The dictionary item set is configured in the namespace named custom_prop according to the configuration management specifications of the JAVA configuration file. The KEY of the dictionary item set is named according to the custom business specifications, and the Namespace is guaranteed to be unique. The VALUE of the dictionary item set is configured in a JSON structure, which contains four elements, namely business group, business name, business field name, and dictionary data set.
[0067] Business grouping is used to mark the group to which the dictionary item belongs. It is mainly used to realize dictionary data aggregation of complex multi-business modules, and realize group storage and retrieval. The business group name is specified by the group field. The dictionary data items of the same business group are set with the same business group name. For the convenience of maintenance and management, they are usually named after the business module name. When the background program loads data, it loads and merges the same data blocks into the same data unit according to the business group name to provide retrieval services.
[0068] Business name, used to mark the name of the business module to which the dictionary item belongs, is the basic unit for dividing data dictionary items. It corresponds to the business data table of the relational database and is specified through the table field, usually named after the business data table name.
[0069] Business field name, used to mark the business classification of dictionary items, corresponds to the business data table field of the relational database. It is specified by the column field, and uniquely determines a set of dictionary item data together with the business group, business name, and business field name.
[0070] A field set is a data set consisting of dictionary items, defined using dict fields.
[0071] Dictionary items are saved using Node nodes consisting of code and name. The dictionary item code is saved in code, and the dictionary item name is saved in name.
[0072] S30. Configure a listening interface and a service interface for registering Watch events; wherein both the listening interface and the service interface correspond to the dictionary item set.
[0073] The Watch event includes a dictionary item startup event and a dictionary item set update event. That is, the monitoring step of the monitoring interface is: when the monitored application is started or a dictionary item update action occurs, a Watch event is generated.
[0074] After the dictionary item collection data is configured, the application registers the Watch event through the configuration listening interface (ApolloConfigChangeListener). When the application starts or the configured dictionary item is updated, the Watch event will be generated and the latest data will be pushed to the memory of the application that subscribes to the event, so that the application can dynamically obtain the changed dictionary data in real time. The detailed process is as follows: Integrate the microservice configuration center and complete the dictionary item collection configuration according to the above step S20. Inject the Spring application context through the ApplicationContextAware interface, listen to the Namespace named custom_prop through the configuration listener of the configuration center, and save the monitored dynamic data in the memory of the Spring application context for data storage.
[0075] S40. Configure json memory to store update data of the dictionary item set.
[0076] After the dictionary item data is updated, the listener that has gone through the above steps obtains the changed data and saves it in memory. For ease of application, the data needs to be processed and converted, and the converted data is stored in a dynamic array.
[0077] The process of updating data of the JSON memory storage dictionary item set includes:
[0078] When the monitoring interface monitors that the corresponding dictionary item set is updated, a Watch event corresponding to the update is generated, and the latest configuration data of the updated dictionary item set is written into the service interface;
[0079] The corresponding dictionary item configuration data in the namespace is read through the service interface to determine the corresponding dictionary attribute value; which includes obtaining a dictionary attribute name list; traversing the dictionary attribute name list, and then determining the corresponding dictionary attribute value.
[0080] The latest configuration data and dictionary attribute values are serialized to form dictionary item metadata; wherein the setting process of the dictionary item storage container is as follows: a dynamic array is initialized in the memory of the application as a dictionary item storage container for storing the converted dictionary configuration data. The dictionary item metadata is saved in the dictionary item storage container.
[0081] In the specific implementation process, a dynamic array is initialized as a dictionary item storage container, i.e., a Servlet container, for storing the converted dictionary configuration data; when a monitoring event occurs, the latest configuration data will be written into the configuration service interface (ConfigService), in which the dictionary item configuration data (Config) configured by Namespace is read; in the dictionary item configuration data (Config), the data dictionary attribute name list (PropertyNames) is read; the dictionary attribute name list (PropertyNames) is traversed, and the dictionary attribute value is taken out according to the dictionary attribute name in the dictionary item configuration data (Config), and serialized into dictionary item metadata (DictProp), and saved in the dictionary item storage container. After the dictionary item storage container data is saved, the dictionary data set is merged according to the business table name and the business field name to adapt to the scenario of splitting the configuration of a large amount of dictionary sets. The class instance of the dictionary value is returned to the user.
[0082] S120 , intercepting and processing the acquired business data requests of the users by using aspect programming technology, so as to filter out the business data requests containing dictionary item requirements.
[0083] Specifically, the aspect technology is AOP cross-cutting technology; it is irrelevant to the core business, but it encapsulates the logic or responsibility commonly called by the business modules, which is convenient for reducing the system's duplicate code, reducing the coupling between modules, and is conducive to future operability and maintainability. By using AOP aspect technology, the dictionary demand business and the core business logic are separated, the aspect is configured through configuration files or annotations, and the filtering conditions are set for the aspect. The filtering conditions are the methods in the program, which means that when these methods in the program are called, the methods of the dictionary item aspect will be called to read the dictionary items, which is equivalent to a mechanism that triggers the dictionary items when the filtering conditions are met.
[0084] In a specific embodiment, aspects and entry points are set through configuration files, trigger methods associated with entry points are set, and the mapping relationship between core business functions and trigger functions is configured. Once the trigger method is called, the aspect will be entered, and related functions will be executed before, after, or in exception situations of the trigger method. The specific steps include: configuring aspect information for the log class LogAop, configuring logAopBean in applicationContext.xml to be the bean for configuring the log, and providing it to the IOC call. aop:aspect id="logAspect" defines an aspect. Define the log class and implement the pre, post, exception, return and other methods in the log class. Use annotations instead of configuration files to tell the IOC container the mapping relationship between aspects, entry points, trigger functions and core business methods. In this application scenario, Spring AOP is used to intercept data requests for dictionary requirements.
[0085] S130, sending the service data request to a dictionary encoder, and sending a query request to a dictionary item container through the dictionary encoder; wherein the dictionary item container is used to obtain a dictionary value corresponding to the query request, and return the dictionary value to the dictionary encoder;
[0086] The dictionary encoder is used to obtain the dictionary value encoded into the dictionary item container, that is, the dictionary encoder is used to obtain the dictionary value corresponding to the above dictionary request data from the dictionary item container. After the dictionary encoder receives the dictionary request data intercepted by the AOP, it sends a query request to the dictionary item container, and the dictionary item container finds the dictionary value corresponding to the dictionary request according to the query request, and then returns the dictionary value to the dictionary encoder.
[0087] S140. The dictionary encoder calls a CGLib dynamic generator according to the dictionary value, and the CGLib dynamic generator is used to dynamically generate a class instance containing the dictionary value according to the dictionary value, and return the class instance of the dictionary value to the user.
[0088] The dictionary encoder calls the CGLib dynamic generator according to the obtained dictionary value, and the CGLib dynamic generator dynamically generates a class instance containing the dictionary value (i.e., a proxy embodiment) according to the dictionary value. The dynamic proxy generator returns the generated class instance containing the dictionary value to the dictionary encoder, and then returns it to the user.
[0089] In a specific embodiment, after the data is stored, when there is a business data request, the aspect-oriented programming technology is used to intercept and process it. For requests containing dictionary requirements, the encoder logic is called for processing. The dictionary encoder stores the intercepted dictionary item code in the dictionary item storage container, reads the dictionary value corresponding to the dictionary code, and then calls the dynamic proxy generator, using the dynamic proxy generation technology to dynamically generate a class instance containing the dictionary value, and returns a response to the caller. Among them, the class instance of the dictionary value is to create a class and create an object of the class (instantiate the class), and the instantiation of the class is similar to the function call method.
[0090] The configuration file-based data dictionary management method of the present invention manages dictionary items in the configuration file, decouples them from business codes, is easy to maintain, and uses event monitoring technology to support dynamic updates, so that the updated latest dictionary item configuration can take effect without publishing services. This proposal intercepts requests with dictionary requirements through aspect-oriented programming technology, searches for dictionary values in dictionary item storage containers according to dictionary item codes, and then dynamically generates a return body containing dictionary values using dynamic proxy technology, and returns the new entity to the user, so that there is no need to pay attention to the encoding conversion of dictionary items during the application microservice development process, and realizes the decoupling of dictionary item management and business processing, achieving the technical effect of improving the maintenance efficiency of dictionary items.
[0091] Figure 2 The schematic diagram of the principle of the data dictionary management method based on the configuration file of the present invention is shown. Figure 2 As shown,
[0092] The present invention is a data dictionary management method based on configuration files. When there is a business data request, the aspect-oriented programming technology (AOP) is used to intercept and process it. For requests containing dictionary requirements, the logic of the encoder is called to process it. The dictionary encoder stores the intercepted dictionary item code in the dictionary item storage container, reads the dictionary value corresponding to the dictionary code, and then calls the dynamic proxy generator, uses the dynamic proxy generation technology to dynamically generate a proxy implementation example containing the dictionary value, and returns a response to the caller.
[0093] In summary, the present invention intercepts requests with dictionary requirements through aspect-oriented programming technology, searches for dictionary values in dictionary item storage containers according to dictionary item codes, and then dynamically generates a return body containing dictionary values using dynamic proxy technology, and returns the new entity to the user. The calculation processing of dictionary items through the data dictionary management method based on configuration files is pre-executed in memory, and the data calculation results are cached in memory after execution, achieving the technical effect of improving processing efficiency and response speed.
[0094] Figure 3 This is a schematic diagram of the logical structure of the data dictionary management method system based on the configuration file of the present invention; Figure 3 As shown,
[0095] To achieve the above-mentioned purpose, the present invention provides a data dictionary management method system 300 based on a configuration file, comprising a data request acquisition unit 320, a dictionary item request screening unit 330, a dictionary item query unit 340, and a dictionary value class instance generation unit 350; wherein the data request acquisition unit 320 is used to acquire a business data request; the dictionary item request screening unit 330 is used to intercept and process the acquired user's business data request by using aspect programming technology to filter out business data requests containing dictionary item requirements; the dictionary item query unit 340 is used to send the business data request to a dictionary encoder, and issue a query request to a dictionary item container through the dictionary encoder; wherein the dictionary item container is used to acquire a dictionary value corresponding to the query request and return the dictionary value to the dictionary encoder; the dictionary value class instance generation unit 350 is used for the dictionary encoder to call a CGLib dynamic generator according to the dictionary value, and the CGLib dynamic generator is used to dynamically generate a class instance containing a dictionary value according to the dictionary value, and return the class instance to the user.
[0096] Furthermore, preferably, a dictionary item configuration unit 310 is also included, which is used to pre-configure dictionary items in the configuration center before the step of obtaining the user's business data request.
[0097] Further, preferably, the dictionary item configuration unit 310 includes a namespace creation module, a dictionary item set configuration module, an interface configuration module and an update data storage module; the namespace creation module is used to create a namespace in the configuration center; the dictionary item set configuration module is used to configure the dictionary item set and the configuration specification of the dictionary item set in the namespace; wherein the dictionary item set includes multiple dictionary items; the interface configuration module is used to configure the listening interface and the service interface for registering Watch events; wherein the listening interface and the service interface both correspond to the dictionary item set; the update data storage module is used to configure the json memory for storing the update of the dictionary item set. The CGLib dynamic generator dynamically generates class instances containing dictionary values.
[0098] The data dictionary management system based on the configuration file of the present invention is managed in the configuration file through dictionary items, decoupled from the business code, easy to maintain, and supports dynamic update by using event monitoring technology, so that the updated latest dictionary item configuration can be effective without publishing services. By configuring dictionary items in the configuration file, dictionary item management is provided for application microservices, so that there is no need to pay attention to the encoding conversion of dictionary items during the development of application microservices, and the decoupling of dictionary item management and business processing is realized, which is convenient for the maintenance of dictionary items.
[0099] The present invention provides a data dictionary management method based on a configuration file, which is applied to an electronic device 4 .
[0100] Figure 4 The application environment of a preferred embodiment of the data dictionary management method based on configuration files according to the present invention is shown.
[0101] Reference Figure 4 As shown, in this embodiment, the electronic device 4 can be a terminal device with computing functions such as a server, a smart phone, a tablet computer, a portable computer, or a desktop computer.
[0102] The electronic device 4 includes a processor 42 , a memory 41 , a communication bus 43 , and a network interface 45 .
[0103] 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, etc. 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 equipped on the electronic device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc.
[0104] In this embodiment, the readable storage medium of the memory 41 is generally used to store the data dictionary management method program 40 based on the configuration file installed in the electronic device 4. The memory 41 can also be used to temporarily store data that has been output or is to be output.
[0105] In some embodiments, the processor 42 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 51, such as executing the data dictionary management method program 40 based on the configuration file.
[0106] The communication bus 43 is used to realize the connection and communication between these components.
[0107] The network interface 44 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the electronic device 4 and other electronic devices.
[0108] Figure 4Only the electronic device 4 is shown with components 41 - 44 , but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0109] Optionally, the electronic device 4 may also include a user interface, which may include an input unit such as a keyboard, a voice input device such as a microphone and other devices with voice recognition function, a voice output device such as a speaker, headphones, etc. Optionally, the user interface may also include a standard wired interface or a wireless interface.
[0110] 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, it may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an organic light-emitting diode (OLED) touch device. The display is used to display information processed in the electronic device 4 and to display a visual user interface.
[0111] Optionally, the electronic device 4 may also include a radio frequency (RF) circuit, a sensor, an audio circuit, etc., which will not be described in detail here.
[0112] exist Figure 4 In the device embodiment shown, a memory 41 as a computer storage medium may include an operating system and a data dictionary management method program 40 based on a configuration file; when the processor 42 executes the data dictionary management method program 40 based on a configuration file stored in the memory 41, the following steps are implemented: obtaining a user's business data request; intercepting and processing the business data request using aspect programming technology, and screening out business data requests containing dictionary item requirements; sending the business data request to a dictionary encoder, and the dictionary encoder sends a query request to a dictionary item container; the dictionary item container obtains a dictionary value corresponding to the query request, and returns the dictionary value to the dictionary encoder; the dictionary encoder calls a CGLib dynamic generator according to the dictionary value, and the CGLib dynamic generator dynamically generates a class instance containing a dictionary value, and returns the class instance of the dictionary value to the user.
[0113] In other embodiments, the data dictionary management method program 40 based on the configuration file can also be divided into one or more modules, one or more modules are stored in the memory 41, and are executed by the processor 42 to complete the present invention. The module referred to in the present invention refers to a series of computer program segments that can complete specific functions. The data dictionary management method program 40 based on the configuration file can be divided into a dictionary item configuration unit 310, a data request acquisition unit 320, a dictionary item request screening unit 330, a dictionary item query unit 340, and a dictionary value class instance generation unit 350.
[0114] In addition, the present invention also proposes a computer-readable storage medium, which mainly includes a data storage area and a program storage area, wherein the data storage area can store data created according to the use of the blockchain node, etc., and the program storage area can store an operating system and application programs required for at least one function. The computer-readable storage medium includes a data dictionary management method program based on a configuration file, and when the data dictionary management method program based on a configuration file is executed by a processor, it implements operations such as a data dictionary management method based on a configuration file.
[0115] The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the data dictionary management method, system, and electronic device based on the configuration file, and will not be described in detail here.
[0116] In general, the data dictionary management method, system, electronic device and computer-readable storage medium based on the configuration file of the present invention combine the advantages of easy maintenance, high readability and easy updating of the configuration file as well as dynamic monitoring and dynamic generation technology, which can not only conveniently maintain the configuration of dictionary items, but also dynamically apply such updates to subsequent business processing flows. The calculation processing of dictionary items is pre-executed in memory, and the data calculation results are cached in memory after execution. This processing method improves the response speed of the application. The dynamic encoding function of dictionary items is realized, so that application developers do not need to worry about the conversion of encodings, but only need to focus on business development, which reduces the development workload and improves delivery efficiency.
[0117] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0118] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0119] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. Through the description of the above implementation modes, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation mode. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, including several programs to enable a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0120] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data dictionary management method based on a configuration file, applied to an electronic device, characterized in that: The method comprises: Get business data request; Use aspect programming technology to intercept and process the acquired business data requests of users to filter out business data requests containing dictionary item requirements; Sending the service data request to a dictionary encoder, and issuing a query request to a dictionary item container through the dictionary encoder; wherein the dictionary item container is used to obtain a dictionary value corresponding to the query request, and return the dictionary value to the dictionary encoder; The dictionary encoder calls a CGLib dynamic generator according to the dictionary value, and the CGLib dynamic generator is used to dynamically generate a class instance containing the dictionary value according to the dictionary value, and return the class instance to the user; Before the step of obtaining the user's business data request, the step of pre-configuring dictionary items in the configuration center is also included; wherein the step of pre-configuring dictionary items in the configuration center includes: creating a namespace in the configuration center; configuring a dictionary item set and a configuration specification of the dictionary item set in the namespace; wherein the dictionary item set includes multiple dictionary items; configuring a listening interface and a service interface for registering Watch events; wherein the listening interface and the service interface both correspond to the dictionary item set; and configuring json memory to store updated data of the dictionary item set.
2. The data dictionary management method based on configuration files according to claim 1 is characterized in that: The process of updating data of the JSON memory storage dictionary item set includes: When the monitoring interface monitors that the corresponding dictionary item set is updated, a Watch event corresponding to the update is generated, and the latest configuration data of the updated dictionary item set is written into the service interface; Read the corresponding dictionary item configuration data in the namespace through the service interface to determine the corresponding dictionary attribute value; Serialize the latest configuration data and dictionary attribute values to form dictionary item metadata; The dictionary item metadata is stored in a dictionary item storage container.
3. The data dictionary management method based on configuration files according to claim 1 is characterized in that: The dictionary item set includes KEY and VALUE, where: The KEY is a unique identifier of the dictionary item set in the namespace; The VALUE includes a business table name, a business field name and a dictionary data set; the dictionary data set is formed by merging dictionary item metadata in a dictionary item storage container according to the business table name and the business segment name.
4. The data dictionary management method based on configuration files according to claim 2 is characterized in that: The Watch events include dictionary item start events and dictionary item set update events.
5. A data dictionary management method system based on configuration files, characterized in that: It includes 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 data request acquisition unit is used to acquire a service data request; The dictionary item request screening unit is used to intercept and process the acquired user's business data request by using aspect programming technology to screen out the business data request containing the dictionary item requirement; The dictionary item query unit is used to send the service data request to the dictionary encoder, and send a query request to the dictionary item container through the dictionary encoder; wherein the dictionary item container is used to obtain a dictionary value corresponding to the query request and return the dictionary value to the dictionary encoder; The class instance generation unit of the dictionary value is used for the dictionary encoder to call the CGLib dynamic generator according to the dictionary value, and the CGLib dynamic generator is used to dynamically generate a class instance containing the dictionary value according to the dictionary value, and return the class instance to the user; It also includes a dictionary item configuration unit, which is used to pre-configure dictionary items in the configuration center before the step of obtaining the user's business data request; the dictionary item configuration unit includes a namespace creation module, a dictionary item set configuration module, an interface configuration module and an update data storage module; the namespace creation module is used to create a namespace in the configuration center; the dictionary item set configuration module is used to configure a dictionary item set and a configuration specification of the dictionary item set in the namespace; wherein the dictionary item set includes multiple dictionary items; the interface configuration module is used to configure a listening interface and a service interface for registering Watch events; wherein the listening interface and the service interface both correspond to the dictionary item set; the update data storage module is used to configure a json memory for storing update data of the dictionary item set.
6. An electronic device, characterized in that: The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a program executable by the at least one processor, and the program is executed by the at least one processor so that the at least one processor can execute the data dictionary management method based on the configuration file as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data dictionary management method based on the configuration file as claimed in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Interface data calling method, device and equipment and computer readable storage medium
CN110069248A
Dictionary data operation method and device, readable storage medium and terminal equipment
CN111611241A