An additional log processing method and system

By splitting tables with more than 33 columns in the append log processing method and automatically concatenating commands, the problem of complexity and inefficiency of manual operation in the existing technology is solved, and fast and efficient append log addition is achieved.

CN115422197BActive Publication Date: 2025-10-21CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211115573.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-14
Publication Date
2025-10-21
Estimated Expiration
2042-09-14

AI Technical Summary

Technical Problem

Adding additional logs using existing techniques requires complex manual operations, consumes a lot of manpower, and is prone to errors, especially when the number of additional logs is large, resulting in low efficiency.

Method used

By obtaining the pattern trigger command, it is determined whether the number of columns exceeds 33. If it does, it is split into multiple target sublists, and commands are added to each group for concatenating additional logs. The additional log addition operation in the command set is automatically executed.

Benefits of technology

It enables automatic and rapid addition of additional logs when a single table has more than 33 columns, avoiding accidental operations, improving addition efficiency, and reducing labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115422197B_ABST
    Figure CN115422197B_ABST
Patent Text Reader

Abstract

The application provides an additional log processing method and system. Different mode types are carried in mode trigger instructions to perform corresponding operations. When the additional log adding mode is carried in the mode trigger instruction, the first target list obtained without special columns is split based on the column number 33, and the obtained multiple groups of target sub-lists are respectively spliced after the additional log adding command and written into the to-be-executed command set. The additional log adding command in the to-be-executed command set is executed subsequently, and the spliced additional log is completed. Based on this, when the single table column exceeds 33 columns, the additional log can be automatically and quickly added, the purpose of avoiding misoperation and improving the additional log adding efficiency is achieved.
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 an additional log processing method and system. Background Art

[0002] In the process of data application, data synchronization or data mining is often required. Whether it is data synchronization to maintain data consistency or the process of searching for hidden information from a large amount of data through data mining, additional logs need to be added.

[0003] When adding additional logs, you usually need to manually find the corresponding table of the additional logs to be added. If the number of columns in the corresponding table of the additional logs to be added exceeds 33, you need to divide the columns of the additional log corresponding table into groups of 33, so that every 33 columns form a group to add additional logs. The last group with less than 33 columns is also formed into a separate group to add additional logs. Then write the command to add additional logs by column and execute it.

[0004] In the process of adding additional logs, it is usually necessary to log in to the target device throughout the process, enter the corresponding query command to analyze and judge each step, and then write the column-by-column command to add the additional logs. The process is complicated. Moreover, if the number of additional logs to be added is large, the operation and maintenance personnel will need to spend a lot of manpower costs to handle them, which is costly, inefficient, and prone to errors in the tedious manual processing process. Summary of the Invention

[0005] In view of this, an embodiment of the present invention provides an additional log processing method and system to achieve the purpose of improving the efficiency of adding additional logs.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] A first aspect of an embodiment of the present invention discloses a method for processing additional logs, the method comprising:

[0008] Obtaining a mode trigger instruction, wherein the mode trigger instruction carries a mode type;

[0009] If the mode type is the additional log adding mode, triggering the instruction based on the mode to enter the additional log adding mode;

[0010] In the additional log adding mode, a first list name set is obtained, where the first list name set includes the list name of a first target list to which the additional log is to be added, and the first target list does not include a special column;

[0011] Selecting a list name from the first list name set, and detecting whether the number of columns of the first target list corresponding to the list name exceeds 33;

[0012] If not, append the log addition command to the first target list, write the obtained second target list into the set of commands to be executed, and perform the judgment operation;

[0013] If it exceeds, the first target list is split based on the number of columns 33 to obtain multiple groups of target sub-lists;

[0014] Splicing additional log add commands for each group of the target sublists, writing the obtained multiple groups of second target lists into the set of commands to be executed, and performing a judgment operation;

[0015] The judgment operation includes:

[0016] Determine whether there is an unselected list name in the first list name set, and if so, return to the step of selecting a list name in the first list name set;

[0017] If it does not exist, execute the additional log adding command for splicing the second target list in the set of commands to be executed, splice additional logs for the second target list, and obtain a third target list.

[0018] Optionally, if the additional log adding mode is the full database additional log adding mode, obtaining the first list name set includes:

[0019] Query all non-system lists in the target database for the first target list that does not contain a special column;

[0020] The list names of the first target lists are obtained and combined to obtain a first list name set.

[0021] Optionally, if the additional log adding mode is a specified additional log adding mode, obtaining the first list name set includes:

[0022] Get and query whether the specified list entered by the user does not contain special columns;

[0023] If no special column is included, the specified list is used as the first target list, and the list names of the first target lists are collected to obtain a first list name set.

[0024] Optionally, the first target list is split based on the number of columns 33 to obtain multiple groups of target sub-lists, including:

[0025] Determine the total number of columns in the first target list, and divide the total number of columns by 33 to obtain a quotient;

[0026] If the quotient value only contains the integer N, split the first target list based on the number of columns in each target sub-list being 33, to obtain N groups of target sub-lists;

[0027] If the quotient consists of an integer N and a remainder n, add 1 to the integer N, and split the first target list based on the number of columns in each group of target sub-lists being 33, to obtain N groups of target sub-lists containing 33 columns and one group of target sub-lists with less than 33 columns.

[0028] Optionally, also include:

[0029] Get the list names and set of lists containing special columns to obtain the second list name set;

[0030] Output the second list name set.

[0031] Optionally, also include:

[0032] If the mode type is the additional log management mode, entering the additional log management mode based on the mode trigger instruction;

[0033] In the additional log management mode, all additional logs in the target database are queried and displayed according to user and table classification, wherein each user contains additional logs and lists managed by the user, and each additional log and list has its own table classification;

[0034] Output maintenance mode selection information;

[0035] Obtaining a selection instruction triggered by the current user based on the maintenance mode selection information;

[0036] If the selection instruction is to select to enter the additional log adding mode, enter and execute the additional log adding mode;

[0037] If the selection instruction is to select to enter the full library deletion mode, enter and execute the full library deletion mode;

[0038] If the selection instruction is to select to enter the designated deletion mode, the designated deletion mode is entered and executed.

[0039] Optionally, executing the full database deletion mode includes:

[0040] Splicing deletion commands for the additional logs managed by the current user, and writing the obtained first additional log to be deleted into the set of commands to be executed;

[0041] Output deletion query information;

[0042] If confirmation execution information is received from the current user based on the deletion query information, the deletion command of the first to-be-deleted additional log in the to-be-deleted command set is executed to delete the additional log managed by the current user in the target database.

[0043] Optionally, executing the specified deletion mode includes:

[0044] Output information Input query information;

[0045] If designated deletion information fed back by the current user based on the information input query information is received, query whether the designated deletion list name and / or the additional log name included in the designated deletion information exists;

[0046] If it does not exist, output a re-enter prompt message;

[0047] If so, concatenate deletion commands for the list corresponding to the specified deletion list name and / or the additional log corresponding to the additional log name, and write the obtained list to be deleted and / or the second additional log to be deleted into the set of commands to be executed;

[0048] Output deletion query information;

[0049] If confirmation execution information is received from the current user based on the deletion query information, the deletion command of the list to be deleted and / or the second additional log to be deleted in the pending command set is executed to delete the list to be deleted and / or the second additional log to be deleted.

[0050] Optionally, also include:

[0051] If the mode type is an end mode, the current process is ended based on the mode trigger instruction.

[0052] A second aspect of an embodiment of the present invention discloses an additional log processing system, the system comprising:

[0053] An acquiring unit, configured to acquire a mode trigger instruction, wherein the mode trigger instruction carries a mode type; if the mode type is an additional log adding mode, executing the additional log adding unit based on the mode trigger instruction;

[0054] The additional log adding unit includes:

[0055] An acquisition module, configured to acquire, in the additional log adding mode, a first list name set, wherein the first list name set includes the list name of a first target list to which an additional log is to be added, and the first target list does not include a special column;

[0056] a detection module, configured to select a list name from the first list name set and detect whether the number of columns in the first target list corresponding to the list name exceeds 33; if not, execute the first splicing module; if so, execute the splitting module and the second splicing module;

[0057] The first splicing module is used to splice the additional log addition command for the first target list, write the obtained second target list into the set of commands to be executed, and execute the judgment module;

[0058] The splitting module is used to split the first target list based on the number of columns 33 to obtain multiple groups of target sub-lists;

[0059] The second splicing module is used to splice additional log addition commands for each group of the target sublists, write the obtained multiple groups of second target lists into the set of commands to be executed, and execute the judgment module;

[0060] The judging module is configured to judge whether there is any unselected list name in the first list name set, and if so, return to execute the detecting module to select a list name in the first list name set again; if not, execute the third splicing module;

[0061] The third splicing module is used to execute the additional log adding command for splicing the second target list in the set of commands to be executed, and splice additional logs for the second target list to obtain a third target list.

[0062] An additional log processing method provided based on the above embodiment of the present invention includes: obtaining a mode trigger instruction, wherein the mode trigger instruction carries a mode type; if the mode type is an additional log adding mode, entering the additional log adding mode based on the mode trigger instruction; in the additional log adding mode, obtaining a first list name set, wherein the first list name set includes the list name of the first target list to which the additional log is to be added, and the first target list does not contain special columns; selecting a list name from the first list name set, and detecting whether the number of columns of the first target list corresponding to the list name exceeds 33; if not, splicing the additional log adding command for the first target list, and obtaining The second target list is written into the set of commands to be executed, and a judgment operation is performed; if it exceeds, the first target list is split based on the number of columns 33 to obtain multiple groups of target sub-lists; an additional log adding command is spliced ​​for each group of the target sub-lists, and the multiple groups of second target lists obtained are written into the set of commands to be executed, and a judgment operation is performed; the judgment operation includes: judging whether there is an unselected list name in the first list name set, if so, returning to the step of selecting a list name in the first list name set; if not, executing the additional log adding command spliced ​​for the second target list in the set of commands to be executed, splicing additional logs for the second target list, and obtaining a third target list.

[0063] In the embodiment provided by the present invention, corresponding operations are executed by carrying pattern trigger instructions of different pattern types. When the pattern trigger instruction carries the additional log addition mode, the first target list obtained, which does not contain special columns, is split based on the number of columns 33. The resulting multiple groups of target sublists are then spliced ​​with additional log addition commands and written into the set of pending commands. The additional log addition commands in the set of pending commands are then executed to complete the splicing of additional logs. Based on this, when a single table has more than 33 columns, additional logs can be added automatically and quickly, achieving the purpose of avoiding misoperations and improving the efficiency of additional log addition. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0065] Figure 1 A flowchart of an additional log processing method provided by an embodiment of the present invention;

[0066] Figure 2 A schematic diagram of the execution flow of a full-database additional log adding mode provided by an embodiment of the present invention;

[0067] Figure 3 A schematic diagram of an execution flow of a specified additional log adding mode provided by an embodiment of the present invention;

[0068] Figure 4 A schematic diagram of the execution flow of an additional log management mode provided by an embodiment of the present invention;

[0069] Figure 5 Another flowchart of an additional log processing method provided by an embodiment of the present invention;

[0070] Figure 6 A schematic diagram of the structure of an additional log processing system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0071] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0072] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0073] The embodiment of the present invention provides an additional log processing method, which is deployed on a database service system in the form of a script command of an additional log processing script. The database service system may be an ORACLE database service system. However, the embodiment of the present invention is not limited to this for the database service system. Figure 1 As shown, the additional log processing method includes:

[0074] S100: Acquire mode trigger instruction.

[0075] In S100, the mode trigger instruction carries the mode type.

[0076] Before executing S100, the additional log processing script deployed on the database service system is triggered, and the database service system will pop up a selection prompt for the user to select a mode type. The mode type includes at least additional log adding mode, additional log management mode and end mode.

[0077] A corresponding mode trigger instruction is generated according to the selected mode type, and S100 is executed to obtain the generated mode trigger instruction carrying the mode type.

[0078] S101: Execute corresponding mode operation according to the mode type carried in the mode trigger instruction. If the mode type is additional log adding mode, execute S102; if the mode type is additional log management mode, enter and execute corresponding additional log management mode operation; if the mode type is end mode, enter and execute corresponding end mode operation.

[0079] S102: Entering an additional log adding mode based on the mode triggering instruction.

[0080] Execute S102 to enter the additional log adding mode, and the specific execution process of the additional log adding mode includes: S103 to S112.

[0081] S103: Query whether the list of additional logs to be added in the current database contains a special column. If so, execute S104 to S105; if not, execute S106.

[0082] In S103, the current database can be the entire database or a specified database.

[0083] Special columns include, but are not limited to, columns of the LONG, VARRAY, nestedtable, object, LOB, FILE, or REF data types.

[0084] During the execution of S103, it is queried whether the list of additional logs to be added in the current database contains columns of LONG, VARRAY, nestedtable, object, LOB, FILE or REF data types. If so, it is determined that the list of additional logs to be added contains special columns, and S104 to S105 are executed; if not, it is determined that the list of additional logs to be added does not contain special columns, and S106 is executed.

[0085] S104: Obtain and set the list names of the lists containing the special column to which the additional logs are to be added, to obtain a second list name set.

[0086] In S104, the second list name set includes one or more list names containing special columns to which additional logs are to be added.

[0087] S105: Output the second list name set.

[0088] In S105 , the second list name set may be output by directly popping up or displaying a table where the second list name set is located, promptly informing the user that the list corresponding to the list name included in the second list name set cannot be added.

[0089] S106: Obtain a first list name set.

[0090] In S106 , the first list name set includes the list name of the first target list to which the additional log is to be added, and the first target list does not include any special columns.

[0091] During the execution of S106 , the list names of the lists to be added with additional logs that do not include the special column are obtained and grouped to obtain a first list name set.

[0092] S107: Select a list name from the first list name set, and check whether the number of columns of the first target list corresponding to the list name exceeds 33. If not, execute S108; if exceeded, execute S109 to S110.

[0093] During the process of executing S107 , one list name in the first list name set is randomly selected, or one list name in the first list name set is selected according to the order in which the list names are assembled.

[0094] Check whether the number of columns of the first target list corresponding to the selected list name exceeds 33. If not, execute S108. If more than 33, execute S109 to S110.

[0095] S108: Adding a log appending command to the first target list, and writing the obtained second target list into a set of commands to be executed.

[0096] In S108 , the set of commands to be executed is pre-established and is used to collectively form a list of additional log adding commands.

[0097] During the execution of S108 , the first target list having the number of columns not exceeding 33 is directly spliced ​​with additional log addition commands to obtain a second target list, and the second target list is written into the set of commands to be executed.

[0098] After executing S108 , S111 is executed.

[0099] S109: Split the first target list based on the number of columns 33 to obtain multiple groups of target sub-lists.

[0100] During the execution of S109 , the first target list having more than 33 columns is directly split based on the number of columns 33 to obtain multiple groups of target sub-lists.

[0101] In one embodiment of the present invention, the first target list is split based on the number of columns 33 to obtain multiple groups of target sub-lists in a specific manner including:

[0102] The total number of columns in the first target list is determined, and the total number of columns is divided by 33 to obtain a quotient.

[0103] If the quotient only contains an integer N, the first target list is split based on the number of columns in each target sublist being 33, to obtain N groups of target sublists. The value of N is a positive integer greater than 1.

[0104] For example, if the total number of columns in the first target list corresponding to the currently selected list name is 99, and 99 is divided by 33, the quotient is an integer 3. Then, the first target list is split into three groups of target sub-lists each containing 33 columns, thus obtaining three groups of target sub-lists each containing 33 columns.

[0105] If the quotient consists of an integer N and a remainder n, add 1 to the integer N, and split the first target list so that each target sublist has 33 columns, resulting in N target sublists with 33 columns each and one target sublist with fewer than 33 columns. N is a positive integer greater than 1, and n is a positive integer greater than 0.

[0106] It should be noted that if there is a remainder, it is usually used as the last group during the splitting process, that is, the last group may be less than 33 columns. However, the embodiment of the present invention is not limited to this.

[0107] For example, the total number of columns in the first target list corresponding to the currently selected list name is 98. Divide 98 by 33, and the quotient obtained is composed of the integer 2 and the remainder 9. Add 1 to the integer 2, and then split the first target list into two groups of target sub-lists containing 33 columns and one group of target sub-lists containing 9 columns, that is, two groups of target sub-lists containing 33 columns and one group of target sub-lists containing 9 columns are obtained.

[0108] S110: Adding log commands for each group of target sublists, and writing the obtained multiple groups of second target lists into the set of commands to be executed.

[0109] During the execution of S110 , corresponding additional log adding commands are concatenated for all obtained target sublists to obtain multiple groups of corresponding second target lists.

[0110] In one embodiment of the present invention, the obtained multiple groups of second target lists may be written into the set of commands to be executed in sequence according to the splitting order.

[0111] After executing S110 , S111 is executed.

[0112] S111: Determine whether there is any unselected list name in the first list name set. If not, execute S112; if so, execute S107.

[0113] S112: Execute the additional log adding command for splicing the second target list in the set of commands to be executed, and splice additional logs for the second target list to obtain a third target list.

[0114] During the execution of S112, if there is only one additional log adding command for splicing the second target list in the set of commands to be executed, the additional log adding command for splicing the second target list is directly executed to splice additional logs for the second target list to obtain a corresponding third target list.

[0115] If there are multiple additional log adding commands for splicing the second target list in the command set to be executed, the additional log adding commands for splicing the second target list are executed in a certain order, additional logs are spliced ​​for the second target list, multiple corresponding third target lists are obtained, and then the current process is ended.

[0116] In the embodiment provided by the present invention, corresponding operations are executed by carrying pattern trigger instructions of different pattern types. When the pattern trigger instruction carries the additional log addition mode, the first target list obtained, which does not contain special columns, is split based on the number of columns 33. The resulting multiple groups of target sublists are then spliced ​​with additional log addition commands and written into the set of pending commands. The additional log addition commands in the set of pending commands are then executed to complete the splicing of additional logs. Based on this, when a single table has more than 33 columns, additional logs can be added automatically and quickly, achieving the purpose of avoiding misoperations and improving the efficiency of additional log addition.

[0117] Based on the additional log processing method disclosed in the embodiment of the present invention, in S102 disclosed above, the additional log adding mode is entered based on the mode trigger instruction. The additional log adding mode includes but is not limited to the full database additional log adding mode and the specified additional log adding mode.

[0118] like Figure 2 FIG. 1 is a schematic diagram of the execution flow of a full-library additional log adding mode disclosed in an embodiment of the present invention.

[0119] S201: Query whether the list of additional logs to be added in the entire database contains a special column. If so, execute S202 to S203; if not, execute S204.

[0120] In S201 , special columns include but are not limited to columns of LONG, VARRAY, nestedtable, object, LOB, FILE, or REF data types.

[0121] During the execution of S201, the list of all non-system additional logs to be added in the entire database is queried to see whether it contains columns of LONG, VARRAY, nestedtable, object, LOB, FILE or REF data types. If so, it is determined that the list of additional logs to be added contains special columns, and S202 to S203 are executed; if not, it is determined that the list of additional logs to be added does not contain special columns, and S204 is executed.

[0122] S202: Obtain and set the list names of the lists to which additional logs are to be added that contain special columns to obtain a second list name set.

[0123] S203: Output the second list name set.

[0124] S204: Obtain a first list name set.

[0125] S205: Select a list name from the first list name set, and detect whether the number of columns of the first target list corresponding to the list name exceeds 33. If not, execute S206; if exceeded, execute S207 to S208.

[0126] S206: Adding a log appending command to the first target list, and writing the obtained second target list into a set of commands to be executed.

[0127] After executing S206 , execute S209 .

[0128] S207: Split the first target list based on the number of columns 33 to obtain multiple groups of target sub-lists.

[0129] S208: Adding commands to each group of target sublists by splicing additional logs, and writing the obtained multiple groups of second target lists into the set of commands to be executed.

[0130] After executing S208 , execute S209 .

[0131] S209: Determine whether there is any unselected list name in the first list name set. If not, execute S210; if so, execute S205.

[0132] S210: Execute the additional log adding command for splicing the second target list in the set of commands to be executed, and splice additional logs for the second target list to obtain a third target list.

[0133] The specific execution process of the above S202 to S210 is the same as Figure 1 The specific execution process of S104 to S112 shown in FIG is the same and will not be repeated here.

[0134] like Figure 3 FIG. 1 is a schematic diagram of an execution flow of a specified additional log adding mode disclosed in an embodiment of the present invention.

[0135] S301: Query whether a list of additional logs to be added in a specified library contains a special column. If so, execute S302 to S303; if not, execute S304.

[0136] In S301 , special columns include but are not limited to columns of LONG, VARRAY, nestedtable, object, LOB, FILE, or REF data types.

[0137] During the execution of S301, it is queried whether the specified list input by the user in the specified library contains columns of LONG, VARRAY, nestedtable, object, LOB, FILE or REF data types. If so, it is determined that the specified list contains special columns, and S302 to S303 are executed; if not, it is determined that the specified list does not contain special columns, and S304 is executed.

[0138] S302: Obtain and set the list names of the lists to which additional logs are to be added that contain special columns to obtain a second list name set.

[0139] S303: Output the second list name set.

[0140] S304: Obtain a first list name set.

[0141] S305: Select a list name from the first list name set, and check whether the number of columns in the first target list corresponding to the currently selected list name exceeds 33. If not, execute S306; if so, execute S307 to S308.

[0142] S306: Adding a log appending command to the first target list, and writing the obtained second target list into a set of commands to be executed.

[0143] After executing S306 , execute S309 .

[0144] S307: Split the first target list based on the number of columns 33 to obtain multiple groups of target sub-lists.

[0145] S308: Adding log commands to each target sublist, and writing the obtained multiple sets of second target lists into the set of commands to be executed.

[0146] After executing S308 , execute S309 .

[0147] S309: Determine whether there is any unselected list name in the first list name set. If not, execute S310; if so, execute S305.

[0148] S310: Execute the additional log adding command for splicing the second target list in the set of commands to be executed, and splice additional logs for the second target list to obtain a third target list.

[0149] The specific execution process of S302 to S310 is the same as Figure 1 The specific execution process of S104 to S112 shown in FIG is the same and will not be repeated here.

[0150] In the embodiment provided by the present invention, the corresponding operation is performed by carrying a mode trigger instruction of different mode types. When the additional log adding mode carried in the mode trigger instruction is the whole database additional log adding mode / specified additional log adding mode, the first target list obtained without special columns is split based on the number of columns 33, and the obtained multiple groups of target sublists are respectively spliced ​​with the additional log adding command and then written into the set of commands to be executed. The additional log adding command in the set of commands to be executed is subsequently executed to complete the splicing of the additional log. Based on this, when a single table has more than 33 columns, the additional log can be added automatically and quickly, thereby achieving the purpose of avoiding misoperation and improving the efficiency of adding additional logs.

[0151] Based on the additional log processing method disclosed in the embodiment of the present invention, during the execution of S101, if the mode type is additional log management mode, the additional log management mode is entered and the corresponding additional log management mode operation is performed. Figure 4 FIG. 1 is a schematic diagram of an execution flow of an additional log management mode disclosed in an embodiment of the present invention.

[0152] S401: Query all additional logs in the target database and display them by user and table classification.

[0153] In S401 , there are one or more users in the target database. Each user has additional logs and lists managed by the user. Each additional log and list has its own table classification.

[0154] During the execution of S401 , the list names of all additional logs found in the target database are displayed in correspondence with the user names, so that the user can find the corresponding list according to the user name, or find the corresponding user name according to the list name.

[0155] S402: Output maintenance mode selection information.

[0156] In S402 , the maintenance mode includes an additional log adding mode, a full database deleting mode, and a specified deleting mode.

[0157] During the execution of S402 , outputting maintenance mode selection information may pop up maintenance mode options, such as pop-up options “additional log addition mode”, “full database deletion mode” and “specified deletion mode”, to remind the user to select a specific maintenance mode.

[0158] After the user selects a specific maintenance mode, S403 is executed.

[0159] S403: Acquire a selection instruction triggered by the current user based on the maintenance mode selection information.

[0160] During the execution of S403 , if the selected instruction is to select to enter the additional log adding mode, the additional log adding mode is entered and executed.

[0161] Executing the additional log adding mode includes executing the corresponding process of the additional log adding mode, that is, executing Figure 1 S103 to S112 shown in FIG.

[0162] The additional log adding mode includes a full-database additional log adding mode and a specified additional log adding mode.

[0163] If the additional log adding mode is the full database additional log adding mode, executing the additional log adding mode includes executing the corresponding process of the full database additional log adding mode, that is, executing Figure 2 S201 to S210 shown in FIG.

[0164] If the additional log adding mode is the specified additional log adding mode, executing the additional log adding mode includes executing the corresponding process of the specified additional log adding mode, that is, executing Figure 3 S301 to S310 shown in FIG.

[0165] If the selection instruction is to select to enter the full library deletion mode, enter and execute the full library deletion mode.

[0166] like Figure 4 As shown, the process of executing the full library deletion mode includes: S404 to S407.

[0167] S404: assembling deletion commands for the additional logs managed by the current user, and writing the obtained first additional log to be deleted into the set of commands to be executed.

[0168] In S404 , the set of commands to be executed is pre-established and used to collect additional logs of the spliced ​​deletion commands.

[0169] During the execution of S404 , deletion commands are assembled for the additional logs of the entire database in a certain order, and the obtained first additional log to be deleted is written into the set of commands to be executed.

[0170] S405: Output deletion inquiry information.

[0171] In S405 , a deletion inquiry message is output to confirm whether to delete the first additional log to be deleted in the set of commands to be executed.

[0172] During the execution of S405 , the deletion inquiry information may be outputted in the form of pop-up text options “Confirm deletion” and “Cancel deletion”.

[0173] S406: Whether confirmation execution information based on the deletion inquiry information feedback is received, if not, end the current process; if received, execute S407.

[0174] S407: Execute the deletion command of the first additional log to be deleted in the set of commands to be executed, and delete the additional log managed by the current user in the target database.

[0175] In S407 , the target database is the entire database.

[0176] During the execution of S407 , the deletion commands of the first additional log to be deleted in the set of pending commands are executed in sequence to delete the additional logs managed by the current user in the entire database. After the additional logs are deleted, the current process ends.

[0177] If the selection instruction is to select to enter the designated deletion mode, the designated deletion mode is entered and executed.

[0178] like Figure 4 As shown, the process of executing the designated deletion mode includes: S411 to S417.

[0179] S411: Output information input inquiry information.

[0180] In S411, the query information is inputted by outputting information to prompt the current user to input the designated deletion information, wherein the designated deletion information includes the designated deletion list name and / or the additional log name.

[0181] During the execution of S411 , the output information input inquiry information may be a pop-up text “Please enter the name of the list or additional log to be deleted”.

[0182] If the user inputs the designated deletion information based on the information input inquiry information, step S412 is executed.

[0183] S412: Acquire designated deletion information of the user based on the information input query information feedback.

[0184] During the execution of S412 , designated deletion information including the designated deletion list name and / or the additional log name is obtained.

[0185] S413: Check whether the designated deletion list name and / or additional log name included in the designated deletion information exists. If so, execute S414 to S416; if not, execute S411.

[0186] In S413 , the specified deletion list name and / or additional log name may be one or more.

[0187] During the execution of S413, if it is found that the specified deletion list name and / or additional log name entered by the user exists, S414 to S416 are executed; if it is found that the specified deletion list name and / or additional log name entered by the user does not exist, the process returns to S411 to output a re-entry prompt message.

[0188] S414: Concatenate deletion commands for the list corresponding to the specified deletion list name and / or the additional log corresponding to the additional log name, and write the obtained list to be deleted and / or the second additional log to be deleted into a set of commands to be executed.

[0189] During the execution of S414, deletion commands are spliced ​​for the lists corresponding to the specified deletion list names and / or the additional log names corresponding to the additional log names in an arbitrary order or the order of the deletion list names and / or additional log names input by the user, and the obtained list to be deleted and / or the second additional log to be deleted are written into the set of commands to be executed.

[0190] S415: Output deletion inquiry information.

[0191] In S415 , a deletion inquiry message is output to confirm whether to delete the to-be-deleted list and / or the second to-be-deleted additional log in the to-be-executed command set.

[0192] During the execution of S415 , the deletion inquiry information may be outputted in the form of pop-up text options “Confirm deletion” and “Cancel deletion”.

[0193] S416: Whether the confirmation execution information fed back by the current user based on the deletion inquiry information is received, if not, end the current process; if received, execute S417.

[0194] S417: Execute the deletion command of the to-be-deleted list and / or the second to-be-deleted additional log in the to-be-deleted command set to delete the to-be-deleted list and / or the second to-be-deleted additional log.

[0195] During the execution of S417, the deletion commands of the list to be deleted and / or the second additional log to be deleted in the set of commands to be executed are executed in a certain order to delete the list corresponding to the specified deletion list name and / or the additional log corresponding to the additional log name. After deleting the list to be deleted and / or the second additional log to be deleted, the current process is ended.

[0196] In the embodiment provided by the present invention, the additional log management mode is entered by carrying a mode trigger instruction whose mode type is the additional log management mode, and the selection instruction triggered by the current user based on the maintenance mode selection information is obtained to enter and execute different maintenance modes. If the selection instruction is to select to enter the additional log adding mode, the additional log adding mode is entered and executed to achieve fast and automatic addition of additional logs; if the selection instruction is to select to enter the whole library deletion mode, the whole library deletion mode is entered and executed to achieve fast and automatic deletion of the whole library additional logs; if the selection instruction is to select to enter the specified deletion mode, the specified deletion mode is entered and executed to achieve fast and automatic deletion of the specified additional logs.

[0197] Based on the additional log processing method disclosed in the above embodiment of the present invention, the following will be combined with Figure 5 The practical application process of the additional log processing method is specifically explained.

[0198] After the user triggers the additional log processing script deployed on the database service system, the database service system will pop up multiple selection modes, including: full database additional log adding mode, specified additional log adding mode, additional log management mode and end mode.

[0199] Select 1 to enter the database-wide additional log adding mode, select 2 to enter the specified additional log adding mode, select 4 to enter the additional log management mode, and select 5 to enter the end mode.

[0200] If the user wants to add additional logs for the entire database, he or she can select the additional log adding mode for the entire database with one click. After selecting the additional log adding mode for the entire database, the execution process of the additional log adding mode for the entire database will be automatically entered, and the additional logs that do not contain special columns in the entire database will be added quickly and automatically. For additional logs that contain special columns, the user will be informed that they cannot be added.

[0201] If the user wants to add a specified additional log, he can select the specified additional log adding mode with one click. The user enters the name of the additional log to be added, and then automatically enters the execution process of the specified additional log adding mode, quickly and automatically completing the addition of the specified additional log without special columns, while the additional log with special columns will inform the user that it cannot be added.

[0202] If the user wants to manage additional logs, they can select the additional log management mode with one click. After selecting the additional log management mode, the user will automatically enter the execution process of the additional log management mode. In the execution process of the additional log management mode, they can select a specific maintenance mode with one click, and then automatically enter the execution process of the specific maintenance mode. The maintenance modes include additional log addition mode, full database deletion mode, and specified deletion mode. If the user selects full database deletion mode, the user will automatically enter the execution process of full database deletion mode, quickly and automatically deleting the additional logs of the entire database.

[0203] If the user triggers the additional log processing script deployed on the database service system, the database service system will pop up multiple selection modes. If you do not want to process the additional logs, select the end mode to end the current process.

[0204] Based on the additional log processing method disclosed in the above embodiment of the present invention, the embodiment of the present invention also provides an additional log processing system 600. Figure 6 As shown, the additional log processing system 600 includes:

[0205] The acquisition unit 601 is configured to acquire a mode trigger instruction, wherein the mode trigger instruction carries a mode type; if the mode type is an additional log adding mode, the additional log adding unit 602 is executed based on the mode trigger instruction.

[0206] The additional log adding unit 602 includes:

[0207] The acquisition module 603 is configured to acquire a first list name set in the additional log adding mode, where the first list name set includes the list name of a first target list to which an additional log is to be added, and the first target list does not include a special column.

[0208] If the additional log adding mode is the full database additional log adding mode, the acquisition module 603 is specifically used to:

[0209] A first target list that does not contain a special column in all non-system lists in the target database is searched; list names of the first target lists are obtained and combined to obtain a first list name set.

[0210] If the additional log adding mode is the specified additional log adding mode, the acquisition module 603 is specifically used to:

[0211] Obtain and query whether the specified list input by the user does not contain a special column; if it does not contain a special column, use the specified list as the first target list, and collect the list names of the first target lists to obtain a first list name set.

[0212] In one embodiment of the present invention, the acquisition module 603 is further configured to:

[0213] Obtain a list name union set of lists containing a special column to obtain a second list name set; and output the second list name set.

[0214] The detection module 604 is used to select a list name from the first list name set, detect whether the number of columns of the first target list corresponding to the list name exceeds 33, and if it is detected that the number of columns of the first target list corresponding to the list name does not exceed 33, execute the first splicing module 605; if it is detected that the number of columns of the first target list corresponding to the list name exceeds 33, execute the splitting module 606 and the second splicing module 607 in sequence.

[0215] The first splicing module 605 is used to splice additional log addition commands for the first target list with no more than 33 columns, write the obtained second target list into the set of commands to be executed, and execute the judgment module 608 after the second target list is written into the set of commands to be executed.

[0216] The splitting module 606 is configured to split the first target list having more than 33 columns into multiple target sub-lists.

[0217] In one embodiment of the present invention, the splitting module 606 is specifically configured to:

[0218] Determine the total number of columns in the first target list and divide the total number of columns by 33 to obtain a quotient; if the quotient contains only the integer N, split the first target list based on the number of columns in each group of target sub-lists being 33, to obtain N groups of target sub-lists; if the quotient consists of the integer N and the remainder n, add 1 to the integer N and split the first target list based on the number of columns in each group of target sub-lists being 33, to obtain N groups of target sub-lists containing 33 columns and one group of target sub-lists containing less than 33 columns.

[0219] The second splicing module 607 is used to splice additional log addition commands for each group of the target sub-lists, write the obtained multiple groups of second target lists into the set of commands to be executed, and execute the judgment module 608 after writing the multiple groups of second target lists into the set of commands to be executed.

[0220] The judging module 608 is used to judge whether there is any unselected list name in the first list name set. If so, the detecting module 604 selects another list name in the first list name set; if not, the third splicing module 609 is executed.

[0221] The third splicing module 609 is configured to execute the additional log adding command for splicing the second target list in the set of commands to be executed, and splice additional logs for the second target list to obtain a third target list.

[0222] In one embodiment of the present invention, the additional log processing system 600 further includes an additional log management unit. If the mode type carried by the mode trigger instruction acquired by the acquisition unit 601 is the additional log management mode, the additional log management unit is triggered to execute based on the mode trigger instruction.

[0223] The additional log management unit is specifically used for:

[0224] Query all additional logs in the target database and display them according to user and table categories; output maintenance mode selection information; obtain the selection instruction triggered by the current user based on the maintenance mode selection information; if the selection instruction is to select to enter the additional log addition mode, enter and execute the additional log addition unit 602; if the selection instruction is to select to enter the full database deletion mode, enter and execute the full database deletion unit; if the selection instruction is to select to enter the specified deletion mode, enter and execute the specified deletion unit.

[0225] Each user includes additional logs and lists managed by the user, and each additional log and list has its own table classification.

[0226] The entire library deletes units, specifically used for:

[0227] A deletion command is spliced ​​for the additional logs managed by the current user, and the obtained first additional log to be deleted is written into the set of commands to be executed; a deletion query message is output; if a confirmation execution message based on the deletion query message is fed back by the current user, the deletion command of the first additional log to be deleted in the set of commands to be executed is executed to delete the additional logs managed by the current user in the target database.

[0228] Specifies the deletion unit, specifically used for:

[0229] Output information input query information; if the specified deletion information is received from the current user based on the information input query information, query whether the specified deletion list name and / or additional log name included in the specified deletion information exists; if not, output re-enter prompt information; if so, splice deletion commands for the list corresponding to the specified deletion list name and / or the additional log name, and write the obtained list to be deleted and / or the second additional log to be deleted into the set of commands to be executed; output deletion query information; if the confirmation execution information is received from the current user based on the deletion query information, execute the deletion command spliced ​​with the list to be deleted and / or the second additional log to be deleted in the set of commands to be executed, and delete the list to be deleted and / or the second additional log to be deleted.

[0230] It should be noted that the specific principles and execution processes of the various units and modules in the additional log processing system disclosed in the above embodiment of the present invention are the same as those of the additional log processing method disclosed in the above embodiment of the present invention. Please refer to the corresponding parts of the additional log processing method disclosed in the above embodiment of the present invention, and no further details will be given here.

[0231] In the embodiment provided by the present invention, the corresponding operation is executed by the pattern trigger instruction carrying different pattern types acquired by the acquisition unit. When the pattern trigger instruction acquired by the acquisition unit carries the additional log adding mode, the splitting module splits the first target list obtained without the special column based on the number of columns 33, and then writes the obtained multiple groups of target sublists into the set of commands to be executed after splicing the additional log adding commands respectively through the second splicing module. The subsequent third splicing module executes the additional log adding commands in the set of commands to be executed to complete the splicing of the additional logs. Based on this, when a single table has more than 33 columns, the additional log can be added automatically and quickly, thereby achieving the purpose of avoiding misoperation and improving the efficiency of adding additional logs.

[0232] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.

[0233] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0234] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing additional logs, characterized in that: The method comprises: Obtaining a mode trigger instruction, wherein the mode trigger instruction carries a mode type; If the mode type is the additional log adding mode, triggering the instruction based on the mode to enter the additional log adding mode; In the additional log adding mode, a first list name set is obtained, where the first list name set includes the list name of a first target list to which the additional log is to be added, and the first target list does not include a special column; Selecting a list name from the first list name set, and detecting whether the number of columns of the first target list corresponding to the list name exceeds 33; If not, append the log addition command to the first target list, write the obtained second target list into the set of commands to be executed, and perform the judgment operation; If it exceeds, the first target list is split based on the number of columns 33 to obtain multiple groups of target sub-lists; Splicing additional log add commands for each group of the target sublists, writing the obtained multiple groups of second target lists into the set of commands to be executed, and performing a judgment operation; The judgment operation includes: Determine whether there is an unselected list name in the first list name set, and if so, return to the step of selecting a list name in the first list name set; If it does not exist, execute the additional log adding command for splicing the second target list in the set of commands to be executed, splice additional logs for the second target list, and obtain a third target list.

2. The method according to claim 1, characterized in that If the additional log adding mode is the full database additional log adding mode, obtaining the first list name set includes: Query all non-system lists in the target database for the first target list that does not contain a special column; The list names of the first target lists are obtained and combined to obtain a first list name set.

3. The method according to claim 1, characterized in that If the additional log adding mode is the specified additional log adding mode, obtaining the first list name set includes: Get and query whether the specified list entered by the user does not contain special columns; If no special column is included, the specified list is used as the first target list, and the list names of the first target lists are collected to obtain a first list name set.

4. The method according to any one of claims 1 to 3, characterized in that The first target list is split based on the number of columns 33 to obtain multiple groups of target sub-lists, including: Determine the total number of columns in the first target list, and divide the total number of columns by 33 to obtain a quotient; If the quotient value only contains the integer N, split the first target list based on the number of columns in each target sub-list being 33, to obtain N groups of target sub-lists; If the quotient consists of an integer N and a remainder n, add 1 to the integer N, and split the first target list based on the number of columns in each group of target sub-lists being 33, to obtain N groups of target sub-lists containing 33 columns and one group of target sub-lists with less than 33 columns.

5. The method according to any one of claims 1 to 3, characterized in that Also includes: Get the list names and set of lists containing special columns to obtain the second list name set; Output the second list name set.

6. The method according to any one of claims 1 to 3, characterized in that Also includes: If the mode type is the additional log management mode, entering the additional log management mode based on the mode trigger instruction; In the additional log management mode, all additional logs in the target database are queried and displayed according to user and table classification, wherein each user contains additional logs and lists managed by the user, and each additional log and list has its own table classification; Output maintenance mode selection information; Obtaining a selection instruction triggered by the current user based on the maintenance mode selection information; If the selection instruction is to select to enter the additional log adding mode, enter and execute the additional log adding mode; If the selection instruction is to select to enter the full library deletion mode, enter and execute the full library deletion mode; If the selection instruction is to select to enter the designated deletion mode, the designated deletion mode is entered and executed.

7. The method according to claim 6, characterized in that Executing the full database deletion mode includes: Splicing deletion commands for the additional logs managed by the current user, and writing the obtained first additional log to be deleted into the set of commands to be executed; Output deletion query information; If confirmation execution information is received from the current user based on the deletion query information, the deletion command of the first to-be-deleted additional log in the to-be-deleted command set is executed to delete the additional log managed by the current user in the target database.

8. The method according to claim 6, characterized in that Executing the specified deletion mode includes: Output information Input query information; If designated deletion information fed back by the current user based on the information input query information is received, query whether the designated deletion list name and / or the additional log name included in the designated deletion information exists; If it does not exist, output a re-enter prompt message; If so, concatenate deletion commands for the list corresponding to the specified deletion list name and / or the additional log corresponding to the additional log name, and write the obtained list to be deleted and / or the second additional log to be deleted into the set of commands to be executed; Output deletion query information; If confirmation execution information is received from the current user based on the deletion query information, the deletion command of the list to be deleted and / or the second additional log to be deleted in the pending command set is executed to delete the list to be deleted and / or the second additional log to be deleted.

9. The method according to claim 1, characterized in that Also includes: If the mode type is an end mode, the current process is ended based on the mode trigger instruction.

10. An additional log processing system, characterized in that: The system comprises: An acquiring unit, configured to acquire a mode trigger instruction, wherein the mode trigger instruction carries a mode type; if the mode type is an additional log adding mode, executing the additional log adding unit based on the mode trigger instruction; The additional log adding unit includes: An acquisition module, configured to acquire, in the additional log adding mode, a first list name set, wherein the first list name set includes the list name of a first target list to which an additional log is to be added, and the first target list does not include a special column; a detection module, configured to select a list name from the first list name set and detect whether the number of columns in the first target list corresponding to the list name exceeds 33; if not, execute the first splicing module; if so, execute the splitting module and the second splicing module; The first splicing module is used to splice the additional log addition command for the first target list, write the obtained second target list into the set of commands to be executed, and execute the judgment module; The splitting module is used to split the first target list based on the number of columns 33 to obtain multiple groups of target sub-lists; The second splicing module is used to splice additional log addition commands for each group of the target sublists, write the obtained multiple groups of second target lists into the set of commands to be executed, and execute the judgment module; The judging module is configured to judge whether there is any unselected list name in the first list name set, and if so, return to execute the detecting module to select a list name in the first list name set again; if not, execute the third splicing module; The third splicing module is used to execute the additional log adding command for splicing the second target list in the set of commands to be executed, and splice additional logs for the second target list to obtain a third target list.

Citation Information

Patent Citations

  • Method for automatically and rapidly adding BMC sel

    CN107861831A

  • Automated source code log generation

    US11089000B1