CN113672626A - Data structure changing method and device and electronic equipment - Google Patents

Data structure changing method and device and electronic equipment Download PDF

Info

Publication number
CN113672626A
CN113672626A CN202111039474.3A CN202111039474A CN113672626A CN 113672626 A CN113672626 A CN 113672626A CN 202111039474 A CN202111039474 A CN 202111039474A CN 113672626 A CN113672626 A CN 113672626A
Authority
CN
China
Prior art keywords
information
adjustment
data
table structure
sql
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.)
Granted
Application number
CN202111039474.3A
Other languages
Chinese (zh)
Other versions
CN113672626B (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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111039474.3A priority Critical patent/CN113672626B/en
Publication of CN113672626A publication Critical patent/CN113672626A/en
Application granted granted Critical
Publication of CN113672626B publication Critical patent/CN113672626B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/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/242Query formulation
    • G06F16/2433Query languages
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

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

Abstract

The application discloses a data structure changing method and device and electronic equipment, which can be applied to the field of big data or the field of finance. In the application, the product information corresponding to the obtained login user information, the batch information corresponding to the product information and the database identification corresponding to the batch information are inquired, the target batch information selected by the user is obtained, the table structure information corresponding to the target batch information is read and displayed, the adjustment operation of the user on the displayed table structure information is received, SQL adjustment data corresponding to the adjustment operation is generated, the SQL adjustment data is operated to realize the adjustment on the table structure information corresponding to the target batch information, and the table structure information corresponding to different batches of information corresponding to the product information is synchronously adjusted based on the SQL adjustment data. The invention realizes the automatic change of the data structure and avoids the problems of complex operation, low efficiency and low accuracy caused by manual change.

Description

Data structure changing method and device and electronic equipment
Technical Field
The present invention relates to the field of data processing, and in particular, to a data structure changing method and apparatus, and an electronic device.
Background
The data structure change is a change of a data definition language SQL DDL performed in program development.
When a data structure is changed, the data structure change process is generally managed manually by a human, so that the data structure change is realized. Such as SQL operation for manually managing batch databases, synchronous operation between different batches, and the like. The whole data structure changing process is complex in operation, low in efficiency and low in accuracy.
Disclosure of Invention
In view of this, the present invention provides a data structure changing method, an apparatus and an electronic device, so as to solve the problems of complex operation, low efficiency and low accuracy in the whole data structure changing process.
In order to solve the technical problems, the invention adopts the following technical scheme:
a data structure alteration method, comprising:
obtaining login user information, and inquiring product information corresponding to the login user information, batch information corresponding to the product information and database identification corresponding to the batch information;
acquiring target batch information selected by a user from batch information corresponding to the product information, reading table structure information corresponding to the target batch information from a database corresponding to a database identifier corresponding to the target batch information, and displaying the table structure information;
receiving adjustment operation of a user on displayed table structure information, and generating SQL adjustment data corresponding to the adjustment operation;
running the SQL adjustment data to realize the adjustment of the table structure information corresponding to the target batch information;
and based on the SQL adjustment data, synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information.
Optionally, receiving an adjustment operation of the user on the displayed table structure information, and generating SQL adjustment data corresponding to the adjustment operation, including:
acquiring at least one adjustment sub-operation of the displayed table structure information, which is input by a user on a display interface; the adjusting sub-operation at least comprises adding, deleting or modifying;
determining SQL sub-adjustment data corresponding to each sub-adjustment operation;
and integrating all the SQL adjustment subdata to obtain SQL adjustment data.
Optionally, after generating the SQL adjusting data corresponding to the adjusting operation, the method further includes:
comparing the adjusted table structure information with the table structure information before adjustment to obtain a current adjustment record table;
comparing the adjusted table structure information with initial table structure information corresponding to the table structure information to obtain a complete adjustment record table; the table identification information of the current adjustment record table and the complete adjustment record table is related to the adjustment times of the table structure information.
Optionally, the method further comprises:
receiving an adjustment query operation; the adjustment query operation comprises target product information to be queried;
determining an adjustment record table corresponding to the target product information; the adjustment record table comprises a complete adjustment record table and/or a current adjustment record table.
Optionally, the method further comprises:
under the condition of reaching the production time point, outputting a latest complete adjustment record table;
and generating a complete data dictionary according to the complete adjustment record table and the initial table structure information.
Optionally, running the SQL adjusting data to adjust the table structure information corresponding to the target batch information includes:
and calling a Jekins tool to enable the Jekins tool to operate the SQL adjustment data so as to adjust the table structure information corresponding to the target batch information.
Optionally, based on the SQL adjustment data, performing a synchronous adjustment operation on table structure information corresponding to different batches of information corresponding to the product information, including:
after the table structure information corresponding to the target batch information is successfully adjusted, calling a Jekins tool to enable the Jekins tool to store the SQL adjustment data into an SVN specified directory and store the SQL adjustment data into a specified position corresponding to a Flyway tool;
and calling the Flyway tool to enable the Flyway tool to use the SQL adjusting data to synchronously adjust the table structure information corresponding to the other batch information except the target batch information corresponding to the product information.
Optionally, when the table structure information corresponding to the target batch information is not successfully adjusted, the method further includes:
and calling the Jekins tool to enable the Jekins tool to execute rollback operation until the table structure information corresponding to the target batch information is successfully adjusted.
A data structure changing apparatus comprising:
the data determining module is used for acquiring login user information and inquiring product information corresponding to the login user information, batch information corresponding to the product information and database identification corresponding to the batch information;
the information display module is used for acquiring target batch information selected by a user from batch information corresponding to the product information, reading table structure information corresponding to the target batch information from a database corresponding to a database identifier corresponding to the target batch information, and displaying the table structure information;
the adjusting data generating module is used for receiving the adjusting operation of a user on the displayed table structure information and generating SQL adjusting data corresponding to the adjusting operation;
the adjustment data operation module is used for operating the SQL adjustment data so as to adjust the table structure information corresponding to the target batch information;
and the synchronous adjusting module is used for carrying out synchronous adjusting operation on the table structure information corresponding to different batches of information corresponding to the product information based on the SQL adjusting data.
An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used to perform the data structure change method described above.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a data structure changing method, a device and electronic equipment, in the invention, login user information is acquired, inquiring product information corresponding to the login user information, batch information corresponding to the product information and database identification corresponding to the batch information to obtain target batch information selected by the user from the batch information corresponding to the product information, and reading the table structure information corresponding to the target batch information from the database corresponding to the database identifier corresponding to the target batch information, displaying, receiving adjustment operation of a user on the displayed table structure information, generating SQL adjustment data corresponding to the adjustment operation, operating the SQL adjustment data, to implement adjustment of table structure information corresponding to the target lot information, based on the SQL adjustment data, and synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information. The invention realizes the automatic change of the data structure and avoids the problems of complex operation, low efficiency and low accuracy caused by manual change.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for changing a data structure according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an internal architecture of a data structure modification system according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for changing a data structure according to another embodiment of the present invention;
FIG. 4 is a flowchart of a method for changing a data structure according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data structure changing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
When a data structure is changed, the data structure change process is generally managed manually by a human, so that the data structure change is realized. Such as SQL operation for manually managing batch databases, synchronous operation between different batches, and the like. The whole data structure changing process is complex in operation, low in efficiency and low in accuracy.
In order to solve the above technical problems, the inventors found that if the data structure can be automatically changed, the problems of complicated operation, low efficiency and low accuracy caused by manual change can be avoided.
The embodiment of the invention provides a data structure changing method, a device and electronic equipment, in the invention, login user information is acquired, inquiring product information corresponding to the login user information, batch information corresponding to the product information and database identification corresponding to the batch information to obtain target batch information selected by the user from the batch information corresponding to the product information, and reading the table structure information corresponding to the target batch information from the database corresponding to the database identifier corresponding to the target batch information, displaying, receiving adjustment operation of a user on the displayed table structure information, generating SQL adjustment data corresponding to the adjustment operation, operating the SQL adjustment data, to implement adjustment of table structure information corresponding to the target lot information, based on the SQL adjustment data, and synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information. The invention realizes the automatic change of the data structure and avoids the problems of complex operation, low efficiency and low accuracy caused by manual change.
The data structure changing method, the data structure changing device and the electronic equipment provided by the invention can be used in the field of big data or the field of finance. The above description is only an example, and does not limit the application fields of the data structure changing method, the data structure changing device, and the electronic device provided by the present invention.
The execution main body of the data structure changing method provided by the embodiment of the invention can be a processor, and a data structure changing system is arranged in the processor, and the system can support user login and realize the recording of data structure change.
Referring to fig. 1, the data structure changing system may include:
the system comprises a product parameter management module, a table structure management module, a table change checking module, a data dictionary maintenance module, a production exporting SQL module and an execution result query module.
The product parameter management module can perform batch maintenance, product batch maintenance, database parameter maintenance, product information maintenance and the like.
In this embodiment, only the user with the right, such as the DBA role of the database administrator, can call the product parameter management module to implement data maintenance. The data maintained mainly includes: the method comprises the steps of configuring and maintaining a product staff table, configuring and maintaining product information, configuring and maintaining batch information, configuring and maintaining product batch association information and configuring and maintaining database information.
The table structure management module can maintain corresponding table structures according to the selected products and batches, and record the baseline data and the change records of the table structures of each batch of each product.
And the table change checking module generates a final integrated record of the data structure change SQL DDL about the table dimension and all history modification records for displaying the table structure according to the record of the table structure management module.
The table change recording module can record the modification or adjustment records of the table, the table structure, the table primary key and the table index, and inquire the specific modification records according to the dimensions of the table, the table structure, the table primary key and the table index respectively.
The export commissioning SQL module may generate the commissioning SQL from a baseline generated by the table structure maintenance.
The data dictionary maintenance module can generate a latest data dictionary according to the data dictionary of the previous batch and the modification record of the batch; when the batch is put into production or no data structure changes, maintenance personnel can issue the data dictionary of the batch to realize the baseline issuing function.
The execution result query module is an operation result in each table structure maintenance, and if the execution is unsuccessful, the executed operation is rolled back.
In addition, when the table structure is modified, a plurality of data tables can be constructed, and each data table stores a corresponding modification record. The data tables may include a table structure baseline table, a table structure baseline modification record table, a table structure primary key baseline modification record table, a table structure index baseline modification record table, and the like.
Referring to fig. 1, the data structure changing method may include:
s11, obtaining login user information, and inquiring product information corresponding to the login user information, batch information corresponding to the product information, and database identification corresponding to the batch information.
In practical applications, the data structure modification system in this embodiment may implement data structure modification of multiple products, and the products in this embodiment may be a loan system, a money transfer system, and the like. Each product has multiple functions and needs to be developed simultaneously or sequentially, and each product is provided with multiple batches, and each batch is developed on different functions according to the same product code.
For each batch, a corresponding database is set for data storage, the database can be Oracle and the like, the data structure change process corresponding to the batch can also be recorded in the corresponding database, and the table structure baseline table, the table structure baseline modification record table, the table structure main key baseline modification record table, the table structure index baseline table and the table structure index baseline modification record table can be recorded in the database.
In this embodiment, if the user wants to change the data structure, the data structure changing system may be clicked, then the login operation may be clicked, login information, such as a user name and a password, may be input during login, and after the login information verifies the login, product information corresponding to the user may be displayed. Specifically, the data structure changing system may query the product staff table, determine which product the login user corresponds to, and then query batch information corresponding to the product information and a database identifier corresponding to the batch information. In this embodiment, the batch information corresponding to the product information is all the appeared batch information corresponding to the product.
S12, acquiring target batch information selected by a user from the batch information corresponding to the product information, reading and displaying table structure information corresponding to the target batch information from a database corresponding to the database identification corresponding to the target batch information.
In this embodiment, the batch information corresponding to the product may be displayed in the form of an icon such as a list, and then the user may select one batch information to adjust the table structure information corresponding to the batch information.
In this embodiment, the batch information selected by the user is used as the target batch information, then the database identifier corresponding to the target batch information is determined, where the database identifier may be a database name or the like, such as a plurality of data sources like Oracle, and then the database corresponding to the database identifier is accessed. And reading the table structure information corresponding to the target batch information from the database, and displaying the table structure information in an editable form such as a text box or a pull-down menu.
And S13, receiving the adjustment operation of the user on the displayed table structure information, and generating SQL adjustment data corresponding to the adjustment operation.
In this embodiment, the user may modify the field value, the length, the type, and the like of each field in the table structure information by inputting the field value to the table structure information through a mouse, for example, change the value of the field a from a to B, or modify the type of the field a. After the user finishes modifying the content to be modified, the user can click a save or confirm button, and the background generates SQL adjustment data according to the user modification, which can also be called change SQL.
In practical applications, referring to fig. 2, step S13 may include:
and S21, acquiring at least one adjustment sub-operation of the displayed table structure information input by the user on the display interface.
The adjustment sub-operations include at least an addition, a deletion, or a modification.
In this embodiment, the user may modify the field value, the length, the type, and the like of at least one field. In addition, a certain field may be deleted or added, that is, in this embodiment, modification, deletion, or addition operation may be performed on the field.
In addition, in this embodiment, when the user adjusts each field, it is used as an adjustment sub-operation. When multiple fields are adjusted, there are multiple adjustment sub-operations.
And S22, determining SQL sub-adjustment data corresponding to each sub-adjustment operation.
In this embodiment, the SQL sub-adjustment data may be dynamically generated in real time according to the sub-adjustment operations of the user. In this embodiment, which way to generate the SQL trim subdata may be set by a technician.
S23, integrating all the SQL adjustment subdata to obtain SQL adjustment data.
In this embodiment, all the SQL adjustment sub-data may be integrated according to the adjustment sequence to obtain the SQL adjustment data. Or integrating all the SQL adjustment subdata according to the sequence positions of the columns to obtain the SQL adjustment data.
After generating the SQL adjustment data, the adjusted table structure information may be compared with the table structure information before adjustment to obtain a current adjustment record table, and the adjusted table structure information is compared with the initial table structure information corresponding to the table structure information to obtain a complete adjustment record table.
The table identification information of the current adjustment record table and the complete adjustment record table is related to the adjustment times of the table structure information.
In this embodiment, for each adjustment operation of the user, the adjusted table structure information may be compared with the table structure information before adjustment to obtain the current adjustment record table. If the user has multiple adjustments, the table identification information may be set for the current adjustment record table according to the adjustment sequence, such as the current adjustment record table 01, the current adjustment record table 02, and the current adjustment record table 03 … …
In addition, the adjusted table structure information may be compared with the initial table structure information corresponding to the table structure information to obtain a complete adjustment record table, that is, the adjusted table structure information is compared with the initial table structure information, that is, the current version of the current table structure information is compared with the first version to obtain the complete adjustment record table. If the user has multiple adjustments, table identification information may be set for the complete adjustment record table according to the order of the adjustments, such as complete adjustment record table 01, complete adjustment record table 02, and complete adjustment record table 03 … ….
It should be noted that the current adjustment record table records adjustment records of two adjacent adjustments, as an intermediate adjustment process, the complete adjustment record table records adjustment records of the latest table structure information and the first version table structure information, as a complete adjustment process, when production needs to be put into operation, for example, when a production time point is reached, the latest complete adjustment record table is directly output, so that the change of the final table structure information compared with the initial version table structure information can be directly observed.
In another implementation manner of the present invention, an adjustment query operation of the user may also be supported, and the adjustment record table required by the user is queried in response to the operation.
Specifically, 1) receiving an adjustment query operation.
The adjustment query operation comprises target product information to be queried. The change records of each table can be checked from the table, the table structure, the table main key and the table index dimension, and the change records of each table can be easily checked according to the excel view by each development.
In this embodiment, the user may be allowed to adjust the query operation according to the product, and during the query, the user may select the target product information to be queried in a text box input manner or a pull-down menu selection manner.
2) Determining an adjustment record table corresponding to the target product information; the adjustment record table comprises a complete adjustment record table and/or a current adjustment record table.
In this embodiment, the complete adjustment record table and/or the current adjustment record table corresponding to the target product information may be determined according to the recorded complete adjustment record table and/or the current adjustment record table.
In this embodiment, the complete adjustment record table and/or the current adjustment record table may be:
the above-described table structure baseline table, table structure baseline modification record table, table structure primary key baseline modification record table, table structure index baseline modification record table, and the like, which may be recorded in the database. The method can be realized by a Jekins tool.
After the query is made, the user can click an export button to realize the export of the various tables.
In addition, a complete data dictionary can be generated according to the complete adjustment recording table and the initial table structure information.
Specifically, the initial table structure information corresponds to a data dictionary, and then the data dictionary is modified, deleted or newly added according to the complete adjustment record table, so that the finally obtained complete data dictionary comprises a table structure complete set of the latest table structure information. In addition, the complete data dictionary of each batch of products can be exported by one key, and the labor force for manually maintaining the data dictionary is liberated.
And S14, operating the SQL adjustment data to realize the adjustment of the table structure information corresponding to the target batch information.
In this embodiment, a Jekins tool may be called to enable the Jekins tool to run the SQL adjustment data, so as to adjust the table structure information corresponding to the target batch information.
Specifically, after the SQL adjustment data is obtained, Jekins can be called in real time to operate the SQL adjustment data in a corresponding database, so as to adjust the table structure information corresponding to the target batch information.
If the table structure information corresponding to the target batch information is not successfully adjusted, calling the Jekins tool to enable the Jekins tool to execute rollback operation until the table structure information corresponding to the target batch information is successfully adjusted.
Specifically, if the adjustment of the table structure information fails, the Jekins tool rolls back all operations again and prompts the user of the error reason.
And S15, based on the SQL adjustment data, synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information.
Specifically, referring to fig. 4, step S15 may include:
and S31, after the table structure information corresponding to the target batch information is successfully adjusted, calling a Jekins tool to enable the Jekins tool to store the SQL adjustment data into an SVN specified directory, and store the SQL adjustment data into a specified position corresponding to a Flyway tool.
Specifically, if the Jekins tool successfully executes the adjustment of the table structure information, the Jekins tool uploads SQL adjustment data, that is, changes the SQL script to the SVN specified directory, and stores change records (including the current adjustment record table and the complete adjustment record table) to related tables in the database corresponding to the batch, such as a table structure baseline table, a table structure baseline modification record table, a table structure main key baseline table, a table structure main baseline key modification record table, a table structure index baseline modification record table, and the like.
In addition, Jekins calls SQL adjustment data under the SVN specified directory according to configuration and stores the SQL adjustment data in the specified directory of the machine where Flyway is located.
And S32, calling the Flyway tool to enable the Flyway tool to use the SQL adjustment data to synchronously adjust the table structure information corresponding to the batch information except the target batch information corresponding to the product information.
The Jekins tool triggers Flyway to execute SQL tuning data to level up the database structures of the following batches.
In this embodiment, login user information is obtained, product information corresponding to the login user information, batch information corresponding to the product information, and database identification corresponding to the batch information are queried, target batch information selected by a user from the batch information corresponding to the product information is obtained, and reading the table structure information corresponding to the target batch information from the database corresponding to the database identifier corresponding to the target batch information, displaying, receiving adjustment operation of a user on the displayed table structure information, generating SQL adjustment data corresponding to the adjustment operation, operating the SQL adjustment data, to implement adjustment of table structure information corresponding to the target lot information, based on the SQL adjustment data, and synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information. The invention realizes the automatic change of the data structure and avoids the problems of complex operation, low efficiency and low accuracy caused by manual change.
In addition, the invention realizes the whole process management of the data structure change, such as table structure change management, batch leveling, record query, data dictionary maintenance and production SQL derivation. A developer can realize the full automation of the data structure change management only by changing the table structure on the system, and the version management and the automatic leveling of the changed SQL can meet the requirement of a large-scale development team on the quick and effective management of the data structure change under the conditions of multitask and high parallelism.
Optionally, on the basis of the embodiment of the data structure changing method, another embodiment of the present invention provides a data structure changing apparatus, and referring to fig. 5, the data structure changing apparatus may include:
the data determining module 11 is configured to acquire login user information, and query product information corresponding to the login user information, batch information corresponding to the product information, and a database identifier corresponding to the batch information;
the information display module 12 is configured to obtain target batch information selected by a user from batch information corresponding to the product information, read table structure information corresponding to the target batch information from a database corresponding to a database identifier corresponding to the target batch information, and display the table structure information;
the adjustment data generation module 13 is configured to receive an adjustment operation of a user on the displayed table structure information, and generate SQL adjustment data corresponding to the adjustment operation;
an adjustment data operation module 14, configured to operate the SQL adjustment data to implement adjustment of the table structure information corresponding to the target batch information;
and the synchronous adjusting module 15 is configured to perform synchronous adjusting operation on the table structure information corresponding to different batches of information corresponding to the product information based on the SQL adjusting data.
Further, the adjustment data generating module 13 is specifically configured to:
acquiring at least one adjustment sub-operation of the displayed table structure information, which is input by a user on a display interface; the adjusting sub-operation at least comprises adding, deleting or modifying;
determining SQL sub-adjustment data corresponding to each sub-adjustment operation;
and integrating all the SQL adjustment subdata to obtain SQL adjustment data.
Further, still include:
the comparison module is used for comparing the adjusted table structure information with the table structure information before adjustment to obtain a current adjustment record table, and comparing the adjusted table structure information with the initial table structure information corresponding to the table structure information to obtain a complete adjustment record table; the table identification information of the current adjustment record table and the complete adjustment record table is related to the adjustment times of the table structure information.
Further, still include:
the query module is used for receiving and adjusting query operation; the adjustment query operation comprises target product information to be queried;
determining an adjustment record table corresponding to the target product information; the adjustment record table comprises a complete adjustment record table and/or a current adjustment record table.
Further, still include:
and the information processing module is used for outputting the latest complete adjustment record table under the condition that the production time point is reached, and generating a complete data dictionary according to the complete adjustment record table and the initial table structure information.
Further, the adjustment data operation module 14 is specifically configured to:
and calling a Jekins tool to enable the Jekins tool to operate the SQL adjustment data so as to adjust the table structure information corresponding to the target batch information.
Further, the synchronization adjustment module 15 is specifically configured to:
after the table structure information corresponding to the target batch information is successfully adjusted, calling a Jekins tool to enable the Jekins tool to store the SQL adjustment data into an SVN specified directory and store the SQL adjustment data into a specified position corresponding to a Flyway tool;
and calling the Flyway tool to enable the Flyway tool to use the SQL adjusting data to synchronously adjust the table structure information corresponding to the other batch information except the target batch information corresponding to the product information.
Further, still include:
and the rollback module is used for calling the Jekins tool under the condition that the table structure information corresponding to the target batch information is not successfully adjusted, so that the Jekins tool executes rollback operation until the table structure information corresponding to the target batch information is successfully adjusted.
In this embodiment, login user information is obtained, product information corresponding to the login user information, batch information corresponding to the product information, and database identification corresponding to the batch information are queried, target batch information selected by a user from the batch information corresponding to the product information is obtained, and reading the table structure information corresponding to the target batch information from the database corresponding to the database identifier corresponding to the target batch information, displaying, receiving adjustment operation of a user on the displayed table structure information, generating SQL adjustment data corresponding to the adjustment operation, operating the SQL adjustment data, to implement adjustment of table structure information corresponding to the target lot information, based on the SQL adjustment data, and synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information. The invention realizes the automatic change of the data structure and avoids the problems of complex operation, low efficiency and low accuracy caused by manual change.
It should be noted that, for the working process of each module in this embodiment, please refer to the corresponding description in the above embodiments, which is not described herein again.
Optionally, on the basis of the embodiments of the data structure changing method and apparatus, another embodiment of the present invention provides an electronic device, including: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used to perform the data structure change method described above.
In this embodiment, login user information is obtained, product information corresponding to the login user information, batch information corresponding to the product information, and database identification corresponding to the batch information are queried, target batch information selected by a user from the batch information corresponding to the product information is obtained, and reading the table structure information corresponding to the target batch information from the database corresponding to the database identifier corresponding to the target batch information, displaying, receiving adjustment operation of a user on the displayed table structure information, generating SQL adjustment data corresponding to the adjustment operation, operating the SQL adjustment data, to implement adjustment of table structure information corresponding to the target lot information, based on the SQL adjustment data, and synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information. The invention realizes the automatic change of the data structure and avoids the problems of complex operation, low efficiency and low accuracy caused by manual change.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present 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 (10)

1. A method for data structure modification, comprising:
obtaining login user information, and inquiring product information corresponding to the login user information, batch information corresponding to the product information and database identification corresponding to the batch information;
acquiring target batch information selected by a user from batch information corresponding to the product information, reading table structure information corresponding to the target batch information from a database corresponding to a database identifier corresponding to the target batch information, and displaying the table structure information;
receiving adjustment operation of a user on displayed table structure information, and generating SQL adjustment data corresponding to the adjustment operation;
running the SQL adjustment data to realize the adjustment of the table structure information corresponding to the target batch information;
and based on the SQL adjustment data, synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information.
2. The method according to claim 1, wherein receiving a user adjustment operation on the presented table structure information and generating SQL adjustment data corresponding to the adjustment operation comprises:
acquiring at least one adjustment sub-operation of the displayed table structure information, which is input by a user on a display interface; the adjusting sub-operation at least comprises adding, deleting or modifying;
determining SQL sub-adjustment data corresponding to each sub-adjustment operation;
and integrating all the SQL adjustment subdata to obtain SQL adjustment data.
3. The data structure changing method according to claim 1, further comprising, after generating SQL adjustment data corresponding to the adjustment operation:
comparing the adjusted table structure information with the table structure information before adjustment to obtain a current adjustment record table;
comparing the adjusted table structure information with initial table structure information corresponding to the table structure information to obtain a complete adjustment record table; the table identification information of the current adjustment record table and the complete adjustment record table is related to the adjustment times of the table structure information.
4. The data structure changing method according to claim 3, further comprising:
receiving an adjustment query operation; the adjustment query operation comprises target product information to be queried;
determining an adjustment record table corresponding to the target product information; the adjustment record table comprises a complete adjustment record table and/or a current adjustment record table.
5. The data structure changing method according to claim 3, further comprising:
under the condition of reaching the production time point, outputting a latest complete adjustment record table;
and generating a complete data dictionary according to the complete adjustment record table and the initial table structure information.
6. The method according to claim 1, wherein the executing the SQL adjusting data to adjust the table structure information corresponding to the target batch information comprises:
and calling a Jekins tool to enable the Jekins tool to operate the SQL adjustment data so as to adjust the table structure information corresponding to the target batch information.
7. The method according to claim 6, wherein the step of synchronously adjusting the table structure information corresponding to different batches of information corresponding to the product information based on the SQL adjustment data comprises:
after the table structure information corresponding to the target batch information is successfully adjusted, calling a Jekins tool to enable the Jekins tool to store the SQL adjustment data into an SVN specified directory and store the SQL adjustment data into a specified position corresponding to a Flyway tool;
and calling the Flyway tool to enable the Flyway tool to use the SQL adjusting data to synchronously adjust the table structure information corresponding to the other batch information except the target batch information corresponding to the product information.
8. The data structure changing method according to claim 6, further comprising, when the table structure information corresponding to the target lot information is not successfully adjusted:
and calling the Jekins tool to enable the Jekins tool to execute rollback operation until the table structure information corresponding to the target batch information is successfully adjusted.
9. A data structure modification apparatus, comprising:
the data determining module is used for acquiring login user information and inquiring product information corresponding to the login user information, batch information corresponding to the product information and database identification corresponding to the batch information;
the information display module is used for acquiring target batch information selected by a user from batch information corresponding to the product information, reading table structure information corresponding to the target batch information from a database corresponding to a database identifier corresponding to the target batch information, and displaying the table structure information;
the adjusting data generating module is used for receiving the adjusting operation of a user on the displayed table structure information and generating SQL adjusting data corresponding to the adjusting operation;
the adjustment data operation module is used for operating the SQL adjustment data so as to adjust the table structure information corresponding to the target batch information;
and the synchronous adjusting module is used for carrying out synchronous adjusting operation on the table structure information corresponding to different batches of information corresponding to the product information based on the SQL adjusting data.
10. An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
a processor calls a program and is arranged to perform the data structure change method as claimed in claims 1-8.
CN202111039474.3A 2021-09-06 2021-09-06 Data structure changing method and device and electronic equipment Active CN113672626B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111039474.3A CN113672626B (en) 2021-09-06 2021-09-06 Data structure changing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111039474.3A CN113672626B (en) 2021-09-06 2021-09-06 Data structure changing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113672626A true CN113672626A (en) 2021-11-19
CN113672626B CN113672626B (en) 2024-02-13

Family

ID=78548757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111039474.3A Active CN113672626B (en) 2021-09-06 2021-09-06 Data structure changing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113672626B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678532A (en) * 2013-12-02 2014-03-26 ***(深圳)有限公司 Alternation statement reverse analysis method, database alternating and backspacing method and database alternating and backspacing system
CN108255925A (en) * 2017-11-10 2018-07-06 平安普惠企业管理有限公司 A kind of display methods and its terminal of data list structure alteration
CN109885581A (en) * 2019-03-14 2019-06-14 苏州达家迎信息技术有限公司 Synchronous method, device, equipment and the storage medium of database
CN110633284A (en) * 2019-09-19 2019-12-31 中国工商银行股份有限公司 Method and device for changing table in database
CN113204558A (en) * 2021-05-25 2021-08-03 城云科技(中国)有限公司 Method and device for automatically updating data table structure

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678532A (en) * 2013-12-02 2014-03-26 ***(深圳)有限公司 Alternation statement reverse analysis method, database alternating and backspacing method and database alternating and backspacing system
CN108255925A (en) * 2017-11-10 2018-07-06 平安普惠企业管理有限公司 A kind of display methods and its terminal of data list structure alteration
CN109885581A (en) * 2019-03-14 2019-06-14 苏州达家迎信息技术有限公司 Synchronous method, device, equipment and the storage medium of database
CN110633284A (en) * 2019-09-19 2019-12-31 中国工商银行股份有限公司 Method and device for changing table in database
CN113204558A (en) * 2021-05-25 2021-08-03 城云科技(中国)有限公司 Method and device for automatically updating data table structure

Also Published As

Publication number Publication date
CN113672626B (en) 2024-02-13

Similar Documents

Publication Publication Date Title
US8078651B2 (en) Match rules to identify duplicate records in inbound data
US10423392B2 (en) Systems and methods for transactional applications in an unreliable wireless network
CN100570604C (en) A kind of method of relation data base applications automatic upgrade
US10210240B2 (en) Systems and methods for code parsing and lineage detection
US20100280990A1 (en) Etl for process data warehouse
KR101013810B1 (en) An excel-based management system for updating db tables and the method thereof
CN105447122A (en) Implementation method for autonomously creating file system based on multi-table association
CN107291471B (en) Meta-model framework system supporting customizable data acquisition
CN103810224A (en) Information persistence and query method and device
US8046382B2 (en) Method and system for software object profile management
CN114510478A (en) General data entry method, device, equipment and medium based on data model
US10289620B1 (en) Reporting and data governance management
US20060136471A1 (en) Differential management of database schema changes
CN103678396A (en) Data backup method and device based on data models
CN108959391B (en) Apparatus, system, method, and storage medium for presenting database cluster architecture diagram
CN113515564A (en) Data access method, device, equipment and storage medium based on J2EE
EP3422177A1 (en) Systems and methods for code parsing and lineage detection
US20040039755A1 (en) Metadata relationships
US10817272B2 (en) Generation and usage of language-converted script
CN112162992A (en) Efficient database updating system and method
CN109460318B (en) Import method of rollback archive collected data, computer device and computer readable storage medium
CN115114325B (en) Data query method and device, electronic equipment and storage medium
CN113672626B (en) Data structure changing method and device and electronic equipment
US10318524B2 (en) Reporting and data governance management
CN115408111A (en) Database script control method, system, device, storage medium and program product

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