Method, device, computer device and storage medium for filling fields

By using a population engine to load entity objects and configuration information in the database management system, and using identification information to obtain population values ​​and populate fields, the problem of inconvenient code management caused by the increase in the number of database tables is solved, and code reuse and flexible configuration are realized.

CN118012866BActive Publication Date: 2025-11-11BEIJING SHENZHOU AEROSPACE SOFTWARE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410095399.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-23
Publication Date
2025-11-11
Estimated Expiration
2044-01-23

AI Technical Summary

Technical Problem

In database management systems, as the number of database tables increases, the amount of populated code also increases, leading to inconvenience in code management.

Method used

By loading entity objects and configuration information through the population engine, extracting target configuration information using object and field identification information, obtaining target population values ​​and populating target fields, code reuse is achieved and the amount of population code is reduced.

Benefits of technology

It improves code writing efficiency, reduces the amount of filler code, facilitates code management by technical personnel, supports real-time configuration information modification, and enhances the flexibility and maintainability of the database management system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118012866B_ABST
    Figure CN118012866B_ABST
Patent Text Reader

Abstract

This invention relates to the field of database technology and discloses a method, apparatus, computer device, and storage medium for filling fields. The method includes: when a first operation instruction is received, extracting object identification information and field identification information from the first operation instruction; determining a target entity object corresponding to the object identification information from at least one entity object based on the object identification information, the target entity object including at least one field; obtaining a target field corresponding to the field identification information from at least one field based on the field identification information; determining whether at least one piece of configuration information contains target configuration information corresponding to the target field based on the field identification information; when the target configuration information is determined to exist, obtaining a target fill value based on the target configuration information; and filling the target field with the target fill value. This invention can improve the ease of managing fill code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and more specifically to methods, apparatus, computer devices, and storage media for filling fields. Background Technology

[0002] In the field of database technology, a database typically includes multiple database tables (also known as entity objects), each of which can include multiple fields, and each field has its corresponding value.

[0003] In the process of managing databases in a business management system, it is common to modify the values ​​of fields or add new fields in any database table. When modifying or adding fields, it is necessary to first populate the fields with default values ​​to facilitate subsequent data processing based on these default values. The scheme for populating fields with default values ​​is as follows: for each database table, corresponding population code is written. When an operation instruction for a specific database table is received, the population operation can be executed through the corresponding population code.

[0004] Therefore, when there are many database tables in the database, a large amount of population code needs to be written, making it inconvenient to manage them. Summary of the Invention

[0005] In view of this, the present invention provides a method, apparatus, computer device and storage medium for filling fields, so as to solve the problem of inconvenient management of filling codes.

[0006] In a first aspect, the present invention provides a method for populating a field, the method being applied to a population engine, the population engine loading at least one entity object and at least one piece of configuration information, the method comprising:

[0007] When the first operation instruction is obtained, the object identification information and field identification information are extracted from the first operation instruction;

[0008] Based on the object identification information, a target entity object corresponding to the object identification information is determined from at least one of the entity objects, wherein the target entity object includes at least one field;

[0009] Based on the field identification information, obtain the target field corresponding to the field identification information from at least one of the fields;

[0010] Based on the field identification information, determine whether at least one piece of configuration information contains target configuration information corresponding to the target field;

[0011] When the target configuration information is determined to exist, the target fill value is obtained based on the target configuration information;

[0012] The target value is filled into the target field.

[0013] This invention provides a method for populating fields. Operation instructions for any entity object can be processed through the aforementioned execution logic, enabling code reuse and eliminating the need to set corresponding population code for each data table. Therefore, regardless of the number of data tables, this solution can perform related population operations, resulting in high coding efficiency. When adding or deleting data tables, there is no need to create corresponding population code for the addition or deletion. By reusing population code, the number of population codes can be significantly reduced, facilitating code management for technical personnel.

[0014] In one optional implementation, the field identification information is a fully qualified target name, wherein the fully qualified target name includes the name of the first field, the identification information of the target class to which the first field belongs, and the identification information of the target package to which the target class belongs; the step of obtaining the target field corresponding to the field identification information from at least one of the fields according to the field identification information includes:

[0015] Obtain the target field from at least one of the fields, which corresponds to the name of the first field, the identification information of the target class, and the identification information of the target package.

[0016] Specifically, since a field can belong to different classes, and each class can belong to different packages, a field can be uniquely identified by using three types of identification information, thus accurately determining the target field.

[0017] In one optional implementation, at least one piece of configuration information includes a first type of configuration information and a second type of configuration information. The first type of configuration information includes a fully qualified name and a padding type corresponding to the fully qualified name. The second type of configuration information includes a field name and a padding type corresponding to the field name. Determining whether there is target configuration information corresponding to the target field in at least one piece of configuration information based on the field identifier information includes:

[0018] Based on the fully qualified name of the target, determine whether there is first configuration information in the first type of configuration information that corresponds to the fully qualified name of the target;

[0019] When it is determined that the first configuration information exists, the first configuration information is determined as the target configuration information;

[0020] Alternatively, if it is determined that the first configuration information does not exist, determine whether there is second configuration information in the second type of configuration information that corresponds to the name of the first field;

[0021] When it is determined that the second configuration information exists, the second configuration information is determined as the target configuration information.

[0022] Specifically, since a field can belong to different classes, and each class can belong to different packages, a configuration piece of information can be identified by the field name, class identifier, and package identifier. This configuration piece of information is also for a field belonging to a specific class within a specific package. Through this precise matching, accurate population values ​​can be provided for subsequent business processing operations. In some cases, the field may belong to other classes, or to a class within another package; in these cases, the population value used for the field is the same. This eliminates the need to write the configuration information in the first type of configuration information, avoiding excessive duplicate content and wasting storage space.

[0023] In one optional implementation, the target configuration information includes fixed values, and obtaining the target fill value based on the target configuration information includes:

[0024] The fixed value is extracted from the target configuration information and used as the target fill value.

[0025] Specifically, configuration information corresponding to different fill methods is set. This means that for different fields, as long as they belong to the fixed-value fill method, this fill method can be used. By reusing the fill code, the amount of fill code can be significantly reduced, making code management easier for technical personnel.

[0026] In one optional implementation, the target configuration information includes a preset class name, and obtaining the target fill value based on the target configuration information includes:

[0027] Extract the preset class name from the target configuration information;

[0028] Based on the preset class name, obtain the target fill value corresponding to the preset class name.

[0029] Specifically, configuration information corresponding to different fill methods is set. This means that for different fields belonging to the same preset fill method category, that fill method can be used. By reusing fill code, the amount of fill code can be significantly reduced, making code management easier for technical personnel.

[0030] In an optional implementation, when the target configuration information includes target configuration values ​​for custom classes, obtaining the target fill value based on the target configuration information includes:

[0031] Extract the target configuration value from the target configuration information;

[0032] Obtain the target function to be called, and use the target configuration value as the calling parameter value of the target function to be called;

[0033] Execute the target function and receive the return result of the target function.

[0034] The returned result is used as the target fill value.

[0035] Specifically, configuration information corresponding to different fill methods is set. This means that for different fields belonging to the same custom fill method class, that fill method can be used. By reusing fill code, the amount of fill code can be significantly reduced, making code management easier for technical personnel.

[0036] In an optional implementation, the method further includes:

[0037] When the second operation instruction is received, the second operation instruction is parsed;

[0038] When the identification information and modification content of the configuration information are parsed from the second operation instruction, the third configuration information corresponding to the identification information of the configuration information is determined from at least one of the configuration information;

[0039] Based on the aforementioned modifications, the third configuration information is modified;

[0040] or,

[0041] When the fourth configuration information is parsed from the second operation instruction, the fourth configuration information is cached in the filling engine.

[0042] Specifically, configuration information can be modified in real time by operations and maintenance personnel or ordinary users. Since the configuration information is pre-loaded into memory, real-time modifications to the in-memory configuration information do not affect the operation of the database management system, and there is no need to redeploy the database management system after modification. This is extremely useful for scenarios that require frequent modifications to configuration information or rapid response to changes in configuration information, improving the flexibility and maintainability of the database management system.

[0043] Secondly, the present invention provides an apparatus for filling a field, the apparatus comprising:

[0044] The extraction module is used to extract object identification information and field identification information from the first operation instruction when the first operation instruction is obtained;

[0045] The determining module is configured to determine a target entity object corresponding to the object identification information from at least one entity object based on the object identification information, wherein the target entity object includes at least one field;

[0046] The acquisition module is configured to acquire a target field corresponding to the field identification information from at least one of the fields based on the field identification information;

[0047] The determining module is further configured to determine, based on the field identification information, whether at least one piece of configuration information contains target configuration information corresponding to the target field;

[0048] The acquisition module is further configured to, when it is determined that the target configuration information exists, acquire the target fill value based on the target configuration information;

[0049] The fill module is used to fill the target field with the target fill value.

[0050] Thirdly, 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 computer instructions to perform the method of filling fields as described in the first aspect or any corresponding embodiment thereof.

[0051] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method of filling fields according to the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0052] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

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

[0054] Figure 2 This is a flowchart illustrating a method for filling in fields according to an embodiment of the present invention;

[0055] Figure 3This is a flowchart illustrating another method for filling in a field according to an embodiment of the present invention;

[0056] Figure 4 This is a flowchart illustrating another method for filling in a field according to an embodiment of the present invention;

[0057] Figure 5 This is a flowchart illustrating a method for modifying configuration information according to an embodiment of the present invention;

[0058] Figure 6 This is a schematic diagram of a view management interface according to an embodiment of the present invention;

[0059] Figure 7 This is a schematic diagram of another view management interface according to an embodiment of the present invention;

[0060] Figure 8 This is a schematic diagram of another view management interface according to an embodiment of the present invention;

[0061] Figure 9 This is a structural block diagram of a device for filling fields according to an embodiment of the present invention;

[0062] Figure 10 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] This invention provides a database management system. The database management system is mainly used for managing databases, such as adding and deleting data tables. Figure 1 As shown, the database management system can be configured with a population engine and local configuration files. The database management system can be deployed on a server or server cluster. From a hardware perspective, this method is executed by the server or server cluster; from a software perspective, this method is mainly executed by the population engine. This embodiment of the invention will be described using a software-level description approach.

[0065] The database mentioned above can be a Structured Query Language (SQL) database. The database can store multiple tables, each containing multiple fields. After the database management system starts, it can first generate and cache the entity objects corresponding to each table in the database. Before modifying any data table, the entity objects can be modified first, and then synchronized to the data table.

[0066] A local configuration file can be a ".yaml" file and can include two parts: fill switch settings and configuration information. The configuration information in the local configuration file can be common fill settings shared across different databases. Technical personnel can pre-set the value of "auto-insert-fill" to "true" in the local configuration file, effectively enabling fill. The local configuration file can be written by developers and pre-configured in the database management system. After modifying the local configuration file, the database management system needs to be redeployed and restarted. For example, the content of a local configuration file could be:

[0067] auto-insert-fill: true

[0068] -field-name: "createTime"

[0069] field-class: java.time.LocalDateTime

[0070] -field-name: "updateTime"

[0071] field-class:java.time.LocalDateTime

[0072] -field-name:"deleted"

[0073] field-value: false

[0074] -field-name: "readonly"

[0075] field-value: false

[0076] Here, field-name represents the name of the field, field-class represents the default class, and field-value represents the fixed value.

[0077] The filling engine can be an application and may include synchronizers, interceptors, and extended implementation modules. Interceptors, in particular, have internal parsing and filling processors.

[0078] The functions of the synchronizer are described below:

[0079] After starting the database management system, the synchronizer can load and cache the configuration information in the local configuration file into the population engine.

[0080] To facilitate modifications to cached configuration information by operations and maintenance personnel, a configuration center can be set up on the operator's terminal. This configuration center can have an Application Programming Interface (API) that allows interaction with the synchronizer. In this way, operations and maintenance personnel can modify configuration information through the configuration center, and the synchronizer will update the configuration information loaded into the population engine in real time based on these modifications. For example, the configuration center could be the Nacos configuration center.

[0081] To facilitate modification of cached configuration information by ordinary users, a view management interface can be provided. For example, users can modify configuration information through the database management system's web interface, or through the application's view management interface. Ordinary users can set or modify configuration information through simple selection or input in the view management interface, allowing their terminals to receive modification commands and send them to the server or server cluster deployed with the database management system. This allows the synchronizer in the database management system to update the cached configuration information in real time based on the modification commands.

[0082] The following is an introduction to the functions of the interceptor:

[0083] Interceptors are primarily used to intercept entity objects, that is, to receive relevant information about entity objects parsed from operation instructions by the business layer and inform the parsing and filling processor of this information. For example, an interceptor could be the Object Relational Mapping (ORM) entity filling interceptor from the Mybatis-Plus open-source framework. This ORM interceptor provides two function call methods: insertFill() and updateFill(). These two functions are mainly set in the parsing and filling processor and are used to perform the field filling operations.

[0084] The following is a description of the functions of the parsing fill processor:

[0085] The parsing and filling processor is used to find the corresponding entity object and fill in the fields after receiving relevant information about the entity object.

[0086] The functionality of the extended implementation module is described below:

[0087] Because different databases have their own characteristics, an extended implementation module is provided to meet the needs of different databases. This extended implementation module mainly provides the FieldProcessor interface and the getFieldValue abstract method. The FieldProcessor interface is primarily used to interact with the parsing and filling processor. The getFieldValue abstract method can provide customized filling value settings. Users can write the getFieldValue abstract method according to their actual needs.

[0088] This invention provides a method for filling in fields, which improves code writing efficiency by pre-setting configuration information and reusing filling code, and also enhances the convenience of managing the filling code.

[0089] According to an embodiment of the present invention, a method embodiment for filling fields is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0090] This embodiment provides a method for filling in a field. Figure 2 This is a flowchart of a method for filling in fields according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:

[0091] Step S201: When the first operation instruction is obtained, extract the object identification information and field identification information from the first operation instruction.

[0092] The first operation instruction can be an operation instruction to populate a target field in a target data table in the database, or an operation instruction to modify the value of a target field, etc.

[0093] In implementation, firstly, in the field of database technology, since different data tables are related to different business operations, each business operation has its own corresponding execution rules. For example, when modifying a field in a data table, it is necessary to first fill the field with a default value. Taking time as an example, since different users may be in different time zones, the current time field in the data table is recorded based on the current time in time zone A. Suppose a user in time zone B needs to perform business processing operations based on the current time, then the current time field needs to be filled with the current time in time zone B before proceeding with subsequent business processing operations.

[0094] Secondly, since the database is stored on disk while the population engine is configured in memory, to improve the speed of database-related business processing, the entity objects corresponding to each data table in the database can be pre-loaded into the population engine. Before performing any operation on a data table, the corresponding entity object can be modified first, and then the modifications can be synchronized to the data table. In this way, when the business layer of the database management system receives the first operation instruction, it can intercept the execution of the first operation instruction, parse the first operation instruction, obtain the object identification information and field identification information, and transmit the object identification information and field identification information to the population engine.

[0095] Step S202: Based on the object identification information, determine the target entity object corresponding to the object identification information from at least one entity object.

[0096] The target entity object may include at least one field.

[0097] In implementation, the filling engine can traverse its cached entity objects. For each entity object encountered, it obtains the entity object's identification information and compares it with the object identification information extracted from the first operation instruction. If they match, the entity object is identified as the target entity object. If not, it traverses the next entity object, and so on, until the target entity object is identified.

[0098] Step S203: Based on the field identification information, obtain the target field corresponding to the field identification information from at least one field.

[0099] In implementation, the filling engine can traverse the fields included in the target entity object. For each field traversed, it obtains the field's identifier information based on the field identifier information and determines whether the field's identifier information matches the field identifier information extracted from the first operation instruction. If it does, the field is obtained; otherwise, it traverses the next field until the target field is determined.

[0100] Step S204: Based on the field identification information, determine whether there is target configuration information corresponding to the target field in at least one piece of configuration information.

[0101] In implementation, since the local configuration file is stored on disk while the filling engine is configured in memory, to improve filling efficiency, the filling engine can load and cache the configuration information from the local configuration file. Each configuration information can include field identifier information and filling value setting information. The filling engine can traverse at least one configuration information cached by itself. Each time a configuration information is encountered, it determines whether the field identifier information in the encountered configuration information is consistent with the field identifier information extracted from the first operation instruction. If they are consistent, the encountered configuration information is determined as the target configuration information. If not, the engine traverses the next configuration information until the target configuration information is determined or all configuration information has been traversed, at which point the traversal stops.

[0102] Step S205: When it is determined that target configuration information exists, obtain the target fill value based on the target configuration information.

[0103] In implementation, if the target configuration information is determined to exist, the target fill value is obtained based on the fill value settings in the target configuration information. Alternatively, if the target configuration information is determined not to exist, no fill operation is performed.

[0104] Step S206: Fill the target field with the target fill value.

[0105] In implementation, the target value can be filled into the target field. Then, business operation information can be extracted from the first operation instruction, and relevant business operations can be performed based on the business operation information and the target value. For example, if the target value is the current time in time zone B, and the business operation information is the current time field plus 15 days, then the business completion time in time zone B can be obtained by using the target value of the current time field and 15 days.

[0106] The field population method provided in this embodiment can process operation instructions for any entity object through the aforementioned execution logic, achieving code reuse and eliminating the need to set corresponding population code for each data table. Therefore, regardless of the number of data tables, this solution can be used for related population operations, resulting in high coding efficiency. When adding or deleting data tables, there is no need to create corresponding population code for the addition or deletion. By reusing population code, the number of population codes can be significantly reduced, facilitating code management for technical personnel.

[0107] This embodiment provides a method for filling in a field. Figure 3 This is a flowchart of a method for filling in fields according to an embodiment of the present invention, such as... Figure 3As shown, the process includes the following steps:

[0108] Step S301: When the first operation instruction is obtained, extract the object identification information and field identification information from the first operation instruction.

[0109] Step S302: Based on the object identification information, determine the target entity object corresponding to the object identification information from at least one entity object.

[0110] The target entity object may include at least one field.

[0111] The specific processing of steps S301 to S302 can be similar to that of steps S201 to S202, and will not be repeated here.

[0112] Step S303: Based on the field identification information, obtain the target field corresponding to the field identification information from at least one field.

[0113] Specifically, when the field identifier information is the fully qualified name of the target, step S303 above can be:

[0114] Retrieve the target field from at least one field that corresponds to the name of the first field, the identifier of the target class, and the identifier of the target package.

[0115] The fully qualified name of the target can include the name of the first field, the identifier of the target class to which the first field belongs, and the identifier of the target package to which the target class belongs. For example, the fully qualified name of the target is "com.bjsasc.avfms.eamd.artifact.po.PtEamdArtifact.artifactName", where "com.bjsasc.avfms.eamd.artifact.po" is the identifier of the target package, "PtEamdArtifact" is the identifier of the target class, and "artifactName" is the name of the first field.

[0116] In implementation, the filling engine can parse each field in its cache to obtain the field's name, the identifier of the class to which the field belongs, and the identifier of the package to which the class to which the field belongs. Further, it compares the field's name with the name of the first field, the identifier of the class to which the field belongs with the identifier of the target class, and the identifier of the class to which the field belongs with the identifier of the target package. When all three comparisons result in a match, the field is determined to be the target field.

[0117] Step S304: Based on the field identification information, determine whether there is target configuration information corresponding to the target field in at least one piece of configuration information.

[0118] Specifically, when at least one piece of configuration information cached in the fill engine includes a first type of configuration information and a second type of configuration information, wherein the first type of configuration information may include a fully qualified name (field_all_name) and the fill type corresponding to the fully qualified name, and the second type of configuration information includes a field name (field_name) and the fill type corresponding to the field name, the above step S304 may include:

[0119] Step S3041: Based on the target fully qualified name, determine whether there is first configuration information in the first type of configuration information that corresponds to the target fully qualified name.

[0120] Step S3042: When it is determined that the first configuration information exists, the first configuration information is determined as the target configuration information.

[0121] In implementation, the filling engine can compare the target fully qualified name with the fully qualified name in each configuration information in the first type of configuration information. When the target fully qualified name matches the fully qualified name in a certain configuration information, then that configuration information can be identified as the target configuration information.

[0122] Step S3043: When it is determined that the first configuration information does not exist, determine whether there is second configuration information in the second type of configuration information that corresponds to the name of the first field.

[0123] Step S3044: When it is determined that second configuration information exists, the second configuration information is determined as the target configuration information.

[0124] In implementation, if the first configuration information is not identified in the first type of configuration information, the name of the first field can be compared with the name of the field of each configuration information in the second type of configuration information. When the name of the first field matches the name of a field in a certain configuration information, that configuration information can be identified as the target configuration information.

[0125] Step S305: When it is determined that target configuration information exists, obtain the target fill value based on the target configuration information.

[0126] Specifically, when the target configuration information is determined, the padding type can be extracted from the target configuration information, and then the target padding value corresponding to the padding type can be determined based on the padding type.

[0127] Step S306: Fill the target field with the target fill value.

[0128] The specific processing of step S306 is similar to that of step S206, and will not be described in detail here.

[0129] The field population method provided in this embodiment allows for precise matching. Since a field can belong to different classes, and each class can belong to different packages, a configuration message can be determined using the field name, class identifier, and package identifier. This configuration message is specific to a field belonging to a class within a specific package. This accurate matching ensures precise population values ​​for subsequent business processing. In some cases, the field may belong to other classes or to a class within another package; in these cases, the population value used is the same. This eliminates the need to write the configuration information in the first type of configuration information, avoiding excessive duplicate content and wasting storage space.

[0130] This embodiment provides a method for filling in a field. Figure 4 This is a flowchart of a method for filling in fields according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps:

[0131] Step S401: When the first operation instruction is obtained, extract the object identification information and field identification information from the first operation instruction.

[0132] Step S402: Based on the object identification information, determine the target entity object corresponding to the object identification information from at least one entity object.

[0133] The target entity object may include at least one field.

[0134] The specific processing of steps S401 to S402 can be similar to that of steps S201 to S202, and will not be repeated here.

[0135] Step S403: Based on the field identification information, obtain the target field corresponding to the field identification information from at least one field.

[0136] Step S404: Based on the field identification information, determine whether there is target configuration information corresponding to the target field in at least one piece of configuration information.

[0137] The specific processing of steps S403 to S404 can be similar to that of steps S203 to S204, or similar to that of steps S303 to S304, and will not be described in detail here.

[0138] Step S405: When it is determined that target configuration information exists, obtain the target fill value based on the target configuration information.

[0139] Specifically, depending on the content included in the target configuration information, this step can obtain the target fill value in the following three ways.

[0140] Scenario 1: When the target configuration information includes a fixed value (field_value), step S405 may specifically be:

[0141] Step S4051: Extract fixed values ​​from the target configuration information as target fill values.

[0142] In implementation, when the target configuration information includes a fixed value corresponding to the fully qualified name of the target (or the name of the target field), or when the fill type in the target configuration information is a fixed value type and the target configuration information includes a fixed value corresponding to that type, the fixed value can be extracted from the target configuration information as the target fill value.

[0143] Scenario 2: When the target configuration information includes a preset class name, step S405 may specifically include:

[0144] Step S4052: Extract the preset class name from the target configuration information.

[0145] In practice, when the target configuration information includes a preset class name corresponding to the fully qualified name of the target (or the name of the target field), or when the fill type in the target configuration information is a preset class type (field_class) and the target configuration information includes a preset class name corresponding to that fill type, the preset class name can be extracted from the target configuration information.

[0146] Step S4053: Obtain the target fill value corresponding to the preset class name based on the preset class name.

[0147] The default class name can be one of Date, Timestamp, LocalDateTime, Long, Integer, or Boolean. Date, Timestamp, and LocalDateTime values ​​can all be the current time. Long and Integer values ​​can all be 0. Boolean values ​​can be False.

[0148] In implementation, the target fill value corresponding to the preset class name can be determined from the correspondence table between the first class name and the fill value, based on the extracted preset class name.

[0149] Scenario 3: When the target configuration information includes the target configuration value of a custom class (field_processor_class), step S405 may specifically include:

[0150] Step S4054: Extract the target configuration value from the target configuration information.

[0151] In implementation, when the target configuration information includes a target configuration value of a custom class corresponding to the fully qualified name of the target (or the name of the target field), or when the fill type in the target configuration information is a custom class type and the target configuration information includes a target configuration value corresponding to that fill type, the target configuration value can be extracted from the target configuration information.

[0152] Step S4055: Obtain the target function and use the target configuration value as the call parameter value of the target function.

[0153] In practice, when the target configuration value is extracted from the target configuration information, a pre-defined target call function can be executed, and the target configuration value can be filled into the position of the call parameter of the target call function.

[0154] Step S4056: Execute the target function and receive the return result of the target function.

[0155] Step S4057: Use the returned result as the target fill value.

[0156] In implementation, after the target configuration value is filled into the calling parameters of the target function, the target function can be executed. The target function can automatically execute the extended implementation module, retrieve the filling algorithm for the custom class in the target configuration information based on the target configuration value, and execute it to obtain the target filled value. The target function returns the target filled value as the result and feeds it back to the parsing filling processor. The parsing filling processor receives the return result and determines it as the target filled value.

[0157] Step S406: Fill the target field with the target fill value.

[0158] The specific processing of step S406 is similar to that of step S206, and will not be repeated here.

[0159] The field population method provided in this embodiment sets configuration information corresponding to different population methods. This allows different fields that belong to the same population method to be populated using that method. By reusing the population code, the amount of population code can be significantly reduced, facilitating code management for technical personnel.

[0160] This embodiment provides a method for modifying configuration information, which can be used in server clusters or servers. Figure 5 This is a flowchart of a method for modifying configuration information according to an embodiment of the present invention, such as... Figure 5 As shown, the process includes the following steps:

[0161] Step S501: When the second operation instruction is obtained, the second operation instruction is parsed.

[0162] The second operation command can come from the terminal where the configuration center is located, or it can come from the terminal where a regular user is located.

[0163] In implementation, such as Figure 6 , 7 As shown in Figures 8 and 9, the operation interfaces correspond to fixed value types, preset type types, and custom type types, respectively. When the second operation command comes from the terminal of a regular user, the regular user can make selections and inputs in the operation interface. For example, in... Figure 6 In the interface, regular users can select a fixed value type as the fill type from the drop-down menu in the fill value type input box, and then enter a fixed value in the fill value box. Figure 7 In the middle, ordinary users can select any preset class name through the drop-down button. Figure 7 The selected preset class name is Current Time. Figure 8 In the middle, ordinary users can select any custom class name through the drop-down button. Figure 8 The selected preset class name is the current department code. After setting the relevant information for the fill value, you can click the OK button.

[0164] The user's terminal generates a second operation command based on the detected operation and sends it to the server. The server's database management system can then parse the second operation command and perform corresponding operations based on the parsing results.

[0165] The second operation instruction can be either an instruction to modify cached configuration information or an instruction to add new configuration information. When the second operation instruction is the former, the identification information and modified content of the configuration information can be parsed from it. When the second operation instruction is the latter, the new configuration information, i.e., the fourth configuration information, can be parsed from it.

[0166] Step S502: When the identification information and modification content of the configuration information are parsed from the second operation instruction, the third configuration information corresponding to the identification information of the configuration information is determined from at least one piece of configuration information.

[0167] In practice, when the identification information and modification content of the configuration information are parsed from the second operation instruction, the third configuration information can be determined from the configuration information that fills the engine cache based on the identification information of the configuration information.

[0168] Step S503: Modify the third configuration information according to the modification content.

[0169] The modification content can be an operation that changes the fill type. When the modified fill type is a fixed value type, the modification content can include the fixed value. When the modified fill type is a preset class type, the modification content can include the preset class name. When the modified fill type is a custom class type, the modification content can include the custom class name.

[0170] Step S504: When the fourth configuration information is parsed from the second operation instruction, the fourth configuration information is cached in the filling engine.

[0171] In implementation, the fourth configuration information can be further parsed. If the fully qualified name is parsed, the fourth configuration information can be added to the first type of configuration information. If the field name is parsed, the fourth configuration information can be added to the second type of configuration information.

[0172] The method for modifying configuration information provided in this embodiment allows maintenance personnel or ordinary users to modify the configuration information in real time. Since the configuration information is pre-loaded into memory, real-time modifications to the configuration information in memory do not affect the operation of the database management system, and there is no need to redeploy the database management system after modification. This is extremely useful for scenarios that require frequent modification of configuration information or rapid response to changes in configuration information, improving the flexibility and maintainability of the database management system.

[0173] This embodiment also provides a field-filling device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0174] This embodiment provides a device for filling in fields, such as... Figure 9 As shown, it includes:

[0175] The extraction module 901 is used to extract object identification information and field identification information from the first operation instruction when the first operation instruction is obtained.

[0176] The determination module 902 is used to determine the target entity object corresponding to the object identification information from at least one entity object based on the object identification information, wherein the target entity object includes at least one field;

[0177] The acquisition module 903 is used to acquire the target field corresponding to the field identification information from at least one field based on the field identification information;

[0178] The determination module 902 is also used to determine, based on the field identification information, whether there is target configuration information corresponding to the target field in at least one piece of configuration information;

[0179] The acquisition module 903 is also used to acquire the target fill value based on the target configuration information when it is determined that target configuration information exists;

[0180] Fill module 904 is used to fill the target field with the target fill value.

[0181] In some optional implementations, the field identification information is the fully qualified name of the target, wherein the fully qualified name of the target includes the name of the first field, the identification information of the target class to which the first field belongs, and the identification information of the target package to which the target class belongs; the acquisition module 903 is used for:

[0182] Retrieve the target field from at least one field that corresponds to the name of the first field, the identifier of the target class, and the identifier of the target package.

[0183] In some optional implementations, at least one piece of configuration information includes a first type of configuration information and a second type of configuration information. The first type of configuration information includes a fully qualified name and a padding type corresponding to the fully qualified name. The second type of configuration information includes a field name and a padding type corresponding to the field name. The determining module 902 is used to:

[0184] Based on the fully qualified name of the target, determine whether there is first configuration information in the first type of configuration information that corresponds to the fully qualified name of the target;

[0185] When it is determined that the first configuration information exists, the first configuration information is determined as the target configuration information;

[0186] Alternatively, if it is determined that the first configuration information does not exist, determine whether there is second configuration information in the second type of configuration information that corresponds to the name of the first field;

[0187] When it is determined that a second configuration information exists, the second configuration information is determined as the target configuration information.

[0188] In some optional implementations, the target configuration information includes fixed values, and the acquisition module 903 is used for:

[0189] Extract fixed values ​​from the target configuration information and use them as target fill values.

[0190] In some optional implementations, the target configuration information includes a preset class name, and the acquisition module 903 is used for:

[0191] Extract the preset class name from the target configuration information;

[0192] Based on the preset class name, obtain the target fill value corresponding to the preset class name.

[0193] In some optional implementations, when the target configuration information includes the target configuration value of a custom class, the acquisition module 903 is used to:

[0194] Extract the target configuration value from the target configuration information;

[0195] Obtain the target function to be called, and use the target configuration value as the call parameter value of the target function;

[0196] Execute the target function and receive its return value.

[0197] Use the returned result as the target fill value.

[0198] In some alternative implementations, the acquisition module 903 is further configured to:

[0199] When a second operation instruction is obtained, the second operation instruction is parsed; when the identification information and modification content of the configuration information are parsed from the second operation instruction, the third configuration information corresponding to the identification information of the configuration information is determined from at least one configuration information; the third configuration information is modified according to the modification content; or, when the fourth configuration information is parsed from the second operation instruction, the fourth configuration information is cached in the filling engine.

[0200] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0201] In this embodiment, the means for filling fields is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.

[0202] This invention also provides a computer device having the above-described features. Figure 9 The device shown is for filling in fields.

[0203] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 10As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 10 Take a processor 10 as an example.

[0204] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0205] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0206] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

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

[0208] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0209] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

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

Claims

1. A method for filling a field, characterized in that, The method is applied to a population engine, which loads at least one entity object and at least one piece of configuration information. The method includes: When the first operation instruction is received, object identification information, field identification information, and business operation information are extracted from the first operation instruction; Based on the object identification information, a target entity object corresponding to the object identification information is determined from at least one of the entity objects, wherein the target entity object includes at least one field; Based on the field identification information, obtain the target field corresponding to the field identification information from at least one of the fields; Based on the field identification information, determine whether at least one piece of configuration information contains target configuration information corresponding to the target field; When the target configuration information is determined to exist, the target fill value is obtained based on the target configuration information, wherein the target fill value is the default fill value; Fill the target field with the target value; Execute the business operation based on the business operation information and the target fill value in the target field; When the second operation instruction is received, the second operation instruction is parsed; When the identification information and modification content of the configuration information are parsed from the second operation instruction, the third configuration information corresponding to the identification information of the configuration information is determined from at least one of the configuration information; Based on the aforementioned modifications, the third configuration information is modified.

2. The method according to claim 1, characterized in that, The field identification information is a fully qualified target name, wherein the fully qualified target name includes the name of the first field, the identification information of the target class to which the first field belongs, and the identification information of the target package to which the target class belongs; the step of obtaining the target field corresponding to the field identification information from at least one of the fields according to the field identification information includes: Obtain the target field from at least one of the fields, which corresponds to the name of the first field, the identification information of the target class, and the identification information of the target package.

3. The method according to claim 2, characterized in that, At least one of the configuration information includes a first type of configuration information and a second type of configuration information. The first type of configuration information includes a fully qualified name and a padding type corresponding to the fully qualified name. The second type of configuration information includes a field name and a padding type corresponding to the field name. The step of determining whether at least one piece of configuration information contains target configuration information corresponding to the target field based on the field identifier information includes: Based on the fully qualified name of the target, determine whether there is first configuration information in the first type of configuration information that corresponds to the fully qualified name of the target; When it is determined that the first configuration information exists, the first configuration information is determined as the target configuration information; Alternatively, if it is determined that the first configuration information does not exist, determine whether there is second configuration information in the second type of configuration information that corresponds to the name of the first field; When it is determined that the second configuration information exists, the second configuration information is determined as the target configuration information.

4. The method according to any one of claims 1-3, characterized in that, The target configuration information includes fixed values, and obtaining the target fill value based on the target configuration information includes: The fixed value is extracted from the target configuration information and used as the target fill value.

5. The method according to any one of claims 1-3, characterized in that, The target configuration information includes a preset class name. Obtaining the target fill value based on the target configuration information includes: Extract the preset class name from the target configuration information; Based on the preset class name, obtain the target fill value corresponding to the preset class name.

6. The method according to any one of claims 1-3, characterized in that, When the target configuration information includes target configuration values ​​for custom classes, obtaining the target fill value based on the target configuration information includes: Extract the target configuration value from the target configuration information; Obtain the target function to be called, and use the target configuration value as the calling parameter value of the target function to be called; Execute the target function and receive the return result of the target function. The returned result is used as the target fill value.

7. The method according to any one of claims 1-3, characterized in that, The method further includes: When the fourth configuration information is parsed from the second operation instruction, the fourth configuration information is cached in the filling engine.

8. An apparatus for filling a field, characterized in that, The device is configured in a fill engine, which loads at least one entity object and at least one piece of configuration information. The device includes: The extraction module is used to extract object identification information, field identification information, and business operation information from the first operation instruction when the first operation instruction is received. The determining module is configured to determine a target entity object corresponding to the object identification information from at least one entity object based on the object identification information, wherein the target entity object includes at least one field; The acquisition module is configured to acquire a target field corresponding to the field identification information from at least one of the fields based on the field identification information; The determining module is further configured to determine, based on the field identification information, whether at least one piece of configuration information contains target configuration information corresponding to the target field; The acquisition module is further configured to, when it is determined that the target configuration information exists, acquire a target fill value based on the target configuration information, wherein the target fill value is a default fill value; A fill module is used to fill the target field with the target fill value; The execution module is used to execute business operations based on the business operation information and the target fill value filled in the target field; The acquisition module is further configured to: parse the second operation instruction when it is acquired; when the identification information and modification content of the configuration information are parsed from the second operation instruction, determine the third configuration information corresponding to the identification information of the configuration information from at least one piece of configuration information; and modify the third configuration information according to the modification content.

9. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of filling fields according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of filling a field as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Unstructured evidence file-oriented analysis method and system

    CN109582647A