Business data processing method and device, storage medium and computer equipment
By intercepting and parsing SQL statements and combining configuration information and code segments to process data table fields, it solves the architectural intrusiveness and maintenance complexity problems of traditional business data processing methods, and achieves efficient and secure data processing, which is suitable for financial technology and medical health and elderly care business systems.
Patent Information
- Application Number
- CN202510918770.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-10-17
AI Technical Summary
Traditional business data processing methods have problems such as highly invasive architecture, high maintenance complexity, and high costs. Especially in financial technology and medical health and elderly care business systems, data processing security is low and difficult to adapt to changes.
By intercepting the SQL statements of the target business, parsing the data table and processing fields, and using the configuration information and code segments in the preset container for data processing, custom data table field processing is implemented, reducing code intrusion and improving performance.
Fine-grained control at the metadata level is achieved with minimal intrusion, which simplifies data processing logic, reduces development and maintenance costs, and improves the flexibility and security of data processing.
Smart Images

Figure CN120804137A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and can be applied to the fields of financial technology and medical health and old-age care, and particularly relates to a business data processing method and device, a storage medium and a computer device. BACKGROUND
[0002] Under the background of digital transformation, field automatic processing in the data governance system has become a key link to ensure information security and system specification. The traditional method usually realizes functions such as sensitive data encryption, desensitization and timestamp filling by embedding an annotation processor, an interceptor and the like in an entity class or a DAO layer. However, such a strong coupling design based on the code level has the following defects: the architecture is highly invasive. It is necessary to customize an adapter for each data type, and changes in the ORM framework often trigger a chain of reconstruction. If a new field does not follow the established pattern, it is easy to cause a security protection gap. Moreover, the operation and maintenance are complex and costly. A financial technology business platform supports functions such as shopping, socializing, interactive gaming and resource transfer, and has functions such as applying for a loan, a credit card or purchasing insurance and financial products. The business platform can be an insurance system, a bank system, a transaction system, an order system and the like. In a medical health and old-age care business system, business data processing can support functions such as disease auxiliary diagnosis, health management and remote consultation, and the platform for business data processing can be a medical platform. SUMMARY
[0003] Therefore, the present application provides a business data processing method and device, a storage medium and a computer device, which mainly aims to solve the problems of low security, complex maintenance and high cost in current business data processing.
[0004] To solve the above problems, the present application provides a business data processing method, which comprises the following steps:
[0005] In response to the start of a target business, configuration information corresponding to the target business is extracted, the configuration information comprising a data processing mode and a to-be-data-processed table field corresponding to the data processing mode;
[0006] An SQL statement for processing business data in a target database during the running of the target business is intercepted;
[0007] The SQL statement is parsed to obtain a target data table currently being processed and a target data processing field corresponding to the target data table;
[0008] When the target data table and the target data processing field are included in the to-be-data-processed table field, the target data processing field in the target data table is processed by using the data processing mode corresponding to the to-be-data-processed table field.
[0009] Optionally, the method further comprises:
[0010] listening to the configuration information in the running process of the target service;
[0011] when the configuration information is changed, generating a configuration change notification and sending the configuration change notification to a server;
[0012] receiving the changed configuration information sent by the server;
[0013] updating the configuration information based on the changed configuration information.
[0014] Optionally, the method of claim 1 further comprises:
[0015] when the target data table and / or the target data processing field are not included in the to-be-data-processed table field, executing the SQL statement.
[0016] Optionally, when the target data table and the target data processing field are included in the to-be-data-processed table field, the target data processing field in the target data table is processed by the data processing method corresponding to the to-be-data-processed table field, specifically comprising:
[0017] when the target data table and the target data processing field are included in the to-be-data-processed table field, the configuration information is queried based on the target data table and the target data processing field to obtain a target data processing method;
[0018] querying each code segment in a preset container based on the target data processing method to obtain a target code segment corresponding to the target data processing method;
[0019] processing the target data processing field based on the target code segment to obtain a business data processing result.
[0020] Optionally, the method of querying each code segment in a preset container based on the target data processing method to obtain a target code segment corresponding to the target data processing method specifically comprises:
[0021] determining a processing rule name corresponding to the target data processing method based on the target data processing method and a predetermined naming convention mode;
[0022] querying each code segment in a preset container based on the processing rule name to obtain the target code segment.
[0023] Optionally, the target data processing field is processed based on the target code segment to obtain a business data processing result, and the processing specifically includes:
[0024] The target code segment is run to process the original data of the target data processing field obtained through parsing to obtain update data;
[0025] The SQL statement is updated based on the update data to obtain a current SQL statement;
[0026] The current SQL statement is executed to obtain a business data processing result.
[0027] Optionally, the SQL statement is updated based on the update data to obtain a current SQL statement, and the updating specifically includes:
[0028] When the target data processing mode is a replacement processing mode, the original data of the target data processing field in the SQL statement is processed based on the update data to obtain a current SQL statement;
[0029] When the target data processing mode is a completion processing mode, the new field in the SQL statement is processed based on the update data to obtain a current SQL statement.
[0030] To solve the above problems, the application provides a business data processing device, which includes:
[0031] An extraction module is configured to extract configuration information corresponding to a target business in response to a start of the target business, the configuration information including a data processing mode and a table field to be processed corresponding to the data processing mode;
[0032] An interception module is configured to intercept a SQL statement for processing business data in a target database during running of the target business;
[0033] An analysis module is configured to analyze the SQL statement to obtain a target data table to be processed and a target data processing field corresponding to the target data table;
[0034] A processing module is configured to process the target data processing field in the target data table using the data processing mode corresponding to the table field to be processed when the table field to be processed includes the target data table and the target data processing field.
[0035] To solve the above problems, the application provides a storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the business data processing method.
[0036] To solve the above problems, the present application provides a computer device, at least comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above business data processing method when executing the computer program on the memory.
[0037] The beneficial effects in the present application, the present application configures the configuration information of the target service uniformly, and configures the code segment corresponding to different data processing modes, so as to realize custom data table field processing at the lowest cost, establish data table configuration pertinently, improve performance, reduce code development work, reduce the invasiveness of code script, reduce additional work of database, and also facilitate control and adjustment. The overall implementation logic is simple, easy to understand and use, and also convenient for subsequent maintenance. The method of the present application combines declarative configuration and runtime intervention, realizes fine-grained control at the metadata level under the premise of ensuring minimum invasion.
[0038] The above description is only a summary of the technical scheme of the present application, in order to more clearly understand the technical means of the present application, and to be implemented according to the content of the specification, and in order to make the above and other purposes, characteristics and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS
[0039] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of illustrating the preferred embodiments and are not considered as limiting the present application. Moreover, the same reference symbols are used throughout the drawings to represent the same parts. In the drawings:
[0040] Figure 1 An application environment schematic diagram of a business data processing method provided by an embodiment of the present application is shown;
[0041] Figure 2 A flowchart of a business data processing method provided by an embodiment of the present application is shown;
[0042] Figure 3 A flowchart of a business data processing method provided by another embodiment of the present application is shown;
[0043] Figure 4 A structure block diagram of a business data processing device provided by another embodiment of the present application is shown;
[0044] Figure 5 A structure schematic diagram of a computer device in an embodiment of the present application is shown;
[0045] Figure 6 Another structure schematic diagram of a computer device in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0046] Various aspects and features of the present application are described herein below with reference to the accompanying drawings.
[0047] It is to be understood that various modifications can be made to the embodiments described herein. Thus, the description is not to be considered as limiting, but merely as a description of exemplary embodiments. Other modifications of the application will occur to those skilled in the art upon reading the present application.
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and, together with the general description of the application given above, and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0049] These and other characteristics of the present application will become apparent upon consideration of the following detailed description taken in conjunction with the accompanying drawings.
[0050] It should also be understood that, although the present application has been described above with reference to particular embodiments, many other equivalents and modifications can be made to the application by those skilled in the art.
[0051] The above and other aspects, features, and advantages of the present application will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings, when considered in conjunction with the following detailed description.
[0052] Specific embodiments of the present application are described herein below with reference to the accompanying drawings; however, it is to be understood that the application is not limited to the specific embodiments described, but encompasses numerous alternatives and modifications. Those skilled in the art will readily recognize a variety of ways to implement the application, and the application is not limited to the specific embodiments described. The specific structural and functional details disclosed herein are merely representative for purposes of describing and disclosing the present application, and are not intended to limit the scope of the application.
[0053] The specification can use phrases like "in one embodiment", "in another embodiment", "in yet another embodiment", or "in other embodiments", which can refer to one or more of the same or different embodiments.
[0054] The operation configuration information assisted auditing method provided by the embodiments of the present application can be applied to the network management system as shown in Figure 1In an application environment of the client and the server, the client communicates with the server through a network. In response to starting and running of a target service server, configuration information corresponding to the target service is extracted, the configuration information including a data processing mode and a to-be-data-processed table field corresponding to the data processing mode; a SQL statement for processing business data in a target database during running of the target service is intercepted; the SQL statement is parsed to obtain a target data table currently processed and a target data processing field corresponding to the target data table; when the target data table and the target data processing field are included in the to-be-data-processed table field, the target data processing field in the target data table is processed by using the data processing mode corresponding to the to-be-data-processed table field, and a business processing result is fed back to the client. The application configures configuration information uniformly, and configures a corresponding code segment for each data processing mode, so as to realize custom data table field processing at a minimum cost, to establish a data table configuration in a targeted manner, to improve performance, to reduce development work of code, to reduce invasiveness of a code script, to reduce additional work of a database, and to facilitate control and adjustment. The overall implementation logic is simple, easy to understand and use, and convenient for subsequent maintenance. The method realizes fine-grained control at a metadata level in a manner of combining declarative configuration and runtime intervention, and realizes the fine-grained control under the premise of minimum invasion.
[0055] The embodiment of the application provides a business data processing method, as shown in the following Figure 2 The embodiment of the application provides a business data processing method, as shown in the following
[0056] Step S101: In response to starting and running of a target service, configuration information corresponding to the target service is extracted, the configuration information including a data processing mode and a to-be-data-processed table field corresponding to the data processing mode.
[0057] In the specific implementation process, the configuration information can be a data processing mode for processing different fields in different data tables and a to-be-data-processed table field corresponding to the data processing mode, which is defined in advance; the data processing mode includes an encryption processing mode, a replacement processing mode, and a completion processing mode; and the to-be-data-processed table field includes a data table name to be processed and a field name to be processed. In the field of financial technology business, the configuration information can be extracted from a business service platform, the data processing mode includes an encryption processing mode, and the security of business data is ensured. The business service platform can be an insurance system, a bank system, a transaction system, an order system, or the like. In a medical and health care business system, business data can be medical data such as personal health records, prescriptions, and examination reports.
[0058] Step S102: A SQL statement for processing business data in a target database during running of the target service is intercepted.
[0059] In the implementation process, the MyBatis plug-in can be used to intercept and process all newly added and updated SQL statements. Specifically, the Interceptor interface of MyBatis is called to intercept all first statements and all second statements. The first statement is an INSERT statement, which is an insertion statement in SQL and is used to add new records to a database table. The second statement is an UPDATE statement, which is an update statement in SQL and is used to modify existing records in a database. Unified processing is performed before and after execution, such as parameter modification.
[0060] Step S103: The SQL statement is parsed to obtain the target data table being processed and the target data processing field corresponding to the target data table.
[0061] In the implementation process, the SQL statement can be parsed by a SQL parsing tool to obtain the target data table being processed and the target data processing field corresponding to the target data table. The SQL parsing tool can be JSqlParser, ANTLR, Alibaba Druid, etc.
[0062] Step S104: When the target data table and the target data processing field are included in the data processing table field, the target data processing field in the target data table is processed by the data processing method corresponding to the data processing table field.
[0063] In the implementation process, when the target data table and the target data processing field are included in the data processing table field, the configuration information is queried based on the target data table and the target data processing field to obtain the target data processing method. The target code segment corresponding to the target data processing method is obtained by querying each code segment in the preset container based on the target data processing method. The target data processing field is processed based on the target code segment to obtain the business data processing result.
[0064] The application configures the configuration information uniformly and configures the corresponding code segment for each data processing method to achieve custom data table field processing at the lowest cost, establishes a data table configuration, improves performance, reduces code development work, reduces the invasiveness of code scripts, reduces additional work of the database, and is convenient for control and adjustment. The overall implementation logic is simple, easy to understand and use, and convenient for subsequent maintenance. The method combines declarative configuration and runtime intervention to achieve fine-grained control at the metadata level with minimal intrusion.
[0065] Another embodiment of the present application provides another service data processing method, as shown in the following table, comprising: Figure 3
[0066] Step S201: in response to the start of the target service, extracting configuration information corresponding to the target service, the configuration information including data processing mode and the data processing table field corresponding to the data processing mode;
[0067] In the implementation process, the configuration information can be a data processing mode for different fields in different data tables and the data processing table field corresponding to the data processing mode, which is predefined. The data processing mode includes encryption processing mode, replacement processing mode, and completion processing mode, etc. The data processing table field includes the data table name to be processed and the field name to be processed. For example, the encryption processing involves the mobile phone number PHONE field in two tables TB_A and TB_B, and the configuration information is encrypt = TB_A::PHONE, TB_B::PHONE. The data processing mode is encryption processing mode encrypt. The configuration information in the target service running process on the server is also monitored in real time. When the configuration information changes, the extracted configuration information is updated in real time. Specifically, the configuration information in the target service running process is monitored. When the configuration information changes, a configuration change notification is generated and sent to the server. The server sends the changed configuration information. The configuration information is updated based on the changed configuration information.
[0068] Step S202: intercepting the SQL statement for processing the service data in the target database in the target service running process;
[0069] In the implementation process, MyBatis plug-in can be used to intercept and process all new and updated SQL statements. Specifically, the Interceptor interface of MyBatis is called to intercept all first statements and all second statements. The first statement is an INSERT statement, which is an insert statement in SQL, used to add new records to the database table. The second statement is an UPDATE statement, which is an update statement in SQL, used to modify existing records in the database. Before and after execution, unified processing such as parameter modification is performed.
[0070] Step S203: parsing the SQL statement to obtain the target data table currently processed and the target data processing field corresponding to the target data table;
[0071] In the implementation process, the JSqlParser can be used to parse the SQL statement to obtain the target data table to be processed and the target data processing field corresponding to the target data table, and the original data to be processed of the target data processing field can be parsed.
[0072] Step S204: When the target data table and / or the target data processing field are not included in the data table field to be processed, the SQL statement is executed, and the business processing procedure is ended.
[0073] In the implementation process, when the target data table and / or the target data processing field are not included in the data table field to be processed, the newly added or updated SQL statement currently intercepted does not need to be processed, and the newly added or updated statement is executed to complete the current business processing.
[0074] Step S205: When the target data table and the target data processing field are included in the data table field to be processed, the configuration information is queried based on the target data table and the target data processing field to obtain the target data processing mode.
[0075] In the implementation process, when the target data table and the target data processing field are included in the data table field to be processed, the configuration information is queried based on the target data table and the target data processing field to obtain the target data processing mode. For example, the configuration information is that the encryption processing involves the mobile phone number PHONE field in two tables TB_A and TB_B, and the configuration information is encrypt=TB_A::PHONE,TB_B::PHONE. When the target data table TB_A and the target data processing field PHONE are included in the data table field to be processed, the configuration information is queried based on the target data table and the target data processing field to obtain the target data processing mode, which is the encryption processing mode encrypt.
[0076] Step S206: Each code segment in the preset container is queried based on the target data processing mode to obtain the target code segment corresponding to the target data processing mode.
[0077] In the implementation process, the processing rule name corresponding to the target data processing mode is determined based on the target data processing mode and the predetermined naming convention mode; and each code segment in the preset container is queried based on the processing rule name to obtain the target code segment. For example, the target data processing mode is encrypt, and the predetermined naming convention mode is a specific suffix FieldHandler, so the processing rule name is encryptFieldHandler; then the bean object corresponding to the processing rule name is obtained by using the spring bean management, that is, the target code segment.
[0078] Step S207: Running the target code segment to perform data processing on the original data of the target data processing field obtained by parsing to obtain update data;
[0079] In the implementation process, the target code segment is run to perform data processing on the original value of the target data processing field obtained by parsing to obtain update data NEW_VALUE; and the original data of the target data processing field is processed by using the update data NEW_VALUE.
[0080] Step S208: Updating the SQL statement based on the update data to obtain a current SQL statement;
[0081] In the implementation process, when the target data processing mode is a replacement processing mode, the original data of the target data processing field in the SQL statement is processed by data replacement based on the update data; and the original data of the target data processing field is replaced by using the update data NEW_VALUE. When the target data processing mode is a completion processing mode, the newly added field in the SQL statement is processed by data completion based on the update data. The newly added field in the SQL statement script is filled with the update data NEW_VALUE.
[0082] Step S209: Executing the current SQL statement to obtain a business data processing result.
[0083] In the implementation process, the modified SQL script is executed and a result set is returned to complete the current business processing.
[0084] The application configures configuration information of a target service uniformly, and configures code segments corresponding to different data processing modes, so as to realize custom data table field processing at the lowest cost, establish a data table configuration pertinently, improve performance, reduce code development work, reduce the invasiveness of code scripts, reduce additional work of a database, and facilitate control and adjustment. The overall implementation logic is simple, easy to understand and use, and convenient for subsequent maintenance. The method of the application realizes fine-grained control at a metadata level in a way of combining declarative configuration and runtime intervention, and realizes the fine-grained control at the metadata level under the premise of minimum invasion.
[0085] Another embodiment of the application provides a service data processing device, as shown in the accompanying drawings, comprising: Figure 4
[0086] An extraction module 1 is configured to extract configuration information corresponding to a target service in response to starting and running of the target service, wherein the configuration information comprises a data processing mode and a to-be-data-processed table field corresponding to the data processing mode.
[0087] An interception module 2 is configured to intercept an SQL statement for processing service data in a target database during running of the target service.
[0088] An analysis module 3 is configured to analyze the SQL statement to obtain a target data table currently processed and a target data processing field corresponding to the target data table.
[0089] A processing module 4 is configured to, when the target data table and the target data processing field are included in the to-be-data-processed table field, process the target data processing field in the target data table by using the data processing mode corresponding to the to-be-data-processed table field.
[0090] In the specific implementation process, the device further comprises an update module, which is specifically configured to listen to the configuration information during running of the target service, generate a configuration change notification when the configuration information is changed, send the configuration change notification to a server, receive changed configuration information sent by the server, and update the configuration information based on the changed configuration information.
[0091] In the specific implementation process, the device further comprises an execution module, which is specifically configured to, when the target data table and / or the target data processing field are not included in the to-be-data-processed table field, execute the SQL statement.
[0092] In the implementation process, the processing module 4 is specifically configured to: when the target data table and the target data processing field are included in the to-be-data-processed table field, query the configuration information based on the target data table and the target data processing field to obtain a target data processing manner; query each code segment in a preset container based on the target data processing manner to obtain a target code segment corresponding to the target data processing manner; and perform data processing on the target data processing field based on the target code segment to obtain a business data processing result.
[0093] In the implementation process, the processing module 4 is further configured to: determine a processing rule name corresponding to the target data processing manner based on the target data processing manner and a predetermined naming convention mode; and query each code segment in the preset container based on the processing rule name to obtain the target code segment.
[0094] In the implementation process, the processing module 4 is further configured to: run the target code segment to perform data processing on the original data of the target data processing field parsed to obtain updated data; update the SQL statement based on the updated data to obtain a current SQL statement; and execute the current SQL statement to obtain a business data processing result.
[0095] In the implementation process, the processing module 4 is further configured to: when the target data processing manner is a replacement processing manner, perform data replacement processing on the original data of the target data processing field in the SQL statement based on the updated data; and when the target data processing manner is a completion processing manner, perform data completion processing on the added field in the SQL statement based on the updated data.
[0096] The application configures the configuration information of a target business uniformly, configures code segments corresponding to different data processing manners, realizes custom data table field processing at the lowest cost, establishes a data table configuration in a targeted manner, improves performance, reduces code development work, reduces the invasiveness of code scripts, reduces additional work of a database, and is convenient for control and adjustment. The overall implementation logic is simple, easy to understand and use, and convenient for subsequent maintenance. The method of the application combines declarative configuration and runtime intervention to realize fine-grained control at the metadata level under the premise of ensuring minimal invasion.
[0097] Another embodiment of the application provides a storage medium storing a computer program, the computer program being executed by a processor to implement the following method steps:
[0098] Step one, in response to the start of the target service, extracting configuration information corresponding to the target service, the configuration information including a data processing mode and a to-be-data-processed table field corresponding to the data processing mode;
[0099] Step two, intercepting an SQL statement for data processing of service data in a target database in a running process of the target service;
[0100] Step three, parsing the SQL statement to obtain a target data table currently processed and a target data processing field corresponding to the target data table;
[0101] Step four, when the target data table and the target data processing field are included in the to-be-data-processed table field, performing service data processing on the target data processing field in the target data table by using the data processing mode corresponding to the to-be-data-processed table field.
[0102] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0103] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
[0104] The specific implementation process of the above method steps can refer to the embodiments of any of the above business data processing methods, which will not be repeated here.
[0105] The present application configures the configuration information of the target service uniformly, and configures the code segments corresponding to different data processing modes, to realize custom data table field processing at the lowest cost, establish data table configuration pertinently, improve performance, reduce code development work, reduce the invasiveness of code scripts, reduce additional work of the database, and also facilitate control and adjustment. The overall implementation logic is simple, easy to understand and use, and also facilitates subsequent maintenance. The method of the present application combines declarative configuration with runtime intervention to achieve fine-grained control at the metadata level with minimal intrusion.
[0106] Another embodiment of the present application provides a computer device, which can be a server, comprising a processor, a memory, a network interface and a database connected by a system bus, as shown in the structural schematic diagram Figure 5 . The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with external clients through network connection. The computer device program is executed by the processor to implement the functions or steps of the service side of the business data processing method.
[0107] In one embodiment, a computer device is provided, which can be a client, as shown in the structural schematic diagram Figure 6 . The computer device comprises a processor, a memory, a network interface, a display screen and an input device connected by a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with external servers through network connection. The computer device program is executed by the processor to implement the functions or steps of the client side of the business data processing method.
[0108] Another embodiment of the present application provides a computer device comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the following method steps when executing the computer program on the memory:
[0109] Step one, in response to the start of the target service, extracting configuration information corresponding to the target service, the configuration information including data processing mode and a to-be-data-processed table field corresponding to the data processing mode;
[0110] Step two, intercepting an SQL statement for data processing of service data in a target database in a running process of the target service;
[0111] Step three, parsing the SQL statement to obtain a target data table currently processed and a target data processing field corresponding to the target data table;
[0112] Step four, when the target data table and the target data processing field are included in the to-be-data-processed table field, using the data processing mode corresponding to the to-be-data-processed table field to process the target data processing field in the target data table.
[0113] The specific implementation process of the above method steps can be referred to the embodiments of any of the business data processing methods described above, and will not be repeated here.
[0114] The present application configures the configuration information of the target service uniformly, and configures code segments corresponding to different data processing modes, so as to realize custom data table field processing at the lowest cost, establish data table configuration pertinently, improve performance, reduce code development work, reduce the invasiveness of code scripts, reduce additional work of the database, and also facilitate control and adjustment. The overall implementation logic is simple, easy to understand and use, and convenient for subsequent maintenance. The method of the present application combines declarative configuration and runtime intervention to realize fine-grained control at the metadata level under the premise of ensuring minimal invasion.
[0115] The above embodiments are only exemplary embodiments of the present application and are not used to limit the present application, and the protection scope of the present application is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements to the present application within the spirit and protection scope of the present application, and such modifications or equivalent replacements should also be considered to fall within the protection scope of the present application.
Claims
1. A business data processing method, characterized in that: include: In response to the start-up of the target service, extracting configuration information corresponding to the target service, the configuration information including a data processing mode and fields in a table of data to be processed corresponding to the data processing mode; Intercepting SQL statements that process business data in a target database during the operation of the target business; Parsing the SQL statement to obtain the target data table currently being processed and the target data processing fields corresponding to the target data table; When the field of the table to be processed includes the target data table and the target data processing field, business data processing is performed on the target data processing field in the target data table using the data processing method corresponding to the field of the table to be processed.
2. The method according to claim 1, wherein The method further comprises: Monitoring the configuration information during the operation of the target service; When the configuration information changes, a configuration change notification is generated and sent to the server; Receiving configuration change information sent by the server; The configuration information is updated based on the changed configuration information.
3. The method according to claim 1, wherein The method according to claim 1, further comprising: When the field of the table to be processed does not include the target data table and / or the target data processing field, the SQL statement is executed.
4. The method according to claim 1, wherein When the field in the table to be processed includes the target data table and the target data processing field, performing business data processing on the target data processing field in the target data table using the data processing method corresponding to the field in the table to be processed specifically includes: When the field of the table to be processed includes the target data table and the target data processing field, querying the configuration information based on the target data table and the target data processing field to obtain the target data processing method; Based on the target data processing method, query each code segment in the preset container to obtain a target code segment corresponding to the target data processing method; Data processing is performed on the target data processing field based on the target code segment to obtain a business data processing result.
5. The method according to claim 4, wherein The step of querying each code segment in the preset container based on the target data processing method to obtain a target code segment corresponding to the target data processing method specifically includes: Determining a processing rule name corresponding to the target data processing method based on the target data processing method and a predetermined naming convention pattern; The target code segment is obtained by querying each code segment in a preset container based on the processing rule name.
6. The method according to claim 4, wherein The performing data processing on the target data processing field based on the target code segment to obtain a business data processing result specifically includes: Running the target code segment to process the original data of the target data processing field obtained by parsing to obtain updated data; Update the SQL statement based on the update data to obtain a current SQL statement; Execute the current SQL statement to obtain the business data processing result.
7. The method according to claim 6, wherein The updating of the SQL statement based on the update data to obtain the current SQL statement specifically includes: When the target data processing mode is a replacement processing mode, performing data replacement processing on the original data of the target data processing field in the SQL statement based on the update data; When the target data processing mode is a completion processing mode, data completion processing is performed on the newly added fields in the SQL statement based on the updated data.
8. A business data processing device, characterized in that: include: an extraction module, configured to extract configuration information corresponding to the target service in response to the start-up of the target service, the configuration information including a data processing mode and fields in a table of data to be processed corresponding to the data processing mode; An interception module is used to intercept SQL statements that process business data in a target database during the operation of the target business; A parsing module, configured to parse the SQL statement to obtain a target data table currently being processed and a target data processing field corresponding to the target data table; The processing module is used to perform business data processing on the target data processing field in the target data table using the data processing method corresponding to the field in the table to be processed when the field in the table to be processed includes the target data table and the target data processing field.
9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the business data processing method according to any one of claims 1 to 7 are implemented.
10. A computer device, characterized in that: The system comprises at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the business data processing method according to any one of claims 1 to 7 when executing the computer program on the memory.