Data processing method, device, equipment and storage medium based on microservice architecture
Through the data processing method based on microservice architecture, the request events and rule field values of the rule engine are processed in modules, which solves the performance bottleneck and scalability problem of the rule engine under large-scale rule collections, and achieves efficient rule processing and maintenance. , improving the reliability and flexibility of the system.
Patent Information
- Application Number
- CN202311779049.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-12-22
AI Technical Summary
Existing rule engines have performance bottlenecks, insufficient scalability, complex rule management, and lack of high availability and fault tolerance when processing large-scale rule collections with high concurrency.
Using a data processing method based on microservice architecture, it is divided into three engine modules (the first engine module, the second engine module and the third engine module) which are respectively responsible for receiving request events, processing rule field values and generating rule analysis results. The high cohesion and low coupling design facilitates expansion and maintenance, and supports one-way data flow interaction, containerized deployment and real-time online testing.
It improves the scalability, flexibility and reliability of the system, lowers the threshold for rule writing, realizes efficient rule processing and maintenance, supports multiple deployment architectures and cloud-native operations, and improves the performance and maintainability of the system.
Smart Images

Figure CN117971203B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rule engines, and in particular to a data processing method, device, computer equipment and storage medium based on a microservice architecture. Background Art
[0002] A rule engine is a software system that automatically executes predefined rules to process data, trigger events, or perform other operations. There are three main types of existing rule engines, including rule-based engines, decision table-based engines, and event-driven engines. Rule-based engines use rules as the main logic processing method and implement business logic execution by defining rule sets. Such engines include Drools, Jess, etc. Decision table-based engines use decision tables to describe and execute business logic, and manage and execute rules by organizing rules and data in the form of tables. Such engines include Easy Rules, OpenL Tablets, etc. Event-driven engines trigger and execute corresponding business logic by listening to and responding to events, and are highly flexible and real-time. Such engines include Camunda, Activiti, etc.
[0003] However, existing rule engines have at least one of the following problems:
[0004] 1. Performance issues: Some rule engines may have performance bottlenecks when processing large-scale rule sets, and performance needs to be improved through optimization algorithms, parallel computing, etc.
[0005] 2. Scalability issues: Some rule engines may lack good scalability when facing complex business scenarios. They need to support features such as dynamic loading and modular design to flexibly respond to changing needs.
[0006] 3. Rule management issues: The rule engine needs to provide convenient rule management functions, including rule creation, editing, version control, and publishing, so as to facilitate rule maintenance and updates;
[0007] 4. High availability and fault tolerance issues: The rule engine needs to have high availability and fault tolerance when facing high concurrency, large data volumes, etc. to ensure the stability and reliability of the system. Summary of the invention
[0008] Based on this, it is necessary to provide a data processing method, device, computer equipment and storage medium based on a microservice architecture to address the above technical problems.
[0009] A data processing method based on a microservice architecture, comprising:
[0010] Receiving a request event through the first engine module, and determining whether the request event meets the triggering requirement;
[0011] If the request event meets the triggering requirement, the request event is processed by the second engine module to obtain the rule field value associated with the request event;
[0012] Processing the rule field value through a third engine module to generate a rule analysis result;
[0013] The rule analysis result is outputted through the first engine module.
[0014] A data processing device based on a microservice architecture, comprising:
[0015] A first engine module, configured to receive a request event and determine whether the request event meets a trigger requirement;
[0016] A second engine module is used to process the request event and obtain a rule field value associated with the request event when the request event meets the triggering requirement;
[0017] A third engine module is used to process the rule field value and generate a rule analysis result;
[0018] The first engine module is used to output the rule analysis result.
[0019] A computer device comprises a memory, a processor and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-mentioned data processing method based on microservice architecture when executing the computer-readable instructions.
[0020] One or more readable storage media storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the data processing method based on the microservice architecture as described above.
[0021] The above-mentioned data processing method, device, computer equipment and storage medium based on microservice architecture divide three different engine modules based on roles, each engine module can achieve high cohesion and low coupling, which is convenient for expansion and maintenance; it is decoupled from the application system, and there is no need to export data from the application system, nor is there a need to synchronize data to the application system, and the interaction between the two is a one-way data flow; it does not rely on other computing engine frameworks, and has high flexibility and customizability. The rule engine provided by the present invention supports a variety of deployment architectures, not only supports the more popular Spring Cloud package in the prior art field, but also supports traditional JAR package deployment, or runs in a cloud-native manner. The core of its implementation is that all service nodes of the present invention have been containerized, and the service discovery and service registration layers are abstracted, and it does not rely strongly on a certain form; it supports real-time online testing of rules and decision diagrams, and there is no need to actually deploy to see the effect. All rule fields can be given simulated values on the test page to test whether the running results meet expectations. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0023] Figure 1 This is a schematic diagram of an application environment of a data processing method based on a microservice architecture in one embodiment of the present invention;
[0024] Figure 2 It is a flow chart of a data processing method based on a microservice architecture in one embodiment of the present invention;
[0025] Figure 3 is a structural schematic diagram of a data processing device based on a microservice architecture in one embodiment of the present invention;
[0026] Figure 4 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] The data processing method based on the microservice architecture provided in this embodiment can be applied in Figure 1 In an application environment, a client communicates with a server. The client includes but is not limited to various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.
[0029] In one embodiment, if Figure 2 As shown, a data processing method based on a microservice architecture is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the following steps:
[0030] S10, receiving a request event through the first engine module, and determining whether the request event meets the triggering requirement;
[0031] S20: If the request event meets the triggering requirement, the request event is processed by the second engine module to obtain a rule field value associated with the request event;
[0032] S30, processing the rule field value through a third engine module to generate a rule analysis result;
[0033] S40: Output the rule analysis result through the first engine module.
[0034] Understandably, the data processing method based on microservice architecture provided in this embodiment can be a Java language rule engine based on microservice architecture. It allows the rule engine to run in a distributed and scalable manner, and each microservice is responsible for a specific function and can be independently deployed, expanded and maintained, thereby improving the scalability, flexibility and reliability of the system. According to different focus points, the rule engine is divided into three engine modules, namely the first engine module (BE), the second engine module (FE) and the third engine module (CN). Among them, the first engine module is responsible for storing services such as rule output and message notification; the second engine module is responsible for storing metadata, such as rule definition, decision diagram definition, parameter configuration, rule triggering and other services; the third engine module is responsible for rule calculation. It should be noted that the input and output of the first engine module and the third engine module are both the responsibility of the second engine module.
[0035] Each engine module can be deployed independently, and since the third engine module is only responsible for calculations, the complexity of its internal structure is greatly reduced. Its stateless characteristics also support real-time elastic scaling based on the number of requests.
[0036] It should be noted that the rule engine provided in this embodiment can be connected to an application system (such as a business system). The rule engine and the application system use a one-way data flow interaction method to decouple the engine system from the application system. The engine system does not need to export data from the application system, nor does it need to synchronize data to the application system.
[0037] Specifically, the request event is received by the first engine module, and it is determined whether the request event meets the trigger requirements. For example, a member places an order in the mini program or offline; the mini program or POS machine transfers the order to the order system; the order system stores the order and sends an order event (a type of request event) to the first engine module; the first engine module determines whether the order event meets the trigger requirements. Here, the trigger requirements can be configured according to actual needs. For another example, the member service queries the members whose levels have expired on that day at 0:00 every night; constructs a level expiration event, and sends an expiration event (a type of request event) to the first engine module; the first engine module determines whether the expiration event meets the trigger requirements.
[0038] If the request event meets the trigger requirements, the request event is processed by the second engine module. If the request event does not meet the trigger requirements, the request event is not processed. When the second engine module processes the request event, it parses the request event, obtains the corresponding decision diagram, and then constructs each rule block and model block according to the decision diagram, thereby constructing a decision tree, traversing each node, and finding all the required rule parameters. Then the rule field value associated with the rule parameter is called through the data retrieval service. In some examples, the rule field values include: [Order amount], [Cumulative order amount], [Is it the first order], [Is it a new user],...
[0039] After obtaining the rule field value, the rule field value is processed by the third engine module to generate a rule analysis result. The third engine module operates on the rule field value according to the calculation rule to generate a rule analysis result. The rule analysis result can be transmitted to the second engine module; the second engine module stores the analysis result in the first engine module. The first engine module can encapsulate the rule analysis result and generate a rule output event. Different business services consume rule output events to achieve the output of rule analysis results. For example, [Membership Service] receives a rule output event to determine whether it needs to be upgraded or downgraded; [Loyalty Service] receives a rule output event to change the points.
[0040] The rule engine provided in this embodiment divides three different engine modules based on roles. Each engine module can achieve high cohesion and low coupling, which is easy to expand and maintain; it is decoupled from the application system, and there is no need to export data from the application system or synchronize data to the application system. The interaction between the two is a one-way data flow; it does not rely on other computing engine frameworks and has high flexibility and customizability; it supports multiple deployment architectures, not only supporting the more popular Spring Cloud package in the prior art field, but also supporting traditional JAR package deployment, or running in a cloud-native manner. The core of its implementation is that all service nodes of the present invention have been containerized, and the service discovery and service registration layers have been abstracted, without strong dependence on a certain form; it supports real-time online testing of rules and decision diagrams. There is no need to actually deploy to see the effect. Simulated values of all rule fields can be given on the test page to test whether the running results meet expectations.
[0041] Optionally, step S20, that is, processing the request event by the second engine module to obtain a rule field value associated with the request event, includes:
[0042] S201, obtaining a decision diagram corresponding to the request event;
[0043] S202, constructing a data block according to the decision diagram; the data block includes a rule block and a model block;
[0044] S203, parsing the data block to obtain rule parameters; the rule parameters include rule fields and field values;
[0045] S204: Call a data retrieval service to obtain the rule field value associated with the rule parameter through the data retrieval service.
[0046] Understandably, after receiving the request event, the second engine module parses the request event and constructs a decision diagram corresponding to the request event; then constructs the corresponding data block according to the decision diagram; the data block includes a rule block and a model block. The rule block and the model block are the two core components in the decision diagram. The rule block is a component that describes the actions taken according to specific conditions. If the conditions are met, the rule block will perform one or more actions. The rule block is usually composed of a conditional statement and an action statement. The model block is a mathematical formula or algorithm used to describe the relationship between input variables and output variables. It can be a model based on machine learning, statistics or other methods. The model block receives a set of input variables, processes them according to a specific mathematical formula, and outputs the values of one or more output variables.
[0047] Parse the data block and cache the rule parameters; the rule parameters include the key-value pairs formed by the rule fields and field values. When processing large amounts of data, caching the rule fields and field values can improve the performance of the system. Since the rule fields and field values are frequently used in the rule block, caching them in memory can reduce the reading and calculation time.
[0048] When you need to obtain the value of a rule field, you can obtain it by calling the data retrieval service. The data retrieval service is a service used to extract data from a data source. It can connect to a database, API interface, or other data storage system and perform query operations to obtain the required field values.
[0049] This embodiment implements the call of the rule field value. The service provided by the second engine module is stateless, supports elastic expansion, can dynamically adjust the scale and computing resources of the second engine module according to business needs, and has good scalability.
[0050] Optionally, step S204, i.e., calling a data acquisition service to obtain the rule field value associated with the rule parameter through the data acquisition service, includes:
[0051] S2041, generating a field request according to the rule parameters, and sending the field request to a storage system;
[0052] S2042: Parse the field request through the storage system to obtain the rule field value.
[0053] Understandably, a field request is constructed according to the rule parameters, and the field request includes the specified field name, conditions, and other relevant information. The field request is used to indicate which rule field values the storage system needs to provide. The generated field request is sent to the storage system. This can be done through network communication or other appropriate means to ensure that the request can reach the storage system. Once the storage system successfully parses the field request, the corresponding rule field value is searched in the storage system according to the field name and conditions specified in the request. The storage system encapsulates the obtained rule field value and returns it to the second engine module that initiated the field request.
[0054] This embodiment realizes the acquisition of rule field values.
[0055] Optionally, before step S201, that is, before obtaining the decision graph corresponding to the request event, the method further includes:
[0056] S2011, receiving a field definition instruction through a visual interface, so as to configure rule parameters required by the decision diagram through the field definition instruction;
[0057] S2012, receiving an expression definition instruction through the visual interface, so as to generate an expression including the rule parameters through the expression definition instruction;
[0058] S2013, receiving a data block creation instruction through the visual interface, and combining the expression through the data block creation instruction to generate a data block;
[0059] S2014. Receive a decision diagram creation instruction through the visualization interface to construct a decision diagram including the data block through the decision diagram creation instruction.
[0060] Understandably, rule parameters, expressions, data blocks and decision diagrams can be edited through a visual interface. Specifically, all rule parameters required for a decision diagram, such as order amount, order source, order channel, etc., can be configured through field definition instructions. Expressions containing the rule parameters can be generated through expression definition instructions, such as order amount>1000, order source is "Tmall", etc. The expressions are combined through data block creation instructions to generate data blocks. Data blocks can be rule blocks or model blocks. For example, rule blocks can be: condition 1: if the temperature is greater than 30 degrees Celsius; condition 2: if the humidity is greater than 70%; action: turn on the air conditioner. Model blocks can be: input variables: temperature, humidity; output variables: human comfort; model: human comfort model based on temperature and humidity. Decision diagrams containing data blocks are constructed through decision diagram creation instructions. Rule blocks and model blocks are combined together to form a decision diagram. Decision diagrams can describe complex decision processes, in which rule blocks and model blocks are evaluated based on given input variables and determine the best actions or results. The construction of decision diagrams requires defining rule blocks and model blocks based on specific decision processes and problems to be solved. By gradually adding and combining rule blocks and model blocks, a complete decision graph can be constructed to guide the decision-making process.
[0061] This embodiment implements the editing of various elements of the decision diagram through a visual interface, making the creation and maintenance of rules more intuitive and easy to use, lowering the threshold for rule writing, and improving the flexibility and maintainability of the rule engine.
[0062] Optionally, in the visualization interface, the decision diagram is displayed in a tree structure.
[0063] Understandably, the visual interface provided by this embodiment enables users to represent the logical relationship of rules in a tree structure, and define rule conditions and operations through simple fields and expressions. Users can clearly see the logical relationship and dependency between rules. The hierarchical relationship between rules can be understood based on the tree structure, so as to better understand the logical structure of the rules. The actual rules can be represented as a tree structure according to specific business needs and rule logic.
[0064] In this embodiment, the decision diagram is displayed in a tree structure in the visualization interface so that the user can intuitively understand and analyze the relationship between the rules.
[0065] Optionally, step S30, that is, processing the rule field value by a third engine module to generate a rule analysis result, includes:
[0066] S301: asynchronously process the rule field value by calculating the rule to generate a rule analysis result.
[0067] Understandably, for each calculation rule, asynchronous computing technology (such as multithreading, asynchronous tasks, message queues, etc.) is used for calculation. This ensures that the rule calculation does not block the main thread, improving the system's responsiveness and concurrent processing capabilities. In some examples, parallel execution and non-blocking processing of rules are achieved by using asynchronous messaging and event-driven mechanisms. This asynchronous processing capability improves the throughput and responsiveness of the rule engine, enabling it to handle a large number of concurrent rule requests and to be decoupled and integrated with other system components.
[0068] The rule engine will create an independent thread pool for each calculation rule execution, and tasks are independent of each other. In addition, in order to avoid a large amount of thread pool overhead causing waste of resources, the system will monitor all thread pool conditions in real time and release threads after task execution is completed. For abnormal thread pool status, timeout forced release and system alarm will be performed to ensure stable operation of the system.
[0069] The calculation results of each rule are parsed and organized and encapsulated into a unified data structure, such as converting the calculation results into objects or data streams in a specific format, which are the rule analysis results.
[0070] This embodiment uses message queues and asynchronous threads to implement fully asynchronous processing rules, thereby improving the concurrency capability and response performance of the system.
[0071] Optionally, before step S30, that is, before the third engine module processes the rule field value and generates a rule analysis result, the following steps are included:
[0072] S303: Configure the calculation rules of the third engine module through a dynamic loading and unloading rule mechanism.
[0073] Understandably, the third engine module is only responsible for rule calculation, which greatly reduces the complexity of its internal structure. Its stateless nature also supports real-time elastic scaling based on the number of requests. The dynamic loading and unloading rule mechanism is used to dynamically add new rules or remove existing rules at runtime to achieve system flexibility and scalability. For example, you can iteratively configure based on the basic version without affecting the existing decision graph, add or remove new rules for testing, and after completion, you can switch to the new version in real time without downtime.
[0074] In the prior art, most rule engines are operated by importing rule packages. If a rule package is to be updated, a short downtime is required, and the rule package itself needs to be manually maintained by the operator, which greatly increases the operating cost of the system. This embodiment uses a dynamic loading and unloading rule mechanism to enable the rule engine to quickly respond to business changes and demand changes.
[0075] This embodiment supports real-time version updates and hot-swappable rules, so that rule changes can take effect in real time without restarting the system, thereby improving the flexibility and maintainability of the system.
[0076] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0077] In one embodiment, a data processing device based on a microservice architecture is provided, and the data processing device based on a microservice architecture corresponds one-to-one to the data processing method based on a microservice architecture in the above embodiment. Figure 3 As shown, the data processing device based on the microservice architecture includes a first engine module 10, a second engine module 20 and a third engine module 30. Each functional module is described in detail as follows:
[0078] The first engine module 10 is used to receive a request event and determine whether the request event meets the triggering requirement;
[0079] The second engine module 20 is used to process the request event and obtain the rule field value associated with the request event when the request event meets the triggering requirement;
[0080] The third engine module 30 is used to process the rule field value and generate a rule analysis result;
[0081] The first engine module 10 is used to output the rule analysis result.
[0082] Optionally, the second engine module 20 includes:
[0083] A decision diagram acquisition unit, used to acquire a decision diagram corresponding to the request event;
[0084] A data block construction unit is used to construct a data block according to the decision diagram; the data block includes a rule block and a model block;
[0085] A rule parameter acquisition unit, used for parsing the data block to acquire rule parameters; the rule parameters include rule fields and field values;
[0086] The data acquisition unit is used to call the data acquisition service and obtain the rule field value associated with the rule parameter through the data acquisition service.
[0087] Optionally, the data acquisition unit includes:
[0088] A field request unit, configured to generate a field request according to the rule parameters, and send the field request to a storage system;
[0089] The rule field value obtaining unit is used to parse the field request through the storage system to obtain the rule field value.
[0090] Optionally, the second engine module 20 further includes:
[0091] A rule parameter configuration unit, used to receive a field definition instruction through a visual interface, so as to configure the rule parameters required by the decision diagram through the field definition instruction;
[0092] A configuration expression unit is used to receive an expression definition instruction through the visual interface to generate an expression including the rule parameters through the expression definition instruction;
[0093] A data block unit is configured to receive a data block creation instruction through the visual interface, so as to combine the expression through the data block creation instruction to generate a data block;
[0094] A decision diagram unit is configured to receive a decision diagram creation instruction through the visualization interface, so as to construct a decision diagram including the data block through the decision diagram creation instruction.
[0095] Optionally, in the visualization interface, the decision diagram is displayed in a tree structure.
[0096] Optionally, the third engine module 30 includes:
[0097] The asynchronous calculation unit is used to asynchronously process the rule field value through calculation rules to generate rule analysis results.
[0098] Optionally, the third engine module 30 includes:
[0099] A rule loading and unloading unit is used to configure the calculation rules of the third engine module through a dynamic loading and unloading rule mechanism.
[0100] For the specific definition of the data processing device based on the microservice architecture, please refer to the definition of the data processing method based on the microservice architecture above, which will not be repeated here. Each module in the above-mentioned data processing device based on the microservice architecture can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0101] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer-readable instructions and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The database of the computer device is used to store data involved in a data processing method based on a microservice architecture. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a data processing method based on a microservice architecture is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0102] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor executes the computer-readable instructions to implement the following steps:
[0103] Receiving a request event through the first engine module, and determining whether the request event meets the triggering requirement;
[0104] If the request event meets the triggering requirement, the request event is processed by the second engine module to obtain the rule field value associated with the request event;
[0105] Processing the rule field value through a third engine module to generate a rule analysis result;
[0106] The rule analysis result is outputted through the first engine module.
[0107] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. The readable storage media store computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the following steps are implemented:
[0108] Receiving a request event through the first engine module, and determining whether the request event meets the triggering requirement;
[0109] If the request event meets the triggering requirement, the request event is processed by the second engine module to obtain the rule field value associated with the request event;
[0110] Processing the rule field value through a third engine module to generate a rule analysis result;
[0111] The rule analysis result is outputted through the first engine module.
[0112] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), 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.
[0113] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0114] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A data processing method based on microservice architecture, characterized in that: include: Receiving a request event through the first engine module, and determining whether the request event meets the triggering requirement; The first engine module is responsible for storage rule output and message notification services; If the request event meets the triggering requirement, the request event is processed by the second engine module to obtain the rule field value associated with the request event; The second engine module is responsible for storing metadata, including rule definitions, decision graph definitions, parameter configurations, and rule triggering services; Processing the rule field value through a third engine module to generate a rule analysis result; The third engine module is responsible for rule calculation; The rule analysis result is outputted through the first engine module.
2. The data processing method based on microservice architecture according to claim 1, characterized in that: The step of processing the request event by the second engine module and obtaining a rule field value associated with the request event includes: Obtaining a decision graph corresponding to the request event; Constructing a data block according to the decision diagram; the data block includes a rule block and a model block; Parsing the data block to obtain rule parameters; the rule parameters include rule fields and field values; Calling a data retrieval service, and obtaining the rule field value associated with the rule parameter through the data retrieval service.
3. The data processing method based on microservice architecture according to claim 2, characterized in that: The calling of the data acquisition service to obtain the rule field value associated with the rule parameter through the data acquisition service includes: Generate a field request according to the rule parameters, and send the field request to the storage system; The field request is parsed by the storage system to obtain the rule field value.
4. The data processing method based on microservice architecture according to claim 2, characterized in that: Before obtaining the decision graph corresponding to the request event, the method further includes: Receiving a field definition instruction through a visual interface to configure rule parameters required by the decision diagram through the field definition instruction; Receiving an expression definition instruction through the visual interface to generate an expression including the rule parameters through the expression definition instruction; Receiving a data block creation instruction through the visual interface, and combining the expression through the data block creation instruction to generate a data block; A decision diagram creation instruction is received through the visualization interface to construct a decision diagram including the data block through the decision diagram creation instruction.
5. The data processing method based on microservice architecture according to claim 4, characterized in that: In the visualization interface, the decision diagram is displayed in a tree structure.
6. The data processing method based on microservice architecture according to claim 1, characterized in that: The step of processing the rule field value by the third engine module to generate a rule analysis result includes: The rule field value is asynchronously processed by calculating the rule to generate the rule analysis result.
7. The data processing method based on microservice architecture according to claim 1, characterized in that: Before the third engine module processes the rule field value to generate a rule analysis result, the method includes: The calculation rules of the third engine module are configured through a dynamic loading and unloading rule mechanism.
8. A data processing device based on a microservice architecture, characterized in that: include: A first engine module, configured to receive a request event and determine whether the request event meets a trigger requirement; The first engine module is responsible for storage rule output and message notification services; A second engine module is used to process the request event and obtain a rule field value associated with the request event when the request event meets the triggering requirement; The second engine module is responsible for storing metadata, including rule definitions, decision graph definitions, parameter configurations, and rule triggering services; A third engine module is used to process the rule field value and generate a rule analysis result; The third engine module is responsible for rule calculation; The first engine module is used to output the rule analysis result.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executed on the processor, characterized in that: When the processor executes the computer-readable instructions, the data processing method based on the microservice architecture as described in any one of claims 1 to 7 is implemented.
10. One or more readable storage media storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the data processing method based on the microservice architecture as described in any one of claims 1 to 7.
