Data storage method, device, computer equipment, storage medium and program product

By introducing data processing models and corresponding functional information and mapping relationship information into the database management platform, the problem of low development efficiency of database management platform is solved, and data screening and storage without code is realized, which improves development efficiency and stability.

CN118349546BActive Publication Date: 2025-04-18BEIJING SHENZHOU AEROSPACE SOFTWARE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410313831.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2025-04-18
Estimated Expiration
2044-03-19

AI Technical Summary

Technical Problem

The development efficiency of the database management platform is low, mainly due to the complexity of writing filter code and the problem of rewriting filter code every time a new business function is added.

Method used

By introducing data processing models, model function information and mapping relationship information into the database management platform, technicians can define corresponding model functions and mapping relationships to realize data filtering and storing without writing code.

Benefits of technology

It improves the development efficiency of the database management platform, allowing technicians to simply fill in model information during the initial development and subsequent tuning stages, without writing code, and avoids the crash problem caused by manual code modification errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118349546B_ABST
    Figure CN118349546B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of database technology, and discloses a data storage method, device, computer equipment, storage medium and program product, including: obtaining a target instruction; obtaining a first database table corresponding to the database table identifier according to a database table identifier; selecting at least one data processing model corresponding to the database table identifier from at least one data processing model according to mapping relationship information and the database table identifier of each data processing model; determining a second database table corresponding to the target data processing model according to the target mapping relationship information; screening all business data in the first database table according to the target model function information to obtain multiple target business data corresponding to the target data processing model; storing the multiple target business data in the second database table according to the target mapping relationship information. The present invention can improve the development efficiency of a database management platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a data storage method, device, computer equipment, storage medium and program product. Background Art

[0002] In the field of database technology, users usually use various Excel spreadsheet templates to record data. For example, the Excel spreadsheet template can be a template for filling in user information, a template for filling in organizational structure information, etc. After obtaining the Excel file imported by the user, the database management platform can parse the data in the Excel file according to the template corresponding to the Excel file, filter the parsed data, and store the filtered data in the corresponding business database table. In this way, data can be directly extracted from the business database table in subsequent business.

[0003] Generally, technicians will write corresponding codes in advance according to the screening conditions corresponding to the business database table to implement data screening. However, due to the large number of business database tables, the coding process is relatively complicated, and the corresponding screening code needs to be rewritten every time a new business function is added. Therefore, the relevant technology will lead to low development efficiency of the database management platform. Summary of the invention

[0004] In view of this, the present invention provides a data storage method, apparatus, computer equipment, storage medium and program product to solve the problem of low development efficiency of a database management platform.

[0005] In a first aspect, the present invention provides a data storage method, the method is applied to a database management platform, the database management platform includes at least one data processing model, wherein each data processing model includes model function information and mapping relationship information, the method includes:

[0006] Obtaining a target instruction, wherein the target instruction includes a database table identifier;

[0007] According to the database table identifier, obtaining a first database table corresponding to the database table identifier, wherein the first database table includes a plurality of business data;

[0008] According to the mapping relationship information of each data processing model and the database table identifier, selecting at least one data processing model corresponding to the database table identifier from at least one data processing model;

[0009] Determine a second database table corresponding to a target data processing model according to target mapping relationship information, wherein the target mapping relationship information is mapping relationship information corresponding to the target data processing model, and the target data processing model is any data processing model of at least one data processing model corresponding to the database table identifier;

[0010] According to the target model function information, all business data in the first database table are screened to obtain a plurality of target business data corresponding to the target data processing model, wherein the target model function information is model function information corresponding to the target data processing model;

[0011] According to the target mapping relationship information, multiple target business data are stored in the second database table.

[0012] A data storage method provided by the present invention has the following advantages:

[0013] Through the data processing model, technicians can define corresponding model function information and mapping relationship information according to different business needs. In this way, whether in the initial development stage of the database management platform or in the subsequent tuning stage, technicians only need to simply fill in the model function information and mapping relationship information to build or modify the data processing model without writing code, which can improve the development efficiency of the database management platform.

[0014] In an optional implementation, before acquiring the target instruction, the method further includes:

[0015] Get the target table file;

[0016] Extracting a plurality of initial business data, a plurality of field names, and field configuration information corresponding to each field name from the target table file;

[0017] Converting the data type of each field of each piece of initial business data in the plurality of pieces of initial business data to obtain a plurality of pieces of business data after the data type is converted;

[0018] Creating the first database table according to the plurality of field names and the field configuration information corresponding to each of the field names;

[0019] The plurality of business data after data type conversion are stored in the first database table.

[0020] Specifically, by identifying and converting the data types of various fields in the initial business data, the data format is ensured to be consistent with the first database table, errors or exceptions caused by data type mismatch are avoided, and the success rate and accuracy of data entry are improved.

[0021] In an optional implementation, the mapping relationship information includes an identifier of a data processing model and an identifier of a source database table corresponding to the identifier of the data processing model;

[0022] The selecting, according to the mapping relationship information of each data processing model and the database table identifier, at least one data processing model corresponding to the database table identifier from at least one data processing model comprises:

[0023] Matching the database table identifier with a source database table identifier in each of the data processing models in at least one of the data processing models included in the database management system;

[0024] When the source database table identifier of one or more of the data processing models matches the database table identifier, it is determined that the one or more data processing models are data processing models corresponding to the database table identifier.

[0025] Specifically, when adding a new data processing model or database table, it is only necessary to update the corresponding identification information to conveniently match the new model with the existing table or the newly added table, which is conducive to the horizontal expansion of the database management platform.

[0026] In an optional implementation, the mapping relationship information further includes an identifier of a business database table corresponding to the identifier of the data processing model;

[0027] The step of determining the second database table corresponding to the target data processing model according to the target mapping relationship information includes:

[0028] Extracting a target business database table identifier from the target mapping relationship information;

[0029] The second database table is determined according to the target service database table identifier.

[0030] In an optional implementation, the model function information includes at least one condition field name and condition configuration information corresponding to each condition field name;

[0031] The method of screening all business data in the first database table according to the target model function information to obtain multiple target business data corresponding to the target data processing model includes:

[0032] Traversing all business data in the first database table;

[0033] Each time a piece of business data is traversed, determining whether a field value corresponding to a target condition field name in the traversed business data matches the target condition configuration information, wherein the target condition field name is any field name in at least one condition field name, and the target condition configuration information is condition configuration information corresponding to the target condition field name;

[0034] When the field values ​​corresponding to all the condition field names of the traversed business data respectively match the condition configuration information corresponding to the condition field name, the traversed data is determined as the target business data, and the next business data is traversed;

[0035] or,

[0036] When the field value of any condition field name of the traversed business data does not match the condition configuration information of the condition field name, the traversed business data is filtered out and the next business data is traversed;

[0037] After traversing all the business data in the first database table, a plurality of target business data corresponding to the target data processing model are obtained, and the traversal is stopped.

[0038] Specifically, the conditional configuration information can be dynamically set and adjusted according to actual needs, so that the solution can adapt to different business scenarios and screening rules. That is, when modifying the conditional configuration information, the technical personnel only need to modify the conditional configuration information, and the technical personnel do not need to modify the code. In this way, the development efficiency of the database management platform can be improved, and the problem of the database management platform crashing due to manual code modification errors can be avoided.

[0039] In an optional implementation manner, the mapping relationship information further includes multiple model field identifiers, and source database table field identifiers and business database table field identifiers corresponding to each model field identifier, each piece of business data includes a field value corresponding to each of the source database table field identifiers, and the second database table includes a field corresponding to each of the business database table field identifiers;

[0040] The storing of the plurality of target business data in the second database table according to the target mapping relationship information includes:

[0041] For each piece of the target business data, determining the target source database table field identifier and the target business database table field identifier corresponding to the target model field identifier according to the target model field identifier and the mapping relationship information, wherein the target model field identifier is any one of the multiple model field identifiers;

[0042] The field value corresponding to the target source database table field identifier in the target business data is stored in the field corresponding to the target business database table field identifier in the second database table.

[0043] Specifically, when adding a new model field or business field, you only need to update the corresponding identification information to easily match the new field with the fields in the existing table or the newly added table, which is conducive to the horizontal expansion of the database management platform.

[0044] In a second aspect, the present invention provides a data storage device, the device is applied to a database management platform, the database management platform includes at least one data processing model, wherein each data processing model includes model function information and mapping relationship information, the device includes:

[0045] An acquisition module, configured to acquire a target instruction, wherein the target instruction includes a database table identifier; and acquire a first database table corresponding to the database table identifier according to the database table identifier, wherein the first database table includes a plurality of business data;

[0046] A selection module, configured to select at least one data processing model corresponding to the database table identifier from at least one data processing model according to the mapping relationship information of each data processing model and the database table identifier;

[0047] A determination module, configured to determine a second database table corresponding to a target data processing model according to target mapping relationship information, wherein the target mapping relationship information is mapping relationship information corresponding to the target data processing model, and the target data processing model is any data processing model of at least one data processing model corresponding to the database table identifier;

[0048] A screening module, configured to screen all business data in the first database table according to target model function information to obtain a plurality of target business data corresponding to the target data processing model, wherein the target model function information is model function information corresponding to the target data processing model;

[0049] A storage module is used to store multiple target business data in the second database table according to the target mapping relationship information.

[0050] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the data storage method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0051] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data storage method of the first aspect or any corresponding embodiment thereof.

[0052] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the data storage method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0054] Figure 1 is a schematic diagram of the architecture of a database management system according to an embodiment of the present invention;

[0055] Figure 2 is a schematic diagram of a flow chart of a data storage method according to an embodiment of the present invention;

[0056] Figure 3 is a flow chart of another data storage method according to an embodiment of the present invention;

[0057] Figure 4 is a flow chart of another data storage method according to an embodiment of the present invention;

[0058] Figure 5 is a flow chart of another data storage method according to an embodiment of the present invention;

[0059] Figure 6 is a structural block diagram of a data storage device according to an embodiment of the present invention;

[0060] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0062] like Figure 1 As shown, the database management system includes a client and a database management platform, wherein the client can be a terminal, such as a mobile phone, a computer, etc., and the database management platform can be a server or a server cluster, etc. The database management platform includes at least one data processing model and a database, and at least one database table can be stored in the database. Among them, the database can be a database such as Hadoop, HBase, Cassandra, MongoDb, CouchDB, etc. The data processing model can include model function information and mapping relationship information. The database table can include the correspondence between field names and field identifiers, as well as multiple business data, each business data includes multiple field values, and each field value corresponds to a field name and a field identifier.

[0063] The client may provide a configuration interface for the data processing model, in which the user may input model function information and mapping relationship information in the input box, and click the save control after the input is completed. After detecting that the user clicks the save control operation, the client may send the input model function information, mapping relationship information, and template configuration information of each input box to the database management platform. In this way, the database management platform may construct a data processing model based on the input model function information, mapping relationship information, and template configuration information of each input box, and store it. In particular, for the mapping relationship information, the user may directly create a JSON (JavaScript Object Notation) file.

[0064] In daily work, when the amount of information is huge, you can record the data in an Excel spreadsheet file, and then import the Excel spreadsheet file into the database management platform. The database management platform then fills the data in the Excel spreadsheet file into the corresponding database table according to various business needs. For example, an enterprise records personnel information in an Excel spreadsheet file, and then imports the personnel information into the database management platform.

[0065] The embodiment of the present invention provides a data storage method, which can improve the development efficiency of a database management platform by constructing a data processing model as an intermediate layer to process data.

[0066] According to an embodiment of the present invention, a data storage method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0067] In this embodiment, a data storage method is provided, which can be executed by the above-mentioned database management platform. Figure 2 is a flow chart of a data storage method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0068] Step S201, obtaining a target instruction.

[0069] The target instruction may be an instruction automatically triggered by the database management platform, or may be an instruction generated and sent by the client according to the user's operation. The target instruction may include a database table identifier.

[0070] Step S202: According to the database table identifier, obtain the first database table corresponding to the database table identifier.

[0071] The first database table may include multiple pieces of business data.

[0072] Specifically, the first database table may be cached in the memory. After the database management platform obtains the target instruction, it may parse the target instruction to obtain the database table identifier, and further determine the first database table corresponding to the database table identifier according to the database table identifier.

[0073] Step S203: selecting at least one data processing model corresponding to the database table identifier from at least one data processing model according to the mapping relationship information and the database table identifier of each data processing model.

[0074] Specifically, first, the database management platform can traverse each data processing model, and extract mapping relationship information from each data processing model traversed. Then, it is determined whether the extracted mapping relationship information matches the database table identifier. If so, the data processing model can be selected, and if not, the next data processing model can be traversed. Finally, after traversing all data processing models, all selected data processing models can be determined as data processing models corresponding to the database table identifier.

[0075] For example, the first database table is an employee information table, including fields a, b, c, d, e, and f, where f is family information. There is no data in field f for employees under 35 years old, and data in field f for employees 35 years old or older. The first database table corresponds to two data processing models, namely, a data processing model corresponding to employees under 35 years old and a data processing model corresponding to employees 35 years old or older. The fields in the data processing model corresponding to employees under 35 years old include a, b, c, d, and e, and the fields in the data processing model corresponding to employees 35 years old or older include a, b, c, d, e, and f.

[0076] Step S204: determining a second database table corresponding to the target data processing model according to the target mapping relationship information.

[0077] The target mapping relationship information may be mapping relationship information corresponding to a target data processing model, and the target data processing model may be any data processing model in at least one data processing model corresponding to a database table identifier.

[0078] Specifically, for the target data processing model, the database management platform may extract the target mapping relationship information from the target data processing model, then extract the identifier of the second database table from the target mapping relationship information, and determine the second database table according to the identifier of the second database table.

[0079] Step S205: Screen all business data in the first database table according to the target model function information to obtain multiple target business data corresponding to the target data processing model.

[0080] The target model function information is model function information corresponding to the target data processing model, and may include a filter field identifier.

[0081] Specifically, the database management platform may filter out the field value corresponding to the filter field identifier in each piece of business data to obtain multiple pieces of target business data.

[0082] Step S206: storing the plurality of target business data in the second database table according to the target mapping relationship information.

[0083] The target mapping relationship information may include a correspondence between a source database table field identifier and a business database table identifier field. The second database table may include multiple business database table fields.

[0084] Specifically, for each target business data, the database management platform can determine the target source database table field identifier corresponding to the target business database table field identifier in the target mapping relationship according to the target business database table field identifier. Further, the field value corresponding to the target source database table field identifier in the target business data can be filled into the field corresponding to the target business database table field identifier. In this way, all target business data can be filled into the second database table.

[0085] The data storage method provided in this embodiment allows technicians to define corresponding model function information and mapping relationship information according to different business requirements through the data processing model. In this way, whether in the initial development stage of the database management platform or in the subsequent tuning stage, technicians only need to simply fill in the model function information and mapping relationship information to build or modify the data processing model without writing code, which can improve the development efficiency of the database management platform.

[0086] In this embodiment, a data storage method is provided, which can be executed by the above-mentioned database management platform. Figure 3 is a flow chart of a data storage method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0087] Step S301, obtaining a target table file.

[0088] The first row of the target table file may include multiple field names, and the other rows are all business data.

[0089] Specifically, the user can select the target table file on the client and import it into the database management platform, so that the database management platform can obtain the target table file.

[0090] Step S302: extracting a plurality of initial business data, a plurality of field names, and field configuration information corresponding to each field name from the target table file.

[0091] Specifically, the database management platform can be provided with a data parsing tool, such as the EasyExcel framework. In this way, the database management platform can use the data parsing tool to extract multiple initial business data from the target table file. The database management platform can also be provided with a field parsing tool, such as the Mybatis data persistence layer framework. In this way, the database management platform can use the field parsing tool to extract multiple field names from the target table file, as well as the field configuration information corresponding to each field name.

[0092] Step S303 , converting the data type of each field of each of the multiple pieces of initial business data to obtain multiple pieces of business data with converted data types.

[0093] Specifically, for each piece of initial business data, the field value of each field of the initial business data is converted into a string. If the original data type of the field is a date type, the field value of the field can be converted into a preset format, for example, "yyyy-MM-dd HH:mm:ss".

[0094] In some optional implementations, problems may occur in the process of converting data types. Therefore, in the process of converting data types, the row identifier of the failed data type conversion and the failure reason can be recorded, and the row identifier and failure reason can be sent to the client. In this way, the user can view the row identifier and failure reason on the client, and then find the corresponding row according to the row identifier, and then modify the field configuration information, field name, etc. of the failed field of the row according to the failure reason. After the modification, the data type of the business data of the row is converted again.

[0095] Step S304: Create a first database table according to multiple field names and field configuration information corresponding to each field name.

[0096] Specifically, the database management platform can use Foreach in Mybatis to generate a first database table according to the extracted multiple field names and the field configuration information of each field name.

[0097] Step S305: storing the plurality of business data after data type conversion in the first database table.

[0098] Specifically, for each of the multiple business data after the data type is converted, the database management platform can fill the field value of each field in the business data into the filling position of the corresponding field name in the first database table, and put the first database table filled with business data in the memory. In this way, in subsequent business processing, the first database table can be obtained from the memory more quickly. In addition, since the first database table may be related to multiple businesses at the same time, the business data in the first database table needs to be filled into different business database tables, so the business processing speed can be greatly accelerated.

[0099] Step S306, obtaining the target instruction.

[0100] The target instruction may be an instruction automatically triggered by the database management platform, or may be an instruction generated and sent by the client according to the user's operation. The target instruction may include a database table identifier.

[0101] Step S307: According to the database table identifier, obtain the first database table corresponding to the database table identifier.

[0102] The first database table includes multiple pieces of business data.

[0103] Step S308: selecting at least one data processing model corresponding to the database table identifier from at least one data processing model according to the mapping relationship information and the database table identifier of each data processing model.

[0104] Step S309: Determine a second database table corresponding to the target data processing model according to the target mapping relationship information.

[0105] The target mapping relationship information is mapping relationship information corresponding to a target data processing model, and the target data processing model is any data processing model in at least one data processing model corresponding to a database table identifier.

[0106] Step S310: Screen all business data in the first database table according to the target model function information to obtain multiple target business data corresponding to the target data processing model.

[0107] Among them, the target model function information is the model function information corresponding to the target data processing model.

[0108] Step S311: storing multiple target business data in a second database table according to the target mapping relationship information.

[0109] The specific processing from step S306 to step S311 is similar to the specific processing from step S201 to step S206, and will not be repeated here.

[0110] The data storage method provided in this embodiment ensures that the data format is consistent with the first database table by identifying and converting the data types of each field in the initial business data, avoids errors or exceptions caused by data type mismatch, and improves the success rate and accuracy of data entry.

[0111] In this embodiment, a data storage method is provided, which can be executed by the above-mentioned database management platform. Figure 4 is a flow chart of a data storage method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0112] Step S401, obtaining a target instruction.

[0113] The target instruction includes a database table identifier.

[0114] Step S402: According to the database table identifier, obtain the first database table corresponding to the database table identifier.

[0115] The first database table includes multiple pieces of business data.

[0116] The specific processing from step S401 to step S402 is similar to the specific processing from step S201 to step S202, and will not be repeated here.

[0117] Step S403: selecting at least one data processing model corresponding to the database table identifier from at least one data processing model according to the mapping relationship information and the database table identifier of each data processing model.

[0118] Specifically, when the mapping relationship information includes the identifier of the data processing model and the identifier of the source database table corresponding to the identifier of the data processing model, the above step S403 includes:

[0119] Step S4031: Match the database table identifier with a source database table identifier in each data processing model of at least one data processing model included in the database management system.

[0120] Step S4032: when the source database table identifier of the one or more data processing models matches the database table identifier, determine that the one or more data processing models are the data processing models corresponding to the database table identifier.

[0121] Specifically, first, the database management platform can traverse each data processing model, and each time a data processing model is traversed, the mapping relationship information is extracted from the data processing model, and then the source database table identifier is extracted from the mapping relationship information. Then, the extracted source database table identifier is compared with the database table identifier in the target instruction. When the two identifiers are consistent, the data processing model can be selected and the next data processing model can be traversed. When the two identifiers are inconsistent, the next data processing model is directly traversed. Finally, after traversing all data processing models, all selected data processing models can be determined as data processing models corresponding to the database table identifier.

[0122] Step S404: Determine a second database table corresponding to the target data processing model according to the target mapping relationship information.

[0123] The target mapping relationship information is mapping relationship information corresponding to a target data processing model, and the target data processing model is any data processing model in at least one data processing model corresponding to a database table identifier.

[0124] Specifically, when the mapping relationship information also includes the identifier of the business database table corresponding to the identifier of the data processing model, the above step S404 includes:

[0125] Step S4041: extract the target business database table identifier from the target mapping relationship information.

[0126] Specifically, the database management platform may extract target mapping relationship information from the target data processing model, and then extract the target business database table identifier from the target mapping relationship information.

[0127] Step S4042: Determine the second database table according to the target business database table identifier.

[0128] Specifically, the database management platform can traverse each database table it manages, and each time a database table is traversed, a database table identifier can be extracted from the database table and compared with the target business database table identifier. When the comparison result is a match, the database table can be determined as the second database table. Alternatively, when the comparison result is a mismatch, the next database table can be traversed until the second database table is determined, and the traversal is stopped.

[0129] Alternatively, the database management platform may store a management table having database table identifiers, and therefore, each database table identifier in the management table may be compared with the target business database table identifier, and the database table identifier with a matching comparison result may be determined as the second database table identifier, and further, based on the second database table identifier, the second database table may be determined from the database tables managed by it.

[0130] Step S405: Screen all business data in the first database table according to the target model function information to obtain multiple target business data corresponding to the target data processing model.

[0131] Among them, the target model function information is the model function information corresponding to the target data processing model.

[0132] The specific processing of step S405 is similar to that of step S205 and will not be repeated here.

[0133] Step S406: storing the plurality of target business data in the second database table according to the target mapping relationship information.

[0134] Specifically, when the mapping relationship information further includes multiple model field identifiers, and source database table field identifiers and business database table field identifiers corresponding to each model field identifier, each piece of business data includes a field value corresponding to each source database table field identifier, and the second database table includes a field corresponding to each business database table field identifier, the above step S406 includes:

[0135] Step S4061: for each piece of target business data, determine the target source database table field identifier and the target business database table field identifier corresponding to the target model field identifier according to the target model field identifier and the mapping relationship information.

[0136] The target model field identifier is any model field identifier among the multiple model field identifiers.

[0137] Specifically, in general, the number of model field identifiers in the data processing model is the same as the number of business database table field identifiers in the corresponding business database table, and is less than or equal to the number of source database table field identifiers in the corresponding source database table. For each target business data, the database management platform can determine the target source database table field identifier and the target business database table field identifier in the mapping relationship information according to the target model field identifier.

[0138] Step S4062: Store the field value corresponding to the target source database table field identifier in the target business data into the field corresponding to the target business database table field identifier in the second database table.

[0139] Specifically, for each target business data, the database management platform can fill the field value corresponding to the target source database table field identifier in the target business data into the field corresponding to the target business database table field identifier. In this way, all target business data can be filled into the second database table.

[0140] For example, the mapping relationship information may be as shown in Table 1, including two modules, one is the table mapping relationship, and the other is the field mapping relationship.

[0141] Table 1

[0142]

[0143] In some optional implementations, the data processing model may include an enablement status, a model name, the length of a model field, a source database table name, a business database table name, a field data type, and the like.

[0144] The data storage method provided in this embodiment can conveniently match the new model with the existing table or the newly added table by only updating the corresponding identification information when adding a new data processing model or database table, which is conducive to the horizontal expansion of the database management platform.

[0145] In this embodiment, a data storage method is provided, which can be executed by the above-mentioned database management platform. Figure 5 is a flow chart of a data storage method according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:

[0146] Step S501, obtaining a target instruction.

[0147] The target instruction includes a database table identifier.

[0148] Step S502: According to the database table identifier, obtain the first database table corresponding to the database table identifier.

[0149] The first database table includes multiple pieces of business data.

[0150] Step S503: selecting at least one data processing model corresponding to the database table identifier from at least one data processing model according to the mapping relationship information and the database table identifier of each data processing model.

[0151] Step S504: Determine a second database table corresponding to the target data processing model according to the target mapping relationship information.

[0152] The target mapping relationship information is mapping relationship information corresponding to a target data processing model, and the target data processing model is any data processing model in at least one data processing model corresponding to a database table identifier.

[0153] The specific processing from step S501 to step S504 is similar to the specific processing from step S201 to step S204, and will not be repeated here.

[0154] Step S505 , screening all business data in the first database table according to the target model function information to obtain a plurality of target business data corresponding to the target data processing model.

[0155] Among them, the target model function information is the model function information corresponding to the target data processing model.

[0156] Specifically, when the model function information includes at least one condition field name and condition configuration information corresponding to each condition field name, the above step S505 includes:

[0157] S5051, traverse all business data in the first database table.

[0158] S5052: Every time a piece of business data is traversed, it is determined whether the field value corresponding to the target condition field name in the traversed business data matches the target condition configuration information.

[0159] The target condition field name is any field name in at least one condition field name. The target condition configuration information is the condition configuration information corresponding to the target condition field name. The condition configuration information can be one of a preset default value, whether it is a required item, greater than or equal to a preset field value, less than or equal to a preset field value, field regularity check, etc.

[0160] Specifically, when the target condition configuration information is that the target field is a preset default value, it is determined whether the field value of the target field in the traversed business data is equal to the preset default value. If yes, it can be determined that the field value corresponding to the target condition field name in the traversed business data matches the target condition configuration information. If not, a matching operation can be performed on the field value of the next condition field name.

[0161] When the target condition field information indicates that the target field is a required item, determine whether the field value of the target field in the traversed business data is filled with a value. If yes, it can be determined that the field value corresponding to the target condition field name in the traversed business data matches the target condition configuration information. If not, a matching operation can be performed on the field value of the next condition field name.

[0162] When the target condition field information is that the target field is greater than or equal to the preset field value, determine whether the field value of the target field in the traversed business data is greater than or equal to the preset field value. If yes, it can be determined that the field value corresponding to the target condition field name in the traversed business data matches the target condition configuration information. If not, a matching operation can be performed on the field value of the next condition field name.

[0163] When the target condition field information is that the target field is less than or equal to the preset field value, determine whether the field value of the target field in the traversed business data is less than or equal to the preset field value. If yes, it can be determined that the field value corresponding to the target condition field name in the traversed business data matches the target condition configuration information. If not, a matching operation can be performed on the field value of the next condition field name.

[0164] When the target condition field information is to perform field regularity check on the target field, determine whether the field value of the target field in the traversed business data conforms to the preset format. If yes, it can be determined that the field value corresponding to the target condition field name in the traversed business data matches the target condition configuration information. If not, a matching operation can be performed on the field value of the next condition field name.

[0165] S5053, when the field values ​​corresponding to all condition field names of the traversed business data match the condition configuration information corresponding to the condition field names, the traversed data is determined as the target business data, and the next business data is traversed.

[0166] Specifically, for each piece of business data, the field value corresponding to each conditional field name of the business data is matched with the conditional configuration information of the conditional field name. When the matching results corresponding to all conditional field names are matched, the traversed data can be determined as the target business data, and the next piece of business data is traversed.

[0167] S5054, when the field value of any condition field name of the traversed business data does not match the condition configuration information of the condition field name, the traversed business data is filtered out and the next business data is traversed.

[0168] Specifically, for each piece of business data, when there is a field value of a conditional field name that does not match the field configuration information of the added field name, the business data can be removed and the next piece of business data can be traversed.

[0169] S5055, after traversing all the business data in the first database table, a plurality of target business data corresponding to the target data processing model are obtained, and the traversal is stopped.

[0170] In some optional implementations, the conditional configuration information may also include field value conversion rules. After each target business data is determined, the database management platform may convert the field value corresponding to each conditional field name in the target business data according to the field value conversion rule corresponding to the conditional field name in the target business data.

[0171] Step S506: storing the plurality of target business data in the second database table according to the target mapping relationship information.

[0172] The specific processing of step S506 is similar to that of step S206 and will not be repeated here.

[0173] The data storage method provided in this embodiment can dynamically set and adjust the condition configuration information according to actual needs, so that the solution can adapt to different business scenarios and screening rules. That is, when modifying the condition configuration information, the technician only needs to modify the condition configuration information, and the technician does not need to modify the code. In this way, the development efficiency of the database management platform can be improved, and the problem of the database management platform crashing due to manual code modification errors can be avoided.

[0174] In the present embodiment, a data storage device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0175] This embodiment provides a data storage device, such as Figure 6 As shown, including:

[0176] The acquisition module 601 is used to acquire a target instruction, wherein the target instruction includes a database table identifier; according to the database table identifier, acquire a first database table corresponding to the database table identifier, wherein the first database table includes a plurality of business data;

[0177] A selection module 602 is used to select at least one data processing model corresponding to the database table identifier from at least one data processing model according to the mapping relationship information and the database table identifier of each data processing model;

[0178] A determination module 603 is used to determine a second database table corresponding to a target data processing model according to target mapping relationship information, wherein the target mapping relationship information is mapping relationship information corresponding to the target data processing model, and the target data processing model is any data processing model of at least one data processing model corresponding to the database table identifier;

[0179] A screening module 604 is used to screen all business data in the first database table according to the target model function information to obtain a plurality of target business data corresponding to the target data processing model, wherein the target model function information is model function information corresponding to the target data processing model;

[0180] The storage module 605 is used to store multiple target business data in the second database table according to the target mapping relationship information.

[0181] In some optional implementations, the acquisition module 601 is further used to:

[0182] Get the target table file;

[0183] Extract multiple pieces of initial business data, multiple field names, and field configuration information corresponding to each field name from a target table file;

[0184] Converting the data type of each field of each piece of initial business data in the plurality of pieces of initial business data to obtain a plurality of pieces of business data after the data type is converted;

[0185] Create a first database table according to multiple field names and field configuration information corresponding to each field name;

[0186] The plurality of business data after data type conversion is stored in the first database table.

[0187] In some optional implementations, the mapping relationship information includes an identifier of the data processing model and an identifier of a source database table corresponding to the identifier of the data processing model;

[0188] The selection module 602 is used to:

[0189] Matching the database table identifier with a source database table identifier in each of at least one data processing model included in the database management system;

[0190] When the source database table identifiers of the one or more data processing models match the database table identifier, the one or more data processing models are determined to be data processing models corresponding to the database table identifier.

[0191] In some optional implementations, the mapping relationship information further includes an identifier of a business database table corresponding to the identifier of the data processing model;

[0192] The determination module 603 is used to:

[0193] Extracting a target business database table identifier from the target mapping relationship information;

[0194] According to the target business database table identifier, a second database table is determined.

[0195] In some optional implementations, the model function information includes at least one condition field name, and condition configuration information corresponding to each condition field name;

[0196] The screening module 604 is used to:

[0197] Traversing all business data in the first database table;

[0198] Each time a piece of business data is traversed, determining whether a field value corresponding to a target condition field name in the traversed business data matches the target condition configuration information, wherein the target condition field name is any field name in at least one condition field name, and the target condition configuration information is the condition configuration information corresponding to the target condition field name;

[0199] When the field values ​​corresponding to all condition field names of the traversed business data match the condition configuration information corresponding to the condition field name, the traversed data is determined as the target business data, and the next business data is traversed;

[0200] or,

[0201] When the field value of any condition field name of the traversed business data does not match the condition configuration information of the condition field name, the traversed business data is filtered out and the next business data is traversed;

[0202] After all the business data in the first database table are traversed, a plurality of target business data corresponding to the target data processing model are obtained, and the traversal is stopped.

[0203] In some optional implementations, the mapping relationship information further includes a plurality of model field identifiers, and a source database table field identifier and a business database table field identifier corresponding to each model field identifier, each piece of business data includes a field value corresponding to each source database table field identifier, and the second database table includes a field corresponding to each business database table field identifier;

[0204] The storage module 605 is used for:

[0205] For each target business data, determine the target source database table field identifier and the target business database table field identifier corresponding to the target model field identifier according to the target model field identifier and the mapping relationship information, wherein the target model field identifier is any one of the multiple model field identifiers;

[0206] The field value corresponding to the target source database table field identifier in the target business data is stored in the field corresponding to the target business database table field identifier in the second database table.

[0207] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0208] The data storage device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0209] The embodiment of the present invention also provides a computer device having the above Figure 6 The data storage device shown.

[0210] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0211] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0212] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0213] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0214] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0215] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0216] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0217] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0218] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A data storage method, characterized in that: The method is applied to a database management platform, the database management platform includes at least one data processing model, wherein each data processing model includes an activation state, model function information and mapping relationship information, the mapping relationship information includes table mapping relationship information and field mapping relationship information, the table mapping relationship information includes an identifier of the data processing model, and a source database table identifier and a business database table identifier corresponding to the identifier of the data processing model; the method includes: Obtaining a target instruction, wherein the target instruction includes a database table identifier; According to the database table identifier, acquiring a first database table corresponding to the database table identifier, wherein the first database table includes a plurality of business data; Matching the database table identifier with a source database table identifier in each of the data processing models in at least one of the data processing models included in the database management platform; When the source database table identifier of one or more of the data processing models matches the database table identifier, determining that the one or more data processing models are data processing models corresponding to the database table identifier; Determine a second database table corresponding to a target data processing model according to target mapping relationship information, wherein the target mapping relationship information is mapping relationship information corresponding to the target data processing model, and the target data processing model is any data processing model of at least one data processing model corresponding to the database table identifier; According to the target model function information, all business data in the first database table are screened to obtain a plurality of target business data corresponding to the target data processing model, wherein the target model function information is model function information corresponding to the target data processing model; According to the target mapping relationship information, multiple target business data are stored in the second database table.

2. The method according to claim 1, characterized in that Before acquiring the target instruction, the method further includes: Get the target table file; Extracting a plurality of initial business data, a plurality of field names, and field configuration information corresponding to each field name from the target table file; Converting the data type of each field of each piece of initial business data in the plurality of pieces of initial business data to obtain a plurality of pieces of business data after the data type is converted; Creating the first database table according to the plurality of field names and the field configuration information corresponding to each of the field names; The plurality of business data after data type conversion are stored in the first database table.

3. The method according to claim 1, characterized in that The step of determining the second database table corresponding to the target data processing model according to the target mapping relationship information includes: Extracting a target business database table identifier from the target mapping relationship information; The second database table is determined according to the target service database table identifier.

4. The method according to claim 1 or 2, characterized in that: The model function information includes at least one condition field name and condition configuration information corresponding to each condition field name; The method of screening all business data in the first database table according to the target model function information to obtain multiple target business data corresponding to the target data processing model includes: Traversing all business data in the first database table; Each time a piece of business data is traversed, determining whether a field value corresponding to a target condition field name in the traversed business data matches the target condition configuration information, wherein the target condition field name is any field name in at least one condition field name, and the target condition configuration information is condition configuration information corresponding to the target condition field name; When the field values ​​corresponding to all the condition field names of the traversed business data respectively match the condition configuration information corresponding to the condition field name, the traversed data is determined as the target business data, and the next business data is traversed; or, When the field value of any condition field name of the traversed business data does not match the condition configuration information of the condition field name, the traversed business data is filtered out and the next business data is traversed; After traversing all the business data in the first database table, a plurality of target business data corresponding to the target data processing model are obtained, and the traversal is stopped.

5. The method according to claim 1, characterized in that: The mapping relationship information also includes a plurality of model field identifiers, and a source database table field identifier and a business database table field identifier corresponding to each model field identifier, each piece of business data includes a field value corresponding to each of the source database table field identifiers, and the second database table includes a field corresponding to each of the business database table field identifiers; The storing of the plurality of target business data in the second database table according to the target mapping relationship information includes: For each piece of the target business data, determining the target source database table field identifier and the target business database table field identifier corresponding to the target model field identifier according to the target model field identifier and the mapping relationship information, wherein the target model field identifier is any one of the multiple model field identifiers; The field value corresponding to the target source database table field identifier in the target business data is stored in the field corresponding to the target business database table field identifier in the second database table.

6. A data storage device, characterized in that: The device is applied to a database management platform, the database management platform includes at least one data processing model, wherein each data processing model includes an activation state, model function information and mapping relationship information, the mapping relationship information includes table mapping relationship information and field mapping relationship information, the table mapping relationship information includes an identifier of the data processing model, and a source database table identifier and a business database table identifier corresponding to the identifier of the data processing model; the device includes: An acquisition module, configured to acquire a target instruction, wherein the target instruction includes a database table identifier; and acquire a first database table corresponding to the database table identifier according to the database table identifier, wherein the first database table includes a plurality of business data; a selection module, configured to match the database table identifier with a source database table identifier in each of the data processing models in at least one of the data processing models included in the database management platform; when the source database table identifier of one or more of the data processing models matches the database table identifier, determine that one or more of the data processing models are data processing models corresponding to the database table identifier; A determination module, configured to determine a second database table corresponding to a target data processing model according to target mapping relationship information, wherein the target mapping relationship information is mapping relationship information corresponding to the target data processing model, and the target data processing model is any data processing model of at least one data processing model corresponding to the database table identifier; A screening module, configured to screen all business data in the first database table according to target model function information to obtain a plurality of target business data corresponding to the target data processing model, wherein the target model function information is model function information corresponding to the target data processing model; A storage module is used to store multiple target business data in the second database table according to the target mapping relationship information.

7. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data storage method according to any one of claims 1 to 5 by executing the computer instructions.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data storage method according to any one of claims 1 to 5.

9. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the data storage method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data processing method and device

    CN116303428A