Sentence processing method and apparatus, processor, and electronic device

CN117033414BActive Publication Date: 2026-10-30INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311008059.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-10
Publication Date
2026-10-30
Estimated Expiration
2043-08-10

AI Technical Summary

Technical Problem

[0006]本申请的主要目的在于提供一种语句的处理方法、装置、处理器以及电子设备,以解决相关技术中执行时间长的语句处理不到位的问题

Benefits of technology

[0017]通过本申请,采用以下步骤:获取业务系统中的待处理语句,并获取待处理语句的基本信息和待处理语句的关联数据,其中,待处理语句是指语句执行时长大于预设执行时长的语句;根据基本信息获取待处理语句关联的日志文件,并从日志文件中提取日志信息;从基本信息中提取入参信息,从关联数据中提取关联表,并从日志信息中获取待处理语句使用的关联条件信息,其中,入参信息包括执行待处理语句时需要提供的数据或变量;在入参信息与关联条件信息的关键字段信息相同的情况下,对关联表进行拆分处理,并基于拆分后的关联表执行待处理语句,解决了相关技术中执行时间长的语句处理不到位的问题,通过获取待处理语句和该待处理语句的基本信息和关联数据,基于基本信息和关联数据提取入参信息和关联表,并在入参信息中的字段和关联表中的字段符合要求的情况下对关联表进行拆分处理,进而达到了及时有效地处理待处理语句的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117033414B_ABST
    Figure CN117033414B_ABST
Patent Text Reader

Abstract

The application discloses a kind of processing method, device, processor and electronic equipment of sentence. It is related to the field of financial technology or other related fields, which comprises: obtaining the pending sentence in business system, and obtaining the basic information of pending sentence and the associated data of pending sentence, wherein the pending sentence refers to the sentence execution duration greater than the preset execution duration;According to the basic information, the log file associated with the pending sentence is obtained, and the log information is extracted from the log file;From the basic information, the input parameter information is extracted, the associated table is extracted from the associated data, and the associated condition information used by the pending sentence is obtained from the log information;In the case where the key field information of input parameter information and associated condition information is the same, the associated table is split and processed, and the pending sentence is executed based on the split associated table. Through the present application, the problem of not in place in the related art for processing the sentence with long execution time is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology or other related fields, and more specifically, to a method, apparatus, processor, and electronic device for processing statements. Background Technology

[0002] In financial institutions, a financial management system can be used to support staff in carrying out their business smoothly. This system enables functions such as expense reimbursement, expense collection and reconciliation, and employee payroll disbursement. In recent years, with the explosive growth of production data and the increasing demands for timely data processing, the requirements for the operation of financial management systems have become increasingly stringent. Quickly, accurately, and promptly locating and processing slow statements within the financial management system can improve its execution efficiency, thereby ensuring stable production operations.

[0003] Slow statements are those that take a long time to execute and have low query processing efficiency during actual production operation. Slow statements are unavoidable in the daily operation of a financial management system. The main causes of slow statements are program logic processing problems and non-program processing problems. Program logic processing problems often occur during the system's functional design phase, such as inadequate evaluation of data to be used, lack of proper table indexing, and unreasonable processing logic. Non-program processing problems usually arise as production-related tables have been in use for a long time and the volume of production data becomes massive. Slow statements lead to long processing times for business logic functions and low user satisfaction; therefore, it is necessary to handle slow statements generated during operation in a timely manner.

[0004] In routine system maintenance, operations personnel typically proactively acquire and analyze load performance reports (AWR reports: Automatic Workload Repository Reports), then send the analysis results to technical developers for processing within a specified timeframe. This approach is a passive approach, requiring emergency repairs through production changes. Furthermore, when operations personnel periodically retrieve and analyze production AWR reports, this is usually done during normal working hours. However, abnormal slow statements generated at night cannot be processed promptly, and there is a risk of inadequate analysis and incomplete resolution.

[0005] There is currently no effective solution to the problem of inadequate handling of long-running statements in related technologies. Summary of the Invention

[0006] The main objective of this application is to provide a method, apparatus, processor, and electronic device for processing statements, in order to solve the problem of inadequate processing of statements with long execution times in the related art.

[0007] To achieve the above objectives, according to one aspect of this application, a method for processing statements is provided. The method includes: acquiring a statement to be processed from a business system, and acquiring basic information and associated data of the statement to be processed, wherein the statement to be processed refers to a statement whose execution duration is greater than a preset execution duration; acquiring a log file associated with the statement to be processed based on the basic information, and extracting log information from the log file; extracting input parameter information from the basic information, extracting an association table from the associated data, and acquiring association condition information used by the statement to be processed from the log information, wherein the input parameter information includes data or variables required to execute the statement to be processed; and, if the key field information of the input parameter information and the association condition information is the same, splitting the association table, and executing the statement to be processed based on the split association table.

[0008] Optionally, obtaining the pending statements from the business system and obtaining the basic information and associated data of the pending statements includes: determining whether the business system is online at the current time, where the current time refers to the time when the pending statements need to be obtained; if the business system is online, it performs an update log operation; if the business system is not online at the current time, it obtains a load performance report for a preset time period from the operation and maintenance website associated with the business system, obtains the pending statements from the load performance report, and obtains basic information and associated data from the database associated with the business system, wherein the end time of the preset time period is earlier than the current time; if the business system is online at the current time, it scans the executed statements of the business system according to a scheduled scanning program to obtain the pending statements, and obtains basic information and associated data from the database associated with the business system.

[0009] Optionally, obtaining the log file associated with the statement to be processed based on basic information includes: determining whether the business system is online; if the business system is online, stopping the step of obtaining the log file associated with the statement to be processed based on basic information until it is detected that the business system is offline; if the business system is offline, obtaining candidate log files associated with the business system, and obtaining the log file from the candidate log files based on the basic information.

[0010] Optionally, the method further includes: sending the statement to be processed to the client when the key field information of the input parameter information and the associated condition information are different; and executing the adjusted statement to be processed when the client provides feedback.

[0011] Optionally, the associated table is split, and the pending statements are executed based on the split associated table, including: determining whether the storage time of the table data in the associated table exceeds the data storage period, where the data storage period refers to the earliest time the table data is saved; if there is target table data in the associated table whose storage time exceeds the data storage period, the target table data is migrated to the first newly added table; if there is no target table data in the associated table whose storage time exceeds the data storage period, the associated table is split to obtain the split result; the first newly added table and the split result constitute the split associated table.

[0012] Optionally, the related tables are split to obtain the splitting results, which include: obtaining the data to be migrated from the related tables within the data storage period, and determining whether there are candidate data to be migrated among the data to be migrated. Candidate data to be migrated refers to data to be migrated whose execution time exceeds a preset query time range. The preset query time range is the smallest of M initial query time ranges, and the data execution time is the time to execute the table data of the related tables, where M is a positive integer. If candidate data to be migrated exists among the data to be migrated, target data to be migrated from the candidate data to be migrated with a query frequency lower than a preset frequency is obtained, and the target data to be migrated is migrated to the second newly added table. The candidate data to be migrated is migrated to the new database, and the new database is migrated to the new partition. The new database includes candidate data to be migrated from the second newly added table and target data to be migrated with a query frequency higher than the preset frequency. The splitting result consists of the second newly added table, the new database, and the table data in the new partition.

[0013] Optionally, before obtaining the data to be migrated from the associated tables within the data storage period and determining whether there are candidate data to be migrated in the data to be migrated, the method further includes: obtaining the time and number of times the pending statement appears from the log information, obtaining the query time and number of queries, and obtaining the M time field information contained in the input parameter information; calculating the ratio of the number of queries to the query time to obtain the query frequency, and determining M initial query time ranges based on the M time field information.

[0014] To achieve the above objectives, according to another aspect of this application, a statement processing apparatus is provided. The apparatus includes: a first acquisition unit, configured to acquire a statement to be processed from a business system, and acquire basic information and associated data of the statement to be processed, wherein the statement to be processed refers to a statement whose execution duration is greater than a preset execution duration; a second acquisition unit, configured to acquire a log file associated with the statement to be processed based on the basic information, and extract log information from the log file; an extraction unit, configured to extract input parameter information from the basic information, extract an association table from the associated data, and acquire association condition information used by the statement to be processed from the log information, wherein the input parameter information includes data or variables required to execute the statement to be processed; and a processing unit, configured to split the association table when the key field information of the input parameter information and the association condition information are the same, and execute the statement to be processed based on the split association table.

[0015] According to another aspect of the present invention, a processor is also provided, which is used to run a program, wherein the program controls a device containing a non-volatile storage medium to execute a statement processing method during runtime.

[0016] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions, when executed, perform a statement processing method.

[0017] This application employs the following steps: obtaining statements to be processed from the business system, and acquiring basic information and associated data of the statements to be processed, wherein the statements to be processed refer to statements whose execution time exceeds a preset execution time; obtaining the log file associated with the statements to be processed based on the basic information, and extracting log information from the log file; extracting input parameter information from the basic information, extracting the association table from the associated data, and obtaining the association condition information used by the statements to be processed from the log information, wherein the input parameter information includes data or variables required to execute the statements to be processed; when the key field information of the input parameter information and the association condition information are the same, splitting the association table, and executing the statements to be processed based on the split association table, solves the problem of inadequate processing of statements with long execution times in related technologies. By acquiring the statements to be processed and their basic information and associated data, extracting input parameter information and association tables based on the basic information and associated data, and splitting the association table when the fields in the input parameter information and the fields in the association table meet the requirements, the effect of timely and effective processing of statements to be processed is achieved. Attached Figure Description

[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0019] Figure 1 This is a flowchart of a statement processing method provided according to an embodiment of this application;

[0020] Figure 2 This is a schematic diagram of a method for obtaining log files according to an embodiment of this application;

[0021] Figure 3 This is a schematic diagram of a method for obtaining a load performance report according to an embodiment of this application;

[0022] Figure 4 This is a schematic diagram of a method for processing statements to be processed according to an embodiment of this application;

[0023] Figure 5 This is a schematic diagram of a processing method for optional statements provided according to an embodiment of this application;

[0024] Figure 6 This is a schematic diagram of a statement processing apparatus provided according to an embodiment of this application;

[0025] Figure 7 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0026] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties.

[0030] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a statement processing method provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0031] Step S101: Obtain the statement to be processed in the business system, and obtain the basic information and associated data of the statement to be processed. The statement to be processed refers to the statement whose execution time is longer than the preset execution time.

[0032] Specifically, the business system can be a system used by financial institutions, such as the financial management system of financial institutions. Pending statements refer to statements in the business system that have long execution time and low execution efficiency during the execution of business statements. The generation of pending statements can be caused by a variety of reasons. For example, the business system may generate pending statements due to improper design during the functional development phase; as the business system is put into use for a longer period of time, the amount of production data involved will also lead to the generation of pending statements.

[0033] To improve the execution efficiency of financial institutions' business systems and ensure the smooth operation of related businesses, it is necessary to process pending statements in the business systems in a timely manner. Processing operations on pending statements may include splitting data in the related tables and adjusting the basic information of the pending statements. Therefore, before processing a pending statement, it is necessary to first obtain the pending statement and, based on the pending statement, retrieve its relevant basic information and related data. The basic information of the pending statement may include the stored procedure it resides in, real-time performance metrics, and storage location, while the related data may include data from the related tables associated with the pending statement.

[0034] Step S102: Obtain the log file associated with the statement to be processed based on the basic information, and extract log information from the log file.

[0035] Specifically, Figure 2 This is a schematic diagram of a method for obtaining log files according to an embodiment of this application, such as... Figure 2 As shown, after obtaining the statement to be processed and its basic information and related data, in order to determine whether the related data of the statement to be processed needs to be adjusted, candidate log information related to the statement to be processed can be obtained from the log file associated with the business system based on the statement to be processed. After obtaining the candidate log information, it is cleaned and the log information is filtered to obtain the log information associated with the statement to be processed.

[0036] Step S103: Extract input parameter information from basic information, extract association tables from associated data, and obtain association condition information used by the statement to be processed from log information. The input parameter information includes data or variables that need to be provided when executing the statement to be processed.

[0037] Specifically, when the associated data is an associated table, it can be determined whether the associated table of the statement to be processed needs to be processed based on the input parameter information and the associated condition information of the statement to be processed. The input parameter information and the associated condition information of the statement to be processed are obtained from the basic information and log information of the statement to be processed. The associated condition information can be read from the stored procedure name and the location of the stored procedure in the log information, and the input parameter information can be obtained directly from the basic information.

[0038] Step S104: If the key field information of the input parameter information and the association condition information are the same, the association table is split, and the statement to be processed is executed based on the split association table.

[0039] Specifically, the processing method for the statement to be processed can be to split the related table of the statement. Before processing the related table, it is necessary to determine whether the key fields of the input parameters and the related conditions are the same. If the key fields of the input parameters and the related conditions are the same, it means that the statement to be processed can be read and executed normally in the business system. However, due to the low execution efficiency of the statement, the table data of the related table of the statement to be processed can be split to obtain the split related table, and the statement to be processed can be executed based on the related table, thereby improving the execution efficiency of the statement. Conversely, if the key fields of the input parameters and the related conditions are different, it means that the statement to be processed may have structural or configuration problems, and it needs to be sent to the client of the operation and maintenance personnel for manual processing.

[0040] The statement processing method provided in this application embodiment obtains the statement to be processed from the business system, and obtains the basic information and associated data of the statement to be processed. The statement to be processed refers to a statement whose execution time is longer than a preset execution time. Based on the basic information, the method obtains the log file associated with the statement to be processed and extracts log information from the log file. It extracts input parameter information from the basic information, extracts the association table from the associated data, and obtains the association condition information used by the statement to be processed from the log information. The input parameter information includes data or variables required to execute the statement to be processed. If the key field information of the input parameter information and the association condition information are the same, the association table is split, and the statement to be processed is executed based on the split association table. This solves the problem of inadequate processing of statements with long execution times in related technologies. By obtaining the statement to be processed and its basic information and associated data, extracting input parameter information and the association table based on the basic information and associated data, and splitting the association table if the fields in the input parameter information and the fields in the association table meet the requirements, the method achieves timely and effective processing of the statement to be processed.

[0041] The statement to be processed, along with its basic information and associated data, can be obtained in various ways. Optionally, in the statement processing method provided in this application embodiment, obtaining the statement to be processed in the business system and obtaining its basic information and associated data includes: determining whether the business system is online at the current time, where the current time refers to the time when the statement to be processed needs to be obtained; the business system performs an update log operation when it is online; if the business system is not online at the current time, obtaining a load performance report for a preset time period from the operation and maintenance website associated with the business system, obtaining the statement to be processed from the load performance report, and obtaining its basic information and associated data from the database associated with the business system, where the end time of the preset time period is earlier than the current time; if the business system is online at the current time, scanning the executed statements of the business system according to a timed scanning program to obtain the statement to be processed, and obtaining its basic information and associated data from the database associated with the business system.

[0042] To obtain the pending statements in the business system, you can filter from the websites associated with the business system and the executed statements. It should be noted that when the business system is a financial management system, the pending statements obtained are more accurate because the financial management system usually processes financial data outside of working hours. If the financial management system is still in an external access state, that is, in an online state, the complete pending statements cannot be obtained. Therefore, it is necessary to first determine the status of the business system in order to obtain the pending statements.

[0043] Specifically, the status of the financial management system can be determined through a "end-of-day check." This involves setting the end-of-day check condition to midnight, and simultaneously checking whether the financial management system is online at midnight when retrieving pending statements. Figure 3 This is a schematic diagram of a method for obtaining a load performance report according to an embodiment of this application, as shown below. Figure 3 As shown, when the judgment result indicates that the financial management system is not online at the current time, the system logs into the operation and maintenance website associated with the financial management system and enters the query conditions for the load performance report on the website to obtain the load performance report. The load performance report (AWR report) is a performance analysis report in Oracle database, which includes collected and stored performance index data such as database load, database objects, and system configuration, and generates a report to help users analyze and optimize database performance.

[0044] Furthermore, a load performance report can be obtained using the following code:

[0045] System.setProperty(“webdriver.ie.driver”, “path to driver file”);

[0046] web Driver Ie Driver=new Internet Explorer Driver();

[0047] Driver.get("http: / / acs / icbc");

[0048] DOMElement auto click=document.find Element(By.tag Name(“button”));

[0049] Auto click.click();

[0050] Furthermore, after obtaining the load performance report, preprocessing analysis is performed on the report. This involves querying the data representing execution time (i.e., the Elapsed Time per Exec(s) column) and identifying execution statements whose execution time exceeds the preset execution time. After confirming and verifying these statements, basic information and related data are retrieved from the database associated with the financial management system. These execution statements are then treated as pending statements, and the basic information and related data are used as the basic information and related data for the pending statements. In other words, the pending statements are obtained through the following code snippet:

[0051]

[0052]

[0053] If the financial management system is determined to be online via a "end-of-day check" (i.e., the end-of-day check condition is set to midnight), and pending statements are retrieved at midnight, some business operations may need to be performed outside of working hours. In this case, the financial management system may still be accessible at midnight, and the online financial management system will continue to execute related statements, making it impossible to obtain a complete load performance report. Therefore, a scheduled scanning program can be compiled to periodically scan the statements being executed by the financial management system. The pending statements can be retrieved using the following code:

[0054]

[0055] After obtaining the statement to be processed from the above code, the basic information and related data of the statement to be processed are retrieved from the database and used as the basic information and related data of the statement to be processed. This embodiment determines whether the business system is online, and then obtains the statement to be processed and its associated basic information and related data in different ways, thereby laying the foundation for the processing of the statement to be processed.

[0056] The log file for the statement to be processed is selected from the log file of the business system. Optionally, in the statement processing method provided in this application embodiment, obtaining the log file associated with the statement to be processed based on basic information includes: determining whether the business system is online; if the business system is online, stopping the step of obtaining the log file associated with the statement to be processed based on basic information until it is detected that the business system is not online; if the business system is not online, obtaining candidate log files associated with the business system, and obtaining the log file from the candidate log files based on basic information.

[0057] Specifically, before processing the associated table of the statement to be processed using the log information associated with the statement to be processed, it is necessary to obtain the log information. Obtaining the log information requires determining whether the business system is online. If the business system is online, that is, when the business system is providing business services to the outside world normally, subsequent operations need to be stopped until the business system is offline.

[0058] When the business system is offline, the first step is to retrieve the business system's log files, i.e., obtain candidate log files. Since the log files generated during system execution usually contain basic information such as "stored procedure registration" and "input parameter information," information that matches the basic information associated with the statement to be processed is filtered out from these basic information files. This allows us to select the log files related to the statement to be processed. This can also be achieved using the following code:

[0059] import java.io.File Input Stream;

[0060] File Input Stream file = new File Input Stream("log file name");

[0061] response.getOutputStream().write();

[0062] file.read().

[0063] This embodiment obtains the log file of the statement to be processed by judging the status of the business system, and then determines the processing result of the related table of the statement to be processed based on the log file, thus laying the foundation for the processing of the statement to be processed.

[0064] When a statement to be processed cannot be processed by the system, it can be sent to the operation and maintenance personnel. Optionally, in the statement processing method provided in this application embodiment, the method further includes: sending the statement to be processed to the client when the key field information of the input parameter information and the associated condition information are different; and executing the adjusted statement to be processed when the client provides feedback.

[0065] Specifically, after comparing the input parameter information and association condition information extracted from the basic information and log information, the comparison result determines whether the associated table needs to be split. It should be noted that the comparison of input parameter information and association condition information refers to determining whether there is any common key field information between the input parameter information and the association condition information. For example, if the association condition information includes the field information required to use the index, it is necessary to determine whether there is also the same field information in the input parameter information. When the comparison result indicates that the key field information is different, the statement to be processed needs to be sent to the client, and the operation and maintenance personnel will receive the statement and process it manually.

[0066] Furthermore, after the manually processed statement is fed back to the business system, the business system can execute the modified statement at runtime.

[0067] This embodiment determines whether the key fields of the input parameters and the associated conditions are the same, and then provides different processing methods for the statements to be processed based on the determination results, thereby saving processing time and improving processing efficiency.

[0068] Before splitting the associated table, a preliminary migration is required. Optionally, in the statement processing method provided in this application embodiment, splitting the associated table and executing the statement to be processed based on the split associated table includes: determining whether the storage time of the table data in the associated table exceeds the data storage period, wherein the data storage period refers to the earliest time when the table data is saved; if there is target table data in the associated table whose storage time exceeds the data storage period, migrating the target table data to the first newly added table; if there is no target table data in the associated table whose storage time exceeds the data storage period, splitting the associated table to obtain the splitting result; the first newly added table and the splitting result constitute the split associated table.

[0069] Specifically, when splitting the related tables of the statements to be processed, it is first necessary to determine whether the table data stored in the related tables is data outside the data storage period. Since the data stored in the financial management system is characterized by long storage time and large data volume, and the generation of statements to be processed is also partly due to excessive data volume, after determining the storage time of the table data in the related tables, the table data whose storage time exceeds the data storage period is migrated to the newly created first new table, and the table is marked to remind the operation and maintenance personnel to pay attention to the data stored in the table and to process it accordingly when permitted.

[0070] It should be noted that the storage time of table data in the related tables can be determined through the following code:

[0071] SELECT*FROM DBA_IND_COLUMNS T;

[0072] WHERE T.TABLE_NAME = 'table_name';

[0073] ORDER BY T.INDEX_NAME,T.COLUMN_POSITION ASC.

[0074] Furthermore, table data with a storage time less than the data storage period is processed by table partitioning, database partitioning, or partitioning to obtain the splitting result. This embodiment achieves preliminary data processing by judging the storage time of data in the associated tables, which also saves processing time for subsequent data splitting and improves processing efficiency.

[0075] The associated table needs to be split based on the query frequency and the initial query time range. Optionally, in the statement processing method provided in this application embodiment, before obtaining the data to be migrated table data in the associated table within the data storage period and determining whether there is candidate data to be migrated table data in the data to be migrated table data, the method further includes: obtaining the time and number of times the statement to be processed appears from the log information, obtaining the query time and query number, and obtaining the M time field information contained in the input parameter information; calculating the ratio of the query number to the query time to obtain the query frequency, and determining M initial query time ranges based on the M time field information.

[0076] To facilitate subsequent inspections by maintenance personnel, the table data in the related tables needs to be migrated reasonably based on the query time and frequency. The query time and frequency are determined based on data from the log information of the statements to be processed. Specifically, the time of occurrence of the statements to be processed is obtained from the log information, along with the number of times the basic information associated with the statements to be processed appears in the log information, yielding the query time and query count. The query frequency is then calculated based on the query time and query count. Furthermore, a preset query time range is determined based on multiple time fields included in the input parameters, and the table data in the related tables is migrated based on the calculated query time range and query frequency. This embodiment lays the foundation for subsequent splitting of the related tables by utilizing data from the log information to calculate the query frequency and preset query time range.

[0077] There are various ways to split the associated table. Optionally, in the statement processing method provided in this application embodiment, splitting the associated table to obtain the splitting result includes: obtaining the table data to be migrated in the associated table within the data storage period, and determining whether there is candidate table data to be migrated in the table data to be migrated, wherein candidate table data to be migrated refers to table data to be migrated whose data execution time exceeds a preset query time range, the preset query time range refers to the smallest preset query time range among M initial query time ranges, and the data execution time refers to the time for executing the table data of the associated table, where M is a positive integer; if there is candidate table data to be migrated in the table data to be migrated, obtaining the target table data to be migrated from the candidate table data to be migrated with a query frequency lower than a preset frequency, and migrating the target table data to be migrated to the second newly added table; migrating the candidate table data to be migrated to the newly added database, and migrating the newly added database to the newly added partition, wherein the newly added database includes the candidate table data to be migrated in the second newly added table and the target table data to be migrated with a query frequency higher than the preset frequency; the splitting result is composed of the table data in the second newly added table, the newly added database, and the table data in the newly added partition.

[0078] After initial data processing, data with a storage time shorter than the data storage expiration period is split into smaller chunks. Specifically, Figure 4 This is a schematic diagram of a method for processing statements to be processed according to an embodiment of this application, such as... Figure 4 As shown, after obtaining the statement to be processed and the related table of the statement to be processed, the related table is split. First, the time range with the smallest query time range is selected from multiple initial query time ranges and this initial query time range is determined as the preset query time range. The preset query time range is used as the dividing point, and the candidate table data to be migrated in the related table from the preset query time range to the current time is split into tables.

[0079] Specifically, it is determined whether the query frequency of the candidate table data to be migrated is less than the query frequency calculated from the log information, that is, whether the query frequency of the candidate table data to be migrated is less than the preset frequency. If there is a part of the candidate table data to be migrated with a query frequency less than the preset frequency, a second new table with the same structure as the first new table is created, and this part of the table data is migrated to the second new table. The table data migration can be performed by using database technology to create new tables, create indexes, etc.

[0080] Furthermore, a second newly added table containing data from tables with a query frequency lower than a preset frequency is treated as historical data and migrated to another database. Migration logic is generated in the database associated with the business system. This migration logic can include the type of table data to be migrated and the target table for the data migration, thereby further reducing the query pressure on the database. It should be noted that the database migration can be implemented using the following code:

[0081] DBMS_STATS.GATHER_TABLE_STATS('Related parameter configuration');

[0082] Furthermore, since the partitions of the current related tables are divided according to time sequence, the efficiency of data retrieval and the performance of certain functions implemented by querying related tables will decrease when the amount of data in the related tables grows rapidly. To enable maintenance personnel to retrieve relevant data faster and to improve execution efficiency, the related tables can be partitioned. Specifically, by determining the generation time of each related table and dividing it according to "year," "quarter," or "month," for example, when partitioning by "year," the databases for 2022 and 2023 can be divided into partitioned databases to achieve partition management. At this time, the database for 2022 can be migrated to the partition representing 2022. The partitioning method can be range partitioning, hash partitioning, or list partitioning, etc., and can be implemented using the following code:

[0083]

[0084]

[0085] Furthermore, after migrating the table, database, and region data, the migration process generates new execution logic and sets a logic switch in the business system. When the switch is on, the new logic is used; when the switch is off, the old logic is used. The old logic refers to the execution logic before the migration. By executing the pending statements using the migrated related tables, the execution efficiency before and after the migration is judged. If the new logic's execution efficiency is poor or the execution result is inconsistent with the preset result, the execution process is recorded, the switch is turned off, and the execution process is saved and sent to the operations and maintenance personnel for comparison. If the new logic's execution efficiency is good or the execution result is consistent with the preset result, the switch is directly turned on, and the new logic is executed.

[0086] It should be noted that after processing the associated table for each pending statement, the processing flag for that statement is set to "processed," and an email is sent to the client used by the operations and maintenance personnel. This embodiment achieves timely processing of pending statements by splitting the data in the associated table in different ways, and also reduces the workload of operations and maintenance personnel in financial institutions.

[0087] This application also provides an optional method for processing statements. Figure 5 This is a schematic diagram of the processing method of optional statements provided in the embodiments of this application, such as... Figure 5 As shown, the method includes:

[0088] To improve the execution efficiency of business systems, pending statements within the system can be processed. Firstly, when the business system is a financial management system, the pending statements obtained are more accurate because financial management systems typically process financial data outside of working hours. However, if the financial management system is still in an online state (accessible externally), complete pending statements cannot be obtained. Therefore, it is necessary to determine the status of the business system to retrieve the pending statements.

[0089] Specifically, the status of the financial management system can be determined through a "end-of-day check." This involves setting the end-of-day check condition to midnight, and simultaneously checking whether the financial management system is online at midnight when retrieving pending statements. If the check indicates that the financial management system is not online at that time, the system logs into the associated maintenance website and enters the query conditions for a load performance report to retrieve it. The load performance report is then used to obtain the pending statements, their basic information, and related data. Conversely, if the check indicates that the financial management system is online at that time, a scheduled scanning program is set up to periodically scan the statements being executed by the financial management system, thereby obtaining the pending statements, their basic information, and related data.

[0090] Furthermore, it determines whether the business system is online. If the business system is online, it waits for the business system to transition from online to offline. If the business system is offline, it retrieves the candidate log files associated with the business system and obtains the log file from the candidate log files based on the basic information.

[0091] Furthermore, based on the log files, the log information of the statements to be processed is obtained, and the related tables of the statements to be processed are split using the statement processing model. After processing, the information is sent to the operations and maintenance personnel's client to remind them to pay attention in a timely manner.

[0092] This embodiment obtains the statement to be processed and its basic information and related data, extracts input parameter information and related tables based on the basic information and related data, and splits the related tables if the fields in the input parameter information and the fields in the related tables meet the requirements, thereby achieving the effect of timely and effective processing of the statement to be processed.

[0093] 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, and 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.

[0094] This application also provides a statement processing apparatus. It should be noted that the statement processing apparatus of this application can be used to execute the statement processing method provided in this application. The statement processing apparatus provided in this application will be described below.

[0095] Figure 6 This is a schematic diagram of a statement processing apparatus provided according to an embodiment of this application, such as... Figure 6As shown, the device includes: a first acquisition unit 60, a second acquisition unit 61, an extraction unit 62, and a processing unit 63.

[0096] The first acquisition unit 60 is used to acquire statements to be processed in the business system, and to acquire the basic information of the statements to be processed and the associated data of the statements to be processed. The statements to be processed refer to statements whose execution time is longer than the preset execution time.

[0097] The second acquisition unit 61 is used to acquire the log file associated with the statement to be processed based on the basic information, and extract log information from the log file.

[0098] Extraction unit 62 is used to extract input parameter information from basic information, extract association tables from associated data, and obtain association condition information used by the statement to be processed from log information. The input parameter information includes data or variables that need to be provided when executing the statement to be processed.

[0099] Processing unit 63 is used to split the association table when the key field information of the input parameter information and the association condition information are the same, and to execute the statement to be processed based on the split association table.

[0100] Optionally, in the statement processing apparatus provided in this application embodiment, the first acquisition unit 60 includes: a first judgment module, used to determine whether the business system is online at the current time, wherein the current time refers to the time when the statement to be processed needs to be acquired, and the business system performs the operation of updating the log when it is online; a first acquisition module, used to acquire a load performance report for a preset time period from the operation and maintenance website associated with the business system when the business system is not online at the current time, acquire the statement to be processed from the load performance report, and acquire basic information and related data from the database associated with the business system, wherein the end time of the preset time period is earlier than the current time; and a scanning module, used to scan the executed statements of the business system according to a timed scanning program when the business system is online at the current time, obtain the statement to be processed, and acquire basic information and related data from the database associated with the business system.

[0101] Optionally, in the statement processing apparatus provided in this application embodiment, the second acquisition unit 61 includes: a second judgment module, used to judge whether the business system is online; a stop module, used to stop executing the step of acquiring the log file associated with the statement to be processed based on basic information when the business system is online, until it is detected that the business system is not online; and a second acquisition module, used to acquire candidate log files associated with the business system when the business system is not online, and acquire log files from the candidate log files based on basic information.

[0102] Optionally, in the statement processing apparatus provided in the embodiments of this application, the apparatus further includes: a sending module, used to send the statement to be processed to the client when the key field information of the input parameter information and the associated condition information are different; and an execution module, used to execute the adjusted statement to be processed when the client provides feedback on the adjusted statement to be processed.

[0103] Optionally, in the statement processing apparatus provided in this application embodiment, the processing unit 63 includes: a third judgment module, used to judge whether the storage time of table data in the associated table exceeds the data storage period, wherein the data storage period refers to the earliest time of saving table data; a first migration module, used to migrate the target table data to a first newly added table when there is target table data in the associated table whose storage time exceeds the data storage period; a processing module, used to split the associated table to obtain a splitting result when there is no target table data in the associated table whose storage time exceeds the data storage period; and a first composition module, used to construct the split associated table from the first newly added table and the splitting result.

[0104] Optionally, in the statement processing apparatus provided in this application embodiment, the processing unit 63 includes: a third acquisition module, used to acquire the data to be migrated table data in the associated table within the data storage period, and determine whether there are candidate data to be migrated in the data to be migrated, wherein the candidate data to be migrated refers to the data to be migrated whose data execution time exceeds a preset query time range, the preset query time range refers to the smallest preset query time range among M initial query time ranges, and the data execution time refers to the time for executing the table data of the associated table, wherein M is a positive integer; a fourth acquisition module, used to acquire the target data to be migrated whose query frequency is lower than a preset frequency in the candidate data to be migrated when there are candidate data to be migrated in the data to be migrated, and migrate the target data to be migrated to the second newly added table; a second migration module, used to migrate the candidate data to be migrated to the new database, and migrate the new database to the new partition, wherein the new database includes the candidate data to be migrated in the second newly added table and the target data to be migrated whose query frequency is higher than the preset frequency; and a second composition module, used to compose the splitting result from the second newly added table, the new database, and the table data in the new partition.

[0105] Optionally, in the statement processing apparatus provided in the embodiments of this application, the apparatus further includes: a third acquisition unit, used to acquire the data to be migrated table in the associated table within the data storage period, and before determining whether there is candidate data to be migrated table in the data to be migrated table, acquire the time and number of times the statement to be processed appears from the log information, obtain the query time and query number, and acquire the M time field information contained in the input parameter information; a calculation unit, used to calculate the ratio of the number of queries to the query time, obtain the query frequency, and determine M initial query time ranges based on the M time field information.

[0106] The statement processing apparatus provided in this application embodiment includes a first acquisition unit 60, which acquires statements to be processed in a business system and acquires basic information and associated data of the statements to be processed, wherein the statements to be processed refer to statements whose execution time is longer than a preset execution time; a second acquisition unit 61, which acquires log files associated with the statements to be processed based on the basic information and extracts log information from the log files; an extraction unit 62, which extracts input parameter information from the basic information, extracts association tables from the associated data, and acquires association condition information used by the statements to be processed from the log information, wherein the input parameter information includes data or variables required to execute the statements to be processed; and a processing unit 63, which splits the association table when the key field information of the input parameter information and the association condition information are the same, and executes the statements to be processed based on the split association table. This solves the problem of inadequate processing of statements with long execution times in related technologies. By acquiring the statements to be processed and their basic information and associated data, extracting input parameter information and association tables based on the basic information and associated data, and splitting the association tables when the fields in the input parameter information and the fields in the association tables meet the requirements, the apparatus achieves the effect of timely and effective processing of the statements to be processed.

[0107] The statement processing device includes a processor and a memory. The first acquisition unit 60, the second acquisition unit 61, the extraction unit 62, the processing unit 63, etc. are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.

[0108] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address issues such as the inadequate processing of long-running statements in related technologies.

[0109] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0110] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a method for processing statements.

[0111] This invention provides a processor for running a program, wherein the program executes a method for processing statements during runtime.

[0112] Figure 7 This is a schematic diagram of an electronic device provided according to an embodiment of this application, such as... Figure 7 As shown, this embodiment of the invention provides an electronic device 70, which includes a processor, a memory, and a program stored in the memory and executable on the processor. The processor is used to execute computer-readable instructions, wherein the computer-readable instructions execute a statement processing method when they are run. The device described herein may be a server, PC, PAD, mobile phone, etc.

[0113] This application also provides a computer program product that, when executed on a data processing device, is adapted to perform a statement processing method.

[0114] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0115] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0116] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0117] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0118] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0119] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0120] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0121] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0122] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0123] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for processing statements, characterized in that, include: Obtain the pending statements in the business system, and obtain the basic information of the pending statements and the associated data of the pending statements, wherein the pending statements refer to statements whose execution time is longer than the preset execution time; Based on the basic information, obtain the log file associated with the statement to be processed, and extract log information from the log file; Extract input parameter information from the basic information, extract association tables from the associated data, and obtain association condition information used by the statement to be processed from the log information, wherein the input parameter information includes data or variables that need to be provided when executing the statement to be processed; If the key field information of the input parameter information is the same as that of the association condition information, the association table is split, and the statement to be processed is executed based on the split association table. In the case that there is no target table data in the association table whose storage time exceeds the data storage period, the association table is split to obtain the split result. The process of splitting the associated table to obtain the splitting result includes: obtaining the table data to be migrated in the associated table within the data storage period, and determining whether there are candidate table data to be migrated among the table data to be migrated, wherein the candidate table data to be migrated refers to the table data to be migrated whose data execution time exceeds a preset query time range, the preset query time range refers to the smallest preset query time range among M initial query time ranges, and the data execution time refers to the time for executing the table data of the associated table, where M is a positive integer; if the candidate table data to be migrated exists among the table data to be migrated, obtaining the target table data to be migrated from the candidate table data whose query frequency is lower than a preset frequency, and migrating the target table data to be migrated to the second newly added table; migrating the candidate table data to the newly added database, and migrating the newly added database to the newly added partition, wherein the newly added database includes the candidate table data to be migrated in the second newly added table and the target table data to be migrated whose query frequency is higher than the preset frequency; the splitting result is composed of the second newly added table, the newly added database, and the table data in the newly added partition.

2. The method according to claim 1, characterized in that, Obtaining the pending statements from the business system, and acquiring the basic information and associated data of the pending statements, includes: Determine whether the business system is online at the current time, wherein the current time refers to the time when the statement to be processed needs to be obtained, and the business system performs the operation of updating the log when it is online; If the business system is not online at the current time, a load performance report for a preset time period is obtained from the operation and maintenance website associated with the business system, the statement to be processed is obtained from the load performance report, and the basic information and the associated data are obtained from the database associated with the business system, wherein the end time of the preset time period is earlier than the current time. When the business system is online at the current time, the execution statements of the business system are scanned according to the timed scanning program to obtain the statement to be processed, and the basic information and the associated data are obtained from the database associated with the business system.

3. The method according to claim 1, characterized in that, The log file associated with the statement to be processed, obtained based on the basic information, includes: Determine whether the business system is online; When the business system is in the online state, the step of obtaining the log file associated with the statement to be processed based on the basic information is stopped until it is detected that the business system is not in the online state; If the business system is not in the online state, obtain the candidate log file associated with the business system, and obtain the log file from the candidate log file according to the basic information.

4. The method according to claim 1, characterized in that, The method further includes: If the key field information of the input parameter information is different from that of the associated condition information, the statement to be processed is sent to the client. Upon receiving the adjusted pending statement from the client, the adjusted pending statement is executed.

5. The method according to claim 1, characterized in that, The process of splitting the associated table and executing the statement to be processed based on the split associated table includes: Determine whether the storage time of the table data in the associated table exceeds the data storage period, wherein the data storage period refers to the earliest time when the table data is stored; If there is target table data in the associated table whose storage time exceeds the data storage period, the target table data will be migrated to the first newly added table; The first newly added table and the splitting result constitute the splitting association table.

6. The method according to claim 1, characterized in that, Before obtaining the data to be migrated from the associated table within the data storage period, and determining whether there are candidate data to be migrated among the data to be migrated, the method further includes: The time and number of times the pending statement appeared are obtained from the log information to obtain the query time and query count, and the M time fields contained in the input parameter information are obtained. Calculate the ratio of the number of queries to the query time to obtain the query frequency, and determine the M initial query time ranges based on the M time field information.

7. A statement processing apparatus, characterized in that, include: The first acquisition unit is used to acquire statements to be processed in the business system, and to acquire the basic information of the statements to be processed and the associated data of the statements to be processed, wherein the statements to be processed refer to statements whose execution time is longer than the preset execution time. The second acquisition unit is used to acquire the log file associated with the statement to be processed based on the basic information, and extract log information from the log file; The extraction unit is used to extract input parameter information from the basic information, extract the association table from the association data, and obtain the association condition information used by the statement to be processed from the log information, wherein the input parameter information includes the data or variables required to execute the statement to be processed; The processing unit is configured to split the association table when the key field information of the input parameter information is the same as that of the association condition information, and execute the statement to be processed based on the split association table. In the case that there is no target table data in the association table whose storage time exceeds the data storage period, the association table is split to obtain the split result. The process of splitting the associated table to obtain the splitting result includes: a third acquisition module, used to acquire the data to be migrated in the associated table within the data storage period, and to determine whether there are candidate data to be migrated in the data to be migrated, wherein the candidate data to be migrated refers to the data to be migrated whose data execution time exceeds a preset query time range, the preset query time range refers to the smallest preset query time range among M initial query time ranges, and the data execution time refers to the time for executing the table data of the associated table, where M is a positive integer; a fourth acquisition module, used to, if there are candidate data to be migrated in the data to be migrated, acquire the target data to be migrated from the candidate data to be migrated whose query frequency is lower than a preset frequency, and migrate the target data to be migrated to a second newly added table; a second migration module, used to migrate the candidate data to be migrated to a new database, and migrate the new database to a new partition, wherein the new database includes the candidate data to be migrated in the second newly added table and the target data to be migrated whose query frequency is higher than the preset frequency; and a second composition module, used to compose the splitting result from the second newly added table, the new database, and the table data in the new partition.

8. A processor, characterized in that, The processor is used to run a program, wherein the program, when running, executes the processing method of the statements according to any one of claims 1 to 6.

9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the statement processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Database management method and device, equipment and storage medium

    CN112783900A