[go: up one dir, main page]

CN115374089A - Method, device, medium and electronic equipment for generating version package of database - Google Patents

Method, device, medium and electronic equipment for generating version package of database Download PDF

Info

Publication number
CN115374089A
CN115374089A CN202211082578.7A CN202211082578A CN115374089A CN 115374089 A CN115374089 A CN 115374089A CN 202211082578 A CN202211082578 A CN 202211082578A CN 115374089 A CN115374089 A CN 115374089A
Authority
CN
China
Prior art keywords
version package
ddls
generating
current
file
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.)
Pending
Application number
CN202211082578.7A
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211082578.7A priority Critical patent/CN115374089A/en
Publication of CN115374089A publication Critical patent/CN115374089A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the field of databases, and discloses a method, a device, a medium and electronic equipment for generating a version package of a database, wherein the method comprises the following steps: acquiring at least one change table name and corresponding change content in a database, and acquiring a table configuration file, a table structure definition file, a primary key and an index file which are associated with the at least one change table name; generating a plurality of current DDLs for the current version package based on the table configuration file, the table structure definition file, the main key and the index file according to the change content; comparing the plurality of current DDLs to a plurality of previous DDLs for previous version packets to identify at least one altered DDL corresponding to the altered content; a scripting language corresponding to each changed DDL is invoked to generate a current version package. The invention can realize the production of the version packet without manual work, greatly reduces the time for manually producing the version packet, reduces the uncertainty of manual operation and enhances the accuracy.

Description

用于生成数据库的版本包的方法、装置、介质及电子设备Method, device, medium and electronic equipment for generating version package of database

技术领域technical field

本申请涉及数据库,特别涉及一种用于生成数据库的版本包的方法、装置、介质、电子设备、计算机程序产品。The present application relates to databases, in particular to a method, device, medium, electronic equipment, and computer program product for generating a version package of a database.

背景技术Background technique

随着互联网和信息化技术的不断发展,应用软件的版本发布频率也越来越快,应用软件的每个版本对应的项目包含多个子应用,每个子应用又调取若干数据库,每个数据库包含了数据库实例(dbname)、数据库所有者(dbowner)、表和数据存储过程。应用软件的版本发布实际上是将当前版本下所有变更的表、数据存储过程和代码等程序打包成新的版本包,利用推送工具将代码推送至版本库,对版本库进行部署从而实现版本变更。With the continuous development of the Internet and information technology, the release frequency of application software versions is getting faster and faster. The project corresponding to each version of application software contains multiple sub-applications, and each sub-application calls several databases. Each database contains The database instance (dbname), database owner (dbowner), tables, and data stored procedures. The version release of the application software is actually to package all the changed tables, data storage procedures, codes and other programs under the current version into a new version package, use the push tool to push the code to the version library, and deploy the version library to realize the version change .

在对数据库的版本包进行制作的过程中,随着基线(上线版本的时间)越来越多,使得变更的表的数目也在飞速增长,目前靠人工来识别并制作版本包会降低版本发布速率。In the process of making database version packages, as the number of baselines (on-line version time) increases, the number of changed tables is also increasing rapidly. At present, manual identification and production of version packages will reduce version release rate.

发明内容Contents of the invention

本申请实施例提供了用于生成数据库的版本包的方法、装置、介质、电子设备、计算机程序产品。Embodiments of the present application provide a method, device, medium, electronic device, and computer program product for generating a version package of a database.

第一方面,本申请实施例提供了一种用于生成数据库的版本包的方法,所述方法包括:In the first aspect, the embodiment of the present application provides a method for generating a database version package, the method comprising:

获取步骤,获取所述数据库中的至少一个变更表名称和对应的变更内容,并获取与至少一个所述变更表名称相关联的表配置文件、表结构定义文件以及主键和索引文件;The obtaining step is to obtain at least one change table name and corresponding change content in the database, and obtain a table configuration file, a table structure definition file, a primary key and an index file associated with at least one change table name;

DDL生成步骤,根据所述变更内容,基于所述表配置文件、表结构定义文件以及主键和索引文件,生成用于当前版本包的多个当前DDL;DDL generating step, according to the change content, based on the table configuration file, table structure definition file and primary key and index file, generate a plurality of current DDLs for the current version package;

识别步骤,将所述多个当前DDL与用于先前版本包的多个先前DDL进行比较,以识别出与所述变更内容对应的至少一个变更DDL;an identifying step of comparing the plurality of current DDLs with a plurality of previous DDLs for a previous version package to identify at least one changed DDL corresponding to the changed content;

版本包生成步骤,调用与每个所述变更DDL对应的脚本语言,以生成所述当前版本包。The version package generation step is to call the script language corresponding to each of the changed DDLs to generate the current version package.

在上述第一方面的一种可能的实现中,所述DDL生成步骤进一步包括:In a possible implementation of the first aspect above, the DDL generating step further includes:

修改步骤,根据所述变更内容,对所述主键和索引文件进行修改,并将修改后的所述主键和索引文件更新到所述表配置文件;The modification step is to modify the primary key and index file according to the changed content, and update the modified primary key and index file to the table configuration file;

第一生成步骤,基于更新后的所述表配置文件以及所述表结构定义文件,按照预定分片分区规则,生成所述多个当前DDL。The first generating step is to generate the plurality of current DDLs according to predetermined fragmentation and partition rules based on the updated table configuration file and the table structure definition file.

在上述第一方面的一种可能的实现中,所述版本包生成步骤进一步包括:In a possible implementation of the first aspect above, the step of generating the version package further includes:

第二生成步骤,生成与每个所述变更DDL对应的脚本语言;A second generating step, generating a script language corresponding to each of the changed DDLs;

第三生成步骤,调用每个所述脚本语言,以生成所述当前版本包。The third generation step is to call each of the script languages to generate the current version package.

在上述第一方面的一种可能的实现中,所述脚本语言是shell脚本语言。In a possible implementation of the first aspect above, the scripting language is a shell scripting language.

在上述第一方面的一种可能的实现中,每个所述变更表名称具有对应的变更时间,In a possible implementation of the first aspect above, each name of the change table has a corresponding change time,

其中,在所述获取步骤中,基于输入的变更时间,获取与输入的变更时间对应的至少一个变更表名称和对应的变更内容。Wherein, in the obtaining step, based on the input change time, at least one change table name and corresponding change content corresponding to the input change time are obtained.

在上述第一方面的一种可能的实现中,进一步包括:In a possible implementation of the first aspect above, further comprising:

检查步骤,基于生成的所述当前版本包中的至少一个文件夹,对所述当前版本包进行检查。The checking step is to check the current version package based on at least one folder in the generated current version package.

第二方面,本申请实施例提供了一种用于生成数据库的版本包的装置,所述装置包括:In the second aspect, the embodiment of the present application provides an apparatus for generating a version package of a database, the apparatus comprising:

获取单元,获取所述数据库中的至少一个变更表名称和对应的变更内容,并获取与至少一个所述变更表名称相关联的表配置文件、表结构定义文件以及主键和索引文件;An acquisition unit, which acquires at least one change table name and corresponding change content in the database, and obtains a table configuration file, a table structure definition file, and a primary key and index file associated with at least one change table name;

DDL生成单元,根据所述变更内容,基于所述表配置文件、表结构定义文件以及主键和索引文件,生成用于当前版本包的多个当前DDL;The DDL generation unit generates a plurality of current DDLs for the current version package based on the table configuration file, table structure definition file, primary key and index file according to the changed content;

识别单元,将所述多个当前DDL与用于先前版本包的多个先前DDL进行比较,以识别出与所述变更内容对应的至少一个变更DDL;An identification unit, comparing the plurality of current DDLs with the plurality of previous DDLs used in the previous version package, to identify at least one changed DDL corresponding to the changed content;

版本包生成单元,调用与每个所述变更DDL对应的脚本语言,以生成所述当前版本包。The version package generation unit invokes the script language corresponding to each of the changed DDLs to generate the current version package.

上述获取单元、DDL生成单元、识别单元、版本包生成单元可以通过电子设备中具有这些模块或单元功能的处理器实现。The above acquisition unit, DDL generation unit, identification unit, and version package generation unit may be implemented by a processor in the electronic device having functions of these modules or units.

在上述第二方面的一种可能的实现中,所述DDL生成单元进一步包括:In a possible implementation of the above second aspect, the DDL generating unit further includes:

修改单元,根据所述变更内容,对所述主键和索引文件进行修改,并将修改后的所述主键和索引文件更新到所述表配置文件;The modifying unit modifies the primary key and index file according to the modification content, and updates the modified primary key and index file to the table configuration file;

第一生成单元,基于更新后的所述表配置文件以及所述表结构定义文件,按照预定分片分区规则,生成所述多个当前DDL。The first generation unit is configured to generate the plurality of current DDLs based on the updated table configuration file and the table structure definition file according to predetermined fragmentation and partition rules.

在上述第二方面的一种可能的实现中,所述版本包生成单元进一步包括:In a possible implementation of the above second aspect, the version package generating unit further includes:

第二生成单元,生成与每个所述变更DDL对应的脚本语言;A second generating unit, generating a script language corresponding to each of the changed DDLs;

第三生成单元,调用每个所述脚本语言,以生成所述当前版本包。The third generation unit calls each of the script languages to generate the current version package.

在上述第二方面的一种可能的实现中,所述脚本语言是shell脚本语言。In a possible implementation of the above second aspect, the scripting language is a shell scripting language.

在上述第二方面的一种可能的实现中,每个所述变更表名称具有对应的变更时间,In a possible implementation of the second aspect above, each name of the change table has a corresponding change time,

其中,所述获取单元基于输入的变更时间,获取与输入的变更时间对应的至少一个变更表名称和对应的变更内容。Wherein, the acquiring unit acquires at least one change table name and corresponding change content corresponding to the input change time based on the input change time.

在上述第二方面的一种可能的实现中,所述装置进一步包括:In a possible implementation of the above second aspect, the device further includes:

检查单元,基于生成的所述当前版本包中的至少一个文件夹,对所述当前版本包进行检查。The checking unit checks the current version package based on at least one folder in the generated current version package.

第三方面,本申请实施例提供了一种计算机可读存储介质,所述存储介质上存储有指令,所述指令在计算机上执行时使所述计算机执行上述第一方面中的用于生成数据库的版本包的方法。In the third aspect, the embodiment of the present application provides a computer-readable storage medium, the storage medium stores instructions, and when the instructions are executed on the computer, the computer executes the method for generating the database in the above-mentioned first aspect. method of the version package.

第四方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个程序,当所述一个或者多个程序被所述一个或多个处理器执行时,使得所述电子设备执行上述第一方面中的用于生成数据库的版本包的方法。In a fourth aspect, the embodiment of the present application provides an electronic device, including: one or more processors; one or more memories; one or more programs are stored in the one or more memories, when the one or more When the multiple programs are executed by the one or more processors, the electronic device is made to execute the method for generating the version package of the database in the first aspect above.

第五方面,本申请实施例提供了一种计算机程序产品,包括计算机可执行指令,其特征在于,所述指令被处理器执行以实施述第一方面中的用于生成数据库的版本包的方法。In the fifth aspect, the embodiment of the present application provides a computer program product, including computer-executable instructions, wherein the instructions are executed by a processor to implement the method for generating a database version package in the first aspect .

本发明中,无需人工即可实现版本包的制作,大幅度地降低了人工制作版本包的时间,减少了人工操作的不确定性,增强了准确性。进一步,通过对制作出的当前版本包进行检查,以判断当前版本包是否正确,从而进一步增强了准确性。In the present invention, the production of the version package can be realized without manpower, greatly reducing the time for manual production of the version package, reducing the uncertainty of manual operation, and enhancing the accuracy. Further, by checking the produced current version package, it is judged whether the current version package is correct, thereby further enhancing the accuracy.

附图说明Description of drawings

图1根据本申请的实施例,示出了用于生成数据库的版本包的方法的第一流程示意图;Fig. 1 shows a first schematic flowchart of a method for generating a version package of a database according to an embodiment of the present application;

图2根据本申请的实施例,示出了用于生成数据库的版本包的方法的第二流程示意图;Fig. 2 shows a second schematic flowchart of a method for generating a version package of a database according to an embodiment of the present application;

图3根据本申请的实施例,示出了用于生成数据库的版本包的方法的第三流程示意图;Fig. 3 shows a third schematic flowchart of a method for generating a version package of a database according to an embodiment of the present application;

图4根据本申请的实施例,示出了用于生成数据库的版本包的装置的第一结构图;Fig. 4 shows the first structural diagram of the device for generating the version package of the database according to an embodiment of the present application;

图5根据本申请的实施例,示出了用于生成数据库的版本包的装置的第二结构图;FIG. 5 shows a second structural diagram of a device for generating a version package of a database according to an embodiment of the present application;

图6根据本申请的实施例,示出了用于生成数据库的版本包的装置的第三结构图;FIG. 6 shows a third structural diagram of a device for generating a version package of a database according to an embodiment of the present application;

图7根据本申请的实施例,示出了一种电子设备的框图。Fig. 7 shows a block diagram of an electronic device according to an embodiment of the present application.

具体实施方式Detailed ways

本申请的说明性实施例包括但不限于用于生成数据库的版本包的方法、装置、介质及电子设备。Illustrative embodiments of the present application include, but are not limited to, methods, apparatuses, media, and electronic devices for generating a version package of a database.

本申请技术方案中对数据的获取、存储、使用、处理等均符合国家法律法规的相关规定。The acquisition, storage, use, and processing of data in the technical solution of this application all comply with the relevant provisions of national laws and regulations.

下面将结合附图对本申请的实施例作进一步地详细描述。Embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.

如图1所示,为本申请实施例提供的数据处理方法的流程图,该方法用于电子设备。电子设备例如是计算机、服务器、移动终端等等。As shown in FIG. 1 , it is a flowchart of a data processing method provided by an embodiment of the present application, and the method is used in an electronic device. Electronic devices are, for example, computers, servers, mobile terminals, and the like.

在获取步骤S11,获取数据库中的至少一个变更表名称和对应的变更内容,并获取与至少一个变更表名称相关联的表配置文件、表结构定义文件以及主键和索引文件。In the obtaining step S11, at least one change table name and corresponding change content in the database are obtained, and the table configuration file, table structure definition file, primary key and index file associated with the at least one change table name are obtained.

在数据库中的一些表进行修改(上线)的时候,会将这些表的表名称、变更内容以及对应的变更时间输入到例如上线评审表中,对变更内容进行评审,在评审通过后会保留在上线评审表中。可以理解的是,评审未通过的变更内容以及对应的表名称和变更时间不会保留在上线评审表中。When some tables in the database are modified (online), the table names, changed contents and corresponding changed time of these tables will be input into the online review table, for example, to review the changed contents, and they will be retained in the database after the review is passed. on the online review form. It is understandable that the changed content that failed the review and the corresponding table name and change time will not be retained in the online review table.

基于输入的变更时间,获取与输入的变更时间对应的至少一个变更表名称和对应的变更内容。Based on the input change time, at least one change table name and corresponding change content corresponding to the input change time are acquired.

例如,输入的变更时间是两个变更时间(即,两个基线,date1和date2),从上线评审表中获取与两个基线分别对应的变更表名称和变更内容,如下表1所示。For example, the input change time is two change times (that is, two baselines, date1 and date2), and the name and change content of the change table corresponding to the two baselines are obtained from the online review form, as shown in Table 1 below.

表1Table 1

变更表名称change table name 变更内容change content 基线baseline AA 增加字段add field date1date1 BB 删除数据delete data date2date2

表1中与每个基线对应的变更表名称和变更内容仅仅用于示例,可以理解的是,与每个基线对应的变更表名称和变更内容可以是任意的。The change table name and change content corresponding to each baseline in Table 1 are only examples, and it can be understood that the change table name and change content corresponding to each baseline can be arbitrary.

接着,获取与表A和表B各自相关联的表配置文件(以下称为DA文件)、表结构定义文件(以下成为DS文件)以及主键和索引文件(以下成为DB文件)。Next, the table configuration file (hereinafter referred to as DA file), table structure definition file (hereinafter referred to as DS file), and primary key and index file (hereinafter referred to as DB file) associated with each of Table A and Table B are obtained.

DA文件是分布式表DD(数据定义)配置文件,定义了每张表的分片方式,分片字段,分区方式,分区字段,分区数,归属库名等详细信息,用于代码生成DDL(Data DefinitionLanguage,数据定义语言)使用。The DA file is a distributed table DD (data definition) configuration file, which defines the fragmentation method, fragmentation field, partition method, partition field, number of partitions, and attribution library name of each table. It is used for code generation DDL ( Data DefinitionLanguage, data definition language) use.

DB文件是主键与索引文件,包含了每张表的主键与索引。The DB file is a primary key and index file, which contains the primary key and index of each table.

DS文件是表结构定义文件,包括每张表的字段,字段属性,comment等。The DS file is a table structure definition file, including the fields, field attributes, comments, etc. of each table.

在DDL生成步骤S12,根据上述表1中的变更内容,基于表配置文件、表结构定义文件以及主键和索引文件,生成用于当前版本包的多个当前DDL(数据定义语言)。In the DDL generation step S12, according to the changes in the above-mentioned Table 1, based on the table configuration file, the table structure definition file, and the primary key and index file, a plurality of current DDLs (data definition languages) for the current version package are generated.

具体的,如图2所示,DDL生成步骤S12进一步包括修改步骤S121和第一生成步骤S122。Specifically, as shown in FIG. 2 , the DDL generating step S12 further includes a modifying step S121 and a first generating step S122.

在修改步骤S121,根据上述表1中的变更内容,对表A的DB文件进行修改,并将修改后的DB文件更新到表A的DA文件。同样,对表B的DB文件进行修改,并将修改后的DB文件更新到表B的DA文件。In the modification step S121, the DB file of Table A is modified according to the modification content in Table 1 above, and the modified DB file is updated to the DA file of Table A. Similarly, modify the DB file of table B, and update the modified DB file to the DA file of table B.

在第一生成步骤S122,基于上述更新后的DA文件以及DS文件,按照预定分片分区规则,生成多个当前DDL。In the first generation step S122, multiple current DDLs are generated based on the above-mentioned updated DA file and DS file according to predetermined fragmentation and partition rules.

可以理解的是,DB文件中的索引是DDL很重要的一部分,由于DB文件被更新到DA文件中,而在生成DDL的时候会调用读取更新后的DA文件,所以通过更新后的DA文件,可以生成相应的索引。It is understandable that the index in the DB file is an important part of DDL. Since the DB file is updated to the DA file, and the updated DA file will be called to read when the DDL is generated, so through the updated DA file , the corresponding index can be generated.

另外,在生成DDL的时候,会读取DS文件,用于生成整个表中所有字段的定义。In addition, when generating DDL, the DS file will be read to generate the definitions of all fields in the entire table.

预定分片分区规则是预先设定的分片规则和分区规则,其中,分片是指数据根据一定规则被拆分成子集,并分别部署到不同的节点上;分区是一种物理数据库设计技术,在分片里将数据根据一定规则进行进一步拆分。Predetermined sharding and partitioning rules are preset sharding rules and partitioning rules. Among them, sharding means that data is split into subsets according to certain rules and deployed on different nodes respectively; partitioning is a physical database design Technology, in the sharding, the data is further split according to certain rules.

例如,预定分片规则例如是范围分片,即,按照不同的省份进行分片。对于一个省内的数据进行分区,预定分区规则例如是按照分区号。For example, the predetermined fragmentation rule is, for example, range fragmentation, that is, fragmentation is performed according to different provinces. For partitioning the data in a province, the predetermined partitioning rule is, for example, according to the partition number.

可以理解的是,上述预定分片规则和预定分区规则仅仅用于示例,其他的规则同样适用于本发明。It can be understood that the above predetermined fragmentation rules and predetermined partition rules are only examples, and other rules are also applicable to the present invention.

在识别步骤S13,将多个当前DDL与用于先前版本包的多个先前DDL进行比较,以识别出与表1中的变更内容对应的至少一个变更DDL。In the identifying step S13 , the plurality of current DDLs are compared with the plurality of previous DDLs for the previous version package to identify at least one changed DDL corresponding to the changed content in Table 1 .

多个当前DDL例如是10个当前DDL,先前版本包的多个先前DDL例如是10个先前DDL,将10个当前DDL和10个先前DDL进行比较,从而识别出与表1中的变更内容对应的两个变更DDL,例如DDL1(对应于“增加字段”),DDL2(对应于“删除数据”)。The multiple current DDLs are, for example, 10 current DDLs, and the multiple previous DDLs of the previous version package are, for example, 10 previous DDLs. Compare the 10 current DDLs with the 10 previous DDLs to identify the corresponding changes in Table 1. Two change DDLs, such as DDL1 (corresponding to "add field"), DDL2 (corresponding to "delete data").

可以理解的是,DDL1和DDL2是10个当前DDL中的两个DDL,并且与10个先前DDL中的先前两个DDL不同。也就是说,将10个当前DDL中与10个先前DDL不同的DDL作为变更DDL。It can be understood that DDL1 and DDL2 are two DDLs among the 10 current DDLs, and are different from the previous two DDLs among the 10 previous DDLs. That is, among the 10 current DDLs, the DDLs different from the 10 previous DDLs are taken as the changed DDLs.

在版本包生成步骤S14,调用与每个变更DDL对应的脚本语言,以生成当前版本包。In the version package generating step S14, the script language corresponding to each changed DDL is invoked to generate the current version package.

具体的,如图2所示,版本包生成步骤S14进一步包括第二生成步骤S141和第三生成步骤S142。Specifically, as shown in FIG. 2 , the version package generating step S14 further includes a second generating step S141 and a third generating step S142.

在第二生成步骤S141,生成与每个变更DDL对应的脚本语言。脚本语言是shell脚本语言。In the second generation step S141, a script language corresponding to each changed DDL is generated. The scripting language is a shell scripting language.

具体的,使用例如java工具,生成与DDL1对应的shell脚本1、以及与DDL2对应的shell脚本2。Specifically, for example, a java tool is used to generate a shell script 1 corresponding to DDL1 and a shell script 2 corresponding to DDL2.

在第三生成步骤S142,调用shell脚本1和shell脚本2,从而生成当前版本包。In the third generation step S142, the shell script 1 and the shell script 2 are invoked, thereby generating the current version package.

由于shell脚本已经做好了一系列的封装,所以只需将其按照固定的版本框架,进行调用,即可制作出当前版本包。Since the shell script has already prepared a series of packages, it only needs to be called according to the fixed version framework to make the current version package.

图3示出了根据本发明的用于生成数据库的版本包的方法的第三流程图。如图3所示,在版本包生成步骤S14之后,进一步包括检查步骤S15,基于生成的当前版本包中的至少一个文件夹,对当前版本包进行检查。Fig. 3 shows a third flow chart of the method for generating a database version package according to the present invention. As shown in FIG. 3 , after the step S14 of generating the version package, a checking step S15 is further included to check the current version package based on at least one folder in the generated current version package.

制作出的当前版本包中包括alter文件夹(假设有alter表结构的情况才会存在该文件夹)、DDL文件夹、log文件夹(记录所有脚本执行的日志)、script文件夹(包含所有要执行的脚本),loaddata文件夹(假设存在删表重建需要保留数据的情况需要对表中数据执行上下档操作)。The current version package produced includes the alter folder (this folder exists only if there is an alter table structure), DDL folder, log folder (records all script execution logs), script folder (contains all required Executed script), loaddata folder (assuming that there is a situation where data needs to be retained for table deletion and reconstruction, and the data in the table needs to be uploaded and uploaded).

其中,script文件夹中包含:Among them, the script folder contains:

1.总控脚本,负责调起所有其他的所有脚本1. Master control script, responsible for calling all other scripts

2.备份标准目录脚本、更新标准目录脚本、更新版本目录脚本2. Backup standard directory script, update standard directory script, update version directory script

3.数据库版本脚本(执行变表、新增表等实际数据库执行脚本)3. Database version script (execute actual database execution scripts such as changing tables and adding tables)

4.日志检核脚本4. Log verification script

5.Shlist清单,包含了所有脚本的编号,如果脚本执行成功,则从Shlist清单中删除,而执行失败的脚本依旧保留在Shlist清单中。该Shlist清单为了假设在版本执行过程中遇到报错,在解决问题后能支持直接重提00脚本。5. The Shlist list contains the numbers of all scripts. If the script is successfully executed, it will be deleted from the Shlist list, and the script that failed to execute will still remain in the Shlist list. In order to assume that an error is reported during the execution of the version, the Shlist can support the direct re-promotion of the 00 script after the problem is solved.

判断alter文件夹(假设有alter表结构的情况才需要检核该文件夹情况)和DDL文件夹是否为空,如果不为空,则表示当前版本包正确,否则表示当前版本包不正确。Determine whether the alter folder (it is necessary to check the folder if there is an alter table structure) and the DDL folder are empty. If not, it means that the current version package is correct, otherwise it means that the current version package is incorrect.

检查Shlist清单里的脚本编号,判断是否包含所有脚本,如果包含,则表示当前版本包正确,否则表示当前版本包不正确。Check the script number in the Shlist list to determine whether all scripts are included. If it is included, it means that the current version package is correct, otherwise it means that the current version package is incorrect.

本发明中,无需人工即可实现版本包的制作,大幅度地降低了人工制作版本包的时间,减少了人工操作的不确定性,增强了准确性。进一步,通过对制作出的当前版本包进行检查,以判断当前版本包是否正确,从而进一步增强了准确性。In the present invention, the production of the version package can be realized without manpower, greatly reducing the time for manual production of the version package, reducing the uncertainty of manual operation, and enhancing the accuracy. Further, by checking the produced current version package, it is judged whether the current version package is correct, thereby further enhancing the accuracy.

本发明还提供用于生成数据库的版本包的装置40,如图4所示,装置40包括:获取单元41,获取所述数据库中的至少一个变更表名称和对应的变更内容,并获取与至少一个所述变更表名称相关联的表配置文件、表结构定义文件以及主键和索引文件;DDL生成单元42,根据所述变更内容,基于所述表配置文件、表结构定义文件以及主键和索引文件,生成用于当前版本包的多个当前DDL;识别单元43,将所述多个当前DDL与用于先前版本包的多个先前DDL进行比较,以识别出与所述变更内容对应的至少一个变更DDL;版本包生成单元44,调用与每个所述变更DDL对应的脚本语言,以生成所述当前版本包。The present invention also provides a device 40 for generating a version package of a database. As shown in FIG. A table configuration file, a table structure definition file, and a primary key and index file associated with the change table name; the DDL generating unit 42, according to the change content, based on the table configuration file, the table structure definition file, and the primary key and index file , generating a plurality of current DDLs for the current version package; identification unit 43, comparing the plurality of current DDLs with the plurality of previous DDLs for the previous version package, to identify at least one corresponding to the changed content Change DDL; the version package generation unit 44 invokes the script language corresponding to each change DDL to generate the current version package.

可以理解的是,获取单元41、DDL生成单元42、识别单元43、版本包生成单元44可以通过图7中的电子设备100中具有这些模块或单元功能的处理器102来实现。It can be understood that the acquiring unit 41, the DDL generating unit 42, the identifying unit 43, and the version package generating unit 44 can be implemented by the processor 102 in the electronic device 100 in FIG. 7 having functions of these modules or units.

如图5所示,DDL生成单元42进一步包括修改单元421,根据所述变更内容,对所述主键和索引文件进行修改,并将修改后的所述主键和索引文件更新到所述表配置文件;第一生成单元422,基于更新后的所述表配置文件以及所述表结构定义文件,按照预定分片分区规则,生成所述多个当前DDL。版本包生成单元44进一步包括第二生成单元441,生成与每个所述变更DDL对应的脚本语言;第三生成单元442,调用每个所述脚本语言,以生成所述当前版本包。As shown in Figure 5, the DDL generation unit 42 further includes a modification unit 421, which modifies the primary key and index file according to the changed content, and updates the modified primary key and index file to the table configuration file ; The first generation unit 422 generates the multiple current DDLs based on the updated table configuration file and the table structure definition file according to predetermined fragmentation and partition rules. The version package generation unit 44 further includes a second generation unit 441 for generating a script language corresponding to each of the modified DDLs; a third generation unit 442 for invoking each of the script languages to generate the current version package.

可以理解的是,修改单元421、第一生成单元422、第二生成单元441、第三生成单元442可以通过图7中的电子设备100中具有这些模块或单元功能的处理器102来实现。It can be understood that the modifying unit 421 , the first generating unit 422 , the second generating unit 441 and the third generating unit 442 may be implemented by the processor 102 in the electronic device 100 in FIG. 7 having functions of these modules or units.

如图6所示,装置40进一步包括检查单元45,基于生成的所述当前版本包中的至少一个文件夹,对所述当前版本包进行检查。可以理解的是,检查单元45可以通过图7中的电子设备100中具有这些模块或单元功能的处理器102来实现。As shown in FIG. 6 , the device 40 further includes a checking unit 45 , which checks the current version package based on at least one folder in the generated current version package. It can be understood that the checking unit 45 can be implemented by the processor 102 in the electronic device 100 in FIG. 7 having functions of these modules or units.

本发明还提供一种计算机可读存储介质,存储介质上存储有指令,该指令在计算机上执行时使计算机执行图1中所示的用于生成数据库的版本包的方法。The present invention also provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the method for generating a database version package shown in FIG. 1 .

本发明还提供一种计算机程序产品,包括计算机可执行指令,指令被处理器102执行以实施本发明的数据处理方法。The present invention also provides a computer program product, including computer-executable instructions, which are executed by the processor 102 to implement the data processing method of the present invention.

现在参考图7,图7示意性地示出了根据本发明的实施例的示例电子设备1400。在一个实施例中,系统1400可以包括一个或多个处理器1404,与处理器1404中的至少一个连接的系统控制逻辑1408,与系统控制逻辑1408连接的系统内存1412,与系统控制逻辑1408连接的非易失性存储器(NVM)1416,以及与系统控制逻辑1408连接的网络接口1420。Reference is now made to FIG. 7, which schematically illustrates an example electronic device 1400 in accordance with an embodiment of the present invention. In one embodiment, system 1400 may include one or more processors 1404, system control logic 1408 coupled to at least one of processors 1404, system memory 1412 coupled to system control logic 1408, coupled to system control logic 1408 A non-volatile memory (NVM) 1416, and a network interface 1420 connected to the system control logic 1408.

在一些实施例中,处理器1404可以包括一个或多个单核或多核处理器。在一些实施例中,处理器1404可以包括通用处理器和专用处理器(例如,图形处理器,应用处理器,基带处理器等)的任意组合。在系统1400采用eNB(Evolved Node B,增强型基站)101或RAN(Radio Access Network,无线接入网)控制器102的实施例中,处理器1404可以被配置为执行各种符合的实施例,例如,如图1所示的实施例。In some embodiments, processor 1404 may include one or more single-core or multi-core processors. In some embodiments, processor 1404 may include any combination of general purpose processors and special purpose processors (eg, graphics processors, application processors, baseband processors, etc.). In an embodiment where the system 1400 adopts an eNB (Evolved Node B, enhanced base station) 101 or a RAN (Radio Access Network, radio access network) controller 102, the processor 1404 may be configured to execute various consistent embodiments, For example, the embodiment shown in FIG. 1 .

在一些实施例中,系统控制逻辑1408可以包括任意合适的接口控制器,以向处理器1404中的至少一个和/或与系统控制逻辑1408通信的任意合适的设备或组件提供任意合适的接口。In some embodiments, system control logic 1408 may include any suitable interface controller to provide any suitable interface to at least one of processors 1404 and/or any suitable device or component in communication with system control logic 1408 .

在一些实施例中,系统控制逻辑1408可以包括一个或多个存储器控制器,以提供连接到系统内存1412的接口。系统内存1412可以用于加载以及存储数据和/或指令。在一些实施例中系统1400的内存1412可以包括任意合适的易失性存储器,例如合适的动态随机存取存储器(DRAM)。In some embodiments, system control logic 1408 may include one or more memory controllers to provide an interface to system memory 1412 . System memory 1412 can be used for loading and storing data and/or instructions. Memory 1412 of system 1400 may in some embodiments include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).

NVM/存储器1416可以包括用于存储数据和/或指令的一个或多个有形的、非暂时性的计算机可读介质。在一些实施例中,NVM/存储器1416可以包括闪存等任意合适的非易失性存储器和/或任意合适的非易失性存储设备,例如HDD(Hard Disk Drive,硬盘驱动器),CD(Compact Disc,光盘)驱动器,DVD(Digital Versatile Disc,数字通用光盘)驱动器中的至少一个。NVM/memory 1416 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions. In some embodiments, NVM/memory 1416 may include any suitable non-volatile memory such as flash memory and/or any suitable non-volatile storage device, such as HDD (Hard Disk Drive, hard disk drive), CD (Compact Disc , CD) drive, at least one of DVD (Digital Versatile Disc, Digital Versatile Disc) drive.

NVM/存储器1416可以包括安装系统1400的装置上的一部分存储资源,或者它可以由设备访问,但不一定是设备的一部分。例如,可以经由网络接口1420通过网络访问NVM/存储器1416。NVM/memory 1416 may comprise a portion of storage resources on the device on which system 1400 is installed, or it may be accessed by, but not necessarily part of, the device. For example, NVM/memory 1416 may be accessed over a network via network interface 1420 .

特别地,系统内存1412和NVM/存储器1416可以分别包括:指令1424的暂时副本和永久副本。指令1424可以包括:由处理器1404中的至少一个执行时导致电子设备1400实施如图2所示的方法的指令。在一些实施例中,指令1424、硬件、固件和/或其软件组件可另外地/替代地置于系统控制逻辑1408,网络接口1420和/或处理器1404中。In particular, system memory 1412 and NVM/storage 1416 may include, respectively, temporary and permanent copies of instructions 1424 . The instructions 1424 may include: instructions that cause the electronic device 1400 to implement the method shown in FIG. 2 when executed by at least one of the processors 1404 . In some embodiments, instructions 1424 , hardware, firmware and/or software components thereof may additionally/alternatively reside in system control logic 1408 , network interface 1420 and/or processor 1404 .

网络接口1420可以包括收发器,用于为系统1400提供无线电接口,进而通过一个或多个网络与任意其他合适的设备(如前端模块,天线等)进行通信。在一些实施例中,网络接口1420可以集成于系统1400的其他组件。例如,网络接口1420可以集成于处理器1404的,系统内存1412,NVM/存储器1416,和具有指令的固件设备(未示出)中的至少一种,当处理器1404中的至少一个执行所述指令时,电子设备1400实现如图1所示的方法。The network interface 1420 may include a transceiver for providing a radio interface for the system 1400 to communicate with any other suitable devices (eg, front-end modules, antennas, etc.) via one or more networks. In some embodiments, network interface 1420 may be integrated with other components of system 1400 . For example, network interface 1420 may be integrated into at least one of processor 1404, system memory 1412, NVM/storage 1416, and a firmware device (not shown) with instructions, when at least one of processor 1404 executes the Upon instruction, the electronic device 1400 implements the method shown in FIG. 1 .

网络接口1420可以进一步包括任意合适的硬件和/或固件,以提供多输入多输出无线电接口。例如,网络接口1420可以是网络适配器,无线网络适配器,电话调制解调器和/或无线调制解调器。Network interface 1420 may further include any suitable hardware and/or firmware to provide a multiple-input multiple-output radio interface. For example, network interface 1420 may be a network adapter, a wireless network adapter, a telephone modem and/or a wireless modem.

在一个实施例中,处理器1404中的至少一个可以与用于系统控制逻辑1408的一个或多个控制器的逻辑封装在一起,以形成系统封装(SiP)。在一个实施例中,处理器1404中的至少一个可以与用于系统控制逻辑1408的一个或多个控制器的逻辑集成在同一管芯上,以形成片上系统(SoC)。In one embodiment, at least one of the processors 1404 may be packaged with logic for one or more controllers of the system control logic 1408 to form a system in package (SiP). In one embodiment, at least one of the processors 1404 may be integrated on the same die with logic for one or more controllers of the system control logic 1408 to form a system on chip (SoC).

电子设备1400可以进一步包括:输入/输出(I/O)设备1432。I/O设备1432可以包括用户界面,使得用户能够与电子设备1400进行交互;外围组件接口的设计使得外围组件也能够与电子设备1400交互。在一些实施例中,电子设备1400还包括传感器,用于确定与电子设备1400相关的环境条件和位置信息的至少一种。The electronic device 1400 may further include: an input/output (I/O) device 1432 . The I/O device 1432 may include a user interface, enabling the user to interact with the electronic device 1400 ; the design of the peripheral component interface enables the peripheral components to also interact with the electronic device 1400 . In some embodiments, the electronic device 1400 further includes a sensor for determining at least one of environmental conditions and location information related to the electronic device 1400 .

在一些实施例中,用户界面可包括但不限于显示器(例如,液晶显示器,触摸屏显示器等),扬声器,麦克风,一个或多个相机(例如,静止图像照相机和/或摄像机),手电筒(例如,发光二极管闪光灯)和键盘。In some embodiments, the user interface may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and/or a video camera), a flashlight (e.g., LED flash light) and keyboard.

本申请公开的机制的各实施例可以被实现在硬件、软件、固件或这些实现方法的组合中。本申请的实施例可实现为在可编程系统上执行的计算机程序或程序代码,该可编程系统包括至少一个处理器、存储系统(包括易失性和非易失性存储器和/或存储元件)、至少一个输入设备以及至少一个输出设备。Various embodiments of the mechanisms disclosed in this application may be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of the present application may be implemented as a computer program or program code executed on a programmable system comprising at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements) , at least one input device, and at least one output device.

可将程序代码应用于输入指令,以执行本申请描述的各功能并生成输出信息。可以按已知方式将输出信息应用于一个或多个输出设备。为了本申请的目的,处理系统包括具有诸如例如数字信号处理器(DSP)、微控制器、专用集成电路(ASIC)或微处理器之类的处理器的任何系统。Program code can be applied to input instructions to perform the functions described herein and to generate output information. The output information may be applied to one or more output devices in known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), microcontroller, application specific integrated circuit (ASIC), or microprocessor.

程序代码可以用高级程序化语言或面向对象的编程语言来实现,以便与处理系统通信。在需要时,也可用汇编语言或机器语言来实现程序代码。事实上,本申请中描述的机制不限于任何特定编程语言的范围。在任一情形下,该语言可以是编译语言或解释语言。The program code can be implemented in a high-level procedural language or an object-oriented programming language to communicate with the processing system. Program code can also be implemented in assembly or machine language, if desired. In fact, the mechanisms described in this application are not limited in scope to any particular programming language. In either case, the language may be a compiled or interpreted language.

在一些情况下,所公开的实施例可以以硬件、固件、软件或其任何组合来实现。所公开的实施例还可以被实现为由一个或多个暂时或非暂时性机器可读(例如,计算机可读)存储介质承载或存储在其上的指令,其可以由一个或多个处理器读取和执行。例如,指令可以通过网络或通过其他计算机可读介质分发。因此,机器可读介质可以包括用于以机器(例如,计算机)可读的形式存储或传输信息的任何机制,包括但不限于,软盘、光盘、光碟、只读存储器(CD-ROM)、磁光盘、只读存储器(ROM)、随机存取存储器(RAM)、可擦除可编程只读存储器(EPROM)、电可擦除可编程只读存储器(EEPROM)、磁卡或光卡、闪存、或用于利用因特网以电、光、声或其他形式的传播信号来传输信息(例如,载波、红外信号数字信号等)的有形的机器可读存储器。因此,机器可读介质包括适合于以机器(例如,计算机)可读的形式存储或传输电子指令或信息的任何类型的机器可读介质。In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which can be executed by one or more processors read and execute. For example, instructions may be distributed over a network or via other computer-readable media. Thus, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy disks, optical disks, optical disks, read-only memory (CD-ROM), magnetic Optical discs, read-only memory (ROM), random-access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic or optical cards, flash memory, or A tangible, machine-readable memory used to transmit information (eg, carrier waves, infrared signals, digital signals, etc.) by electrical, optical, acoustic, or other forms of propagating signals using the Internet. Thus, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).

在附图中,可以以特定布置和/或顺序示出一些结构或方法特征。然而,应该理解,可能不需要这样的特定布置和/或排序。而是,在一些实施例中,这些特征可以以不同于说明性附图中所示的方式和/或顺序来布置。另外,在特定图中包括结构或方法特征并不意味着暗示在所有实施例中都需要这样的特征,并且在一些实施例中,可以不包括这些特征或者可以与其他特征组合。In the drawings, some structural or methodological features may be shown in a particular arrangement and/or order. However, it should be understood that such specific arrangements and/or orderings may not be required. Rather, in some embodiments, these features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments these features may not be included or may be combined with other features.

需要说明的是,本申请各设备实施例中提到的各单元/模块都是逻辑单元/模块,在物理上,一个逻辑单元/模块可以是一个物理单元/模块,也可以是一个物理单元/模块的一部分,还可以以多个物理单元/模块的组合实现,这些逻辑单元/模块本身的物理实现方式并不是最重要的,这些逻辑单元/模块所实现的功能的组合才是解决本申请所提出的技术问题的关键。此外,为了突出本申请的创新部分,本申请上述各设备实施例并没有将与解决本申请所提出的技术问题关系不太密切的单元/模块引入,这并不表明上述设备实施例并不存在其它的单元/模块。It should be noted that each unit/module mentioned in each device embodiment of this application is a logical unit/module. Physically, a logical unit/module can be a physical unit/module, or a physical unit/module. A part of the module can also be realized with a combination of multiple physical units/modules, the physical implementation of these logical units/modules is not the most important, the combination of functions realized by these logical units/modules is the solution The key to the technical issues raised. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units/modules that are not closely related to solving the technical problems proposed by this application, which does not mean that the above-mentioned device embodiments do not exist other units/modules.

需要说明的是,在本专利的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in the examples and descriptions of this patent, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply There is no such actual relationship or order between these entities or operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。Although this application has been shown and described with reference to certain preferred embodiments thereof, those skilled in the art will understand that various changes in form and details may be made therein without departing from this disclosure. The spirit and scope of the application.

Claims (15)

1.一种用于生成数据库的版本包的方法,其特征在于,所述方法包括:1. A method for generating a version package of a database, characterized in that the method comprises: 获取步骤,获取所述数据库中的至少一个变更表名称和对应的变更内容,并获取与至少一个所述变更表名称相关联的表配置文件、表结构定义文件以及主键和索引文件;The obtaining step is to obtain at least one change table name and corresponding change content in the database, and obtain a table configuration file, a table structure definition file, a primary key and an index file associated with at least one change table name; DDL生成步骤,根据所述变更内容,基于所述表配置文件、表结构定义文件以及主键和索引文件,生成用于当前版本包的多个当前DDL;DDL generating step, according to the change content, based on the table configuration file, table structure definition file and primary key and index file, generate a plurality of current DDLs for the current version package; 识别步骤,将所述多个当前DDL与用于先前版本包的多个先前DDL进行比较,以识别出与所述变更内容对应的至少一个变更DDL;an identifying step of comparing the plurality of current DDLs with a plurality of previous DDLs for a previous version package to identify at least one changed DDL corresponding to the changed content; 版本包生成步骤,调用与每个所述变更DDL对应的脚本语言,以生成所述当前版本包。The version package generation step is to call the script language corresponding to each of the changed DDLs to generate the current version package. 2.根据权利要求1所述的方法,其特征在于,所述DDL生成步骤进一步包括:2. The method according to claim 1, wherein the DDL generating step further comprises: 修改步骤,根据所述变更内容,对所述主键和索引文件进行修改,并将修改后的所述主键和索引文件更新到所述表配置文件;The modification step is to modify the primary key and index file according to the changed content, and update the modified primary key and index file to the table configuration file; 第一生成步骤,基于更新后的所述表配置文件以及所述表结构定义文件,按照预定分片分区规则,生成所述多个当前DDL。The first generating step is to generate the plurality of current DDLs according to predetermined fragmentation and partition rules based on the updated table configuration file and the table structure definition file. 3.根据权利要求1或2所述的方法,其特征在于,所述版本包生成步骤进一步包括:3. The method according to claim 1 or 2, wherein the version package generation step further comprises: 第二生成步骤,生成与每个所述变更DDL对应的脚本语言;A second generating step, generating a script language corresponding to each of the changed DDLs; 第三生成步骤,调用每个所述脚本语言,以生成所述当前版本包。The third generation step is to call each of the script languages to generate the current version package. 4.根据权利要求3所述的方法,其特征在于,所述脚本语言是shell脚本语言。4. The method according to claim 3, wherein the scripting language is a shell scripting language. 5.根据权利要求1所述的方法,其特征在于,每个所述变更表名称具有对应的变更时间,5. The method according to claim 1, characterized in that, each said change table name has a corresponding change time, 其中,在所述获取步骤中,基于输入的变更时间,获取与输入的变更时间对应的至少一个变更表名称和对应的变更内容。Wherein, in the obtaining step, based on the input change time, at least one change table name and corresponding change content corresponding to the input change time are obtained. 6.根据权利要求1所述的方法,其特征在于,进一步包括:6. The method of claim 1, further comprising: 检查步骤,基于生成的所述当前版本包中的至少一个文件夹,对所述当前版本包进行检查。The checking step is to check the current version package based on at least one folder in the generated current version package. 7.一种用于生成数据库的版本包的装置,其特征在于,所述装置包括:7. A device for generating a version package of a database, characterized in that the device comprises: 获取单元,获取所述数据库中的至少一个变更表名称和对应的变更内容,并获取与至少一个所述变更表名称相关联的表配置文件、表结构定义文件以及主键和索引文件;An acquisition unit, which acquires at least one change table name and corresponding change content in the database, and obtains a table configuration file, a table structure definition file, and a primary key and index file associated with at least one change table name; DDL生成单元,根据所述变更内容,基于所述表配置文件、表结构定义文件以及主键和索引文件,生成用于当前版本包的多个当前DDL;The DDL generation unit generates a plurality of current DDLs for the current version package based on the table configuration file, table structure definition file, primary key and index file according to the changed content; 识别单元,将所述多个当前DDL与用于先前版本包的多个先前DDL进行比较,以识别出与所述变更内容对应的至少一个变更DDL;An identification unit, comparing the plurality of current DDLs with the plurality of previous DDLs used in the previous version package, to identify at least one changed DDL corresponding to the changed content; 版本包生成单元,调用与每个所述变更DDL对应的脚本语言,以生成所述当前版本包。The version package generation unit invokes the script language corresponding to each of the changed DDLs to generate the current version package. 8.根据权利要求7所述的装置,其特征在于,所述DDL生成单元进一步包括:8. The device according to claim 7, wherein the DDL generation unit further comprises: 修改单元,根据所述变更内容,对所述主键和索引文件进行修改,并将修改后的所述主键和索引文件更新到所述表配置文件;The modifying unit modifies the primary key and index file according to the modification content, and updates the modified primary key and index file to the table configuration file; 第一生成单元,基于更新后的所述表配置文件以及所述表结构定义文件,按照预定分片分区规则,生成所述多个当前DDL。The first generation unit is configured to generate the plurality of current DDLs based on the updated table configuration file and the table structure definition file according to predetermined fragmentation and partition rules. 9.根据权利要求7或8所述的装置,其特征在于,所述版本包生成单元进一步包括:9. The device according to claim 7 or 8, wherein the version package generating unit further comprises: 第二生成单元,生成与每个所述变更DDL对应的脚本语言;A second generating unit, generating a script language corresponding to each of the changed DDLs; 第三生成单元,调用每个所述脚本语言,以生成所述当前版本包。The third generation unit calls each of the script languages to generate the current version package. 10.根据权利要求9所述的装置,其特征在于,所述脚本语言是shell脚本语言。10. The device according to claim 9, wherein the scripting language is a shell scripting language. 11.根据权利要求7所述的装置,其特征在于,每个所述变更表名称具有对应的变更时间,11. The device according to claim 7, wherein each of the change table names has a corresponding change time, 其中,所述获取单元基于输入的变更时间,获取与输入的变更时间对应的至少一个变更表名称和对应的变更内容。Wherein, the acquiring unit acquires at least one change table name and corresponding change content corresponding to the input change time based on the input change time. 12.根据权利要求7所述的装置,其特征在于,所述装置进一步包括:12. The device according to claim 7, further comprising: 检查单元,基于生成的所述当前版本包中的至少一个文件夹,对所述当前版本包进行检查。The checking unit checks the current version package based on at least one folder in the generated current version package. 13.一种计算机可读存储介质,其特征在于,所述存储介质上存储有指令,所述指令在计算机上执行时使所述计算机执行权利要求1至6中任一项所述的用于生成数据库的版本包的方法。13. A computer-readable storage medium, wherein instructions are stored on the storage medium, and when the instructions are executed on a computer, the computer executes the method according to any one of claims 1 to 6. The method to generate the version package of the database. 14.一种电子设备,其特征在于,包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个程序,当所述一个或者多个程序被所述一个或多个处理器执行时,使得所述电子设备执行权利要求1至6中任一项所述的用于生成数据库的版本包的方法。14. An electronic device, characterized in that it comprises: one or more processors; one or more memories; one or more programs stored in the one or more memories, when the one or more programs are When executed, the one or more processors make the electronic device execute the method for generating the version package of the database according to any one of claims 1 to 6. 15.一种计算机程序产品,包括计算机可执行指令,其特征在于,所述指令被处理器执行以实施权利要求1至6中任一项所述的用于生成数据库的版本包的方法。15. A computer program product, comprising computer-executable instructions, wherein the instructions are executed by a processor to implement the method for generating a version package of a database according to any one of claims 1 to 6.
CN202211082578.7A 2022-09-06 2022-09-06 Method, device, medium and electronic equipment for generating version package of database Pending CN115374089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211082578.7A CN115374089A (en) 2022-09-06 2022-09-06 Method, device, medium and electronic equipment for generating version package of database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211082578.7A CN115374089A (en) 2022-09-06 2022-09-06 Method, device, medium and electronic equipment for generating version package of database

Publications (1)

Publication Number Publication Date
CN115374089A true CN115374089A (en) 2022-11-22

Family

ID=84069966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211082578.7A Pending CN115374089A (en) 2022-09-06 2022-09-06 Method, device, medium and electronic equipment for generating version package of database

Country Status (1)

Country Link
CN (1) CN115374089A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2079131A1 (en) * 1991-09-27 1993-03-28 Jack Edward Olson Change definition language for computer database system
CN108228838A (en) * 2018-01-05 2018-06-29 浪潮软件集团有限公司 Service data changing method and changing device
CN110633284A (en) * 2019-09-19 2019-12-31 中国工商银行股份有限公司 Method and device for changing table in database
CN112445519A (en) * 2020-12-03 2021-03-05 平安科技(深圳)有限公司 File change control method, device, equipment and storage medium
CN112445781A (en) * 2020-11-30 2021-03-05 建信金融科技有限责任公司 Method and device for managing data base DDL
CN113672626A (en) * 2021-09-06 2021-11-19 中国银行股份有限公司 Data structure changing method and device and electronic equipment
CN114253599A (en) * 2021-12-23 2022-03-29 中国建设银行股份有限公司 Version deployment method, version deployment device, electronic device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2079131A1 (en) * 1991-09-27 1993-03-28 Jack Edward Olson Change definition language for computer database system
CN108228838A (en) * 2018-01-05 2018-06-29 浪潮软件集团有限公司 Service data changing method and changing device
CN110633284A (en) * 2019-09-19 2019-12-31 中国工商银行股份有限公司 Method and device for changing table in database
CN112445781A (en) * 2020-11-30 2021-03-05 建信金融科技有限责任公司 Method and device for managing data base DDL
CN112445519A (en) * 2020-12-03 2021-03-05 平安科技(深圳)有限公司 File change control method, device, equipment and storage medium
CN113672626A (en) * 2021-09-06 2021-11-19 中国银行股份有限公司 Data structure changing method and device and electronic equipment
CN114253599A (en) * 2021-12-23 2022-03-29 中国建设银行股份有限公司 Version deployment method, version deployment device, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN111104392B (en) Database migration method and device, electronic equipment and storage medium
CN109840429B (en) Intelligent contract deployment and calling method and device
CN109032631B (en) Application program patch package obtaining method and device, computer equipment and storage medium
CN112559444B (en) SQL file migration method, device, storage medium and equipment
CN113204558B (en) Automatic data table structure updating method and device
CN108319460A (en) Method and device for generating application program installation package, electronic equipment and storage medium
CN107016047A (en) Document query, document storing method and device
US20190146777A1 (en) Method and apparatus for generating patch
US11360993B1 (en) Automatic generation of specifications for data access layer application programming interfaces
CN111443920B (en) Frame migration method and device
CN114398073B (en) Application updating method and device based on RN
US12045605B2 (en) Method for updating applications in cloud environments
WO2022012327A1 (en) Code analysis method and system, and computing device
CN112631894B (en) Code detection method, device, storage medium and computer equipment
CN115016836A (en) Component version management method, device, electronic device and system
CN112699129A (en) Data processing system, method and device
CN111176720A (en) A control method and control device for realizing application program running in multiple systems
CN115374089A (en) Method, device, medium and electronic equipment for generating version package of database
CN110442353B (en) Installation package management method and device and electronic equipment
CN116795419A (en) Version package grouping method, device, equipment and storage medium
CN115080114B (en) Application program transplanting processing method, device and medium
CN117076753A (en) A resource query method, device, electronic equipment and storage medium
WO2022241947A1 (en) Data processing method and apparatus for application program, device, and storage medium
CN116244009A (en) Object arrangement method and device
CN112597029A (en) Standard inspection system, method, device and medium

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