CN116431669A - Mybatis-based data processing method, mybatis-based data processing device, computer equipment and storage medium - Google Patents

Mybatis-based data processing method, mybatis-based data processing device, computer equipment and storage medium Download PDF

Info

Publication number
CN116431669A
CN116431669A CN202310685420.7A CN202310685420A CN116431669A CN 116431669 A CN116431669 A CN 116431669A CN 202310685420 A CN202310685420 A CN 202310685420A CN 116431669 A CN116431669 A CN 116431669A
Authority
CN
China
Prior art keywords
data
mybatis
database
database operation
interceptor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310685420.7A
Other languages
Chinese (zh)
Other versions
CN116431669B (en
Inventor
王开存
沈晓平
孔海明
张锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Jincheng Bank Ltd By Share Ltd
Original Assignee
Tianjin Jincheng Bank Ltd By Share Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Jincheng Bank Ltd By Share Ltd filed Critical Tianjin Jincheng Bank Ltd By Share Ltd
Priority to CN202310685420.7A priority Critical patent/CN116431669B/en
Publication of CN116431669A publication Critical patent/CN116431669A/en
Application granted granted Critical
Publication of CN116431669B publication Critical patent/CN116431669B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of data processing, and discloses a Mybatis-based data processing method, a Mybatis-based data processing device, a Mybatis-based data processing computer device and a Mybatis-based data storage medium, wherein the method comprises the following steps: when analyzing operation is carried out by intercepting database operation data in a database session through an interceptor, judging whether the intercepted database operation data is a target format data packet, and if so, cloning the database operation data to obtain cloning data; carrying out the analysis operation on the clone data to obtain an analysis result; and adding the analysis result into the database operation data, and carrying out corresponding data processing on the database operation data according to the analysis result. The method can be compatible with the Mybatis and other database processing plug-ins, adaptively expands functions according to the characteristics of the Mybatis plug-ins, and solves the defect of Mybatis plus parameter sealing to analyze and subsequently process the intercepted database operation data.

Description

Mybatis-based data processing method, mybatis-based data processing device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a Mybatis-based data processing method, apparatus, computer device, and storage medium.
Background
The flexible Mybatis interceptor can implement interception of any database operation. The condition builder of Mybatis-Plus makes it possible to operate the database purely Java, but because of the deep packaging of the condition builder, it becomes difficult and heavy to append the interceptor of custom logic to the database operation based on the condition builder. Too shallow interception can not realize business logic, too deep interception can destroy a condition constructor, so that Mybatis-Plus works abnormally, even the workflow of business can be influenced, and the normal operation of the whole system is influenced by a tool which is convenient originally.
Disclosure of Invention
In a first aspect, the present application provides a Mybatis-based data processing method, including:
when analyzing operation is carried out by intercepting database operation data in a database session through an interceptor, judging whether the intercepted database operation data is a target format data packet, and if so, cloning the database operation data to obtain cloning data;
carrying out the analysis operation on the clone data to obtain an analysis result;
and adding the analysis result into the database operation data, and carrying out corresponding data processing on the database operation data according to the analysis result.
Further, the method further comprises:
when a custom interceptor is injected into a database session, analyzing execution logic of the custom interceptor, and determining a registration sequence of each custom interceptor according to the execution logic;
when the database operation data in the database session is intercepted, executing the corresponding custom interceptor according to the registration sequence.
Further, the determining, according to the execution logic, a registration order of each custom interceptor includes:
determining whether execution logic of cloning operation is carried out on the target format data packet in each interceptor, and determining interceptors which can carry out precompiled execution logic;
setting the interceptor with the execution logic for cloning the target format data packet at the position of preferential execution, and setting the interceptor with the precompiled execution logic at the position of low preferential execution, thereby obtaining the registration order.
Further, the method further comprises:
if the intercepted database operation data is not the target format data packet, the database operation data is directly analyzed and corresponding business logic operation is carried out by combining with business requirements.
Further, the appending the analysis result to the database operation data includes:
and adding an analysis field in the database operation data, and writing the analysis result into the analysis field to obtain updated database operation data.
Further, the target format data packet is a data packet package of Mybatis plus.
Further, the determining whether the intercepted database operation data is a target format data packet includes:
and acquiring the parameter entering type of the database operation data and the resource type of the mapping statement so as to judge whether the data type intercepted by the interceptor is the data packet in the target format.
In a second aspect, the present application further provides a Mybatis-based data processing apparatus, including:
the judging module is used for judging whether the intercepted database operation data is a target format data packet or not when the database operation data intercepted by the interceptor is subjected to analysis operation, and cloning the database operation data if the intercepted database operation data is the target format data packet, so as to obtain cloning data;
the analysis module is used for carrying out the analysis operation on the clone data to obtain an analysis result;
and the additional module is used for adding the analysis result to the database operation data, and the database operation data carries out corresponding data processing according to the analysis result.
In a third aspect, the present application also provides a computer device comprising a processor and a memory, the memory storing a computer program which, when run on the processor, performs the Mybatis based data processing method.
In a fourth aspect, the present application also provides a readable storage medium storing a computer program which, when run on a processor, performs the Mybatis based data processing method.
The invention discloses a data processing method, a device, computer equipment and a storage medium based on Mybatis, wherein the method comprises the following steps: when analyzing operation is carried out by intercepting database operation data in a database session through an interceptor, judging whether the intercepted database operation data is a target format data packet, and if so, cloning the database operation data to obtain cloning data; carrying out the analysis operation on the clone data to obtain an analysis result; and adding the analysis result into the database operation data, and carrying out corresponding data processing on the database operation data according to the analysis result. According to the technical scheme, the method and the device can be compatible with Mybatis and other database processing plug-ins, adaptively expand functions according to the characteristics of Mybatis plus, analyze and subsequently process intercepted database operation data by avoiding the defects of Mybatis plus, so that data analysis and data modification can be simultaneously carried out when the Mybatis plug-in is used for processing the database, and execution of business logic is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are required for the embodiments will be briefly described, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope of the present invention. Like elements are numbered alike in the various figures.
Fig. 1 shows a flowchart of a data processing method based on Mybatis according to an embodiment of the present application;
FIG. 2 is a schematic diagram of the operation principle of an interceptor according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an interceptor execution sequence determination process according to an embodiment of the present application;
fig. 4 shows a schematic structural diagram of a Mybatis-based data processing apparatus according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments.
The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
The terms "comprises," "comprising," "including," or any other variation thereof, are intended to cover a specific feature, number, step, operation, element, component, or combination of the foregoing, which may be used in various embodiments of the present invention, and are not intended to first exclude the presence of or increase the likelihood of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and should not be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the invention belong. The terms (such as those defined in commonly used dictionaries) will be interpreted as having a meaning that is the same as the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein in connection with the various embodiments of the invention.
The technical scheme of the application is applied to a database processing flow based on Mybatis plugins, and in an actual service scene and a development scene, the plugins are used for replacing writing database sentences in order to simplify the processing of database operation data, but the plugins can cause irreversible damage to data when intercepting data for analysis. Therefore, the method and the device clone the intercepted target format data aiming at the operation in the process of intercepting database operation data by the Mybatis interceptor, and provide a solution capable of customizing the processing sequence of the interceptor, so that the problem caused by the plug-in can be avoided when the Mybatis plug-in is used for processing the database, and meanwhile, the data and the corresponding analysis result can be acquired to execute the subsequent data processing or business operation.
In an actual application scene, the registration sequence of the interceptors is ordered according to the characteristics of the interceptors. When analyzing the database operation and data intercepted by the interceptor, identifying the type of the database operation intercepted by the interceptor, and realizing specific business logic processing on parameters or returned results.
The technical scheme of the application is described in the following specific examples.
Example 1
As shown in fig. 1, the Mybatis-based data processing method of the present embodiment includes:
step S100, when analyzing operation is performed by intercepting database operation data in a database session through an interceptor, judging whether the intercepted database operation data is a data packet in a target format, and if so, cloning the database operation data to obtain cloning data.
The interceptor is a plug-in tool applied between the database and the application system, has various kinds of interceptors and different characteristics, but is a plug-in tool for simplifying database operation of users in general, so that database operation which is originally required to write a database language can be realized through other programming languages, such as using java for database operation, thereby facilitating development of various operations on the database and realization of the operation on the database by a business system. The interceptor is generally injected into the session between the database and the service system and operates in a certain logic sequence, so as to intercept and obtain corresponding data, and perform corresponding data operation according to logic in the service code, thereby realizing the above-mentioned effect of operating the data operation of the database by using other programming languages. For example, the interceptor can intercept database operation data sent to the database by the server, wherein the database operation data comprises database operation sentences and corresponding operation objects, and after intercepting the data, the interceptor can perform corresponding expansion operation according to own algorithm logic.
For example, a certain interceptor is specially used for intercepting a user password and performing encryption processing, and after the interceptor intercepts data, the interceptor finds a field with the password, and then analyzes the password and performs corresponding encryption operation according to the analysis result.
As shown in fig. 2, the principle of interceptor operation is schematically shown when the database operation is performed.
The interceptor is manipulated through the database proxy portal for a subsequent series of database operations divided into a number of sub-steps, such as internal executor configuration, precompiled parameter settings, query processing results, data conversion and database operations as illustrated in the figure. In each step herein, some interceptors may be configured to perform some relevant data operations. For example, the configuration of the internal executor is that the interceptor is configured by the executor, so as to realize the control of the execution sequence of the interceptor, and the database operation is that the database is added, deleted and checked according to the code logic, and the corresponding query data is returned to the back end for further operation, and some steps are performed, in which the interceptor interception data can be added to perform the corresponding business operation on the data. The visible interceptor may be adapted for use in a variety of scenarios and steps.
In the case of a database of operation of a scene against parameters using XML, by annotation, or by MyBatis Plus, but not using Wrapper, the parameters intercepted by the interceptor may be identified in the interceptor, and the parameters entered and exited may be further processed to fulfill specific business requirements.
When the interceptor identifies the database operation mode and the Wrapper data packet with the parameter of Mybat Plus, the interceptor directly clones the intercepted data into one part, so as to obtain one part of cloned data, the parameter analysis is carried out through the cloned data, and after confirming the service operation logic, the body of the data package is changed, so that the irreversible influence of the behavior method in the data package on the data is ensured.
The database operation data refers not only to an operation instruction of the database, but also some database data related to the operation instruction, for example, data to be stored in the database or data to be calculated in the database, that is, in this embodiment, database operation data refers to operation object data of the operation instruction.
It can be understood that in an actual working scenario, the database operation data often needs to be analyzed and even modified, if the database operation data is simply analyzed and is not required to be modified after the analysis result is obtained, whether the database operation data is available is irrelevant, and for the data to be analyzed and modified, interception and analysis are required to be ensured, the database operation data can be used, so that one intercepted data is cloned and copied in the embodiment, two identical data are obtained, one data can be analyzed, and then the other data can be correspondingly modified.
And step S200, carrying out the analysis operation on the clone data to obtain an analysis result.
Because the Mybatis interceptor intercepts the scenario of the Wrapper packet package of Mybatis Plus, the interceptor can analyze the data according to its algorithm, which can cause the data to suffer irreversible influence, thus when the analysis result is obtained, the intercepted data can not be further subjected to secondary operation, thus cloning operation is needed, after the cloning data is obtained, the corresponding analysis operation is performed on the cloning data, thus obtaining the analysis result, and because the analysis operation is actually performed by using the Mybatis Plus method, the cloning data can be destroyed and discarded instead of the original data, and finally the intercepted original data and the analysis result can be left.
Specifically, taking an operation of storing data in a database as an example, when a business system is operated, user data of a certain user needs to be stored in the database, and at this time, specific business logic processing needs to be performed on the data according to requirements in the system, and the data needs to be stored in a corresponding position, for example, operations such as data encryption and the like. Taking encryption as an example, it can be understood that different encryption methods are often used for different data, and when the data is stored in the database, the data needs to be stored according to a certain rule, so that the data needs to be analyzed, the type and the encryption method of the data are determined, and then encryption operation is performed. In this embodiment, the Mybatis interceptor is used to obtain the data to complete the parsing and encryption operations before the data is stored in the database, and the data cannot be used by parsing Mybatis plus, so that by cloning a piece of data, the data is parsed, and the encryption method and storage location of the data are determined. The encryption method, the storage position and the analysis result.
And step S300, adding the analysis result to the database operation data, and carrying out corresponding data processing on the database operation data according to the analysis result.
After the analysis result is obtained, the analysis result is added to the original database operation data as the analysis result is related to the subsequent operation of the database operation data, and the original database operation data is reserved for the subsequent operation as the analysis operation is already operated on the clone data.
Specifically, a new field is created for the native database operation data, and then the parsing result is written into the field.
Because the data exists in the form of a data packet in the transmission process, the data itself has a certain format structure, so in order to make the original database operation data carry the information of the analysis result, a field of the analysis result can be newly added in the data packet so as to bind the analysis result and the database operation data.
It will be appreciated that even if the data intercepted by the interceptor is not a Wrapper packet of myblocks plus, the parsing result will be attached to the data after the data is directly parsed.
In addition, the analysis result and the original database operation data can be spliced together and then repacked into a new data packet at the outer layer, so that when the data packet is processed later, the analysis result and the database operation data can be respectively read through the two solutions Bao Caozuo, and the analysis result is read first because of being at the outer layer, and therefore the analysis result can be used for guiding the direction of the subsequent operation.
For example, in the actual business process, the analysis result read from the database operation data is that encryption is needed by a certain algorithm, and the specific storage position of the data is encrypted first, and then the encrypted ciphertext is directly stored in the database according to the storage position of the analysis result, so that the whole data storage operation is completed.
Wherein, because the above operations are implemented by means of Mybatis plus, the whole process can be implemented entirely using a programming language such as java, while reducing the additional editing database language.
In the actual use scene, a scene of directly analyzing and operating the Wrapper data packet under the Mybatis plus exists, and at the moment, the Wrapper of the Mybatis plus can be directly used for analysis to determine the name of the target field and the parameter to be processed, and then the operation purpose of data interception is realized by adding the field into the Wrapper or modifying the field, so that the operation of using an interceptor is omitted.
It can be understood that during database processing, two operations of data writing and data reading are generally performed, and under these two operations, different modes are used to perform corresponding operations, in this embodiment, a specific scenario is identified during database processing, if a scenario of a Wrapper format packet of Mybatis plus is performed, the above operations are performed, other scenarios use respective corresponding operation modes, under different scenarios, the operation modes of tools are different, and the operation modes other than the current scenario are not important, so that excessive description is not performed, but only the method for processing the Wrapper format packet of Mybatis plus in this embodiment can make the environment compatible with the operation of multiple plug-ins, and can ensure that the use of Mybatis plus while avoiding some other problems caused by the use of Mybatis plus, such as data format incompatibility.
In addition, the execution sequence of the interceptors can also influence the normal operation of the business program and the data processing of the database.
For example, the data stored in the database needs to be decrypted when being extracted, and then some additional operations such as extraction and calculation can be performed, so the decrypting operation must be performed first, but the existence of the interceptor can cause the additional operations of the interceptor to be performed before the decrypting operation, thus affecting the business operation.
As shown in fig. 3, the present embodiment further provides an interceptor execution sequence determining process, including:
step S400, when the custom interceptors are injected into the database session, analyzing the execution logic of the custom interceptors, and determining the registration sequence of each custom interceptor according to the execution logic.
The custom interceptors refer to interceptors written by Mybatis plugins for a developer to implement some extended operations on database operation data, and in this embodiment, the interceptors default to derivative plugins in the Mybatis plugins.
When a developer writes the interceptors, call relations among the interceptors and execution logic are involved, namely, what kind of preconditions the interceptors need to execute, where execution logic needs to execute, and the like, and the execution logic can be obtained through analysis by a parser. By parsing the execution logic, an execution precedence relationship between the interceptors can be determined.
In addition, interception is performed after the database session is injected, and in a practical environment, a plurality of interceptors exist, obviously, interceptors for the same kind of data also exist, and therefore, the execution sequence among the interceptors affects the processing result of the data. For this reason, it is necessary to sort the registration order of interceptors by their characteristics. When analyzing the database operation and data intercepted by the interceptor, identifying the type of the database operation intercepted by the interceptor, and realizing specific business logic processing on parameters or returned results.
The interceptors have a registration order during injection, and the registration order can influence the execution order of the interceptors, so that the registration order of the interceptors can be determined through the precedence relationship of each interceptor in the execution logic obtained by analyzing before the interceptor is injected into the database session.
Next, as can be seen from the above steps S100 to S300, the analysis operation is performed after cloning the data packet according to the Wrapper format data packet of myblocks plus, so that the interceptor having the above cloning operation for the Wrapper format data packet is placed before the interceptor having no such operation, and the interceptor having no corresponding cloning method for the Wrapper format data packet is prevented from being used.
Thus, in principle, interceptors with clone-then-parse of the Wrapper format packets will be placed in a more prioritized order, while those interceptors that do not clone-then-parse of the Wrapper format packets will be placed at a later location, while those that do precompiled will need to be placed at the end.
And step S500, when the database operation data in the database session is intercepted, executing the corresponding custom interceptor according to the registration sequence.
When the database session is executed, two conditions of writing data into the database and reading data from the database are generated, the interceptor triggers an interception algorithm according to the design principle of the interceptor aiming at the data needing to be intercepted, intercepts the data and triggers the interceptor according to the registration sequence designed in the step S400. Thereby avoiding that some interceptors are operating at improper moments, thereby interfering with the task execution of the system.
Therefore, the method can determine whether each interceptor has execution logic for cloning the target format data packet and determine interceptors for precompiled execution logic;
setting the interceptor with the execution logic for cloning the target format data packet at the position of preferential execution, and setting the interceptor with the precompiled execution logic at the position of low preferential execution, thereby obtaining the registration order.
Because some interceptors exist which can perform precompiled operation on database operation data, the precompiled operation can cause similar irreversible influence on the database operation data after being analyzed, and therefore, the interceptors are arranged in the back row, for example, interceptors A, B, C and D exist, the sequence obtained after analysis of execution logic is A priority, B, C and D are arranged in the back of D in an un-ordered manner, wherein C interceptors can precompiled the database operation data, C can be arranged in the back of D, and the sequence obtained finally is ABDC for registration and execution.
Example 2
The present application further provides a Mybatis-based data processing apparatus as shown in fig. 4, including:
the judging module 10 is configured to judge whether the intercepted database operation data is a target format data packet when the database operation data intercepted by the interceptor performs an parsing operation, and if yes, clone the database operation data to obtain clone data;
the analysis module 20 is configured to perform the analysis operation on the clone data to obtain an analysis result;
and the adding module 30 is configured to add the analysis result to the database operation data, where the database operation data performs corresponding data processing according to the analysis result.
The application also provides a computer device comprising a processor and a memory, the memory storing a computer program which, when run on the processor, performs the Mybatis based data processing method.
The present application also provides a readable storage medium storing a computer program which when run on a processor performs the Mybatis based data processing method, the method comprising: when analyzing operation is carried out by intercepting database operation data in a database session through an interceptor, judging whether the intercepted database operation data is a target format data packet, and if so, cloning the database operation data to obtain cloning data; carrying out the analysis operation on the clone data to obtain an analysis result; and adding the analysis result into the database operation data, and carrying out corresponding data processing on the database operation data according to the analysis result.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, of the flow diagrams and block diagrams in the figures, which illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules or units in various embodiments of the invention may be integrated together to form a single part, or the modules may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a smart phone, a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention.

Claims (10)

1. A Mybatis-based data processing method, characterized in that the method is applied to a data interception process of an interceptor, and comprises the following steps:
when analyzing operation is carried out by intercepting database operation data in a database session through an interceptor, judging whether the intercepted database operation data is a target format data packet, and if so, cloning the database operation data to obtain cloning data;
carrying out the analysis operation on the clone data to obtain an analysis result;
and adding the analysis result into the database operation data, and carrying out corresponding data processing on the database operation data according to the analysis result.
2. The Mybatis-based data processing method of claim 1, further comprising:
when a custom interceptor is injected into a database session, analyzing execution logic of the custom interceptor, and determining a registration sequence of each custom interceptor according to the execution logic;
when the database operation data in the database session is intercepted, executing the corresponding custom interceptor according to the registration sequence.
3. The Mybatis-based data processing method of claim 2, wherein determining the registration order of each custom interceptor based on the execution logic comprises:
determining whether execution logic for cloning the target format data packet exists in each interceptor or not, and determining interceptors for performing precompiled execution logic;
setting the interceptor with the execution logic for cloning the target format data packet at the position of preferential execution, and setting the interceptor with the precompiled execution logic at the position of low preferential execution, thereby obtaining the registration order.
4. The Mybatis-based data processing method of claim 1, further comprising:
if the intercepted database operation data is not the target format data packet, the database operation data is directly analyzed and corresponding business logic operation is carried out by combining with business requirements.
5. The Mybatis-based data processing method of claim 1, wherein appending the parsing result to the database operation data comprises:
and adding an analysis field in the database operation data, and writing the analysis result into the analysis field to obtain updated database operation data.
6. The Mybatis-based data processing method as set forth in claim 1, wherein the target format data packet is a parameter data packet package of Mybatis plus.
7. The Mybatis-based data processing method of claim 1, wherein the determining whether the intercepted database operation data is a target format data packet comprises:
and acquiring the parameter entering type of the database operation data and the resource type of the mapping statement so as to judge whether the data type intercepted by the interceptor is the data packet in the target format.
8. A Mybatis-based data processing apparatus, comprising:
the judging module is used for judging whether the intercepted database operation data is a target format data packet or not when the database operation data intercepted by the interceptor is subjected to analysis operation, and cloning the database operation data if the intercepted database operation data is the target format data packet, so as to obtain cloning data;
the analysis module is used for carrying out the analysis operation on the clone data to obtain an analysis result;
and the additional module is used for adding the analysis result to the database operation data, and the database operation data carries out corresponding data processing according to the analysis result.
9. A computer device comprising a processor and a memory, the memory storing a computer program which, when run on the processor, performs the Mybatis based data processing method of any of claims 1 to 7.
10. A readable storage medium, characterized in that it stores a computer program which, when run on a processor, performs the Mybatis based data processing method of any one of claims 1 to 7.
CN202310685420.7A 2023-06-12 2023-06-12 Mybatis-based data processing method, mybatis-based data processing device, computer equipment and storage medium Active CN116431669B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310685420.7A CN116431669B (en) 2023-06-12 2023-06-12 Mybatis-based data processing method, mybatis-based data processing device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310685420.7A CN116431669B (en) 2023-06-12 2023-06-12 Mybatis-based data processing method, mybatis-based data processing device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116431669A true CN116431669A (en) 2023-07-14
CN116431669B CN116431669B (en) 2023-08-15

Family

ID=87080031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310685420.7A Active CN116431669B (en) 2023-06-12 2023-06-12 Mybatis-based data processing method, mybatis-based data processing device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116431669B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844387A (en) * 2017-10-17 2018-03-27 广东广业开元科技有限公司 A kind of conventional data backup method, system and device
CN111651296A (en) * 2020-04-30 2020-09-11 中国平安财产保险股份有限公司 Interception backup method, device, equipment and storage medium for data deletion operation
CN114153856A (en) * 2021-11-24 2022-03-08 中国工商银行股份有限公司 Host data double-writing method and device
US20220164344A1 (en) * 2020-11-24 2022-05-26 Boe Technology Group Co., Ltd. Data processing method, data processing device and non-volatile computer-readable storage media
CN115640316A (en) * 2022-09-27 2023-01-24 平安科技(深圳)有限公司 Paging method, interceptor, plug-in and server for data query

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844387A (en) * 2017-10-17 2018-03-27 广东广业开元科技有限公司 A kind of conventional data backup method, system and device
CN111651296A (en) * 2020-04-30 2020-09-11 中国平安财产保险股份有限公司 Interception backup method, device, equipment and storage medium for data deletion operation
US20220164344A1 (en) * 2020-11-24 2022-05-26 Boe Technology Group Co., Ltd. Data processing method, data processing device and non-volatile computer-readable storage media
CN114153856A (en) * 2021-11-24 2022-03-08 中国工商银行股份有限公司 Host data double-writing method and device
CN115640316A (en) * 2022-09-27 2023-01-24 平安科技(深圳)有限公司 Paging method, interceptor, plug-in and server for data query

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张旭刚 等, 《微型电脑应用》, vol. 37, no. 2, pages 84 - 86 *

Also Published As

Publication number Publication date
CN116431669B (en) 2023-08-15

Similar Documents

Publication Publication Date Title
CN108614702B (en) Byte code optimization method and device
US20050183068A1 (en) Correlating trace events
US8464236B2 (en) Data consistency in data processing systems
US20230036357A1 (en) Method and apparatus for authority control, computer device and storage medium
KR101861341B1 (en) Deobfuscation apparatus of application code and method of deobfuscating application code using the same
CN109800005B (en) Client hot update method and device
US20130066954A1 (en) Computer software analysis system, client computer, method of controlling operation of same and operation program therefor
CN112565026B (en) Test frame generation method, device and equipment
US20240143739A1 (en) Intelligent obfuscation of mobile applications
US10725748B2 (en) Extracting program features for assisting software development
CN109492181A (en) Method for page jump, device, computer equipment and storage medium
WO2021164462A1 (en) Data encryption method, data decryption method, computer device, and medium
Cope Strong security starts with software development
CN110472425A (en) Unity plug-in unit encryption method based on Mono, storage medium
CN116431669B (en) Mybatis-based data processing method, mybatis-based data processing device, computer equipment and storage medium
WO2021243555A1 (en) Quick application test method and apparatus, device, and storage medium
WO2017076244A1 (en) Method, device and related system for dynamically repairing application
US20090138848A1 (en) Computer readable recording medium on which program converting process program is recorded, program converting method, and program converting apparatus
US9032372B2 (en) Runtime environment and method for non-invasive monitoring of software applications
CN112732644B (en) Resource index processing method for application program, computer device and storage medium
KR20190051301A (en) Fuzzing system, execution flow information extracting apparatus and method for fuzzing
US20230325476A1 (en) Obfuscation device, obfuscation method, and obfuscation program
CN109947407B (en) Data acquisition method and device
CN113821193A (en) Information generation method and device and storage medium
CN108063680B (en) Resource allocation control method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant