Data filtering method and device
By using preset data filtering rule chains and data processing clusters in the distributed publish and subscription messaging system, the problems of inefficiency and data accumulation when consumers acquire data are solved, and efficient data filtering and processing are achieved.
Patent Information
- Application Number
- CN202310485910.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2024-11-05
AI Technical Summary
In the high-throughput distributed publishing and subscription messaging system, consumers can only passively obtain all data when obtaining data, resulting in low data filtering efficiency and complex filtering rules will lead to data accumulation.
Through the preset data filtering rule chain, multiple data filtering rules are used to filter in sequence and allocate them to their respective data processing clusters to improve filtering efficiency and avoid data accumulation.
Improves the efficiency and speed of data filtering, simplifies the execution logic of each data filtering rule, avoids data accumulation, and supports dynamic adjustment of data processing clusters to adapt to changes in data volume.
Smart Images

Figure CN118897835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a data filtering method and device. Background Art
[0002] With the continuous development of technology, a high-throughput distributed publish-subscribe messaging system (Apache Kafka, Kafka) has emerged. It can process all action stream data of consumers on the website. After producing data, the producer can send the data to the Kafka topic (the topic is the space used to store messages in Kafka). Consumers can subscribe to the topic and listen to the data updates in the topic, thereby obtaining the data sent by the producer in the topic.
[0003] However, when consumers obtain data sent by producers in the topic, they can only passively obtain all data. However, in some cases, consumers do not want all the data, so some data filtering rules are needed to filter the data.
[0004] The current method for filtering data is to set the logic code of the filtering rules in the consumer system. However, when the logic of the filtering rules is complex, the execution of this method is complex and the filtering efficiency of the data is low. Therefore, when there is subsequent data to be processed, it will cause data accumulation. Summary of the invention
[0005] In view of the above problems, the present invention provides a data filtering method and device, the main purpose of which is to improve the filtering efficiency of data, thereby solving the problem of data accumulation.
[0006] In order to solve the above technical problems, the present invention proposes the following solutions:
[0007] In a first aspect, the present invention provides a data filtering method, the method comprising:
[0008] Acquire preset configuration information, wherein the preset configuration information includes a preset data filtering rule chain identifier, a rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, and an input topic and an output topic corresponding to each data filtering rule;
[0009] Acquiring input data based on the preset configuration information;
[0010] The input data is filtered using a plurality of data filtering rules in the preset data filtering rule chain to obtain filtered target data, wherein each data filtering rule in the preset data filtering rule chain corresponds to a data processing cluster.
[0011] In a second aspect, the present invention provides a data filtering device, the device comprising:
[0012] An information acquisition unit, used to acquire preset configuration information, wherein the preset configuration information includes a preset data filtering rule chain identifier, a rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, and an input topic and an output topic corresponding to each data filtering rule;
[0013] A data acquisition unit, configured to acquire input data based on the preset configuration information acquired by the information acquisition unit;
[0014] The data filtering unit is used to filter the input data acquired by the data acquisition unit using multiple data filtering rules in the preset data filtering rule chain to obtain filtered target data, and each data filtering rule in the preset data filtering rule chain corresponds to a data processing cluster.
[0015] In order to achieve the above object, according to a third aspect of the present invention, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the data filtering method of the first aspect.
[0016] In order to achieve the above-mentioned purpose, according to the fourth aspect of the present invention, an electronic device is provided, which includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call the program instructions in the memory to execute the data filtering method of the first aspect mentioned above.
[0017] By means of the above technical scheme, a data filtering method and device provided by the present invention can be pre-set with multiple data filtering rules, and then the multiple data filtering rules are sorted and connected to form a preset data filtering rule chain, and then the preset data filtering rule chain is configured. The specific configuration may include a preset data filtering rule chain identifier, a rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, and an input subject and an output subject corresponding to each data filtering rule. After configuration, the preset configuration information can be obtained, and then the input data can be obtained according to the preset configuration information, and then the input data is filtered according to the multiple data filtering rules in the preset data filtering rule chain. Since the preset data filtering rule chain is a rule chain with an order, when filtering the data, it is also in accordance with the order of the data filtering rules in the chain, so that multiple data filtering rules process the input data, and finally the filtered target data is obtained. In this way, the present invention filters the input data in sequence through multiple data filtering rules, which is equivalent to splitting a data filtering rule into multiple parts. Compared with the complete data filtering rule that is not split, the execution logic of each part is simple, and therefore, the execution is fast, which can improve the filtering speed of the data. Moreover, each data filtering rule of the present invention corresponds to a data processing cluster, and multiple data processing services in each cluster can run this data filtering rule at the same time. When there is data to be processed later, it will not cause data accumulation.
[0018] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0020] Figure 1 A flow chart of a data filtering method provided by an embodiment of the present invention is shown;
[0021] Figure 2 Another data filtering method flow chart provided by an embodiment of the present invention is shown;
[0022] Figure 3 A block diagram showing a data filtering device according to an embodiment of the present invention is shown;
[0023] Figure 4A block diagram showing another data filtering device provided by an embodiment of the present invention is shown;
[0024] Figure 5 A block diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0025] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0026] With the continuous development of technology, a high-throughput distributed publish-subscribe messaging system (Apache Kafka, Kafka) has emerged, that is, it can process all action stream data of consumers on the website. After producing data, producers can send data to Kafka topics (topics are spaces in Kafka for storing messages). Consumers can subscribe to the topic and listen to data updates in the topic, thereby obtaining the data sent by the producer to the topic. However, when consumers obtain data sent by producers in the topic, they can only passively obtain all data. In some cases, consumers do not want all data, so some data filtering rules are needed to filter the data.
[0027] The current method for filtering data is to set the logic code of the filtering rules in the consumer end system. However, when the logic of the filtering rules is complex, the execution of this method is complex and the filtering efficiency of the data is low. Therefore, when there is more data to be processed later, it will cause data accumulation. On the other hand, if the current filtering rules want to be changed, the entire logic code needs to be redeployed. To this end, the present invention provides a data filtering method that can solve the two problems mentioned above. The specific execution steps are as follows: Figure 1 As shown, including:
[0028] 101. Obtain preset configuration information.
[0029] 102. Obtain input data based on preset configuration information.
[0030] In the present invention, the execution subject is a message filtering system located between Kafka and the consumer end system. The message filtering system monitors the messages in the topic by subscribing to the relevant topic in Kafka. When the producer sends the produced data to the relevant topic, the message filtering system can obtain the data sent by the producer in the relevant topic in real time, that is, obtain the input data, thereby processing the input data and sending the processed data to the consumer end system. In addition, the message filtering system communicates with the consumer end system and Kafka respectively.
[0031] Specifically, there are rule management systems and data processing services in the message filtering system. In the rule management system, you can first create a project group, and then under the project group, create multiple data filtering rules according to the business needs corresponding to the project group, where each data filtering rule corresponds to a service node, and then the multiple data filtering rules are connected in a preset order to form a preset data filtering rule chain, and then the rule chain can be configured, including configuring the preset data filtering rule chain identifier, the rule identifier corresponding to each data filtering rule, and the input topic and output topic corresponding to each data filtering rule in Kafka.
[0032] The order of connecting the multiple data filtering rules in a preset order can be customized according to specific circumstances, and can also be determined according to specific business circumstances.
[0033] Among them, the input topic is used in Kafka to store the data to be processed by each data filtering rule; the output topic is used in Kafka to store the data processed by each data filtering rule. In addition, since multiple data filtering rules are connected in sequence to form a preset data filtering rule chain, except for the last data filtering rule, the output topic of each data filtering rule is the input topic corresponding to the next data filtering rule in the preset data filtering rule chain.
[0034] After obtaining the preset configuration information, the preset configuration information can be stored in the rule topic in Kafka. Then, the data processing cluster corresponding to each data filtering rule can be deployed at the service node corresponding to each data filtering rule according to the preset deployment method. In this way, multiple data processing services in each data processing cluster can run the corresponding data filtering rules. The deployment method here can be K8S (Kubernetes), which is an open source container orchestration system.
[0035] After completing the above work, in step 101, the data processing service part of the message filtering system can obtain the preset configuration information of the preset filtering rule chain in the rule topic of Kafka. Then, step 102 can determine the identifier corresponding to the initial data filtering rule in the preset data filtering rule chain in the preset configuration information, so as to find the input topic corresponding to the initial filtering rule, that is, the specified input topic, and then Kafka listening can be started, and input data can be obtained in the specified input topic of Kafka after startup.
[0036] 103. Filter the input data using multiple data filtering rules in a preset data filtering rule chain to obtain filtered target data.
[0037] After obtaining the input data, multiple data processing services in the data processing cluster corresponding to the first data filtering rule in the preset data filtering rule chain can run the first data filtering rule. During the run, the first data filtering rule must be parsed to parse out the operation rules and preset results in the first data filtering rule, and then the operation rules in the first data filtering rule are used to filter the input data obtained from the specified input topic of Kafka. After obtaining the filtered data using the first data filtering rule, the obtained data is output to the corresponding output topic, so that multiple data processing services in the data processing cluster corresponding to the second data filtering rule can run the second data filtering rule, and then parse the second data filtering rule to obtain the operation rules and preset results in the second data filtering rule, and then pull the data filtered by the first data filtering rule from the output topic of the first data filtering rule, and then use the operation rules in the parsed second data filtering rule to filter the data filtered by the first data filtering rule, and so on until the final data filtering result, that is, the target data, is obtained by using the last data filtering rule in the preset data filtering rule chain.
[0038] It should be noted that after each data filtering rule filters the data, if it does not meet the expected results, the data will be discarded and not output to the output topic corresponding to the rule.
[0039] In addition, the reason why the data filtering rules need to be parsed is that the data filtering rules do not exist directly in the form of operation rules that can be directly calculated, and when the data processing service parses the data filtering rules, it is necessary to load the parser corresponding to the data filtering rules for parsing.
[0040] After the message filtering system obtains the filtered target data, it can send the target data to the consumer system.
[0041] Based on the above Figure 1It can be seen from the implementation method that a data filtering method provided by the present invention can be pre-set with multiple data filtering rules, and then the multiple data filtering rules are sorted and connected to form a preset data filtering rule chain, and then the preset data filtering rule chain is configured. The specific configuration may include a preset data filtering rule chain identifier, a rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, and an input subject and an output subject corresponding to each data filtering rule. After configuration, the preset configuration information can be obtained, and then the input data is obtained according to the preset configuration information, and then the input data is filtered according to the multiple data filtering rules in the preset data filtering rule chain. Since the preset data filtering rule chain is a rule chain with an order, when filtering the data, it is also in accordance with the order of the data filtering rules in the chain, so that multiple data filtering rules process the input data, and finally the filtered target data is obtained. In this way, the present invention filters the input data in sequence through multiple data filtering rules, which is equivalent to splitting a data filtering rule into multiple parts. Compared with the complete data filtering rule that is not split, the execution logic of each part is simple, and therefore, the execution is fast, which can improve the filtering speed of the data. Moreover, each data filtering rule of the present invention corresponds to a data processing cluster, and multiple data processing services in each cluster can run this data filtering rule at the same time. When there is data to be processed later, it will not cause data accumulation.
[0042] Furthermore, as a Figure 1 The embodiment shown in the figure is refined and expanded. The embodiment of the present invention also provides another data filtering method, such as Figure 2 As shown, the specific steps are as follows:
[0043] 201. Obtain preset configuration information.
[0044] 202. Obtain input data based on preset configuration information.
[0045] Among them, the implementation method of step 201 to step 202 is the same as that of step 101 to step 102, and can achieve the same technical effect and solve the same technical problem, and will not be repeated here.
[0046] 203. Filter the input data using multiple data filtering rules in a preset data filtering rule chain to obtain filtered target data.
[0047] Among them, the implementation method of step 203 is the same as that of step 103, and can achieve the same technical effect and solve the same technical problem, and will not be repeated here.
[0048] 204. Based on the preset monitoring service, real-time monitoring is performed to determine whether there is anomaly when input data is filtered using multiple data filtering rules.
[0049] 205. If abnormal, determine the cause of the filtering abnormality, and repair the abnormality based on the cause of the filtering abnormality.
[0050] In step 204 and step 205, in the message filtering system of the present invention, there is also a preset monitoring service, which is located in the rule management system of the present invention. The preset monitoring service can monitor whether there are any abnormalities in the filtering process of the input data by multiple data filtering rules in the preset data filtering rule chain, because it is possible that the data processing service fails or other external reasons cause the processing to be interrupted. When an abnormality is detected, the cause of the abnormality can be further investigated, and then the abnormality can be repaired according to the cause of the abnormality. If the cause of the abnormality is a data processing service failure, the faulty data processing service can be replaced. In this way, the abnormal situation in the filtering process can be discovered at any time through the preset monitoring service, so that the abnormal situation can be handled in time, which can improve the security and accuracy of the filtered data finally obtained to a certain extent.
[0051] In addition, when filtering the input data according to multiple data filtering rules in the preset data filtering rule chain, the amount of input data can also be confirmed. Because if the amount of input data is too large, the existing multiple data processing services in the data processing cluster corresponding to each data processing rule may not be able to complete the data filtering quickly. Therefore, the number of data processing services in the data processing cluster corresponding to each data filtering rule can be appropriately adjusted according to the amount of input data. In this way, the data processing services in the data processing cluster can be expanded or reduced at any time, and can also be well adapted to large data volumes.
[0052] Furthermore, as a response to the above Figure 1 In order to realize the method shown in the figure, the embodiment of the present invention also provides a data filtering device for filtering the above Figure 1 The device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Figure 3 As shown, the device comprises:
[0053] The information acquisition unit 301 is used to acquire preset configuration information, wherein the preset configuration information includes a preset data filtering rule chain identifier, a rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, and an input topic and an output topic corresponding to each data filtering rule;
[0054] A data acquisition unit 302, configured to acquire input data based on the preset configuration information acquired by the information acquisition unit 301;
[0055] The data filtering unit 303 is used to filter the input data acquired by the data acquisition unit 302 using multiple data filtering rules in the preset data filtering rule chain to obtain filtered target data. Each data filtering rule in the preset data filtering rule chain corresponds to a data processing cluster.
[0056] Furthermore, as a response to the above Figure 2 In order to realize the method shown in the figure, the embodiment of the present invention also provides another data filtering device for filtering the above Figure 2 The device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Figure 4 As shown, the device comprises:
[0057] The information acquisition unit 301 is used to acquire preset configuration information, wherein the preset configuration information includes a preset data filtering rule chain identifier, a rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, and an input topic and an output topic corresponding to each data filtering rule;
[0058] A data acquisition unit 302, configured to acquire input data based on the preset configuration information acquired by the information acquisition unit 301;
[0059] The data filtering unit 303 is used to filter the input data acquired by the data acquisition unit 302 using multiple data filtering rules in the preset data filtering rule chain to obtain filtered target data. Each data filtering rule in the preset data filtering rule chain corresponds to a data processing cluster.
[0060] In an optional implementation, before the data acquisition unit 302 acquires the preset configuration information, the device further includes a rule creation unit 304, and the rule creation unit 304 includes:
[0061] A group creation module 3041, used to create project groups in the rule management system;
[0062] A rule adding module 3042 is used to add multiple data filtering rules based on business requirements under the project group created by the group creating module 3041, wherein each data filtering rule corresponds to a service node;
[0063] The rule chain forming module 3043 is used to connect the multiple data filtering rules added by the rule adding module 3042 in a preset order to form the preset data filtering rule chain.
[0064] In an optional implementation, after the rule creation unit 304 connects the multiple data filtering rules in a preset order to form the preset data filtering rule chain, the device further includes a rule configuration unit 305, and the rule configuration unit 305 includes:
[0065] The rule configuration module 3051 is used to configure the preset data filtering rule chain identifier, the rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, the input subject and the output subject corresponding to each data filtering rule, and obtain the preset configuration information of the preset data filtering rule chain;
[0066] The configuration storage module 3052 is used to store the preset configuration information configured by the rule configuration module 3051 into the rule subject.
[0067] In an optional implementation, after the rule configuration unit 305 stores the preset configuration information in the rule topic, the device further includes a cluster deployment unit 306, and the cluster deployment unit 306 is specifically used to:
[0068] Based on a preset deployment method, a data processing cluster corresponding to each data filtering rule is deployed at a service node corresponding to each data filtering rule, wherein a plurality of data processing services in each data processing cluster are used to run the data filtering rules at the corresponding node.
[0069] In an optional implementation, when the data filtering unit 303 filters the input data using multiple data filtering rules in the preset data filtering rule chain, the device further includes an abnormality monitoring unit 307, and the abnormality monitoring unit 307 includes:
[0070] The abnormality monitoring module 3071 is used to monitor in real time based on a preset monitoring service whether there is an abnormality when the input data is filtered using the multiple data filtering rules;
[0071] A cause determination module 3072, configured to determine a filtering anomaly cause if the anomaly monitoring module 3071 detects an anomaly, wherein the filtering anomaly cause includes a data processing service failure in the data processing cluster corresponding to the data filtering rule;
[0072] The exception repair module 3073 is used to repair the exception based on the filtering exception cause determined by the cause determination module 3072.
[0073] In an optional implementation, when the data filtering unit 303 filters the input data using multiple data filtering rules in the preset data filtering rule chain, the device further includes a service adjustment unit 308, and the service adjustment unit 308 includes:
[0074] A data quantity determination module 3081, configured to determine the quantity of the input data when each data filtering rule in the preset data filtering rule chain filters the input data;
[0075] A service adjustment determination module 3082, configured to determine whether it is necessary to adjust the number of data processing services in the data processing cluster corresponding to each data filtering rule based on the number of input data determined by the data number determination module 3081;
[0076] The service quantity adjustment module 3083 is configured to adjust the quantity of data processing services in the data processing cluster corresponding to each data filtering rule if the service adjustment determination module 3082 determines that it is necessary.
[0077] In an optional implementation manner, the data filtering unit 303 includes:
[0078] A result acquisition module 3031 is used to acquire a filtering result after filtering the input data using each data filtering rule, wherein each data filtering rule includes a preset result;
[0079] A result determination module 3032 is used to determine whether the filtering result obtained by the result acquisition module 3031 meets the preset result in the corresponding data filtering rule;
[0080] A result output module 3033 is used to output the filtering result to the output topic of the corresponding data filtering rule if the result determination module 3032 determines that it is in compliance;
[0081] The result discarding module 3034 is used to discard the filtering result if the result determining module 3032 determines that it does not meet the requirements.
[0082] Furthermore, an embodiment of the present invention further provides a storage medium, wherein the storage medium is used to store a computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the above Figure 1-2 The data filtering method described in .
[0083] Furthermore, an embodiment of the present invention also provides an electronic device, comprising: at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call the program instructions in the memory to execute the above Figure 1-2 The data filtering method described in .
[0084] Furthermore, an embodiment of the present invention provides an electronic device, such as Figure 5 As shown, Figure 5 A block diagram of an electronic device 50 is shown according to an embodiment of the present invention. The electronic device 50 includes at least one processor 501, at least one memory 502 connected to the processor 501, and a bus 503; wherein the processor 501 and the memory 502 communicate with each other through the bus 503. The processor 501 is used to call the program instructions in the memory 502 to execute the above-mentioned data filtering method. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0085] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0086] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.
[0087] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0088] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0089] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0090] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0091] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0094] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0095] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0096] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0097] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0098] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0099] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A data filtering method, characterized in that: The method comprises: Acquire preset configuration information, wherein the preset configuration information includes a preset data filtering rule chain identifier, a rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, and an input topic and an output topic corresponding to each data filtering rule; Acquiring input data based on the preset configuration information; The input data is filtered using a plurality of data filtering rules in the preset data filtering rule chain to obtain filtered target data, wherein each data filtering rule in the preset data filtering rule chain corresponds to a data processing cluster.
2. The method according to claim 1, characterized in that: Before obtaining the preset configuration information, the method further includes: Create project groupings in the rule management system; Under the project grouping, multiple data filtering rules are added based on business requirements, wherein each data filtering rule corresponds to a service node; The multiple data filtering rules are connected in a preset order to form the preset data filtering rule chain.
3. The method according to claim 2, characterized in that After the plurality of data filtering rules are connected in a preset order to form the preset data filtering rule chain, the method further includes: Configure the preset data filtering rule chain identifier, the rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, the input subject and the output subject corresponding to each data filtering rule, and obtain the preset configuration information of the preset data filtering rule chain; The preset configuration information is stored in the rule topic.
4. The method according to claim 3, characterized in that After storing the preset configuration information in the rule topic, the method further includes: Based on a preset deployment method, a data processing cluster corresponding to each data filtering rule is deployed at a service node corresponding to each data filtering rule, wherein a plurality of data processing services in each data processing cluster are used to run the data filtering rules at the corresponding node.
5. The method according to claim 1, characterized in that When the input data is filtered using the multiple data filtering rules in the preset data filtering rule chain, the method further includes: Based on a preset monitoring service, real-time monitoring is performed to determine whether there is an anomaly when filtering the input data using the multiple data filtering rules; If abnormal, determining the cause of the filtering abnormality, wherein the cause of the filtering abnormality includes a data processing service failure in the data processing cluster corresponding to the data filtering rule; The anomaly is repaired based on the cause of the filtering anomaly.
6. The method according to claim 1, characterized in that When the input data is filtered using the multiple data filtering rules in the preset data filtering rule chain, the method further includes: When each data filtering rule in the preset data filtering rule chain filters the input data, determining the amount of the input data; Determining whether it is necessary to adjust the number of data processing services in the data processing cluster corresponding to each data filtering rule based on the number of input data; If necessary, the number of data processing services in the data processing cluster corresponding to each data filtering rule is adjusted.
7. The method according to claim 1, characterized in that Filtering the input data using a plurality of data filtering rules in the preset data filtering rule chain includes: Obtaining a filtering result after filtering the input data using each data filtering rule, wherein each data filtering rule includes a preset result; Determine whether the filtering result meets the preset result in the corresponding data filtering rule; If it is in compliance, the filtering result is output to the output topic of the corresponding data filtering rule; If not, the filtering result is discarded.
8. A data filtering device, characterized in that: The device comprises: An information acquisition unit, used to acquire preset configuration information, wherein the preset configuration information includes a preset data filtering rule chain identifier, a rule identifier corresponding to each data filtering rule in the preset data filtering rule chain, and an input topic and an output topic corresponding to each data filtering rule; A data acquisition unit, configured to acquire input data based on the preset configuration information acquired by the information acquisition unit; The data filtering unit is used to filter the input data acquired by the data acquisition unit using multiple data filtering rules in the preset data filtering rule chain to obtain filtered target data, and each data filtering rule in the preset data filtering rule chain corresponds to a data processing cluster.
9. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the data filtering method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: At least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; The processor is used to call the program instructions in the memory to execute the data filtering method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Rule engine system based on Actor model and method thereof
CN110941420A
Data processing method and device and electronic equipment
CN112559808A
Data filtering method and device, storage medium and electronic equipment
CN112685611A
Service load balancing processing method and device and cloud server
CN113094182A
Data processing method and device, computer equipment and computer readable storage medium
CN116048788A
