CN111767057B - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN111767057B
CN111767057B CN202010608563.4A CN202010608563A CN111767057B CN 111767057 B CN111767057 B CN 111767057B CN 202010608563 A CN202010608563 A CN 202010608563A CN 111767057 B CN111767057 B CN 111767057B
Authority
CN
China
Prior art keywords
information
attribute
data
entity data
metadata
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010608563.4A
Other languages
Chinese (zh)
Other versions
CN111767057A (en
Inventor
王建朝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong City Beijing Digital Technology Co Ltd
Original Assignee
Jingdong City Beijing Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong City Beijing Digital Technology Co Ltd filed Critical Jingdong City Beijing Digital Technology Co Ltd
Priority to CN202010608563.4A priority Critical patent/CN111767057B/en
Publication of CN111767057A publication Critical patent/CN111767057A/en
Application granted granted Critical
Publication of CN111767057B publication Critical patent/CN111767057B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Library & Information Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a data processing method and a device, wherein the method comprises the following steps: determining metadata to be displayed; acquiring annotation information in the metadata; analyzing the metadata according to the annotation information to obtain entity data; and generating form information for displaying the entity data according to the object type of the entity data. Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: the back end adds the normative annotation information on the model, so that the front end and back end verification rules can be used for unification, and the correctness of the service data of the system is improved; and corresponding form information can be conveniently generated, and reading and verification of entity data by front-end personnel are easier.

Description

Data processing method and device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data processing method and apparatus.
Background
In the development process of the Web application, front-end and back-end data interaction is an important basic stone of the Web application, and JSON is an important data format of interaction data.
In enterprise-level application development, there are a large number of look-up tables, functions of newly adding or re-editing, data format verification in the newly adding or re-editing functions, and so on. These functions typically require front-end and back-end developers to develop their own, back-end to query, add, modify logic, front-end to develop a query form, add, edit forms, and implement form verification logic. The front end and the back end interact through a JSON data format.
However, the prior art has the following problems:
When the data at the back end is queried, the specific meaning cannot be visually represented due to the data structure obtained by query, and the data can be read easily only by mapping and converting partial data fields, so that the steps are complicated and the efficiency is low when the front-end personnel check the data.
Aiming at a plurality of technical problems existing in the related art, no effective solution is provided at present.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a data processing method and apparatus.
In a first aspect, an embodiment of the present application provides a data processing method, including:
Determining metadata to be displayed;
Acquiring annotation information in the metadata;
analyzing the metadata according to the annotation information to obtain entity data;
and generating form information for displaying the entity data according to the object type of the entity data.
Optionally, in the foregoing data processing method, the generating form information for displaying the entity data according to an object type of the entity data includes:
Analyzing the entity data to obtain key value pair information included in the entity data;
Determining the attribute type of the key value pair information;
obtaining a table corresponding to the object type according to a preset corresponding rule;
and analyzing the key value pair information according to the attribute type, and writing the analyzed key value pair information into the table to obtain the form information.
Optionally, the data processing method as described above further includes:
determining the number of entity data;
When the number of the entity data is within the preset number, mapping the entity name of the entity data into a drop-down query component to be configured to obtain a target drop-down query component;
When the number of the entity data exceeds the preset number, matching and retrieving the corresponding input query components to perform data query in the form information through the input information in the input query components.
Optionally, in the foregoing data processing method, the analyzing the key pair information according to the attribute type and writing the analyzed key pair information into the table to obtain the form information includes:
Determining attribute name information corresponding to key names in the key value pair information;
Analyzing each key value of the key value pair information according to the attribute name information to obtain description information corresponding to each key value;
and writing the attribute name information and the description information corresponding to each key value into the table to obtain the form information.
Optionally, in the foregoing data processing method, the analyzing the metadata according to the annotation information to obtain the entity data includes:
Determining field information corresponding to the annotation information; the metadata includes at least one of the field information;
determining field rule information of the field information according to the annotation information;
and when the attribute value of the field information passes through the verification of the field rule information, analyzing the metadata to obtain the entity data.
Optionally, in the foregoing data processing method, the obtaining a table corresponding to the attribute type according to a preset corresponding rule includes:
Inquiring in a preset table library to obtain the table component corresponding to the object type; a first corresponding relation between different storage positions of the table components and attribute types is pre-established in the table library;
Receiving a configuration instruction for configuring a candidate attribute display column of the form component;
determining target attribute display columns needing to be displayed at the front end in the table component and arrangement sequences among the target attribute display columns according to the configuration instruction;
And obtaining the table according to the target attribute display column and the arrangement order.
Optionally, the data processing method as described above further includes:
Receiving interface configuration information for configuring a form interface;
Configuring the table in a first position according to the interface configuration information;
And configuring the target drop-down query component or the input query component in a second position according to the interface configuration information.
In a second aspect, an embodiment of the present application provides a data processing apparatus, including:
the determining module is used for determining metadata to be displayed;
the acquisition module is used for acquiring annotation information in the metadata;
the analysis module is used for analyzing the metadata according to the annotation information to obtain entity data;
And the generation module is used for generating form information for displaying the entity data according to the object type of the entity data.
In a third aspect, an embodiment of the present application provides an electronic device, including: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
The memory is used for storing a computer program;
the processor is configured to implement a processing method according to any one of the preceding claims when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform the processing method according to any one of the preceding claims.
The embodiment of the application provides a data processing method and device, wherein the method comprises the following steps: determining metadata to be displayed; acquiring annotation information in the metadata; analyzing the metadata according to the annotation information to obtain entity data; and generating form information for displaying the entity data according to the object type of the entity data. Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: the back end adds the normative annotation information on the model, so that the front end and back end verification rules can be used for unification, and the correctness of the service data of the system is improved; and corresponding form information can be conveniently generated, and reading and verification of entity data by front-end personnel are easier.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart of a data processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of a data processing method according to another embodiment of the present application;
FIG. 3 is a flowchart of a data processing method according to another embodiment of the present application;
FIG. 4 is a flowchart of a data processing method according to another embodiment of the present application;
FIG. 5 is a flowchart of a data processing method according to another embodiment of the present application;
FIG. 6 is a block diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
Fig. 8 is a schematic diagram of a system architecture according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Under the condition that front and back ends of enterprise application are separated, JSON data is a main interaction means in schedule development. Enterprise-level applications increasingly use front-end and back-end separation modes to achieve decoupling of system architecture, and developers are also concentrating on individual application technologies, enabling professionals to do professionals.
Fig. 1 is a diagram of a data processing method according to an embodiment of the present application, including steps S1 to S4 as follows:
and S1, determining metadata to be displayed.
Specifically, when the metadata of the back end is JSON (JavaScript Object Notation, JS object numbered musical notation) format data, the metadata corresponding to the attribute name can be obtained by querying the attribute name of the entity data selected by the front end at the back end.
One alternative implementation is: custom adding a nameProperty attribute for representing attribute name (nameProperty attribute value) of name attribute of data model, generally nameProperty attribute values corresponding to different entities are different from each other, so as to locate back-end specific metadata; and, when an entity is referenced at the front end, the entity may be represented by displaying a name attribute.
JSON is a lightweight data exchange format. It stores and presents data in a text format that is completely independent of the programming language, based on a subset of ECMAScript (JS specification formulated by the european computer institute). The compact and clear hierarchical structure makes JSON an ideal data exchange language.
S2, annotation information in the metadata is obtained.
Specifically, when some attribute types are obtained by self-definition, the front-end personnel cannot accurately obtain the correct data format (such as character length and the like) or attribute type (such as string, number and the like) of the attribute without writing and analyzing the attribute by adopting the same rule.
One alternative implementation is: the annotation information may be field rule information for defining a type of a certain attribute, and the front end and the back end adopt the same rule, so that the front end can parse metadata according to the annotation information.
And S3, analyzing the metadata according to the annotation information to obtain entity data.
Specifically, parsing the metadata according to the annotation information may include: and verifying the format of the metadata according to the annotation information or analyzing the attribute value of the metadata according to the annotation information to obtain a specific meaning.
Wherein the entity is: the individual of each class of data objects is referred to as an entity. The entity data includes field information of a plurality of different attributes, for example, when an entity a exists, the attributes that the entity a may include may be: creation time, product number, service type, product name, modification time, etc. Therefore, the metadata before parsing also includes field information of the above attributes, and each field information corresponding to the attribute may have annotation information corresponding to the attribute, so as to accurately parse each field information.
One alternative implementation is: generating a JSON Schema corresponding to the metadata; and analyzing and expanding the content of the annotation information into the JSON Schema in the JSON Schema generation process for the front end to use. The front end determines corresponding field rule information according to the annotation information in JSON Schame, and generates a corresponding verifier to realize front end automatic data verification. The back end can also use SPRING VALIDATE to realize the rule check of the data model, thereby achieving the unification of the front end check and the back end check.
The JSON Schema can be used to perform validation of JSON data formats; JSON mode (application/mode + JSON) has multiple uses, one of which is instance authentication. The authentication process may be interactive or non-interactive. For example, an application may use JSON mode to build a user interface to cause interactive content to generate data acquired in addition to user input to check or verify various sources.
And S4, generating form information for displaying the entity data according to the object type of the entity data.
Specifically, the entity data of different object types may include different attributes, for example: when the object type is a vehicle, then the included attributes may include: delivery date, sales date, license plate number, brand information, etc.; when the object type is employee information, then the included attributes may include: name, age, gender, time of job entry, etc. And if the object types of the two entity data are employee information, the included attributes may be the same.
Alternatively, in the form information, different attributes and their corresponding attribute values may be displayed through different columns, and in addition, different attributes and their corresponding attribute values may be displayed through different rows.
Therefore, the attribute differences included by different object types are large, so the form differences are also large, and accordingly, different forms can be acquired according to the object types of different entity data, and further different form information can be obtained.
As shown in fig. 2, in some embodiments, the step S4 generates form information for displaying the entity data according to the object type of the entity data, as in the foregoing data processing method, including the following steps S41 to S44:
and S41, analyzing the entity data to obtain key value pair information included in the entity data.
Specifically, taking the entity data as JSON Schema as an example: the field information corresponding to each attribute in the entity data is characterized by a key-value pair (i.e. key-value), so that the analysis of the entity data can be to obtain the key-value pair information corresponding to each attribute.
S42, determining the attribute type of the key value pair information.
Specifically, the attribute type of the key value pair information may be that according to different steps s43, according to a preset corresponding rule, a table corresponding to the object type is obtained;
Optionally, according to a preset corresponding rule, obtaining a table corresponding to the attribute type includes:
inquiring in a preset table library to obtain a table component corresponding to the object type; the first corresponding relation between different storage positions of the table components and attribute types is pre-established in the table library.
Specifically, mapping relations between different tables and object types can be established in the table library; after determining the object type, the storage location information of the corresponding table is queried, and then the corresponding table is called out from the storage location information.
Receiving a configuration instruction for configuring a candidate attribute display column of a table component;
Specifically, the table component comprises a plurality of candidate attribute display columns, and each candidate attribute display column is used for displaying the key value pair information of the specific attribute; the configuration instruction may be used to select a specific display column from all candidate attribute display columns, so that only information of a specific attribute is displayed when the display column is called from the back end, and in addition, the position and the like of each display column may be configured by the configuration instruction.
And determining target attribute display columns required to be displayed at the front end in the table component and the arrangement order among the target attribute display columns according to the configuration instruction.
Specifically, the target attribute display column is a display column which is screened from candidate attribute display columns and is required to be displayed at the front end, wherein the requirements of configuration instructions are met; the arrangement order is the arrangement order of each target attribute display column.
And obtaining the table according to the target attribute display column and the arrangement order.
For example, when the table component includes the attribute presentation column of the attribute A, B, C, D, E, F, G, and the attribute presentation column corresponding to the attribute A, B, C, D is selected by the configuration instruction and the arrangement order is A, D, B, C, the table is shown in table 1:
TABLE 1
Attributes of A D B C
Attribute value
After the table is obtained, the key value pair information in the entity data can be deleted according to the table, and only the key value pair information corresponding to the attribute selected in the configuration instruction is displayed in the corresponding attribute display column.
By using the technical scheme, the front-end form can be automatically matched according to the field types of the back-end data model to obtain the corresponding front-end assembly, and meanwhile, the front-end assembly can be configured again according to the configuration information, so that the usability is improved.
And S44, analyzing the key value pair information according to the attribute type, and writing the analyzed key value pair information into a table to obtain the form information.
Specifically, the parsing of the information by the key value according to the attribute type may be: each key value pair information has a corresponding parsing method, for example: when the key value pair information is dictionary or enumeration type, each value needs to be analyzed according to a consistent description mode and then written into a table, and when the key value pair information is bootean type, the key value needs to be described according to the key name information, but the key value pair information cannot be simply "true" or "false".
In general, the information after the key name and the attribute value in the key value pair information are analyzed needs to be correspondingly displayed in the table.
And analyzing the key value pair information according to the attribute type, and writing the analyzed data into a table to obtain the form information.
As shown in fig. 3, in some embodiments, the data processing method as described above further includes steps S5 to S7 as follows:
s5, determining the number of entity data.
Specifically, since the individual of each type of data object is called an entity, the number of entity data is the number of entities. Since no specific entity exists in the metadata, the metadata may be identified by specific attribute information to characterize that it corresponds to one entity.
One alternative implementation is: the attribute Name of a certain field in the metadata is Name or the Name of the annotation is marked to be used for representing that the field corresponds to the Name of the entity, so that the number of the entity data can be obtained according to the attribute Name of the Name or the number of the marked annotation.
And S6, mapping the entity name of the entity data into the drop-down query component to be configured when the number of the entity data is within the preset number, so as to obtain the target drop-down query component.
Specifically, the preset number of settings can be selected according to actual use situations, and the to-be-configured drop-down query component can display names of entities at the rear end through a drop-down frame so that a front end user can select the entities needing to be displayed from the names.
Furthermore, the implementation manner of mapping the entity name of the entity data into the drop-down query component to be configured may be: the drop down query component is to be configured to retrieve an entity name from a query key (e.g., name in the previous embodiment), and a specific data storage address may be retrieved and associated with the entity name displayed in the front end drop down component.
And S7, when the number of the entity data exceeds the preset number, matching and retrieving to obtain a corresponding input query component so as to query the data in the form information through the input information in the input query component.
Specifically, when the number of entity data exceeds the preset number, if the entity data still passes the pull-down query, the pull-down information is excessive, and the query is inconvenient. The input query component may be a component that matches corresponding entity data at the back end according to information input at the front end, where an alternative implementation may be: after the text is input in the input query component, i.e. the input text is matched with the entity data of the corresponding entity name at the rear end, optionally, all entity names including the input text in all entity names can be displayed, further, each entity name can be displayed in a form of a drop-down box, and after one entity name is selected, the corresponding entity data can be called to the front end.
In summary, by adopting the method in the embodiment, the query component can be selected in a self-adaptive manner, so as to obtain the best query effect and improve the query efficiency of the front-end personnel.
As shown in fig. 4, in some embodiments, as in the foregoing data processing method, step S44 parses the key pair information according to the attribute type and then writes the parsed key pair information into a table to obtain form information, including steps S441 to S443 as follows:
Specifically, when the back end writes the source code, only the attribute value is ensured to be correct and accord with the preset rule, and the legibility of the attribute value is not considered. Because the personnel performing data verification at the front end and the personnel writing the back end source code are often not the same, and the personnel at the front end do not necessarily know the related technology clearly enough, the readability of the data often greatly influences the verification efficiency of the front end personnel when performing data verification.
Step S441, determining attribute name information corresponding to the key name in the key value pair information.
In this embodiment, by determining attribute name information corresponding to a key name, the attribute name information may be obtained by obtaining a key value.
And S442, analyzing each key value of the key value pair information according to the attribute name information to obtain the description information corresponding to each key value.
Specifically, the key value is a value, and the analysis of the key value according to the attribute name information can be characterized by literal meaning of the key value according to the attribute name information, so as to obtain the description information of the corresponding amount; for example, when the key name is complete, in the back-end metadata, it is generally only characterized by 1, 0 as the value; by adopting the method in this embodiment, the resolving of the key value by the attribute name information may be resolving "1" to "complete" and resolving "0" to "incomplete", and the resolving method may be performed according to a preset corresponding rule.
And S443, writing the attribute name information and the description information corresponding to each key value into a table to obtain form information.
Specifically, the attribute name information and the description information corresponding to the same field are generally written into the same row or the same column, and further, the attribute name information is generally set in the start grid of the same row or the same column.
When the method is applied to the fields of enumeration types in the analysis data model in the JSON Schema generation process, the enumeration type members and description can be expanded into the JSON Schema by the method in the embodiment, so that the unification of front-end and back-end enumeration types is realized. The dictionary type is similar.
In summary, by the method in this embodiment, the information of each field may be analyzed in detail, so as to obtain a detailed and clear result, which is easier for the front-end personnel to verify, and has better readability.
As shown in fig. 5, in some embodiments, as the aforementioned data processing method, step S3 parses the metadata according to the annotation information to obtain entity data, including steps S31 to S33 as follows:
S31, determining field information corresponding to annotation information; the metadata includes at least one field information.
Specifically, the field information is information in metadata for characterizing a certain attribute and its attribute value; and generally, the metadata includes a plurality of field information, and when the metadata is in JSON data format, each field information has key-value pair information (i.e., key-value) corresponding to each field information after parsing into JSON Schema.
S32, determining field rule information of the field information according to the annotation information.
Specifically, the field rule information is consistent with the data format defined in the annotation information; one alternative implementation may be: and verifying the annotation information through a preset corresponding relation to judge whether the field information meets the requirement of a preset rule, and meanwhile, when the back-end personnel annotates the field information through the annotation information, the annotation information corresponding to the data format of the field information is generally selected for annotation, but the situation of wrong selection is not excluded.
The field rule information may be, for example, a condition that defines a character such as "string", "number", or a condition that defines a character length, for example: when the field information is age, its corresponding characters are not more than 3 at most, generally less than 150, and must be an integer.
And S33, analyzing the metadata to obtain entity data when the attribute value of the field information passes through the verification of the field rule information.
Specifically, in the verification, after the field rule information is obtained, the attribute value may be verified by the rule included in the field rule information, for example, on the basis of the example illustrated in step S32, when the attribute of a certain field information is still the age and the attribute value is 288; although the attribute value satisfies the requirement that the attribute value is not more than 3 characters and is an integer, if the value is more than 150, it can be determined that the attribute value is obviously erroneous, and thus the verification is not passed. Otherwise, when the attribute value is 51, all the requirements are met, the verification is passed, and the corresponding entity data can be obtained through analysis.
One of the alternative implementation manners may be to parse and extend the content of each annotation information into the JSON Schema in the JSON Schema generation process for use by the front end. And the front end generates a corresponding verifier according to the field rule information in JSON Schame, so as to realize the automatic data verification of the front end. And the back-end mode uses SPRING VALIDATE to realize the rule check of the data model, so that the front-end check and the back-end check are unified.
In some embodiments, the data processing method as described above further includes steps T1 to T3 as follows:
And step T1, receiving interface configuration information for configuring the form interface.
Specifically, interface configuration information can be received through a preset man-machine interaction interface. The interface configuration information may be information for configuring a table in which entity data is presented. The interface configuration information may include information defining display positions of different tables, information for splitting and displaying the same table, and the like.
And step T2, configuring the table in the first position according to the interface configuration information.
Specifically, the first location may be coordinate information in the table interface, and the first location is defined in the interface configuration information.
Optionally, the interface configuration information may further include an upper threshold of the number of maximum displays in the same row or the same column, and when the upper threshold of the number is exceeded, the table is split, so that the number of data bars in each row or each column is smaller than or equal to the upper threshold of the number. And is easier to review.
And step T3, configuring the target drop-down query component or the input query component in the second position according to the interface configuration information.
Specifically, since only one of the target pull-down query component and the input query component is generally set, the position of one of the target pull-down query component and the input query component is configured according to the interface configuration information. The second location may be coordinate information in a form interface and the second location is defined by interface configuration information.
In addition, the interface configuration information can also set the width and the height of each grid in the table, and the size of the target pull-down query component or the input query component; a form and a color of the target drop down query component or the input query component, a size of a character therein.
Therefore, by the method in the embodiment, the interface can be configured, so that typesetting is easier to read, and the readability is further improved.
As shown in fig. 6, according to an embodiment of another aspect of the present application, there is also provided a data processing apparatus including:
a determining module 1, configured to determine metadata to be presented;
An obtaining module 2, configured to obtain annotation information in the metadata;
The analysis module 3 is used for analyzing the metadata according to the annotation information to obtain entity data;
and the generation module 4 is used for generating form information for displaying the entity data according to the object type of the entity data.
Alternatively, the system architecture shown in fig. 8 is a specific implementation of the apparatus in this embodiment. The solution implemented in the development architecture corresponds to the method steps in the foregoing embodiments, and will not be described herein again. Wherein the front end in the technical architecture may include: view layer, component layer, communication/service layer and base layer; the back end may include: a Rest layer, a control layer, a service layer, a model layer, an ORM layer (Object Relational Mapping, object-relationship mapping), and a base layer. The ORM is an automatic persistence of objects in an object oriented language program into a relational database by using metadata describing the mapping between the objects and the database.
The meta-model in fig. 8 corresponds to development logic for implementing the method of the above embodiment, where the relevant development logic for implementing the interaction between the model layer and the ORM layer is:
the model layer is used for defining a back-end entity model, and the entity model is a Java Bean with special notes;
Alternatively, this solid model (Currency) can be identified by @ Entity as needing persistence; for example, one of the Entity models identified by @ Entity is as follows:
While defining a corresponding relationship with the entity:
public interface CurrencyRepository extends EnversRepository
<Currency>{}
Thus, the framework can automatically generate the database table corresponding to the entity based on SPRING DATA Jpa (which is a set of JPA application framework packaged based on the ORM framework and the JPA specification by Spring, so that a developer can realize the access and operation of data by using extremely simple codes).
Thus, after the generation of the metadata of the database (existing in the database table) is completed, currencyRepository can be directly used for performing the operations of adding, deleting and modifying the database.
In AuditableEntity (a basic entity class), the framework encapsulates attribute information such as creator, creation time, modifier, modification time, and the like, and through AuditingEntityListener provided in SPRING DATA Jpa, creator and modifier information of database data can be conveniently recorded, so that an audit function of the data is supported.
In addition, the system does not allow the data to be deleted physically in the actual service, so that the integrity of the system data is ensured. For this requirement support for @ SoftDelete (logical delete) annotations is added to the framework. The annotation is used to identify that the entity is not physically deletable, so that when the delete method in the restore is called, the framework bottom layer modifies deleted values in entity data to true, and converts the original DELETE SQL statement into an update sql statement, thereby realizing logical deletion of the data.
According to another embodiment of the present application, there is also provided an electronic apparatus including: as shown in fig. 7, the electronic device may include: the device comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 are in communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to execute the program stored in the memory 1503, thereby implementing the steps of the method embodiment described above.
The bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a Digital signal processor (Digital SignalProcessing, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The embodiment of the application also provides a non-transitory computer readable storage medium, which stores computer instructions that cause a computer to execute the steps of the method embodiment.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A method of data processing, comprising:
Determining metadata to be displayed;
Acquiring annotation information in the metadata, wherein the annotation information is field rule information used for limiting the attribute type of the metadata;
analyzing the metadata according to the annotation information to obtain entity data;
generating form information for displaying the entity data according to the object type of the entity data, wherein the form information comprises the following steps: analyzing the entity data to obtain key value pair information included in the entity data; determining the attribute type of the key value pair information; obtaining a table corresponding to the object type according to a preset corresponding rule; and analyzing the key value pair information according to the attribute type, and writing the analyzed key value pair information into the table to obtain the form information.
2. The data processing method according to claim 1, characterized by further comprising:
determining the number of entity data;
When the number of the entity data is within the preset number, mapping the entity name of the entity data into a drop-down query component to be configured to obtain a target drop-down query component;
When the number of the entity data exceeds the preset number, matching and retrieving the corresponding input query components to perform data query in the form information through the input information in the input query components.
3. The data processing method according to claim 1, wherein the step of parsing the key pair information according to the attribute type and writing the parsed key pair information into the table to obtain the form information includes:
Determining attribute name information corresponding to key names in the key value pair information;
Analyzing each key value of the key value pair information according to the attribute name information to obtain description information corresponding to each key value;
and writing the attribute name information and the description information corresponding to each key value into the table to obtain the form information.
4. The method of claim 1, wherein parsing the metadata according to the annotation information to obtain entity data comprises:
Determining field information corresponding to the annotation information; the metadata includes at least one of the field information;
determining field rule information of the field information according to the annotation information;
and when the attribute value of the field information passes through the verification of the field rule information, analyzing the metadata to obtain the entity data.
5. The method for processing data according to claim 1, wherein the obtaining a table corresponding to the attribute type according to a preset correspondence rule includes:
inquiring in a preset table library to obtain a table component corresponding to the object type; a first corresponding relation between different storage positions of the table components and attribute types is pre-established in the table library;
Receiving a configuration instruction for configuring a candidate attribute display column of the form component;
determining target attribute display columns needing to be displayed at the front end in the table component and arrangement sequences among the target attribute display columns according to the configuration instruction;
And obtaining the table according to the target attribute display column and the arrangement order.
6. The data processing method according to claim 2, characterized by further comprising:
Receiving interface configuration information for configuring a form interface;
Configuring the table in a first position according to the interface configuration information;
And configuring the target drop-down query component or the input query component in a second position according to the interface configuration information.
7. A data processing apparatus, comprising:
the determining module is used for determining metadata to be displayed;
the acquisition module is used for acquiring annotation information in the metadata, wherein the annotation information is field rule information used for limiting the attribute type of the metadata;
the analysis module is used for analyzing the metadata according to the annotation information to obtain entity data;
The generating module is used for generating form information for displaying the entity data according to the object type of the entity data, and comprises the following steps: analyzing the entity data to obtain key value pair information included in the entity data; determining the attribute type of the key value pair information; obtaining a table corresponding to the object type according to a preset corresponding rule; and analyzing the key value pair information according to the attribute type, and writing the analyzed key value pair information into the table to obtain the form information.
8. An electronic device, comprising: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
The memory is used for storing a computer program;
the processor being adapted to implement the processing method of any of claims 1-6 when executing the computer program.
9. A non-transitory computer readable storage medium storing computer instructions that cause the computer to perform the processing method of any of claims 1-6.
CN202010608563.4A 2020-06-29 2020-06-29 Data processing method and device Active CN111767057B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010608563.4A CN111767057B (en) 2020-06-29 2020-06-29 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010608563.4A CN111767057B (en) 2020-06-29 2020-06-29 Data processing method and device

Publications (2)

Publication Number Publication Date
CN111767057A CN111767057A (en) 2020-10-13
CN111767057B true CN111767057B (en) 2024-05-17

Family

ID=72724115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010608563.4A Active CN111767057B (en) 2020-06-29 2020-06-29 Data processing method and device

Country Status (1)

Country Link
CN (1) CN111767057B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112507067B (en) * 2020-11-30 2022-08-23 厦门海西医药交易中心有限公司 Cache plug-in annotating device and annotation method
CN113032393B (en) * 2021-01-26 2024-01-02 苏州帝博信息技术有限公司 Method and device for binding associated objects
CN113051355B (en) * 2021-04-16 2023-07-18 小芒电子商务有限责任公司 Document generation method and device, computer equipment and storage medium
CN113342782B (en) * 2021-06-29 2023-03-24 山东旗帜信息有限公司 Data monitoring method, device and medium based on expressway
CN113608895B (en) * 2021-08-06 2024-04-09 湖南快乐阳光互动娱乐传媒有限公司 Web back-end data access method and system
CN113704269B (en) * 2021-09-02 2024-04-16 京东城市(北京)数字科技有限公司 Data processing method, system, storage medium and electronic equipment
CN113835692A (en) * 2021-09-27 2021-12-24 湖南快乐阳光互动娱乐传媒有限公司 Dictionary data processing method and device, electronic equipment and computer storage medium
CN114661407B (en) * 2022-05-20 2022-08-23 浙江简捷物联科技有限公司 Interface configuration method, BMS and storage medium
CN115589440B (en) * 2022-12-12 2023-03-21 北京沐融信息科技股份有限公司 Message annotation configuration method, packet packing method and parsing method
CN116467975B (en) * 2023-06-16 2023-09-26 英诺达(成都)电子科技有限公司 Data processing method, device, electronic equipment and storage medium
CN116612865B (en) * 2023-07-17 2023-10-20 神州医疗科技股份有限公司 Image labeling method and system supporting all-disease labeling

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8458201B2 (en) * 2005-04-08 2013-06-04 International Business Machines Corporation Method and apparatus for mapping structured query language schema to application specific business objects in an integrated application environment
US9495347B2 (en) * 2013-07-16 2016-11-15 Recommind, Inc. Systems and methods for extracting table information from documents
US10169316B2 (en) * 2016-05-25 2019-01-01 International Business Machines Corporation Method and system to convert document source data to XML via annotation

Also Published As

Publication number Publication date
CN111767057A (en) 2020-10-13

Similar Documents

Publication Publication Date Title
CN111767057B (en) Data processing method and device
KR102330547B1 (en) Building reports
US8615526B2 (en) Markup language based query and file generation
US10127264B1 (en) Techniques for automated data analysis
CN110795524B (en) Main data mapping processing method and device, computer equipment and storage medium
US9910870B2 (en) System and method for creating data models from complex raw log files
US9411803B2 (en) Responding to natural language queries
US20120266131A1 (en) Automatic program generation device, method, and computer program
US10380011B2 (en) Method, apparatus, and computer-readable medium for performing functional testing of software
CN110837471B (en) Test method, test device, server and storage medium
CN111159016A (en) Standard detection method and device
CN114090671A (en) Data import method and device, electronic equipment and storage medium
WO2016131360A1 (en) Widget file generation method and apparatus
CN107203525B (en) Database processing method and device
US10241899B2 (en) Test input information search device and method
CN101727451A (en) Method and device for extracting information
CN114968348A (en) Data analysis method and device, electronic equipment and storage medium
JP2020502687A (en) System and method for identifying references in patent claims
JP2001256043A (en) Correction history managing method and correction history management system of program source
CN111159205A (en) Data processing method and system
JP4387324B2 (en) Property conversion device
JP2020101898A (en) Design drawing creation support method, design drawing creation support device, and design drawing creation support program
JP6361472B2 (en) Correspondence information generation program, correspondence information generation apparatus, and correspondence information generation method
CN117555955B (en) Data conversion method, data conversion device, computer device, and storage medium
CN111240970B (en) Test case generation method and device

Legal Events

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