Dictionary data processing method, device, electronic device and computer storage medium
By annotating dictionary parsing parameters, cross-data source parsing is supported, and target dictionary logic classes are used to parse dictionary data information, which solves the problem of code redundancy in dictionary data processing and improves development efficiency.
Patent Information
- Application Number
- CN202111135328.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-09-27
AI Technical Summary
There is a problem of code redundancy in the process of dictionary data processing in the prior art, especially when dictionary data is associated with table data.
By adding annotations to parameters to be parsed using dictionary, obtain annotation parameters, including data source parameters, data table parameters, data id parameters, return field parameters and return parameter name parameters, determine the target dictionary logic class based on these parameters, and use the target dictionary logic The class parses dictionary data information, thereby supporting cross-data source parsing and reducing code redundancy.
This enables quick determination of dictionary data information without establishing new associations with table data, improving application development efficiency.
Smart Images

Figure CN113835692B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a dictionary data processing method, device, electronic equipment and computer storage medium. Background Art
[0002] At present, after using dictionary values to define objects and object states in the application system, the dictionary in the system and the dictionary items corresponding to the dictionary are stored in the database. When the application starts, the dictionary and dictionary items are read from the database and stored in the memory; the user can process the dictionary data according to their business needs in the front page. Since in the process of processing the dictionary data, many dictionary data are associated with table data, so in the process of processing the dictionary data, it is necessary to establish a new association with the table data, resulting in code redundancy. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a dictionary data processing method, device, electronic device and computer storage medium to solve the problem of code redundancy in the prior art.
[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0005] A first aspect of an embodiment of the present invention shows a method for processing dictionary data, the method comprising:
[0006] When a page in an application system loads business data, annotations are added to the parameters to be parsed using the dictionary in the business data to obtain annotation parameters, wherein the annotation parameters include data source parameters, data table parameters, data id parameters, return field parameters, and return parameter name parameters;
[0007] Based on the annotation parameter, determining a target dictionary logical class corresponding to the annotation parameter;
[0008] The target dictionary logic class is used to parse the annotation parameters to determine dictionary data information.
[0009] Optionally, annotations are added to the parameters to be parsed using the dictionary in the business data to obtain annotation parameters, including:
[0010] Acquire the attribute function of the business data, and convert the format of the attribute function of the business data according to a preset format;
[0011] Parsing the attribute function of the business data in the preset format to obtain parameters to be parsed using a dictionary;
[0012] Annotations are added to the parameters to be parsed using the dictionary according to preset rules to obtain annotated parameters.
[0013] Optionally, the determining, based on the annotation parameter, a target dictionary logic class corresponding to the annotation parameter includes:
[0014] Based on the data source parameter in the annotation parameter, a target dictionary logic class corresponding to the data source parameter is determined from a plurality of initial dictionary logic classes.
[0015] Optionally, also include:
[0016] The return parameter name parameter in the annotation parameter and the dictionary item corresponding to the dictionary parameter are encapsulated and displayed on the page of the application system.
[0017] A second aspect of an embodiment of the present invention shows a dictionary data processing device, the device comprising:
[0018] An annotation adding unit is used to add annotations to the parameters to be parsed using the dictionary in the business data when the page in the application system loads the business data, so as to obtain annotation parameters, wherein the annotation parameters include data source parameters, data table parameters, data id parameters, return field parameters and return parameter name parameters;
[0019] a determining unit, configured to determine, based on the annotation parameter, a target dictionary logical class corresponding to the annotation parameter;
[0020] The parsing unit is used to parse the annotation parameters using the target dictionary logic class to determine the dictionary data information.
[0021] Optionally, the annotation adding unit includes:
[0022] An acquisition subunit, used for acquiring the attribute function of the business data, and performing format conversion on the attribute function of the business data according to a preset format;
[0023] A processing subunit, used for parsing the attribute function of the business data in the preset format to obtain parameters to be parsed using a dictionary;
[0024] The annotation adding subunit is used to add annotations to the parameters to be parsed using the dictionary according to preset rules to obtain annotated parameters.
[0025] Optionally, the determining unit is specifically used to: determine, based on the data source parameter in the annotation parameter, a target dictionary logical class corresponding to the data source parameter from a plurality of initial dictionary logical classes.
[0026] Optionally, also include:
[0027] The encapsulation unit is used to encapsulate the return parameter name parameter in the annotation parameter and the dictionary item corresponding to the dictionary parameter, and display it on the page of the application system.
[0028] A third aspect of an embodiment of the present invention shows an electronic device, which is used to run a program, wherein the program, when running, executes the dictionary data processing method shown in the first aspect of the embodiment of the present invention.
[0029] A fourth aspect of an embodiment of the present invention shows a computer storage medium, which includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the dictionary data processing method shown in the first aspect of the embodiment of the present invention.
[0030] Based on the above-mentioned embodiment of the present invention, a dictionary data processing method, device, electronic device and computer storage medium are provided. The method includes: when a page in an application system loads business data, an annotation is added to the parameters to be parsed using the dictionary in the business data to obtain an annotation parameter, and the annotation parameter includes a data source parameter, a data table parameter, a data id parameter, a return field parameter and a return parameter name parameter; based on the annotation parameter, a target dictionary logic class corresponding to the annotation parameter is determined; the annotation parameter is parsed using the target dictionary logic class to determine the dictionary data information. In an embodiment of the present invention, by annotating the parameters to be parsed using the dictionary, multiple data sources are supported in the form of annotations, that is, cross-data source parsing, so that a new association does not need to be established with the table data. Then, the annotation parameter is parsed by the target dictionary logic class corresponding to the annotation parameter so that the dictionary data information can be quickly determined, thereby reducing code redundancy and improving the development efficiency of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0032] Figure 1 A flowchart of a dictionary data processing method according to an embodiment of the present invention;
[0033] Figure 2 A schematic diagram of an application architecture for dictionary data processing according to an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of a flow chart of a dictionary data processing device according to an embodiment of the present invention;
[0035] Figure 4 The present invention is a flowchart of another dictionary data processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0038] In the embodiment of the present invention, by annotating the parameters to be parsed using the dictionary, multiple data sources, i.e., cross-data source parsing, are supported in the form of annotations, so that new associations do not need to be established with table data. Then, the annotated parameters are parsed by the target dictionary logic class corresponding to the annotated parameters, so that the dictionary data information can be quickly determined, thereby reducing code redundancy and improving application development efficiency.
[0039] See also Figure 1 , is a flow chart of a dictionary data processing method according to an embodiment of the present invention, the method comprising:
[0040] Step S101: when a page in an application system loads business data, annotations are added to parameters in the business data to be parsed using a dictionary, to obtain annotated parameters.
[0041] In step S101, the annotation parameters include data source parameters, data table parameters, data id parameters, namely, query field parameters, return field parameters and return parameter name parameters.
[0042] In the specific implementation of step S101, all interface methods are taken as entry points, that is, the target methods to be enhanced by the application notification, and the parameters that need to be parsed in the returned business data object are determined, and the corresponding annotations are added. That is, when the target function is being executed, the object of the business data to be returned is obtained through the proceed() method of the surround notification, and the parameters with the annotation are filtered out, and the annotations on the parameters are further parsed to obtain the data source, data table, data id, return field, and return parameter name required for the dictionary item to be parsed, thereby determining the data source parameter, data table parameter, data id parameter, return field parameter, and return parameter name parameter.
[0043] It is understandable that it is sufficient to add annotations to the parameters that require dictionary parsing, either all or some of them. In the specific implementation, some parameters are annotated.
[0044] Step S102: Based on the annotation parameters, determine the target dictionary logical class corresponding to the annotation parameters.
[0045] In the specific implementation of step S102, the data source parameter in the annotation parameter is parsed to obtain the target dictionary logic class DictService corresponding to the data source parameter by using the principle of reflection.
[0046] It should be noted that if you need to annotate to support multiple data sources, you need to configure the current application to also support multiple data sources. Each data source corresponds to a dictionary logic class DictService and implements the corresponding methods.
[0047] Step S103: parse the annotation parameters using the target dictionary logic class to determine dictionary data information.
[0048] In the process of implementing step S103, the corresponding MasterDictService target dictionary logic class, that is, the method of the main dictionary logic layer, is called to inject data tables, query fields, return fields and return parameter names through mybatis custom SQL statements, and then determine the dictionary data information corresponding to the business data. In other words, the relevant business logic is processed through the method of the main dictionary logic layer of MasterDictService to obtain the dictionary data information of the business data.
[0049] It should be noted that the dictionary data information includes the return parameter name parameter and the dictionary item corresponding to the dictionary parameter, as well as the corresponding field information.
[0050] The dictionary value is used to record the state of the data or the corresponding data id stored in the relational table, that is, the corresponding relationship.
[0051] Optionally, the return parameter name parameter in the annotation parameter and the dictionary item corresponding to the dictionary parameter are encapsulated and displayed on the page of the application system.
[0052] In the embodiment of the present invention, by annotating the parameters to be parsed using the dictionary, multiple data sources, i.e., cross-data source parsing, are supported in the form of annotations, so that new associations do not need to be established with table data. Then, the annotated parameters are parsed by the target dictionary logic class corresponding to the annotated parameters, so that the dictionary data information can be quickly determined, thereby reducing code redundancy and improving application development efficiency.
[0053] Based on the dictionary data processing method shown in the above embodiment of the present invention, in the specific implementation step S101, annotations are added to the parameters to be parsed using the dictionary in the business data to obtain the annotated parameters, including the following steps:
[0054] Step S11: Acquire the attribute function of the business data, and convert the format of the attribute function of the business data according to a preset format.
[0055] In the specific implementation of step S11, the target method of the application programming interface api is executed, and each interface is used as a cut point @pointcut to intercept and process the data returned by the interface, that is, receive the parameters to be used for dictionary parsing in the business data to be loaded, that is, the object. Then all the attribute functions and parent classes of the object are obtained and converted according to the preset format.
[0056] It should be noted that the preset format may be a data exchange format (JavaScript Object Notation, json) format. Specifically, the json format is easy to read and understand, and easy to machine parse and generate.
[0057] Step S12: parsing the attribute function of the business data in the preset format to obtain parameters to be parsed using a dictionary.
[0058] In the specific implementation of step S12, the attribute function of the business data in the preset format is parsed, the dictionary corresponding to the attribute function is parsed, and the parameters to be used for dictionary parsing are determined from the database.
[0059] Step S13: adding annotations to the parameters to be parsed using the dictionary according to preset rules to obtain annotated parameters.
[0060] In the process of step S13, the preset rules refer to the characteristics of annotations and the aspect-oriented programming (AOP) technology under the spring framework.
[0061] In the process of implementing step S13, based on the characteristics of annotations and the support of aspect-oriented programming (AOP) technology under the spring framework, custom annotations are added to the fields that need to be parsed to obtain data source parameters, data table parameters, data id parameters, return field parameters and return parameter name parameters.
[0062] It should be noted that the data source parameter refers to ds (data source), the data table parameter refers to dictTable (data table), the query field parameter refers to dictCode (query field), the return field parameter refers to dictText (return field), and the return parameter name parameter refers to rfiedName (return parameter name).
[0063] The parameter value of the query field is the data value of the current annotated object obtained through reflection.
[0064] dictText is the target field to be queried, that is, the returned field.
[0065] Optionally, if the attribute function of the business data is parsed successfully, the multiple data source parameters in the annotation are identified and the data source is switched. Then, the SQL is queried through the mybatis framework and the result is cached. The query result is then returned in json with key (return parameter name)-value (dictionary value), which improves the loading speed and greatly reduces the number of connections to the database.
[0066] It should be noted that AOP is a technology that achieves unified maintenance of program functions through pre-compilation and dynamic proxy during runtime.
[0067] In the embodiment of the present invention, the attribute function of the business data is obtained, and the format of the attribute function of the business data is converted according to a preset format; the attribute function of the business data in the preset format is parsed to obtain the parameters to be parsed using the dictionary; annotations are added to the parameters to be parsed using the dictionary according to the preset rules to obtain the annotation parameters, and multiple data sources are supported in the form of annotations, that is, cross-data source parsing, so that new associations do not need to be established with table data. Then, the target dictionary logic class corresponding to the annotation parameter is parsed to enable the dictionary data information to be quickly determined, thereby reducing code redundancy and improving the development efficiency of the application.
[0068] Based on the dictionary data processing method shown in the above embodiment of the present invention, in the process of executing step S102 to determine the target dictionary logical class corresponding to the annotation parameter based on the annotation parameter, the following steps are included:
[0069] Step S21: Based on the data source parameter in the annotation parameter, determine a target dictionary logic class corresponding to the data source parameter from a plurality of initial dictionary logic classes.
[0070] In the process of implementing step S21, the annotated aspect-oriented programming aop class dictionary aspect class DictAspect is defined to parse the annotation parameters that need to be returned and find the data source corresponding to ds; and according to the data source parameters, the reflection principle is used to obtain the target dictionary logic class corresponding to the data source parameters from multiple initial dictionary logic classes.
[0071] It should be noted that if you need to annotate to support multiple data sources, you need to configure the current application to also support multiple data sources. Each data source corresponds to a dictionary logic class DictService and implements the corresponding methods.
[0072] In the embodiment of the present invention, by annotating the parameters to be parsed using dictionary, multiple data sources, i.e., cross-data source parsing, are supported in the form of annotations, so that new associations do not need to be established with table data. Then, based on the data source parameters in the annotation parameters, a target dictionary logic class corresponding to the data source parameters is determined from multiple initial dictionary logic classes, and the annotation parameters are parsed using the target dictionary logic class through the target dictionary logic class corresponding to the annotation parameters, so that the dictionary data information can be quickly determined, thereby reducing code redundancy and improving application development efficiency.
[0073] In order to better understand the content of the dictionary data processing method shown in the above embodiment of the present invention, Figure 2 The application architecture of the dictionary data processing shown is used as an example, and the specific content is detailed in the following process.
[0074] For example: In education system A, you can query information about all schools and all students in city B.
[0075] The database of the education system A stores a data table biz_student for storing student information and a data table biz_school for storing school information. The data table biz_student for storing student information stores the corresponding schoolId.
[0076] Assume that when the page of education system A needs to load the information of all students named "Li San", the page in education system A needs to display the school information corresponding to the students.
[0077] It should be noted that the student information includes the student ID, student name, gender, ID card and school ID of all students in City B.
[0078] Execute the target method of the education system A programming interface api, take each interface as the cut point @pointcut, intercept and process the student information returned by the interface, that is, receive the parameters to be used for dictionary parsing in the student information to be loaded, that is, the object. Then obtain all the attribute functions and parent classes of the object, and convert them into student information in json format.
[0079] The attribute function of the student letter in json format is parsed, and the dictionary corresponding to the attribute function is parsed to determine the school schoolId in the student entity object StudentVO that needs to be annotated.
[0080] Next, based on the characteristics of annotations and the support of aspect-oriented programming (AOP) technology under the spring framework, a custom annotation is added to the field that needs to be parsed (schoolId), that is, the annotation content is dictTable = @Dict(ds = "master", "biz_school", dictCode = "id", dictText = "name", rfied Name = "schoolName"), and ds (master main data source), dictTable (school information data table biz_school), dictCode (school ID field in the dictTable school information table), dictText (the return field to be queried in the dictTable school information table, that is, the school name in the biz_school table), and rfiedName (alias of the school name schoolName) are obtained.
[0081] Then, define the annotated aspect-oriented programming aop class dictionary aspect class DictAspect to parse ds (master main data source), dictTable (school information data table biz_school), dictCode (school ID field in dictTable school information table), dictText (school name in biz_school table), rfiedName (alias of school name schoolName), and find the data source corresponding to ds; then use the reflection principle to obtain the target dictionary logic class MasterDictService corresponding to the data source parameters from multiple initial dictionary logic classes DictService1 and DictService2.
[0082] Among them, MasterDictService is the initial dictionary logic class DictService1.
[0083] Finally, the corresponding MasterDictService main dictionary logic layer method is called to parse ds (master main data source), dictTable (school information data table biz_school), dictCode (school ID field in dictTable school information table), dictText (school name in biz_school table), and rfiedName (alias of school name schoolName) to parse the annotation parameters into select${dictText}as${rfiedName}from${dictTable}where${dictCode}=#{key}limit 1 to obtain the corresponding school name schoolName, that is, the dictionary data information. In other words, the relevant business logic is processed through the method of the MasterDictService main dictionary logic layer.
[0084] Optional, the schoolName field can be
[0085] {
[0086] "student_number_id":"20210801001",
[0087] "name":"Li San",
[0088] "sex":"male",
[0089] "idcardidcard":"4306821xxxxxxxxx",
[0090] "schoolId":"211",
[0091] "schoolName":"The High School Affiliated to Peking University"},{
[0092] "student_number_id":"20210802002",
[0093] "name":"Li San",
[0094] "sex": "female",
[0095] "idcardidcard":"4306821xxxxxxxxx",
[0096] "schoolId":"985",
[0097] "SchoolNameschoolName":"The High School Affiliated to Tsinghua University"}].
[0098] In the embodiment of the present invention, by annotating the parameters to be parsed using the dictionary, multiple data sources, i.e., cross-data source parsing, are supported in the form of annotations, so that new associations do not need to be established with table data. Then, the annotated parameters are parsed by the target dictionary logic class corresponding to the annotated parameters, so that the dictionary data information can be quickly determined, thereby reducing code redundancy and improving application development efficiency.
[0099] Based on the dictionary data processing method shown in the above embodiment of the present invention, the embodiment of the present invention also discloses a dictionary data processing device. Figure 3 FIG. 1 is a schematic diagram of a structure of a dictionary data processing according to an embodiment of the present invention. The device includes:
[0100] The annotation adding unit 301 is used to add annotations to the parameters to be used for dictionary parsing in the business data when the page in the application system loads business data, so as to obtain annotation parameters, wherein the annotation parameters include data source parameters, data table parameters, data id parameters, return field parameters and return parameter name parameters.
[0101] The determining unit 302 is configured to determine, based on the annotation parameter, a target dictionary logical class corresponding to the annotation parameter.
[0102] The parsing unit 303 is used to parse the annotation parameters using the target dictionary logic class to determine dictionary data information.
[0103] It should be noted that the specific principles and execution processes of each unit in the dictionary data processing device disclosed in the above embodiment of the present invention are the same as the dictionary data processing method implemented in the above embodiment of the present invention. Please refer to the corresponding parts of the dictionary data processing method disclosed in the above embodiment of the present invention, and no further details will be given here.
[0104] In the embodiment of the present invention, by annotating the parameters to be parsed using the dictionary, multiple data sources, i.e., cross-data source parsing, are supported in the form of annotations, so that new associations do not need to be established with table data. Then, the annotated parameters are parsed by the target dictionary logic class corresponding to the annotated parameters, so that the dictionary data information can be quickly determined, thereby reducing code redundancy and improving application development efficiency.
[0105] Optionally, based on the dictionary data processing device shown in the above embodiment of the present invention, the annotation adding unit 301 includes:
[0106] The acquisition subunit is used to acquire the attribute function of the business data and perform format conversion on the attribute function of the business data according to a preset format.
[0107] The processing subunit is used to parse the attribute function of the business data in the preset format to obtain parameters to be parsed using the dictionary.
[0108] The annotation adding subunit is used to add annotations to the parameters to be parsed using the dictionary according to preset rules to obtain annotated parameters.
[0109] In the embodiment of the present invention, the attribute function of the business data is obtained, and the format of the attribute function of the business data is converted according to a preset format; the attribute function of the business data in the preset format is parsed to obtain the parameters to be parsed using the dictionary; annotations are added to the parameters to be parsed using the dictionary according to the preset rules to obtain the annotation parameters, and multiple data sources are supported in the form of annotations, that is, cross-data source parsing, so that new associations do not need to be established with table data. Then, the target dictionary logic class corresponding to the annotation parameter is parsed to enable the dictionary data information to be quickly determined, thereby reducing code redundancy and improving the development efficiency of the application.
[0110] Optionally, based on the dictionary data processing device shown in the above embodiment of the present invention, the determination unit 302 is specifically used to: determine, based on the data source parameter in the annotation parameter, a target dictionary logical class corresponding to the data source parameter from multiple initial dictionary logical classes.
[0111] In the embodiment of the present invention, by annotating the parameters to be parsed using dictionary, multiple data sources, i.e., cross-data source parsing, are supported in the form of annotations, so that new associations do not need to be established with table data. Then, based on the data source parameters in the annotation parameters, a target dictionary logic class corresponding to the data source parameters is determined from multiple initial dictionary logic classes, and the annotation parameters are parsed using the target dictionary logic class through the target dictionary logic class corresponding to the annotation parameters, so that the dictionary data information can be quickly determined, thereby reducing code redundancy and improving application development efficiency.
[0112] Optionally, the data processing device based on the dictionary shown in the above embodiment of the present invention is combined with Figure 3 , see Figure 4 , also includes:
[0113] The encapsulation unit 304 is used to encapsulate the return parameter name parameter in the annotation parameter and the dictionary item corresponding to the dictionary parameter, and display it on the page of the application system.
[0114] In the embodiment of the present invention, by annotating the parameters to be parsed using the dictionary, multiple data sources, i.e., cross-data source parsing, are supported in the form of annotations, so that new associations do not need to be established with table data. Then, the target dictionary logic class corresponding to the annotated parameter is used to parse it, so that the dictionary data information can be quickly determined, and then the obtained dictionary data information is encapsulated to be displayed to the user. This reduces code redundancy and improves application development efficiency.
[0115] The embodiment of the present invention also discloses an electronic device, which is used to run a database storage process, wherein the above-mentioned Figure 1 Public dictionary data processing methods.
[0116] The embodiment of the present invention also discloses a computer storage medium, wherein the storage medium includes a storage database storage process, wherein when the database storage process is running, the device where the storage medium is located is controlled to execute the above Figure 1 Public dictionary data processing methods.
[0117] In the context of the present disclosure, a computer storage medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0118] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0119] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0120] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data processing method for a dictionary, It is characterized in that The method comprises: When a page in an application system loads business data, annotations are added to the parameters to be parsed using the dictionary in the business data to obtain annotation parameters, wherein the annotation parameters include data source parameters, data table parameters, data id parameters, return field parameters, and return parameter name parameters; Based on the annotation parameters, the data source parameters in the annotation parameters are parsed, and the target dictionary logic class corresponding to the data source parameters is obtained by using the principle of reflection, and the target dictionary logic class corresponding to the annotation parameters is determined, and the target dictionary logic class is a method of the main dictionary logic layer; The target dictionary logic class is used to parse the annotation parameters to determine dictionary data information.
2. The method according to claim 1, It is characterized in that Annotations are added to the parameters to be parsed using the dictionary in the business data to obtain annotation parameters, including: Acquire the attribute function of the business data, and convert the format of the attribute function of the business data according to a preset format; Parsing the attribute function of the business data in the preset format to obtain parameters to be parsed using a dictionary; Annotations are added to the parameters to be parsed using the dictionary according to preset rules to obtain annotated parameters.
3. The method according to claim 1, It is characterized in that The determining, based on the annotation parameter, a target dictionary logic class corresponding to the annotation parameter comprises: Based on the data source parameter in the annotation parameter, a target dictionary logic class corresponding to the data source parameter is determined from a plurality of initial dictionary logic classes.
4. The method according to claim 1, It is characterized in that Also includes: The return parameter name parameter in the annotation parameter and the dictionary item corresponding to the dictionary parameter are encapsulated and displayed on the page of the application system.
5. A data processing device for a dictionary, It is characterized in that The device comprises: An annotation adding unit is used to add annotations to the parameters to be parsed using the dictionary in the business data when the page in the application system loads the business data, so as to obtain annotation parameters, wherein the annotation parameters include data source parameters, data table parameters, data id parameters, return field parameters and return parameter name parameters; A determination unit, configured to parse the data source parameter in the annotation parameter based on the annotation parameter, obtain the target dictionary logic class corresponding to the data source parameter by using the principle of reflection, and determine the target dictionary logic class corresponding to the annotation parameter, wherein the target dictionary logic class is a method of the main dictionary logic layer; The parsing unit is used to parse the annotation parameters using the target dictionary logic class to determine the dictionary data information.
6. The device according to claim 5, It is characterized in that The annotation adding unit comprises: An acquisition subunit, used for acquiring the attribute function of the business data, and performing format conversion on the attribute function of the business data according to a preset format; A processing subunit, used for parsing the attribute function of the business data in the preset format to obtain parameters to be parsed using a dictionary; The annotation adding subunit is used to add annotations to the parameters to be parsed using the dictionary according to preset rules to obtain annotated parameters.
7. The device according to claim 5, It is characterized in that The determining unit is specifically configured to determine, based on the data source parameter in the annotation parameter, a target dictionary logic class corresponding to the data source parameter from a plurality of initial dictionary logic classes.
8. The device according to claim 5, It is characterized in that Also includes: The encapsulation unit is used to encapsulate the return parameter name parameter in the annotation parameter and the dictionary item corresponding to the dictionary parameter, and display it on the page of the application system.
9. An electronic device, It is characterized in that The electronic device is used to run a program, wherein the program, when running, executes the dictionary data processing method as described in any one of claims 1 to 4.
10. A computer storage medium, It is characterized in that The storage medium includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the dictionary data processing method according to any one of claims 1 to 4.
