A data processing method, device, storage medium and computer program product based on interceptor
Dynamically compress and decompress large field data in the database through a custom interceptor, which solves the problem of disk and IO pressure caused by large fields in the database, extends the log storage time, meets more business needs, and has good flexibility and Scalability.
Patent Information
- Application Number
- CN202410802616.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-06-20
AI Technical Summary
In the existing technology, too many large fields in the database put pressure on the disk and input and output, and the database log storage time is short and cannot meet business needs.
Obtain method calling information through custom interceptors, extract the complete class name, method name and parameter field of the called method, match the rule object and generate a decompressor instance, perform compression or decompression operations according to the interception point type, reduce IO pressure and prolong Log saving time.
Dynamic compression and decompression operations do not require technical development, reduce process and database IO pressure, increase disk storage, meet more business needs, and are compatible with historical data, with good flexibility and strong scalability.
Smart Images

Figure CN118394279B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to an interceptor-based data processing method, device, storage medium and computer program product. Background Art
[0002] In the prior art, in order to prevent insufficient database memory and too many large fields from causing pressure on the disk and input and output, a scheduled cleanup script is usually executed to regularly clean up some binary logs, but this cannot change the total storage capacity of the database, and when a certain business requires continuous long-term data, this obviously cannot meet the business needs well. Summary of the invention
[0003] The present application provides an interceptor-based data processing method, which aims to solve the problem in the prior art that too many large fields in the database cause pressure on the disk and input and output, and the problem that the database log is kept for a short time and cannot meet more business needs.
[0004] To achieve the above objectives, this application adopts the following technical solutions:
[0005] The present invention provides a data processing method based on an interceptor, comprising the following steps:
[0006] Obtain method call information of the target interception point through a custom interceptor, and extract the full class name, method name and parameter field of the called method from the method call information to initialize the rule context object, in which the rule processor chain and rule configuration class are encapsulated, and obtain all rule objects in the rule configuration class;
[0007] Match the complete class name, method name and parameter fields of the called method with each rule object, and obtain the target rule object if the match is successful;
[0008] Passing the rule configuration object and the target rule object as input parameters into the rule processor chain to determine the target rule processor, and generating a target decompressor instance based on the target rule processor;
[0009] The operation performed by the target decompressor instance on the intercepted data is determined according to the type of the target interception point, and the operation is compression or decompression.
[0010] Preferably, the method further comprises:
[0011] Create a custom interceptor with a custom interception interface, and describe the interception target of the custom interceptor in the annotation of the custom interceptor;
[0012] Rewrite the interception method of the custom interceptor, and specify the type of interception point and its corresponding interception data processing method in the interception method, wherein the type includes a first type for intercepting parameter processing and a second type for intercepting result set processing.
[0013] Preferably, the method for processing intercepted data includes:
[0014] A compression operation is performed on the data intercepted at the first type of interception point, and a decompression operation is performed on the data intercepted at the second type of interception point.
[0015] Preferably, the initialization rule context object, in which the rule context object encapsulates a rule processor chain and a rule configuration class, includes:
[0016] Create a rule processor interface and instantiate it, and assemble the instantiated rule processors into a processing chain in order to obtain a rule processor chain;
[0017] Initialize the rule configuration class and create a rule context object;
[0018] The starting node of the rule processor chain and the rule configuration object are passed as parameters to the construction method of the rule context object and started.
[0019] Preferably, the complete class name, method name and parameter fields of the called method are matched with each rule object, and a target rule object is obtained if the match is successful, including:
[0020] The complete class name, method name and parameter field of the called method are compared with the corresponding attributes in each rule object respectively. When the complete class name, method name and parameter field of the called method completely match the corresponding attributes in any rule object, the rule object is used as the target rule object.
[0021] Preferably, the step of passing the rule configuration object and the target rule object as input parameters into the rule processor chain to determine a target rule processor, and generating a target decompressor instance based on the target rule processor comprises:
[0022] Parsing the target rule object to obtain a target rule processor, and loading the implementation class corresponding to the target rule processor from the rule configuration class to obtain its full class name;
[0023] Based on the complete class name of the target processor, the decompression factory class is called to generate an instance encapsulating the compression method and the decompression method, thereby obtaining a target decompressor instance.
[0024] Preferably, the operation performed by the target decompressor instance on the intercepted data is determined according to the type of the target interception point, and the operation is compression or decompression, including:
[0025] When the target interception point is of the first type, the target decompressor instance is called to perform compression on the interception data, and the compressed interception data is put into json, and its compression state is set to true;
[0026] When the target interception point is of the second type, the intercepted data is parsed by json. If parsing is impossible, the target decompressor instance is not called to perform decompression operation on the intercepted data. Otherwise, it is determined whether its compression status is true. If so, the target decompressor instance is called to perform decompression operation on the intercepted data. Otherwise, the intercepted data is not decompressed.
[0027] A computer device comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any one of the methods described above.
[0028] A computer-readable storage medium stores a computer program or instruction thereon, wherein the computer program or instruction, when executed by a processor, implements the steps of any one of the methods described above.
[0029] A computer program product comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the steps of any one of the methods described above are implemented.
[0030] The present invention has the following beneficial effects:
[0031] This application dynamically compresses and decompresses fields through configuration files, which not only does not require technical personnel to invest in development, but also reduces the IO pressure between the process and the database, and increases disk storage, so that the log is kept for a longer time, meets more business needs, and is compatible with historical data. During use, the configuration of decompression and compression of the fields can also be adjusted dynamically, which has good flexibility.
[0032] At the same time, this application can also be used in the project through Maven dependency or direct introduction of jar, which reduces the difficulty of users getting started, and can also be used in other places, such as important data encryption and other functions, with better scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 is a flow chart of a data processing method based on an interceptor in the present application;
[0035] Figure 2 The present application implements a computer device schematic diagram of an interceptor-based data processing method. DETAILED DESCRIPTION
[0036] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0037] The terms "first", "second", etc. in the claims and specification of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable under appropriate circumstances. This is merely a way of distinguishing objects with the same properties in the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, so that a process, method, system, product or apparatus that includes a series of units is not necessarily limited to those units, but may include other units not expressly listed or inherent to these processes, methods, products or apparatus.
[0038] In one embodiment, Figure 1 As shown, a data processing method based on an interceptor is provided, comprising the following steps:
[0039] S110, obtaining method call information of the target interception point through a custom interceptor, and extracting the complete class name, method name and parameter fields of the called method from the method call information;
[0040] S120, initializing a rule context object, wherein the rule context object encapsulates a rule processor chain and a rule configuration class, and obtaining all rule objects in the rule configuration class;
[0041] S130, matching the complete class name, method name and parameter fields of the called method with each rule object, and obtaining a target rule object if the match is successful;
[0042] S140, passing the rule configuration object and the target rule object as input parameters into the rule processor chain to determine a target rule processor, and generating a target decompressor instance based on the target rule processor;
[0043] S150. Determine the operation to be performed by the target decompressor instance on the intercepted data according to the type of the target interception point, where the operation is compression or decompression.
[0044] In this embodiment, a custom interceptor is pre-generated. The custom interceptor is implemented based on the MyBatis framework and is mainly used to intercept the DAO layer. MyBatis is an excellent persistence layer framework that supports customized SQL, stored procedures, and advanced mapping. In Java enterprise-level applications, especially when MyBatis is used as an ORM (object-relational mapping) framework, the DAO (Data Access Object) layer is a very important component, which is mainly responsible for interacting with the database and encapsulating all operations related to data access, so that the business logic layer (Service layer) can focus on processing business logic without having to worry about how data is stored and accessed.
[0045] Specifically, a custom interceptor with a custom interception interface is created, and the interception target of the custom interceptor is described in the annotation of the custom interceptor;
[0046] Rewrite the interception method of the custom interceptor, and specify the type of interception point and its corresponding interception data processing method in the interception method, wherein the type includes a first type for intercepting parameter processing and a second type for intercepting result set processing.
[0047] First, implement the custom interception interface org.apache.ibatis.plugin.Interceptor. This interface is provided by MyBatis and is used to insert custom logic at key points in the core processing flow. The purpose of implementing this interface is to compress data before executing DML statements such as insert and update operations, and decompress the data retrieved from the relational database after executing the query operation select, so as to ensure that the data returned by the DAO method before and after execution is correct. Among them, DML statements are part of the database SQL statements and are used to operate data in the database.
[0048] There are three methods in org.apache.ibatis.plugin.Interceptor, namely intercept, plugin and setProperties. Among them, intercept is the core method of MyBatis interceptor. When MyBatis executes the intercepted method, this method will be called; plugin is used to wrap the target object to make it a proxy object; setProperties is used to set the properties of the interceptor. You can configure properties for the interceptor in the MyBatis configuration file and obtain and use these properties in this method. The intercept method is mainly implemented in this embodiment. In this method, the parameter Invocation class is also passed in. This class is used to obtain the interception point. In MyBatis There are four interception points in total, namely StatementHandler, Executor, ParameterHandler and ResultSetHandler, among which StatementHandler is used to intercept the execution of SQL statements, such as prepare method; Executor is used to intercept the entire execution process, such as update, query and other methods; ParameterHandler is used to intercept parameter processing process, and ResultSetHandler is used to intercept result set processing process. In this embodiment, the interception points that need to be obtained are ParameterHandler and ResultSetHandler, namely the first type and the second type, and the data intercepted at ParameterHandler is compressed, and the data intercepted at ResultSetHandler is decompressed. At the same time, the org.apache.ibatis.plugin.Intercepts interface is used to enumerate these two interception points. The complete class name, method name and input parameters of the DAO method can be obtained from ParameterHandler through the reflection mechanism, and the complete class name, method name and return value of the DAO method can be obtained from ResultSetHandler. Here, the DAO method is the called method, and the input parameters and return values appear in the form of fields, that is, they are all parameter fields.
[0049] In this embodiment, in order to reduce the pressure on the disk and input and output IO caused by large fields stored in the MySQL database, the pressure on the disk mainly comes from the stored data files and binary binlogs, and the pressure on the input and output IO is mainly reflected in the size of the packet during data transmission. First, the MyBatis interceptor is used to obtain the method call information of the target interception point to obtain the interception data, and then the interception data is judged whether to be compressed or decompressed according to the type of interception point triggered by the MyBatis interceptor. This can not only reduce the IO pressure between the process and the database, but also increase the disk storage capacity, so that the log is kept longer to meet more business needs.
[0050] In one embodiment, the above interceptor-based data processing method further includes:
[0051] Create a rule processor interface and instantiate it, and assemble the instantiated rule processors into a processing chain in order to obtain a rule processor chain;
[0052] Initialize the rule configuration class and create a rule context object;
[0053] The starting node of the rule processor chain and the rule configuration object are passed as parameters to the construction method of the rule context object and started.
[0054] The purpose of this embodiment is to initialize a rule context object, and the object will do two things during the initialization process. The first thing is to load all rule processors into memory and form them into a processing chain in a defined order. The second thing is to load the rule configuration class. The rule configuration class is an abstract class used to define the source of rules, and then load the rules through the rule configuration class.
[0055] Specifically, when the Java process starts, a rule context object RegulationContext needs to be initialized and its constructor needs to be called. The RegulationContext constructor needs to pass in the RuleHander chain, i.e. the rule processor chain, and the RuleConfig class, i.e. the rule configuration class. The constructor also generates a pointer to the RuleHander chain and the init method in RuleConfig. The init method is used to initialize the object when creating a new instance of a class. When an instance of a class is created, this method will be automatically called.
[0056] Among them, RuleHander is an interface, which defines three methods: order, next and doRuler. The first method, order, returns a numeric type, which is used for sorting in the rule processor chain. The second method, next, is used to point to the next rule object. The third method, doRuler, needs to pass in a Rule class and a RuleConfig class, and returns an UnzipperHander. Here, multiple class instances that implement the RuleHander interface will be created to obtain multiple rule processors. All rule processors are linked in a certain order to obtain a RuleHander chain.
[0057] RuleConfig is an abstract class that implements the loading of rule configurations, as well as matching and generating corresponding rule objects. When RuleConfig is passed to RegulationContext, the init method is called, and the init method in turn calls the loadConfig method. loadConfig is an abstract method used to load configurations. There are many ways to load configurations, such as loading xml files, json files, or database tables. Different sources require different RuleConfig definitions. In this embodiment, JsonRuleConfig is used by default for loading, that is, the json file is used as the rule file, and the properties of the RuleConfig object include Rule Config.ruleName, RuleConfig.daoName, RuleConfig.mothedNames[i], RuleConfig.mothedNames[i].parameters[j], and RuleConfig.mothedNames[i].returnSet[j], etc., where ruleName represents the name of the rule processor, daoName represents the name of the DAO, mothedNames represents the name of the method in the DAO, mothedNames[i].parameters[j] represents the name of the field to be compressed in the DAO, and mothedNames[i].returnSet[j] represents the name of the field to be decompressed in the DAO. When the loadConfig method is called, the json file will be loaded into the memory and encapsulated into multiple Rule objects, and one Rule object corresponds to one ruleName.
[0058] Here, the RegulationContext object is instantiated, and then the getRuleConfig method in RegulationContext is called to obtain all RuleConfig objects. The properties of each RuleConfig object are compared with the full class name, method name, and parameter fields of the DAO method, that is, RuleConfig.daoName is compared with the full class name of the dao interface, RuleConfig.mothedNames[i] is compared with its method name, RuleConfig.mothedNames[i].parameters[j] is compared with its input parameter field, or RuleConfig.mothedNames[i].returnSet[j] is compared with its return value parameter. If all match, the target Rule object is returned.
[0059] In one embodiment, a rule configuration object and a target rule object are passed as input parameters into a rule processor chain to determine a target rule processor, and a target decompressor instance is generated based on the target rule processor, including:
[0060] Parsing the target rule object to obtain a target rule processor, and loading the implementation class corresponding to the target rule processor from the rule configuration class to obtain its full class name;
[0061] Based on the complete class name of the target processor, the decompression factory class is called to generate an instance encapsulating the compression method and the decompression method, thereby obtaining a target decompressor instance.
[0062] Specifically, the target Rule object and RuleConfig object are passed as parameters to the doRuler method of RuleHander. When the doRuler method is called, the Rule object is first parsed to obtain the corresponding target ruleName value, and then the corresponding implementation class is loaded from RuleConfig to obtain the full class name of ruleName. This implementation class is also defined in the json configuration file and is configured as follows: [
[0064] / / SnappyUnzipperHander is the value of ruleName, com.xxx.xxx.SnappyUnzipperHander is the implementation class of the UnzipperHander interface, which is used to complete the specific work of decompression
[0065] "SnappyUnzipperHander": "com.xxx.xxx.SnappyUnzipperHander",
[0066] "GzipUnzipperHander": "com.xxx.xxx.GzipUnzipperHander"
[0067] ].
[0068] After obtaining the full class name of UnzipperHander, use the decompression factory class to generate its instance, that is, first use Class.forName() to load the class object of UnzipperHander. If it cannot be loaded, an exception is thrown. After loading, the class object is instantiated using the reflection mechanism, and the result is returned to the caller of doRuler, so that the target decompressor instance can be obtained. In this embodiment, the decompressor can both compress and decompress data, because the UnzipperHander interface encapsulates two data processing methods doHander and unHander, among which doHander is responsible for the compression logic and unHander is responsible for the decompression logic.
[0069] In one of the embodiments, the operation performed by the target decompressor instance on the intercepted data is determined according to the type of the target interception point, and the operation is compression or decompression, including:
[0070] When the target interception point is of the first type, the target decompressor instance is called to perform compression on the interception data, and the compressed interception data is put into json, and its compression state is set to true;
[0071] When the target interception point is of the second type, the intercepted data is parsed by json. If parsing is impossible, the target decompressor instance is not called to perform decompression operation on the intercepted data. Otherwise, it is determined whether its compression status is true. If so, the target decompressor instance is called to perform decompression operation on the intercepted data. Otherwise, the intercepted data is not decompressed.
[0072] When the MyBatis interceptor triggers the ParameterHandler, it will call UnzipperHander.doHander to compress the intercepted data and return the compressed data. The compressed data will be put into json and the compression status handlerStatus will be set to true. The json format is as follows:
[0073] {
[0074] / / handlerStatus indicates the compression status, data is the compressed data
[0075] "handlerStatus":"true",
[0076] "data":"xxxxx"
[0077] }.
[0078] When the MyBatis interceptor triggers the ResultSetHandler, it will first try to parse the intercepted data into json. If the parsing fails, the intercepted data will not be decompressed. If it can be decompressed, the status of handlerStatus will be judged. If the status is true, the intercepted data will be decompressed. If the status is false, the intercepted data will not be decompressed.
[0079] Among them, try to decompress json serialization first when decompressing, in order to be compatible with historical data. Because when using this method, it cannot be guaranteed that all data in the database is stored after compression, so you need to serialize json first, and then judge handlerStatus. If it cannot be serialized, it means that the data is not compressed, so there is no need to decompress it. If it can be serialized, it is also necessary to judge whether handlerStatus is true. If it is not true, it is possible that the data itself is also a json and does not need to be decompressed.
[0080] This embodiment dynamically compresses and decompresses fields through configuration files, does not require technical personnel to invest in development, is compatible with historical data, and can dynamically adjust the decompression and compression configuration of fields during use.
[0081] At the same time, this embodiment can be used in the project through Maven dependency or direct introduction of jar, which reduces the difficulty of users getting started, and can also be used in other places, such as important data encryption and other functions.
[0082] In one embodiment, Figure 2 As shown, a computer device is provided, including a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the above-mentioned interceptor-based data processing method.
[0083] The computer device can be a server or a terminal. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-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 input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method based on an interceptor is implemented.
[0084] This embodiment also provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the above-mentioned interceptor-based data processing method are implemented.
[0085] This embodiment also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of the above-mentioned interceptor-based data processing method.
[0086] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0087] The computer program instructions for performing the operation of the present invention may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
[0088] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0089] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0090] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data processing method based on an interceptor, characterized in that: The following steps are involved: Obtain method call information of the target interception point through a custom interceptor, and extract the full class name, method name and parameter fields of the called method from the method call information; Initialize a rule context object, which encapsulates a rule processor chain and a rule configuration class, and obtain all rule objects in the rule configuration class; Match the complete class name, method name and parameter fields of the called method with each rule object, and obtain the target rule object if the match is successful; Passing the rule configuration object and the target rule object as input parameters into the rule processor chain to determine the target rule processor, and generating a target decompressor instance based on the target rule processor; Determining, according to the type of the target interception point, an operation performed by the target decompressor instance on the intercepted data, the operation being compression or decompression; The method further comprises: Create a custom interceptor with a custom interception interface, and describe the interception target of the custom interceptor in the annotation of the custom interceptor; Rewrite the interception method of the custom interceptor, and specify the type of the interception point and the processing method of the corresponding interception data in the interception method, wherein the type includes a first type for intercepting parameter processing and a second type for intercepting result set processing; The step of determining the operation performed by the target decompressor instance on the intercepted data according to the type of the target interception point, wherein the operation is compression or decompression, comprises: When the target interception point is of the first type, the target decompressor instance is called to perform compression on the interception data, and the compressed interception data is put into json, and its compression state is set to true; When the target interception point is of the second type, the intercepted data is parsed by json. If parsing is impossible, the target decompressor instance is not called to perform decompression operation on the intercepted data. Otherwise, it is determined whether its compression status is true. If so, the target decompressor instance is called to perform decompression operation on the intercepted data. Otherwise, the intercepted data is not decompressed.
2. According to the data processing method based on interceptor 1, it is characterized in that: The method for processing intercepted data includes: A compression operation is performed on the data intercepted at the first type of interception point, and a decompression operation is performed on the data intercepted at the second type of interception point.
3. The data processing method based on interceptor according to claim 1 is characterized in that: The initialization rule context object, in which the rule context object encapsulates the rule processor chain and the rule configuration class, includes: Create a rule processor interface and instantiate it, and assemble the instantiated rule processors into a processing chain in order to obtain a rule processor chain; Initialize the rule configuration class and create a rule context object; The starting node of the rule processor chain and the rule configuration object are passed as parameters to the construction method of the rule context object and started.
4. The data processing method based on interceptor according to claim 1 is characterized in that: The complete class name, method name and parameter fields of the called method are matched with each rule object. If the match is successful, the target rule object is obtained, including: The complete class name, method name and parameter field of the called method are compared with the corresponding attributes in each rule object respectively. When the complete class name, method name and parameter field of the called method completely match the corresponding attributes in any rule object, the rule object is used as the target rule object.
5. The data processing method based on interceptor according to claim 1 is characterized in that: The step of passing the rule configuration object and the target rule object as input parameters into the rule processor chain to determine a target rule processor, and generating a target decompressor instance based on the target rule processor includes: Parsing the target rule object to obtain a target rule processor, and loading the implementation class corresponding to the target rule processor from the rule configuration class to obtain its full class name; Based on the complete class name of the target processor, the decompression factory class is called to generate an instance encapsulating the compression method and the decompression method, thereby obtaining a target decompressor instance.
6. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
