CN-116975080-B - Data batch change processing method, device, equipment and storage medium
Abstract
The application discloses a data batch change processing method, device, equipment and storage medium, and belongs to the technical field of big data and the field of health care. The application firstly creates a database configuration table, then acquires change data, determines class objects in the change data, acquires attribute information of the class objects based on class object reflection, encapsulates the class objects into entity classes based on the attribute information, stores the entity classes into a key value pair format based on the database configuration table, generates change records, stores the change records into a change detail table, determines change records I D of the query object when the change data is required to be queried, encapsulates the change records I D into the key value pair format, and queries data change information in the change detail table based on the change records I D. In addition, the application also relates to the technical field of block chains, and the changed data is stored in a block chain network.
Inventors
- GAO XIANGMENG
Assignees
- 平安科技(深圳)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230809
Claims (10)
- 1. The data batch change processing method is characterized by comprising the following steps of: creating a database configuration table, wherein the database configuration table comprises a class basic information table, a class attribute relation table and an attribute enumeration value table, the class basic information table is used for recording class names and class paths of each service class, each service class corresponds to one class basic information table, the class attribute relation table is used for recording attributes owned by each class, and the attribute enumeration table is used for recording enumeration value fields owned by each attribute; receiving a data change instruction, obtaining change data, and determining a class object corresponding to a service class in the change data; Acquiring attribute information of a class object based on class object reflection, and packaging the class object into an entity class based on the attribute information; Storing the entity class as a key value pair format based on the database configuration table, generating a change record, and storing the change record into a change detail table; receiving a data query instruction, acquiring a query object carried by the data query instruction, and determining a change record ID of the query object in the change detail table; And packaging the change record ID into a key value pair format, and inquiring the data change information of the inquired object in the change detail table based on the packaged change record ID.
- 2. The method for batch modification processing of data according to claim 1, wherein the steps of receiving a data modification instruction, obtaining modification data, and determining a class object corresponding to a service class in the modification data include: Receiving a data change instruction, and acquiring change data based on the data change instruction; Analyzing the change data to obtain the table name, the field name and the data format of the change data; And determining the service class in the change data based on the table name, the field name and the data format of the change data, and acquiring a class object corresponding to the service class.
- 3. The method for batch modification processing of data according to claim 1, wherein obtaining attribute information of the class object based on class object reflection and packaging the class object into an entity class based on the attribute information, specifically comprises: Acquiring attribute information of the Class object based on a method in a preset Class; Creating an entity class object, and configuring attribute values of the entity class object based on attribute information of the class object; and obtaining the entity class object of which the attribute value configuration is completed, and obtaining the entity class.
- 4. The method for batch modification processing of data according to claim 3, wherein creating the entity class object configures an attribute value of the entity class object based on attribute information of the class object, specifically comprising: Traversing the attribute information of the class object, and acquiring a custom annotation, a configuration attribute value and a configuration enumeration value from the attribute information of the class object; Creating the entity class object based on the custom annotation, the configuration attribute value, and the configuration enumeration value; and configuring the attribute value of the entity class object based on the attribute information of the class object to obtain the entity class.
- 5. The method for batch modification processing of data according to claim 4, wherein the creating the entity class object based on the custom annotation, the configuration attribute value and the configuration enumeration value specifically comprises: creating a tool class, and importing the custom annotation, the configuration attribute value and the configuration enumeration value into the tool class; Invoking a create method of the tool class to create the entity class object based on the custom annotation, the configuration attribute value, and the configuration enumeration value.
- 6. The method for batch modification processing of data according to any one of claims 1 to 5, wherein the key pair format is a Map format, the storing the entity class as the key pair format based on the database configuration table, generating a modification record, and storing the modification record in a modification detail table, specifically includes: Storing the entity class into Map format; determining a storage path, a storage position and a storage mode of the entity class based on the database configuration table; Storing the entity class into a preset modelMap data memory based on the storage path, the storage position and the storage mode; And acquiring a change record generated when the entity class is stored, and storing the change record into a change detail table.
- 7. The method for batch modification of data according to claim 6, wherein the modification record ID is packaged in a key-value pair format, and the data modification information of the query object is queried in the modification list based on the packaged modification record ID, and specifically comprising: packaging the change record ID into a Map format; In the change detail table, inquiring an entity class corresponding to the inquiring object based on the change record ID in the Map format; And determining a change record associated with the entity class corresponding to the query object to obtain the data change information of the query object.
- 8. A data batch change processing apparatus, comprising: The configuration table creating module is used for creating a database configuration table, wherein the database configuration table comprises a class basic information table, a class attribute relation table and an attribute enumeration value table, the class basic information table is used for recording class names and class paths of each service class, each service class corresponds to one class basic information table, the class attribute relation table is used for recording attributes owned by each class, and the attribute enumeration table is used for recording enumeration value fields owned by each attribute; The class object determining module is used for receiving a data changing instruction, obtaining changing data and determining a class object corresponding to a service class in the changing data; The entity class packaging module is used for obtaining attribute information of the class object based on class object reflection and packaging the class object into an entity class based on the attribute information; the entity class storage module is used for storing the entity class as a key value pair format based on the database configuration table, generating a change record and storing the change record into a change detail table; The query object determining module is used for receiving a data query instruction, acquiring a query object carried by the data query instruction and determining a change record ID of the query object in the change detail table; and the data change inquiring module is used for packaging the change record ID into a key value pair format and inquiring the data change information of the inquired object in the change detail table based on the packaged change record ID.
- 9. A computer device comprising a memory and a processor, the memory has stored therein computer readable instructions, the processor, when executing the computer-readable instructions, implements the steps of the data batch change processing method of any one of claims 1 to 7.
- 10. A computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the data batch change processing method of any one of claims 1 to 7.
Description
Data batch change processing method, device, equipment and storage medium Technical Field The application belongs to the technical field of big data and the field of health care, and particularly relates to a data batch change processing method, device and equipment and a storage medium. Background The health risk healthcare resource platform maintains a large amount of hospital information, and save and submit operations need to record new and old values for each edited field. However, the conventional comparison method at present has some problems including redundant codes and inconvenient page field expansion, and the conventional comparison method may lead to a large amount of repeated comparison codes because each field needs to write comparison logic, so that the redundant codes increase the development workload and the complexity of maintenance and test. The current comparison mode is inconvenient for the page to carry out field expansion, if new fields are required to be added or existing fields are required to be modified, a large number of comparison logic codes are required to be modified and adjusted, and the tight coupling relation makes the system inflexible, so that the difficulty and risk of subsequent expansion are increased. Disclosure of Invention The embodiment of the application aims to provide a data batch change processing method, a device, computer equipment and a storage medium, which are used for solving the technical problems of difficult expansion of redundant codes and fields when the data batch change processing is carried out by the existing health risk and medical care resource platform. In order to solve the above technical problems, the embodiment of the present application provides a data batch change processing method, which adopts the following technical scheme: a data batch change processing method comprises the following steps: creating a database configuration table, wherein the database configuration table comprises a class basic information table, a class attribute relation table and an attribute enumeration value table; Receiving a data change instruction, acquiring change data, and determining a class object corresponding to a service class in the change data; Acquiring attribute information of the class object based on the class object reflection, and packaging the class object into an entity class based on the attribute information; Storing the entity class as a key value pair format based on a database configuration table, generating a change record, and storing the change record into a change detail table; Receiving a data query instruction, acquiring a query object carried by the data query instruction, and determining a change record ID of the query object in a change detail table; and packaging the change record ID into a key value pair format, and inquiring the data change information of the inquired object in the change detail table based on the packaged change record ID. Further, receiving a data change instruction, obtaining change data, and determining a class object corresponding to a service class in the change data, wherein the method specifically comprises the following steps: receiving a data change instruction, and acquiring change data based on the data change instruction; analyzing the change data to obtain the table name, the field name and the data format of the change data; And determining the service class in the change data based on the table name, the field name and the data format of the change data, and acquiring a class object corresponding to the service class. Further, obtaining attribute information of the class object based on the class object reflection, and packaging the class object into an entity class based on the attribute information, specifically including: Acquiring attribute information of Class objects based on a method in a preset Class; creating an entity class object, and configuring attribute values of the entity class object based on attribute information of the class object; and obtaining the entity class object of which the attribute value configuration is completed, and obtaining the entity class. Further, creating an entity class object, and configuring attribute values of the entity class object based on attribute information of the class object, specifically including: Traversing the attribute information of the class object, and acquiring a custom annotation, a configuration attribute value and a configuration enumeration value from the attribute information of the class object; Creating an entity class object based on the custom annotation, the configuration attribute value and the configuration enumeration value; And configuring the attribute value of the entity class object based on the attribute information of the class object to obtain the entity class. Further, creating an entity class object based on the custom annotation, the configuration attribute value and the configuration enumeration value, speci