Distributed data picketing early warning method and device, early warning server and storage medium

By employing a distributed data inspection and early warning method, which utilizes the rule executors of the main thread and sub-threads to work in collaboration with the Redis data server, the inefficiency of existing early warning systems is resolved, achieving efficient and secure early warning execution.

CN118642771APending Publication Date: 2024-09-13WUXI XIYINJINKE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410691175.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

Existing early warning systems are inefficient in scenarios involving large amounts of data and complex calculations, and cannot be distributed across specific servers according to specific tasks. They also suffer from strong dependence on Java or Scala languages ​​and low efficiency.

Method used

A distributed data inspection and early warning method is adopted. A rule executor composed of a main thread and a sub-thread is used to manage tasks and match rules using a Redis data server. It supports multi-language collaborative execution, assigns tasks to specific rule executors, and establishes a rule matching automaton to achieve efficient rule matching calculation.

Benefits of technology

It improves the efficiency of early warning execution, ensures the accuracy and security of calculations, avoids the leakage of privacy data, and is suitable for scenarios with high concurrency and high security requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118642771A
    Figure CN118642771A
Patent Text Reader

Abstract

The invention discloses a distributed data picketing early warning method and device, an early warning server and a storage medium, and relates to the field of databases, a to-be-executed task table group is pulled from a Redis data server, and a sub-thread service is created based on a target to-be-executed task extracted and selected from the to-be-executed task table group; acquiring corresponding rule information and original data based on the type of the target to-be-executed task; creating a task matching workflow based on the target to-be-executed task and the rule information, and executing rule matching calculation according to the task matching workflow; if the rule matching is successful, determining a matched task state and corresponding state node information; and when the matched task state triggers the early warning rule and the state node information is an end mark, determining and outputting the original data and the triggered early warning rule information. According to the scheme, data entanglement tasks are sunk to respective rule executors, distributed parallel early warning processing is realized, the execution process is quickly and accurately executed according to the rule matching automaton, the efficiency is higher, and the early warning precision and safety are higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of databases, and in particular to a distributed data monitoring and early warning method, device, early warning server and storage medium. Background Art

[0002] In today's information society, big data analysis technology has become an important tool for enterprises and governments to conduct risk management and early warning. Big data analysis refers to the use of computers and mathematical models to analyze large-scale data sets to discover the laws and trends hidden in the data. Through big data analysis, enterprises and governments can better understand risks, predict future development trends, and take appropriate measures to deal with risks. Based on data analysis, risk management and early warning can be carried out. Risk management refers to reducing the impact of risks on organizations by identifying, evaluating and responding to potential risks. Early warning is to discover signs of risks in advance through data analysis before the risks occur, so as to take appropriate measures to avoid the occurrence of risks or reduce the impact of risks. For example, by analyzing financial market data, market fluctuations and risk events can be discovered, so as to adopt corresponding investment strategies; by analyzing user behavior data, signs of user loss can be discovered, so as to adopt corresponding retention strategies.

[0003] In related technologies, early warning calculations usually use database stored procedures, which can only be applied to simple scenarios. It is extremely inefficient in scenarios with large amounts of data, complex calculations, or the need to reference external data. Some early warning systems are also executed using stream processing frameworks such as flink and spark, but the biggest problem with this solution is that it has a strong dependence on Java or Scala. Some calculations need to call Python function libraries, which requires Java to call Python, which is inefficient and cannot be executed on a specified server according to the specific distribution of the task. Summary of the invention

[0004] The present invention provides a distributed data monitoring and early warning method, device, early warning server and storage medium, which solve the problem that the early warning system cannot issue early warnings, has low execution efficiency and low accuracy.

[0005] On the one hand, the present application provides a distributed data patrol warning method, which is used for a rule executor in a data patrol warning system, and the method includes:

[0006] Start the main thread service, pull the task table group to be executed through the communication connection established with the Redis data server in the system, and create a sub-thread service based on the target task to be executed extracted and selected from it;

[0007] Start the sub-thread service, obtain corresponding rule information and original data from the Redis data server based on the type of the target task to be executed, and update the ongoing task list in the Redis data server;

[0008] Creating a task matching workflow based on the target task to be executed and the rule information, and performing rule matching calculation according to the task matching workflow;

[0009] In response to a successful rule match, determine the post-match task status and the corresponding status node information; when the post-match task status does not trigger the warning rule and the status node information is an end mark, end the matching task; when the post-match task status triggers the warning rule and the status node information is an end mark, determine and output the original data and the triggered warning rule information, and synchronously feedback the list update information to the Redis data server.

[0010] Specifically, the to-be-executed task list group includes a general task list and several affinity task lists, wherein the affinity task list contains task IDs marked with affinity tags, and the general task list contains task IDs not marked with affinity tags; different affinity task lists correspond to different types of affinity tasks;

[0011] When the rule executor is configured with affinity tag information, an affinity task list is selected according to the tag type, and an affinity task is selected from the affinity task list as the target task to be executed; when the rule executor is not configured with affinity tag information, the target task to be executed is directly selected and determined from the general task list.

[0012] Specifically, the obtaining corresponding rule information and original data from the Redis data server based on the type of the target task to be executed includes:

[0013] Extracting original data and rule execution class names according to the target task to be executed; selecting rule types and matching execution methods for specific operations according to the rule execution class names;

[0014] The updating of the ongoing task list in the Redis data server includes:

[0015] The target to-be-executed task selected in the general task list or the affinity task list is transferred and inserted into the ongoing task list; the ongoing task list records the task IDs being executed by all rule executors in the rule executor cluster.

[0016] Specifically, creating a task matching workflow based on the target task to be executed and the rule information, and performing rule matching calculation according to the task matching workflow includes:

[0017] Set up the rule automatic matching robot, determine the initial rule id and initial state id according to the input original data and initial task id, and start the matching workflow;

[0018] By querying the Redis data server, determining a list of rule objects matching the state id under each state node; the rule object list includes a rule id for matching calculation;

[0019] A subsequent matching calculation is performed based on the rule id in the rule object list, and a post-matching state id corresponding to the rule id is determined.

[0020] Specifically, when the rule object list corresponding to the state id contains only one rule id, the currently executed task does not undergo fission, and the corresponding task id does not change;

[0021] When the rule object list corresponding to the state id contains at least two rule ids, the currently executed task is split, and a separate subtask and a new state id are generated based on each rule id; the task matching workflow is continued based on the subtasks;

[0022] When the state list corresponding to the state id does not contain the rule id, it indicates that the rule matching fails.

[0023] Specifically, after generating a separate subtask and a new state ID based on each rule ID, the method further includes:

[0024] Insert the status id of the fission-generated subtask into the ongoing task list of the Redis data server;

[0025] When the state list corresponding to the state id does not contain the rule id, the corresponding task id in the ongoing task list is deleted.

[0026] Specifically, each executed task is set with a state end flag, and each task generates a new task state after executing rule matching calculations, and each task state corresponds to a state node; when the rule object list corresponding to the state id contains the rule id, the state end flag is not modified, and the task matching workflow continues to be created;

[0027] When the rule object list corresponding to the state id does not contain the rule id, the state end flag is modified to a valid value, indicating that the state node information of the current task state is an end flag;

[0028] When the warning rule is triggered, the warning information is determined according to the warning rule id, and the original data and the triggered warning information are output. At the same time, the list of tasks to be executed, the list of tasks in execution and the list of completed tasks of the Redis data server are updated, and the sub-thread service is ended.

[0029] In one aspect, the present application provides a distributed data patrol warning device, the device is used as a rule executor in a data patrol warning system, and the device includes:

[0030] A creation module is used to start the main thread service, pull the to-be-executed task table group through the communication connection established with the Redis data server in the system, and create a sub-thread service based on the target to-be-executed task extracted and selected therefrom;

[0031] An update module, used to start a sub-thread service, obtain corresponding rule information and original data from the Redis data server based on the type of the target task to be executed, and update the ongoing task list in the Redis data server;

[0032] A calculation module, used to create a task matching workflow based on the target task to be executed and the rule information, and perform rule matching calculation according to the task matching workflow;

[0033] The early warning module is used to determine the post-matching task status and the corresponding status node information in response to a successful rule match; when the post-matching task status does not trigger the early warning rule and the status node information is an end mark, end the matching task; when the post-matching task status triggers the early warning rule and the status node information is an end mark, determine and output the original data and the triggered early warning rule information, and synchronously feedback the list update information to the Redis data server.

[0034] On the other hand, the present application provides an early warning server, which deploys a rule executor, including a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement any of the above-mentioned distributed data patrol and early warning methods.

[0035] On the other hand, the present application provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by a processor to implement any of the above-mentioned distributed data patrol and warning methods.

[0036] The beneficial effects brought by the present invention include at least: the executor of the scheme can be deployed to the server of the distributed system, and is composed of two parts: the main thread and the distributed parallel sub-thread; the main thread is mainly responsible for quickly obtaining the corresponding task according to the matched affinity tag and creating a sub-thread for execution, each rule executor can select the task to be executed and the rule execution method according to the configured affinity tag, and the execution process is quickly and accurately executed according to the rule matching automaton, which is more efficient. Since all rule executors are interconnected in the domain, the original data is directly obtained from the Redis data server, the processing process is completely located on an independent rule executor, and the warning matching only outputs the warning result, there is no risk of privacy data leakage, and the security is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a distributed data picket warning system disclosed in this application;

[0038] Figure 2 It is a schematic diagram of the Redis structure model of the Redis data server;

[0039] Figure 3 It is a schematic diagram of the object model established in the Redis data server;

[0040] Figure 4 It is a schematic diagram of the rule initialization and raw data initialization flow;

[0041] Figure 5 It is the matching flow chart of the rule matching automaton;

[0042] Figure 6 It is a process view of the distributed data picket warning method;

[0043] Figure 7 A schematic diagram of the execution steps of the rule executor is shown;

[0044] Figure 8 It is a structural diagram of a distributed data monitoring and early warning device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0046] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0047] Figure 1The present application discloses a distributed data monitoring and early warning system, which includes several original databases for storing original data and early warning rules, initialization executors for data initialization operations, Redis data servers for synchronous storage of rules and data, several rule executors for real-time monitoring and early warning operations, result aggregation executors for aggregating early warning results, and result servers for storing the early warning result data obtained by monitoring. The executors are deployed on computer devices or cloud servers in the same or different environments, and together form a rule executor cluster.

[0048] The original database stores the original data generated by the system in real time and the warning rules for data patrol and warning. The initialization executor connects to the original database, extracts the original data and warning rules from the original database, initializes the original data to the task object, and serializes the warning rules. The Redis data server caches the initialized original data and warning rules, and synchronizes the tasks and data executed by the rule executor cluster. The rule executor cluster contains several rule executors, which perform matching operations based on the target and warning rules extracted from the Redis data server and output the matching calculation results. The result aggregation executor connects to the rule executor cluster, receives and aggregates the original data and the hit patrol rules output by the rule executor, generates warning results based on the hit warning rules, and stores them in the result server.

[0049] The original data in the original database of the system can be user data and account data in various application scenarios, and the early warning rules are the rules for the service provider or the inspector to monitor the abnormal content of user data and account data. For example, the patrol system used in banks mainly monitors the abnormality of account information and fund flow. The early warning rules can include but are not limited to the detection of account and behavior data such as "money laundering" and "overseas fund transactions" to determine whether there are illegal or non-compliant behaviors. In the enterprise management system, it can monitor whether the network operations of employees leak the company's private data.

[0050] Redis is an open source NoSQL database written in C language, that is, a non-relational database. It is deployed on a server to form a Redis data server. The Redis server program is a single-process model, that is, multiple Redis processes can be started on a server at the same time. In the actual production environment, it is necessary to decide how many Redis processes to start based on actual needs. If you have higher requirements for high concurrency, you may consider starting multiple processes on the same server. The core module of redis command processing is single-threaded, which reduces lock contention, the cost of frequent thread creation and destruction, and the consumption of thread context switching. It is widely used in high-concurrency clusters and servers.

[0051] Because the original data contains more and different types of data, such as account information, ID information, process data flow, status ID, etc., corresponding monitoring rules and monitoring tasks need to be formulated for the risks that may exist in different data types, especially for some high-risk operations, whose accounts and generated data may violate multiple rules, which requires the formulation of multiple distributed monitoring rules. The rules themselves correspond to sections of logical code, with the input being the original data and the process data generated by related pre-calculations, and the output being a bool type data, that is, whether the match is successful or failed. For the confirmed illegal operation data, the result will trigger one or more warnings. This process requires the data to be synchronously deployed to the Redis data server, especially when updating or deleting the warning rules, and related configuration is also required. This operation is all completed by the initialization executor deployment.

[0052] The processing content of the initialization executor is to split the "warning rule" into the corresponding "state object" and "rule object" and synchronize them to redis. The initialization executor also initializes the newly added raw data into the task list according to the configured "warning rule" so that the rule executor can read the rules according to the task list and perform picket matching on the synchronized data according to the rules. Based on this, it is necessary to generate the following in the Redis data server: Figure 2 The Redis structure model shown.

[0053] Task list: Saves the inspection task ID number generated based on the original data. The relationship between data entries and inspection tasks is not limited to a one-to-one relationship, but can be a one-to-many relationship. For example, a bank account executes a transfer flow. For this data, relevant inspections need to be performed on the bank account, and relevant inspections need to be performed on the fund flow and the transfer object respectively.

[0054] In some embodiments, if the patrol warning system is aimed at high data concurrency scenarios, more rule executors need to be set up for distributed operation for massive amounts of data, especially some data patrol tasks are IO-intensive, and some data patrol tasks are CPU-intensive or memory-intensive. Different intensive tasks need to be assigned to specific rule executors. Some warning rules may need to be completed in multiple languages ​​such as python, scala, java, etc. Different rule servers need to be configured for different tasks to improve system compatibility and execution efficiency. Figure 1 In the early warning system, a rule executor cluster is set, which contains N rule executors. The relevant configuration is performed according to the type of patrol task, and a certain proportion and quantity are set, so that the production tasks can be sent to the specified rule executor for matching according to the type.

[0055] In some application scenarios, sensitive data or private data is needed to perform relevant patrol tasks, but sensitive data or private data cannot be disclosed due to the requirements of regulatory departments, government departments or third parties. That is, such sensitive data or private data must be calculated in the specified network domain. At this time, the rule executor cluster is divided into two parts, one is the general rule executor for general (non-sensitive) task execution, and the other is the special rule executor for executing tasks involving sensitive or private data. These two parts of the rule executor are in the same system at runtime, extracting relevant data and rules from the Redis data server for patrol matching operations.

[0056] Based on the above-mentioned special scenario services, it is necessary to label the tasks executed on the dedicated rule executor and set affinity labels as affinity tasks. Then the task list needs to be further divided into a general task list and an affinity task list. In addition, for different types of affinity tasks, or tasks belonging to different dedicated rule executors, they can also be divided into multiple affinity task lists, namely affinity task list 1 to affinity task list n, corresponding to the corresponding dedicated rule executors.

[0057] For example, if some rules and early warning verification need to be executed using the python executor, you can define the tag as "python". When the task is initialized, the "initialization executor" will put the task into the list of pending tasks corresponding to the "python" tag. At the same time, you can use python to develop a "python-specific rule executor". This executor only obtains the task data in the list of pending tasks corresponding to the "python" tag for execution, and automatically puts the untagged tasks into the general task list.

[0058] In addition, because the inspection of affinity tasks is more important in special scenarios, corresponding priorities can also be set. When the Redis data server forms a task list, the executor can execute affinity tasks first according to the priority during execution.

[0059] When various executors perform picket matching on tasks, they will extract the corresponding raw data based on the extracted tasks to be executed, determine the rules that need to be matched based on the rule execution class name, and determine the status of the execution task based on the corresponding matching rules. In particular, because the data matching process may involve multiple states, and further rule matching is required under different states, it is necessary to establish a complete set of rule matching automata for the early warning rules. In order to allow the rule executor and the rule matching automata to run in an orderly manner, it is also necessary to synchronously establish an object model in the Redis data server, and all execution processes are based on this object model.

[0060] Figure 3This is a schematic diagram of the object model established in the Redis data server. The model objects are divided into three categories: state objects, rule objects, and task objects. The state object contains the state id, rule object list, warning rule id, and end state identifier. The rule object contains the rule id, post-match state id, affinity label, and rule execution class name. The task object contains the task id, the original data corresponding to the task id and the generated process data, the current state id, the current rule id, the match success state identifier, and the warning rule id.

[0061] The state id is used to represent the task state identified by the rule matching automaton at different time sequences, while the rule object list is used to represent the rule id of the subtask further split from the current state id; the warning rule id represents the warning rule triggered by the state id, and the end state identifier serves as a pause mark for the warning triggered by the state id.

[0062] The rule id is used to indicate the matching rule used in the execution process. The post-matching state id is used to indicate the task state determined after the rule matching is completed. The affinity tag is used to determine the task type and rule executor. The rule execution class name is used to determine the rule type and execution method.

[0063] The current state id is used to indicate the task state at the current time sequence. The current rule id indicates the rule matched by the task at the current time sequence. The process data is the inter-process data generated and recorded by the preceding rule executor during the early warning execution process, and is used for parameter transfer between multiple rule executors.

[0064] Figure 4 This is a flow diagram of rule initialization and raw data initialization. For the initialization of raw data, after the initialization executor extracts the raw data, it will initialize the data to the task object and store it in the shared cache object pool. Because the data and the warning rules are a one-to-many relationship, one piece of data will generate multiple warning tasks. Since the task object will also generate fission during the matching process, the subtasks generated by the fission need to be added to the task list synchronously. For the initialization of rules, the initialization server will serialize all warning rules into state objects and rule objects, and then store the state objects and rule objects in the shared cache object pool.

[0065] Combine the following Figure 5 The matching flow chart of the rule matching automaton is shown as an example for introduction:

[0066] First, you need to select a task from the list of tasks to be executed as the task object. This process requires generating and recording the task id (assuming it is task 1), and fetching the corresponding raw data from the Redis data server. The process data generated and interacted during the intermediate process needs to be recorded synchronously. Figure 4The matching rules are executed in sequence. This process selects relevant rules and execution methods from a large number of rule methods according to the rule execution class name. This process also detects whether task 1 has an affinity tag and sends it to the corresponding rule executor for execution according to the affinity tag.

[0067] The rule executor first executes step A for the task, and enters state 1 through matching rule 1. At this time, all subtasks in the subsequent task list will be determined according to the rule object list, that is, rule 4 of step B and rule 2 of step C need to be executed. These two sub-lines run synchronously or asynchronously. After rule 2 is matched successfully, the subsequent state id (state N) will be determined, and after rule 4 is matched successfully, the subsequent state id (state 2) will also be determined. However, because state 2 with successful matching of rule 4 will directly trigger warning rule 1, the subtask will automatically end after reaching state 2.

[0068] The subtasks generated by state 1 will also execute step C and enter state N by matching rule 2. At this time, the rule ids of the subsequent subtasks (rules 3, 4 and N) will be further determined. The task status of the three subtasks after matching rule 3 is still state 3; the task status after matching warning rule 5 changes to state 2, and also triggers warning rule 1; the task status after matching rule N changes to state M, and state M will trigger warning rule 2 according to the definition.

[0069] For any fission-generated subtask, new task objects, rule objects, and state objects will be generated. Therefore, an object pool needs to be established in the Redis data server. The object pool is divided into a state object pool, a rule object pool, and a task object pool according to the type. For each fission subtask, a unique and associated task object, rule object, and state object are added to the object pool by setting a number or other ID number.

[0070] exist Figure 5 In the rule matching process, when a task or subtask matches the corresponding rule id, the match success flag is modified to a valid value. For subtasks that cannot match the corresponding rule id, the process is terminated, indicating that the account and data flow are normal and there is no risk of violation.

[0071] For the Redis data server, in order to maintain high throughput and achieve system dynamic balance, it is also necessary to set up a completed task list and an ongoing task list in the Redis structure model. When the rule executor extracts pending tasks from the pending task list (including the general task list and the affinity task list), it immediately deletes and updates the general task list and the affinity task list, and inserts the extracted tasks into the ongoing task list.

[0072] In general, rule executors can be developed in multiple languages ​​and can be deployed in multiple different types of servers. The rule executor consists of two parts: the main thread and the child thread. The main thread is mainly responsible for obtaining the corresponding tasks according to the matching affinity tags and creating child threads for execution. Each rule executor can be configured with multiple different affinity tags, and each executor prioritizes affinity tasks. There can be multiple execution methods in a rule executor. Each rule corresponds to only one execution method, which is identified by the rule execution class name. The child thread obtains the local rule matching method through this field when waiting for the task details.

[0073] The above rule executors can freely set patrol warning rules according to different privacy scenarios. Since all rule executors are interconnected within the domain, the original data is directly obtained from the Redis data server. The affinity tags and execution class names set for the tasks to be executed can quickly select the target rule executor and enable the corresponding rules to match the patrol. The processing process is completely located on an independent rule executor, and the warning matching only outputs the warning results. There is no risk of privacy data leakage, and the security is higher.

[0074] The result aggregation executor is interconnected with the rule executor cluster and is responsible for collecting the results output by all rule executors, that is, whether there is original data that hits the warning rule and which warning rule is hit. For the data that triggers the warning, the original data and the hit warning rule are associated and stored in the warning result database for subsequent retrieval and tracing.

[0075] like Figure 6 As shown, based on the distributed patrol warning system provided above, the present application also provides a distributed data patrol warning method, which is used for the rule executor in the data patrol warning system. The method specifically includes the following steps:

[0076] Step 610, start the main thread service, pull the to-be-executed task table group through the communication connection established with the Redis data server in the system, and create a sub-thread service based on the target to-be-executed task extracted and selected therefrom.

[0077] All servers deploying rule executors in the early warning system are connected to the Redis data server and are located in the same network domain. When any rule server starts running, the main thread service is started first to pull unstarted tasks from the Redis data server, that is, to extract the target tasks to be executed from the task list.

[0078] Because the task list group to be executed includes a general task list and several affinity task lists, the affinity task list stores task IDs marked with affinity tags, and the general task list stores task IDs without affinity tags; different affinity task lists correspond to different types of affinity tasks. When the rule executor is configured with affinity tag information, a specific affinity task list will be selected according to the tag type, and the affinity task will be selected from the affinity task list as the target task to be executed. Correspondingly, when the rule executor is not configured with affinity tag information, the target task to be executed is directly selected and determined from the general task list.

[0079] In particular, data surveillance in some financial systems uses specific computing data and methods. The distributed server's method of directly extracting raw data from the shared Redis and the method of calculation can effectively improve data security.

[0080] Step 620, start the child thread service, obtain corresponding rule information and original data from the Redis data server based on the type of the target task to be executed, and update the ongoing task list in the Redis data server.

[0081] Because the Redis data server has deployed data and rules through the initialization executor, the child thread can directly extract relevant rules and data from the assigned target task to be executed (id number) when running. In particular, when the server supports multi-threaded synchronous operation, it can multi-thread the picket warning task of multiple data. At this time, it is necessary to delete the selected task id in the general task list and / or affinity task list in the Redis data server, and move the id number to the ongoing task list, indicating that it is in the execution state.

[0082] In particular, because different task types may require different matching rules, each task to be executed will be set with a corresponding rule execution class name. The rule executor or server contains a rule execution library and an algorithm library. After determining the rule execution class name, the corresponding rule set and execution algorithm are selected.

[0083] Step 630: Create a task matching workflow based on the target task to be executed and the rule information, and perform rule matching calculation according to the task matching workflow.

[0084] The stage of creating a matching workflow is the task execution stage, which is based on the rule matching automaton execution, and the automaton is executed with the help of the object model established in the Redis database. It specifically includes the following steps:

[0085] A, set up the rule automatic matching automaton, determine the initial rule id and initial state id according to the input original data and initial task id, and start the matching workflow;

[0086] This step refers to Figure 5 As shown in the figure, the default initial rules and initial status will be determined in the initial execution phase after the rule class name and the execution algorithm are determined. For example, when querying a public account in a bank statement, the default query is to check whether the selected account is a public account. After confirmation, the query will continue to query the fund flow, account status, fund amount, etc. Figure 5 Rule 1 and state 1 in are then executed step by step through the automatic matching automaton according to the object model.

[0087] B. Determine the list of rule objects that match the state id under each state node by querying the Redis data server;

[0088] A state object is set in the object model. For a certain execution task, a rule object list is set in each state of the task. The rule object list contains the rule ID used for matching calculation, so as to quickly match and execute the rules.

[0089] C. Perform subsequent matching calculation based on the rule id in the rule object list, and determine the post-matching state id corresponding to the rule id.

[0090] In the above execution process, because the inspection of a piece of raw data involves multiple rule matching and may trigger one or more warning rules, the task may be fissioned during the execution process.

[0091] When the rule object list corresponding to the state id contains only one rule id, the currently executed task will not generate a branch task, that is, no fission will be performed, and the corresponding task id will not change.

[0092] When the rule object list corresponding to the state id contains at least two rule ids, it means that branch tasks, i.e. subtasks, will be generated later. The currently executed task needs to be split, and a separate subtask and a new state id need to be generated based on each rule id. There are two processing logics in this process. Because the id of the original task is determined before the rule is matched, the original task id can be retained for the split task, and the task id of the subtask can be added. The newly added task id needs to be inserted into the list of executing tasks of the Redis data server. Of course, the task object can also be modified into two different tasks, and different task ids can be reallocated. Then, the task matching workflow can be continued based on the subtasks.

[0093] When the state list corresponding to the state id does not contain the rule id, it indicates that the current state id cannot be matched with the rule or the rule matching fails. Failure to match the rule means that no subsequent picketing tasks will be generated, and the task id in the ongoing task list will be deleted. For details, see Figure 7 The schematic diagram of the rule executor execution steps shown in the figure inserts the task id into the completed task list for this task.

[0094] Step 640, in response to a successful rule match, determine the task status after matching and the corresponding status node information; when the task status after matching does not trigger the warning rule and the status node information is an end mark, end the matching task; when the task status after matching triggers the warning rule and the status node information is an end mark, determine and output the original data and the triggered warning rule information, and synchronously feedback the list update information to the Redis data server.

[0095] In some embodiments, a state end flag may be set for each executed task, which may be specifically represented by 0 and 1. After each task executes rule matching calculations, a new task state is naturally generated, and each task state corresponds to a state node.

[0096] When the rule object list corresponding to the state id contains the rule id, it means that the task or subtask inspection work at this time has not been completed, the state end flag is not modified, and the task matching workflow continues to be created one after another.

[0097] When the rule object list corresponding to the state id does not contain the rule id, it is impossible to proceed, that is, the state end flag is modified to a valid value, and the state node information indicating the task state is the end flag. Of course, this situation is mainly for the case where the subtask does not trigger the warning rule. For this task, a match success flag is set, and it is set to no, indicating that the warning rule is not triggered.

[0098] When the status of a task after rule matching calculation triggers the warning rule, the warning information is determined according to the warning rule id, and the original data and the triggered warning information are output. The corresponding task also meets the end condition, and the task status is the end node, ending the child thread service. Correspondingly, a matching success flag is set for the task, and it is set to yes, indicating that the warning rule is successfully triggered. At the same time, the list of pending tasks, the list of tasks in progress, and the list of completed tasks of the Redis data server are all synchronously modified and updated.

[0099] Figure 8 : is a schematic diagram of the structure of a distributed data picket warning device provided in an embodiment of the present application, the device is used as a rule executor in a data picket warning system, and the device includes:

[0100] A creation module 810 is used to start the main thread service, pull the to-be-executed task table group through the communication connection established with the Redis data server in the system, and create a sub-thread service based on the target to-be-executed task extracted and selected therefrom;

[0101] An updating module 820 is used to start a sub-thread service, obtain corresponding rule information and original data from the Redis data server based on the type of the target task to be executed, and update the ongoing task list in the Redis data server;

[0102] A calculation module 830, configured to create a task matching workflow based on the target task to be executed and the rule information, and perform rule matching calculation according to the task matching workflow;

[0103] The warning module 840 is used to determine the post-matching task status and the corresponding status node information in response to a successful rule match; when the post-matching task status does not trigger the warning rule and the status node information is an end mark, end the matching task; when the post-matching task status triggers the warning rule and the status node information is an end mark, determine and output the original data and the triggered warning rule information, and synchronously feedback the list update information to the Redis data server.

[0104] In addition, an embodiment of the present application also provides an early warning server, wherein the server deploys a rule executor, including a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the distributed data patrol and early warning method as described in any of the above aspects.

[0105] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the distributed data patrol and warning method as described in any of the above aspects.

[0106] The preferred embodiments of the present invention are described above; it should be understood that the present invention is not limited to the above-mentioned specific embodiments, and the devices and structures not described in detail should be understood to be implemented in a common manner in the art; any technician familiar with the art can make many possible changes and modifications without departing from the technical solution of the present invention, or modify them into equivalent embodiments with equivalent changes, which does not affect the essential content of the present invention; therefore, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of protection of the technical solution of the present invention.

Claims

1. A distributed data monitoring and early warning method, It is characterized in that The method is used for a rule executor in a data monitoring and early warning system, and the method comprises: Start the main thread service, pull the task table group to be executed through the communication connection established with the Redis data server in the system, and create a sub-thread service based on the target task to be executed extracted and selected from it; Start the sub-thread service, obtain corresponding rule information and original data from the Redis data server based on the type of the target task to be executed, and update the ongoing task list in the Redis data server; Creating a task matching workflow based on the target task to be executed and the rule information, and performing rule matching calculation according to the task matching workflow; In response to a successful rule match, determine the post-match task status and the corresponding status node information; when the post-match task status does not trigger the warning rule and the status node information is an end mark, end the matching task; when the post-match task status triggers the warning rule and the status node information is an end mark, determine and output the original data and the triggered warning rule information, and synchronously feedback the list update information to the Redis data server.

2. The method according to claim 1, It is characterized in that The to-be-executed task list group includes a general task list and several affinity task lists, wherein the affinity task list contains task IDs marked with affinity tags, and the general task list contains task IDs not marked with affinity tags; different affinity task lists correspond to different types of affinity tasks; When the rule executor is configured with affinity tag information, an affinity task list is selected according to the tag type, and an affinity task is selected from the affinity task list as the target task to be executed; when the rule executor is not configured with affinity tag information, the target task to be executed is directly selected and determined from the general task list.

3. The method according to claim 1, It is characterized in that The obtaining corresponding rule information and original data from the Redis data server based on the type of the target task to be executed includes: Extracting original data and rule execution class names according to the target task to be executed; selecting rule types and matching execution methods for specific operations according to the rule execution class names; The updating of the ongoing task list in the Redis data server includes: The target to-be-executed task selected in the general task list or the affinity task list is transferred and inserted into the ongoing task list; the ongoing task list records the task IDs being executed by all rule executors in the rule executor cluster.

4. The method according to claim 1, It is characterized in that The step of creating a task matching workflow based on the target task to be executed and the rule information, and performing rule matching calculation according to the task matching workflow includes: Set up the rule automatic matching robot, determine the initial rule id and initial state id according to the input original data and initial task id, and start the matching workflow; By querying the Redis data server, determining a list of rule objects matching the state id under each state node; the rule object list includes a rule id for matching calculation; A subsequent matching calculation is performed based on the rule id in the rule object list, and a post-matching state id corresponding to the rule id is determined.

5. The method according to claim 4, It is characterized in that When the rule object list corresponding to the state id contains only one rule id, the currently executed task will not be split, and the corresponding task id will not be changed; When the rule object list corresponding to the state id contains at least two rule ids, the currently executed task is split, and a separate subtask and a new state id are generated based on each rule id; the task matching workflow is continued based on the subtasks; When the state list corresponding to the state id does not contain the rule id, it indicates that the rule matching fails.

6. The method according to claim 5, It is characterized in that After generating a separate subtask and a new state ID based on each rule ID, the method further includes: Insert the status id of the fission-generated subtask into the ongoing task list of the Redis data server; When the state list corresponding to the state id does not contain the rule id, the corresponding task id in the ongoing task list is deleted.

7. The method according to claim 6, It is characterized in that Each executed task is set with a state end flag. After each task executes the rule matching calculation, a new task state is generated, and each task state corresponds to a state node. When the rule object list corresponding to the state id contains the rule id, the state end flag is not modified, and the task matching workflow continues to be created. When the rule object list corresponding to the state id does not contain the rule id, the state end flag is modified to a valid value, indicating that the state node information of the current task state is an end flag; When the warning rule is triggered, the warning information is determined according to the warning rule id, and the original data and the triggered warning information are output. At the same time, the list of tasks to be executed, the list of tasks in execution and the list of completed tasks of the Redis data server are updated, and the sub-thread service is ended.

8. A distributed data picket warning device, It is characterized in that The device is used as a rule executor in a data picket warning system, and the device comprises: A creation module is used to start the main thread service, pull the to-be-executed task table group through the communication connection established with the Redis data server in the system, and create a sub-thread service based on the target to-be-executed task extracted and selected therefrom; An update module, used to start a sub-thread service, obtain corresponding rule information and original data from the Redis data server based on the type of the target task to be executed, and update the ongoing task list in the Redis data server; A calculation module, used to create a task matching workflow based on the target task to be executed and the rule information, and perform rule matching calculation according to the task matching workflow; The early warning module is used to determine the post-matching task status and the corresponding status node information in response to a successful rule match; when the post-matching task status does not trigger the early warning rule and the status node information is an end mark, end the matching task; when the post-matching task status triggers the early warning rule and the status node information is an end mark, determine and output the original data and the triggered early warning rule information, and synchronously feedback the list update information to the Redis data server.

9. An early warning server, It is characterized in that The server deploys a rule executor, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the distributed data patrol and warning method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the distributed data patrol and warning method as described in any one of claims 1 to 7.