WO2024113705A1 - 一种kafka消息数据的下发方法及相关装置 - Google Patents
一种kafka消息数据的下发方法及相关装置 Download PDFInfo
- Publication number
- WO2024113705A1 WO2024113705A1 PCT/CN2023/095599 CN2023095599W WO2024113705A1 WO 2024113705 A1 WO2024113705 A1 WO 2024113705A1 CN 2023095599 W CN2023095599 W CN 2023095599W WO 2024113705 A1 WO2024113705 A1 WO 2024113705A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- partition
- classification
- classification label
- sending
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/278—Data partitioning, e.g. horizontal or vertical partitioning
Definitions
- the present application relates to the field of computer technology, and in particular to a method for sending Kafka message data; it also relates to a device, equipment, computer non-volatile readable storage medium and Kafka message integration service system for sending Kafka message data.
- Kafka is a distributed stream processing platform, which has two main categories of applications: 1. Constructing real-time streaming data pipelines, which can reliably obtain data between systems or applications (equivalent to message queues); 2. Building real-time streaming applications to transform or affect streaming data.
- First application when the business system uses Kafka as a message system middleware, traditional technical solutions usually classify, store and consume according to topics to complete data distribution, which has the following defects:
- the data under the topic is not reclassified, which is not friendly to consumers who only want some types of data under a certain topic.
- the data producer cannot proactively and more meticulously classify and store the data and control the type of data consumed by the consumer.
- the purpose of this application is to provide a method for sending Kafka message data, which can achieve more detailed classified storage and actively control the type of data consumed by the data consumer.
- Another purpose of this application is to provide a device, equipment, computer non-volatile readable storage medium and Kafka message integration service system for sending Kafka message data, all of which have the above technical effects.
- the present application provides a method for sending Kafka message data, including:
- the data consumer interface is called back to send the data in the corresponding partition to the data consumer.
- classification labels identified by the classification label identification tool include:
- a category label recognition tool is configured to recognize a category label.
- determining the correspondence between the data consumer interface and the partition includes:
- a correspondence between the data consumer interface and the partition is determined.
- binding the classification label identification tool to the data consumer interface to obtain the first corresponding relationship includes:
- the classification label recognition tool and the data consumer interface are bound in the database or configuration file to obtain a first corresponding relationship.
- the classification label recognition tool is bound to the partition to obtain the second corresponding relationship including:
- the classification label recognition tool and the partition are bound in the database or configuration file to obtain a second corresponding relationship.
- the classification label recognition tool is bound to the partition to obtain the second corresponding relationship including:
- the classification label recognition tool After storing the data in the partition corresponding to the type, the classification label recognition tool is bound to the partition to obtain the second corresponding relationship.
- storing data in a partition includes:
- the recognition failure rate of the classification recognition tool is calculated by recording the number of times the classification recognition tool succeeds and fails in recognizing the classification label.
- a classification label correction prompt will be sent to the data producer.
- the present application also provides a device for sending Kafka message data, including:
- a receiving module configured to receive data and data classification labels sent by a data producer
- An identification module is configured to identify the classification label through a classification label identification tool to determine the type of data
- a storage module is configured to store data in a partition corresponding to the type
- the sending module is configured to call back the data consumer interface to send the data in the corresponding partition to the data consumer according to the corresponding relationship between the data consumer interface and the partition.
- the present application also provides a device for sending Kafka message data, including:
- a memory arranged to store a computer program
- a processor is configured to implement the steps of any of the above methods for sending Kafka message data when executing a computer program.
- the present application also provides a computer non-volatile readable storage medium, on which a computer program is stored.
- a computer program is stored on which a computer program is stored.
- the steps of the method for sending Kafka message data as described in any of the above items are implemented.
- the present application also provides a Kafka message integration service system, including:
- the service provider is configured to receive the data and classification labels sent by the data producer; identify the classification labels through the classification label identification tool to determine the data type; store the data in the partition corresponding to the type; and based on the correspondence between the data consumer interface and the partition, call back the data consumer interface to send the data in the corresponding partition to the data consumer.
- the method for sending Kafka message data includes: receiving data and classification labels sent by a data producer; identifying classification labels through a classification label identification tool to determine the type of data; storing the data in a partition corresponding to the type; and, based on the correspondence between a data consumer interface and the partition, calling back the data consumer interface to send the data in the corresponding partition to the data consumer.
- the method for sending Kafka message data is that the data producer performs Classify and set classification labels for them, then send the data and the corresponding classification labels to the service provider.
- the service provider uses the classification label identification tool to identify the classification labels of the data and stores the data in the corresponding partitions. Finally, the service provider sends the data based on the correspondence between the data consumer interface and the partition. In this way, more detailed classification storage can be achieved on the basis of topic classification, which can avoid the waste of topic resources when the Kafka message integration service system only classifies data by topic.
- the data producer does not need to apply for the topic again for the new data type, and the data producer can actively control the data type consumed by the data consumer.
- a new data consumer needs to consume the data type specified by the producer, it only needs to configure the corresponding relationship to achieve the access of the consumer, which is efficient and convenient.
- Kafka message data sending device, equipment, computer non-volatile readable storage medium and Kafka message integration service system provided in this application all have the above-mentioned technical effects.
- FIG1 is a flow chart of a method for sending Kafka message data provided in an embodiment of the present application
- FIG2 is a schematic diagram of a Kafka message integration service system provided in an embodiment of the present application.
- FIG3 is a schematic diagram of data classification, identification, storage and delivery provided by an embodiment of the present application.
- FIG4 is a schematic diagram of a device for sending Kafka message data provided in an embodiment of the present application.
- FIG5 is a schematic diagram of a device for sending Kafka message data provided in an embodiment of the present application.
- the core of this application is to provide a method for sending Kafka message data, which can achieve more detailed classified storage based on topic classification, and can actively control the type of data consumed by the data consumer.
- Another core of this application is to provide a device, equipment and computer non-volatile readable storage medium for sending Kafka message data, all of which have the above technical effects.
- FIG. 1 is a schematic diagram of a process of sending Kafka message data provided in an embodiment of the present application.
- the method includes:
- S101 receiving data and data classification labels sent by a data producer
- the execution subject of the method for sending Kafka message data provided in this embodiment is the service party in the Kafka message integration service system.
- the Kafka message integration service system can be referred to as shown in Figure 2, including a data producer, a service party and a data consumer.
- the data producer classifies the data under the topic and generates a classification label. It should be noted that, unlike the data classification based on topci, the data producer in this embodiment does not classify data according to topic, but classifies the data under the topic according to business type, data consumer type, etc.
- classification label of a certain type of data under a certain topic is: "#Gender#Age#school#”.
- the data generator calls the service provider's interface and sends the data and classification labels to the service provider.
- the classification method of data under a topic can be set differently.
- the data under a topic can be classified according to the business type, such as gender, age, weight, etc.
- the data under a topic can be classified according to the type of data consumer.
- S102 Identify the classification label by using a classification label identification tool to determine the type of data
- Classification label identification tools can correspond to data types one by one, and one classification label identification tool can be used to identify one type of classification label.
- the service provider sets up multiple classification label identification tools that can identify any type of classification label issued by the data producer. Every time the data producer adds a new classification label, the service provider will correspondingly add a classification label identification tool that can identify the newly added classification label.
- identifying the category label by the category label identification tool includes:
- the classification label recognition tool is a regular expression.
- Regular expressions correspond to data types one by one.
- One regular expression corresponds to one type of data, and one regular expression is used to identify one type of classification label.
- the service provider sets multiple regular expressions to identify any type of classification label issued by the data producer.
- classification label recognition tool may also be other forms of recognition tools that can ensure accurate recognition of various classification labels.
- the partition is used to store a certain type of data.
- the service provider identifies the classification label through the classification label identification tool, determines the type of data, and then stores the data in the partition used to store data of this type.
- the service side uses the regular expression " ⁇ #male#.*" to identify data of the gender type "male". After invoking the producer client, the data of the gender type "male” is stored in the corresponding partition.
- storing the data in the partition includes:
- the partition is used to store a specific type of data under a specific topic.
- partition 1 and partition 2 are both used to store data under topic 1
- partition 1 is used to store data of service consumer A under topic 1
- partition 2 is used to store data of service consumer B.
- Each data consumer has its own data consumer interface.
- the same data consumer can correspond to one or more data consumer interfaces.
- the same data consumer interface can correspond to one or more data consumers.
- the service sends data to the data consumer, it calls up the consumer client, determines the partition where the data to be sent is located based on the data consumer interface and the correspondence between the data consumer interface and the partition, then pulls the data from the partition, calls back the data consumer interface, and sends the data to the data consumer.
- the premise of calling back the data consumer interface to send the data in the corresponding partition to the data consumer is that there is a correspondence between the data consumer interface and the partition. Therefore, in some embodiments, according to the correspondence between the data consumer interface and the partition, before sending the data in the corresponding partition to the data consumer through the data consumer interface, the following is also included:
- Determining the correspondence between the data consumer interface and the partition may include:
- a correspondence between the data consumer interface and the partition is determined.
- This embodiment indirectly obtains the correspondence between the data consumer interface and the partition based on the correspondence between the classification label identification tool and the data consumer interface and the correspondence between the classification label identification tool and the partition.
- the following further includes:
- binding the classification label identification tool and the data consumer interface to obtain the first corresponding relationship includes:
- the classification label recognition tool and the data consumer interface are bound in the database or configuration file to obtain a first corresponding relationship.
- the service provider configures the classification label identification tool and the data consumer interface into the service provider's database or configuration file for binding to obtain a first corresponding relationship between the two.
- the same classification label identification tool can have multiple first correspondences, that is, the same classification label identification tool can be bound to multiple data consumer interfaces respectively.
- Each classification label identification tool represents a type of data, and each first correspondence represents a business consumption type.
- the following further includes:
- the classification label recognition tool and the partition are bound in the database or configuration file to obtain a second corresponding relationship.
- Each classification label identification tool may have a unique second correspondence, that is, a classification label identification tool is bound to a partition.
- Each classification label identification tool represents a type of data, and each second correspondence represents that a type of data is stored in a specific partition.
- the type of data stored in each partition can be specified before the data is stored in the partition, or after a certain type of data is first stored in the partition.
- the classification label recognition tool used to identify a certain type of data can be bound to the partition used to store the data.
- the classification label recognition tool used to identify such data can be bound to the partition that stores such data.
- binding the classification label identification tool and the partition to obtain the second corresponding relationship includes:
- the classification label recognition tool After storing the data in the partition corresponding to the type, the classification label recognition tool is bound to the partition to obtain the second corresponding relationship.
- the following further includes:
- the classification label recognition tool is updated accordingly to ensure that the service provider can recognize all classification labels issued by the data producer. Every time the data producer adds a new classification label, the service provider adds a regular expression that can recognize the newly added classification label.
- the following further includes:
- the recognition failure rate of the classification recognition tool is calculated by recording the number of times the classification recognition tool succeeds and fails in recognizing the classification label.
- a classification label correction prompt will be sent to the data producer.
- the reason why the recognition failure rate of the classification recognition tool reaches the preset threshold may be due to the classification recognition tool itself. Therefore, when the recognition failure rate of the classification recognition tool reaches the preset threshold, the classification recognition tool can be prompted to be corrected to obtain a high recognition success rate. In addition, the reason why the recognition failure rate of the classification recognition tool reaches the preset threshold may be that there are errors in the classification labels. Therefore, when the recognition failure rate of the classification recognition tool reaches the preset threshold, a classification label correction prompt can be sent to the data producer to enable the data producer to correct the classification label and obtain accurate classification labels that can be recognized by the classification recognition tool.
- the data producer classifies the data under the topic into four categories: A, B, C, and D.
- Data a is category A data, and a category A label is added to data a.
- Data b is category B data, and a category C label is added to data c.
- Data d is category D data, and a category D label is added to data d.
- the service provider After receiving the data d and the D-type label sent by the data producer, the service provider uses the regular expression regular4 to identify the data d as D-type data and stores the data d in partition partition4.
- the data consumer interface URL (Uniform Resource Locator) 4 corresponds to partition partition4, pulls data from partition partition4, calls back the data consumer interface URL4, and sends the pulled data to the corresponding data consumer.
- the method for sending Kafka message data provided by the present application is that the data producer classifies the data under the topic and sets classification labels for it, and then sends the data and the corresponding classification labels to the service provider.
- the service provider uses the classification label identification tool to identify the classification labels of the data and stores the data in the corresponding partitions. Finally, the service provider sends the data according to the correspondence between the data consumer interface and the partition. In this way, more detailed classification storage can be achieved on the basis of topic classification, and the waste of topic resources when the Kafka message integration service system only classifies data by topic can be avoided.
- the data producer does not need to apply for the topic again for adding a new data type, and the data producer can actively control the data type consumed by the data consumer.
- a new data consumer needs to consume the data type specified by the producer, it only needs to configure the corresponding relationship to achieve the access of the consumer, which is efficient and convenient.
- the present application also provides a device for sending Kafka message data, and the device described below can correspond to the method described above.
- Figure 4 is a schematic diagram of a device for sending Kafka message data provided by an embodiment of the present application. As shown in Figure 4, the device includes:
- the receiving module 10 is configured to receive data and data classification labels sent by a data producer
- the identification module 20 is configured to identify the classification label through a classification label identification tool to determine the type of data
- the storage module 30 is configured to store data in a partition corresponding to the type
- the sending module 40 is configured to call back the data consumer interface to send the data in the corresponding partition to the data consumer according to the corresponding relationship between the data consumer interface and the partition.
- the identification module 20 is configured as follows:
- a classification label recognition tool is used to recognize a type of classification label.
- the corresponding relationship determination module is configured to determine the corresponding relationship between the data consumer interface and the partition.
- the corresponding relationship determination module is configured to:
- a correspondence between the data consumer interface and the partition is determined.
- the first binding module is configured to bind the classification label identification tool and the data consumer interface to obtain a first corresponding relationship.
- the first binding module is configured as follows:
- the classification label recognition tool and the data consumer interface are bound in the database or configuration file to obtain a first corresponding relationship.
- the second binding module is configured to bind the classification label identification tool and the partition to obtain a second corresponding relationship.
- the second binding module is configured as follows:
- the classification label recognition tool and the partition are bound in the database or configuration file to obtain a second corresponding relationship.
- the second binding module is configured as follows:
- the classification label recognition tool After storing the data in the partition corresponding to the type, the classification label recognition tool is bound to the partition to obtain the second corresponding relationship.
- the storage module 3 is configured as:
- the update module is configured to update the classification label recognition tool.
- the recording module is configured to record the number of times the classification recognition tool succeeds and fails in recognizing classification labels.
- the calculation module is configured to calculate the recognition failure rate of the classification recognition tool based on the number of times the classification recognition tool successfully and failed to recognize the classification label.
- a judgment module is configured to judge whether the recognition failure rate of the classification recognition tool reaches a preset threshold
- the prompt module is configured to prompt the classification recognition tool to be corrected if the recognition failure rate of the classification recognition tool reaches a preset threshold.
- the sending module is configured to send a classification label correction prompt to the data producer if the recognition failure rate of the classification recognition tool reaches a preset threshold.
- the Kafka message data sending device provided in the present application is that the data producer classifies the data under the topic and sets classification labels for it, and then sends the data and the corresponding classification labels to the service provider.
- the service provider uses the classification label identification tool to identify the classification labels of the data and stores the data in the corresponding partitions. Finally, the service provider sends the data according to the correspondence between the data consumer interface and the partition. In this way, more detailed classification storage can be achieved on the basis of topic classification, which can avoid the waste of topic resources when the Kafka message integration service system only classifies data by topic.
- the data producer does not need to apply for the topic again for adding a new data type, and the data producer can actively control the data type consumed by the data consumer.
- a new data consumer needs to consume the data type specified by the producer, it only needs to configure the corresponding relationship to achieve the access of the consumer, which is efficient and convenient.
- the present application also provides a device for sending Kafka message data. As shown in FIG5 , the device includes a memory 1 and a processor 2.
- a memory 1 configured to store a computer program
- Processor 2 is configured to execute a computer program to implement the following steps:
- the Kafka message data sending device provided in this application is that the data producer classifies the data under the topic and sets classification labels for it, and then sends the data and the corresponding classification labels to the service provider.
- the service provider uses the classification label identification tool to identify the classification labels of the data and stores the data in the corresponding partitions. Finally, the service provider sends the data according to the correspondence between the data consumer interface and the partition. In this way, more detailed classification storage can be achieved on the basis of topic classification, which can avoid the waste of topic resources when the Kafka message integration service system only classifies data by topic.
- the data producer does not need to apply for the topic again for the new data type, and the data producer can actively control the data type consumed by the data consumer.
- a new data consumer needs to consume the data type specified by the producer, it only needs to configure the corresponding relationship to achieve the access of the consumer, which is efficient and convenient.
- the present application also provides a computer non-volatile readable storage medium, on which a computer program is stored.
- a computer program is stored on which a computer program is stored.
- the computer non-volatile readable storage medium may include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.
- the data producer classifies the data under the topic and sets classification labels for it, and then sends the data and the corresponding classification labels to the service provider, the service provider uses the classification label identification tool to identify the classification labels of the data, and stores the data in the corresponding partitions, and finally the service provider sends the data according to the correspondence between the data consumer interface and the partition.
- the service provider uses the classification label identification tool to identify the classification labels of the data, and stores the data in the corresponding partitions, and finally the service provider sends the data according to the correspondence between the data consumer interface and the partition.
- the data producer does not need to apply for the topic again for adding a new data type, and the data producer can actively control the data type consumed by the data consumer.
- a new data consumer needs to consume the data type specified by the producer, it only needs to configure the corresponding relationship to achieve the access of the consumer, which is efficient and convenient.
- the present application also provides a Kafka message integration service system, including:
- the service provider is configured to receive the data and classification labels sent by the data producer; identify the classification labels through the classification label identification tool to determine the data type; store the data in the partition corresponding to the type; and based on the correspondence between the data consumer interface and the partition, call back the data consumer interface to send the data in the corresponding partition to the data consumer.
- the service provider is configured as:
- a classification label recognition tool is configured to recognize a type of classification label.
- the service provider is further configured as follows:
- the service provider is configured as:
- a correspondence between the data consumer interface and the partition is determined.
- the service provider is further configured as follows:
- the service provider is configured as:
- the classification label recognition tool and the data consumer interface are bound in the database or configuration file to obtain a first corresponding relationship.
- the service provider is further configured as follows:
- the service provider is configured as:
- the classification label recognition tool and the partition are bound in the database or configuration file to obtain a second corresponding relationship.
- the service provider is configured as:
- the classification label recognition tool After storing the data in the partition corresponding to the type, the classification label recognition tool is bound to the partition to obtain the second corresponding relationship.
- the service provider is configured as:
- the service provider is further configured as follows:
- the service provider is further configured as follows:
- the service provider is further configured as follows:
- the recognition failure rate of the classification recognition tool is calculated by recording the number of times the classification recognition tool succeeds and fails in recognizing the classification label.
- the service provider is further configured as follows:
- the service side is further configured as:
- a classification label correction prompt will be sent to the data producer.
- the Kafka message integration service system provided in this application, the data producer classifies the data under the topic and Set classification labels, and then send the data and the corresponding classification labels to the service provider.
- the service provider uses the classification label identification tool to identify the classification labels of the data and stores the data in the corresponding partitions. Finally, the service provider sends the data based on the correspondence between the data consumer interface and the partition. In this way, more detailed classification storage can be achieved on the basis of topic classification, which can avoid the waste of topic resources when the Kafka message integration service system only classifies data by topic.
- the data producer does not need to apply for the topic again for the new data type, and the data producer can actively control the data type consumed by the data consumer.
- a new data consumer needs to consume the data type specified by the producer, it only needs to configure the corresponding relationship to achieve the access of the consumer, which is efficient and convenient.
- the steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two.
- the software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请公开了一种kafka消息数据的下发方法,涉及计算机技术领域,包括:接收数据生产方下发的数据与数据的分类标签;通过分类标签识别工具识别分类标签,确定数据的类型;将数据存储到类型对应的分区中;根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。该方法能够实现更加细致的分类存储,能够由数据生产方主动控制数据消费方所消费的数据类型,并且当有新的数据消费方需要消费生产方指定数据类型时,只需配置对应关系即可实现消费方的接入,高效便捷。本申请还公开了一种kafka消息数据的下发装置、设备、计算机非易失性可读存储介质以及kafka消息集成服务系统,均具有上述技术效果。
Description
相关申请的交叉引用
本申请要求于2022年11月30日提交中国专利局,申请号为202211518302.9,申请名称为“一种kafka消息数据的下发方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机技术领域,特别涉及一种kafka消息数据的下发方法;还涉及一种kafka消息数据的下发装置、设备、计算机非易失性可读存储介质以及kafka消息集成服务系统。
kafka是一个分布式流处理平台,其主要有两大类别的应用:1、构造实时流数据管道,它可以在系统或应用之间可靠地获取数据(相当于消息队列);2、构建实时流式应用程序,对流数据进行转换或者影响。针对第一种应用,在业务系统将kafka作为消息系统中间件进行使用时的场景下,传统技术方案通常根据topic(主题)进行分类、存储和消费,完成数据下发,存在以下缺陷:
1、不对topic下的数据进行再次分类,对于只想要某个topic下的部分类型数据的消费方而言不友好。
2、很多kafka消息系统往往对topic有数量上的限制,仅用topic将数据进行分类,无疑是对topic资源的一种浪费。
3、数据生产方在不接入生产者客户端的情况下,无法主动更加细致地对数据进行分类存储和控制消费方所消费的数据类型。
因此,如何解决上述技术缺陷已成为本领域技术人员亟待解决的技术问题。
发明内容
本申请的目的是提供一种kafka消息数据的下发方法,能够实现更加细致的分类存储,并且能够主动控制数据消费方所消费的数据类型。本申请的另一个目的是提供一种kafka消息数据的下发装置、设备、计算机非易失性可读存储介质以及kafka消息集成服务系统,均具有上述技术效果。
为解决上述技术问题,本申请提供了一种kafka消息数据的下发方法,包括:
接收数据生产方下发的数据与数据的分类标签;
通过分类标签识别工具识别分类标签,确定数据的类型;
将数据存储到类型对应的分区中;
根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
可选的,通过分类标签识别工具识别分类标签包括:
通过正则表达式识别分类标签。
可选的,一种分类标签识别工具被设置为识别一类分类标签。
可选的,根据数据消费方接口与分区的对应关系,通过数据消费方接口将对应的分区中的数据下发到数据消费方前还包括:
确定数据消费方接口与分区的对应关系。
可选的,确定数据消费方接口与分区的对应关系包括:
根据分类标签识别工具与数据消费方接口的第一对应关系以及分类标签识别工具与分区的第二对应关系,确定数据消费方接口与分区的对应关系。
可选的,还包括:
绑定分类标签识别工具与数据消费方接口,得到第一对应关系。
可选的,绑定分类标签识别工具与数据消费方接口,得到第一对应关系包括:
在数据库或配置文件中绑定分类标签识别工具与数据消费方接口,得到第一对应关系。
可选的,还包括:
绑定分类标签识别工具与分区,得到第二对应关系。
可选的,绑定分类标签识别工具与分区,得到第二对应关系包括:
在数据库或配置文件中绑定分类标签识别工具与分区,得到第二对应关系。
可选的,绑定分类标签识别工具与分区,得到第二对应关系包括:
将数据存储到类型对应的分区后,绑定分类标签识别工具与分区,得到第二对应关系。
可选的,将数据存储到分区中包括:
将数据存储到类型对应的且为数据所属的topic对应的分区中。
可选的,还包括:
更新分类标签识别工具。
可选的,还包括:
记录分类识别工具识别分类标签成功与失败的次数。
可选的,还包括:
根据记录分类识别工具识别分类标签成功与失败的次数,计算分类识别工具的识别失败率。
可选的,还包括:
判断分类识别工具的识别失败率是否达到预设阈值;
若分类识别工具的识别失败率达到预设阈值,则提示修正分类识别工具。
可选的,还包括:
若分类识别工具的识别失败率达到预设阈值,则向数据生产方发送分类标签修正提示。
为解决上述技术问题,本申请还提供了一种kafka消息数据的下发装置,包括:
接收模块,被设置为接收数据生产方下发的数据与数据的分类标签;
识别模块,被设置为通过分类标签识别工具识别分类标签,确定数据的类型;
存储模块,被设置为将数据存储到类型对应的分区中;
下发模块,被设置为根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
为解决上述技术问题,本申请还提供了一种kafka消息数据的下发设备,包括:
存储器,被设置为存储计算机程序;
处理器,被设置为执行计算机程序时实现如上任一项的kafka消息数据的下发方法的步骤。
为解决上述技术问题,本申请还提供了一种计算机非易失性可读存储介质,计算机非易失性可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上任一项的kafka消息数据的下发方法的步骤。
为解决上述技术问题,本申请还提供了一种kafka消息集成服务系统,包括:
数据生产方、服务方以及数据消费方;
服务方,被设置为接收数据生产方下发的数据与数据的分类标签;通过分类标签识别工具识别分类标签,确定数据的类型;将数据存储到类型对应的分区中;根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
本申请所提供的kafka消息数据的下发方法,包括:接收数据生产方下发的数据与数据的分类标签;通过分类标签识别工具识别分类标签,确定数据的类型;将数据存储到类型对应的分区中;根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
可见,本申请所提供的kafka消息数据的下发方法,数据生产方对topic下的数据进行
分类并为其设置分类标签,然后将数据以及对应的分类标签下发给服务方,服务方使用分类标签识别工具识别数据的分类标签,并将数据存储到相应的分区,最后服务方依据数据消费方接口与分区的对应关系进行数据下发,这样可以在通过topic分类的基础之上,实现更加细致分类存储,可以避免kafka消息集成服务系统仅通过topic对数据进行分类时对topic资源的浪费,数据生产方新增数据类型不必再次申请topic,并且数据生产方能够主动控制数据消费方所消费的数据类型,另外当有新的数据消费方需要消费生产方指定数据类型时,只需配置对应关系即可实现消费方的接入,高效便捷。
本申请所提供的kafka消息数据的下发装置、设备、计算机非易失性可读存储介质以及kafka消息集成服务系统均具有上述技术效果。
为了更清楚地说明本申请实施例中的技术方案,下面将对现有技术和实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例所提供的一种kafka消息数据的下发方法的流程示意图;
图2为本申请实施例所提供的一种kafka消息集成服务系统的示意图;
图3为本申请实施例所提供的一种数据分类识别存储下发示意图;
图4为本申请实施例所提供的一种kafka消息数据的下发装置的示意图;
图5为本申请实施例所提供的一种kafka消息数据的下发设备的示意图。
本申请的核心是提供一种kafka消息数据的下发方法,能够在通过topic分类的基础之上,实现更加细致的分类存储,并且能够主动控制数据消费方所消费的数据类型。本申请的另一个核心是提供一种kafka消息数据的下发装置、设备以及计算机非易失性可读存储介质,均具有上述技术效果。
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参考图1,图1为本申请实施例所提供的一种kafka消息数据的下发方法的流程示意
图,参考图1所示,该方法包括:
S101:接收数据生产方下发的数据与数据的分类标签;
本实施例所提供的kafka消息数据的下发方法的执行主体为kafka消息集成服务系统中的服务方。kafka消息集成服务系统可参考图2所示,包括数据生产方、服务方以及数据消费方。数据生产方对topic下的数据进行分类,生成分类标签。需要说明的是,区别于根据topci进行数据分类,本实施例中数据生产方进行数据分类不是根据topic进行数据分类,而是对topic下的数据根据业务类型、数据消费方类型等所进行的分类。
例如,某个topic下的某类数据的分类标签为:“#Gender#Age#school#”。
数据生成方调用服务方接口,将数据与分类标签下发到服务方。
例如,将“#male#18#CentralSouthUniversity#”下发到服务方。
对于topic下的数据的分类方式可以进行差异性设置。例如,可以根据业务类型对topic下的数据进行分类,例如,根据性别、年龄、体重等进行分类。可以根据数据消费方类型对topic下的数据进行分类。
S102:通过分类标签识别工具识别分类标签,确定数据的类型;
分类标签识别工具与数据类型可一一对应,一个分类标签识别工具可用于识别一类分类标签。服务方设置多个分类标签识别工具,能够识别数据生产方下发的任意一种类型的分类标签。数据生产方每新增一种分类标签,服务方对应的增加能够识别此新增的分类标签的分类标签识别工具。
在一些实施例中,通过分类标签识别工具识别分类标签包括:
通过正则表达式识别分类标签。
本实施例中分类标签识别工具为正则表达式。
例如,正则表达式为“^#male#.*”,能够识别所有性别为“male”类型的数据。
正则表达式与数据类型一一对应,一个正则表达式对应一类数据,一个正则表达式用于识别一类分类标签。服务方设置多个正则表达式,能够识别数据生产方下发的任意一种类型的分类标签。
除了正则表达式外,分类标签识别工具还可以为其他形式的识别工具,能够确保准确识别出各种分类标签即可。
S103:将数据存储到类型对应的分区中;
本实施例中分区用于存储特定的某种类型的数据。服务方通过分类标签识别工具识别分类标签,确定数据的类型后,将数据存储到用于存储该种类型的数据的分区中。
例如,服务方通过正则表达式“^#male#.*”识别出性别为“male”类型的数据。唤起生产者客户端后,将性别为“male”类型的数据存储到对应的分区中。
其中,在一些实施例中,将数据存储到分区中包括:
将数据存储到类型对应的且为数据所属的topic对应的分区中。
本实施例中,分区用于存储特定的topic下的特定的某种类型的数据。例如,分区1与分区2均用于存储topic1下的数据,且分区1用于存储topic1下的业务消费方A的数据,分区2用于存储业务消费方B的数据。
S104:根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
每个数据消费方有自身的数据消费方接口。同一个数据消费方可以对应一个或多个数据消费方接口。同一个数据消费方接口可以对应一个或多个数据消费方。服务方向数据消费方下发数据时,唤起消费客户端,根据数据消费方接口,以及数据消费方接口与分区的对应关系,确定出要下发的数据所在的分区,然后从该分区中拉取数据,并回调数据消费方接口,将数据下发到数据消费方。
根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方的前提是存在数据消费方接口与分区的对应关系,因此,在一些实施例中,根据数据消费方接口与分区的对应关系,通过数据消费方接口将对应的分区中的数据下发到数据消费方前还包括:
确定数据消费方接口与分区的对应关系。
其中,确定数据消费方接口与分区的对应关系可以包括:
根据分类标签识别工具与数据消费方接口的第一对应关系以及分类标签识别工具与分区的第二对应关系,确定数据消费方接口与分区的对应关系。
本实施例根据分类标签识别工具与数据消费方接口的对应关系,分类标签识别工具与分区的对应关系,间接得到数据消费方接口与分区的对应关系。
在上述实施例的基础上,在一些实施例中,还包括:
绑定分类标签识别工具与数据消费方接口,得到第一对应关系。
其中,绑定分类标签识别工具与数据消费方接口,得到第一对应关系包括:
在数据库或配置文件中绑定分类标签识别工具与数据消费方接口,得到第一对应关系。
服务方将分类标签识别工具与数据消费方接口配置到服务方的数据库或配置文件中进行绑定,得到二者之间的第一对应关系。
同一个分类标签识别工具可以具有多个第一对应关系,即同一个分类标签识别工具可以分别与多个数据消费方接口绑定。每一个分类标签识别工具代表一类数据,每一个第一对应关系代表一种业务消费类型。
在上述实施例的基础上,在一些实施例中,还包括:
绑定分类标签识别工具与分区,得到第二对应关系。
其中,绑定分类标签识别工具与分区,得到第二对应关系包括:
在数据库或配置文件中绑定分类标签识别工具与分区,得到第二对应关系。
每个分类标签识别工具可以具有唯一的第二对应关系,即一个分类标签识别工具与一个分区绑定。每一个分类标签识别工具代表一类数据,每一个第二对应关系代表一种类型的数据存储在一个特定的分区中。
每一个分区中存储的数据的类型可以在数据存储到分区之前指定,也可以在某种类型的数据首次存储到分区之后指定。也就是说,可以在数据存储到分区之前,将用于识别某类数据的分类标签识别工具与用于存储该类数据的分区进行绑定。也可以在数据存储到分区之后,将用于识别此类数据的分类标签识别工具与存储了此类数据的分区进行绑定。
在一种可选的实施方式中,绑定分类标签识别工具与分区,得到第二对应关系包括:
将数据存储到类型对应的分区后,绑定分类标签识别工具与分区,得到第二对应关系。
在上述实施例的基础上,在一些实施例中,还包括:
更新分类标签识别工具。
当topic下的数据的分类方式改变,所生成的分类标签发生变化时,相应的进行分类标签识别工具的更新,确保服务方能够识别出数据生产方下发的所有的分类标签。数据生产方每新增一种分类标签,服务方对应的增加能够识别此新增的分类标签的正则表达式。
在上述实施例的基础上,在一些实施例中,还包括:
记录分类识别工具识别分类标签成功与失败的次数。
根据记录分类识别工具识别分类标签成功与失败的次数,计算分类识别工具的识别失败率。
判断分类识别工具的识别失败率是否达到预设阈值;
若分类识别工具的识别失败率达到预设阈值,则提示修正分类识别工具。
若分类识别工具的识别失败率达到预设阈值,则向数据生产方发送分类标签修正提示。
分类识别工具的识别失败率达到预设阈值的原因可能是分类识别工具自身,因此,当分类识别工具的识别失败率达到预设阈值时,可以提示修正分类识别工具,以得到高识别成功
率的分类识别工具,确保能够准确识别分类标签。另外,分类识别工具的识别失败率达到预设阈值的原因可能是分类标签存在错误,因此,当分类识别工具的识别失败率达到预设阈值时,可以向数据生产方发送分类标签修正提示,以使数据生产方进行分类标签的修正,得到准确的可以被分类识别工具识别出的分类标签。
参考图3所示,以下通过一个示例阐述一种可选的分类、识别、存储以及下发流程:
数据生产方对topic下的数据进行分类,得到A、B、C、D四类,数据a为A类数据,为数据a添加上A类标签,数据b为B类数据,为数据c添加上C类标签,数据d为D类数据,为数据d添加上D类标签。
服务方接收到数据生产方下发的数据d与D类标签后,通过正则表达式regular4进行识别,得出数据d为D类数据,将数据d存储到分区partition4。
数据消费方接口URL(Uniform Resource Locator,统一资源定位器)4与分区partition4相对应,从分区partition4拉取数据,回调数据消费方接口URL4,将所拉取的数据下发给对应的数据消费方。
综上所述,本申请所提供的kafka消息数据的下发方法,数据生产方对topic下的数据进行分类并为其设置分类标签,然后将数据以及对应的分类标签下发给服务方,服务方使用分类标签识别工具识别数据的分类标签,并将数据存储到相应的分区,最后服务方依据数据消费方接口与分区的对应关系进行数据下发,这样可以在通过topic分类的基础之上,实现更加细致分类存储,可以避免kafka消息集成服务系统仅通过topic对数据进行分类时对topic资源的浪费,数据生产方新增数据类型不必再次申请topic,并且数据生产方能够主动控制数据消费方所消费的数据类型,另外当有新的数据消费方需要消费生产方指定数据类型时,只需配置对应关系即可实现消费方的接入,高效便捷。
本申请还提供了一种kafka消息数据的下发装置,下文描述的该装置可以与上文描述的方法相互对应参照。请参考图4,图4为本申请实施例所提供的一种kafka消息数据的下发装置的示意图,结合图4所示,该装置包括:
接收模块10,被设置为接收数据生产方下发的数据与数据的分类标签;
识别模块20,被设置为通过分类标签识别工具识别分类标签,确定数据的类型;
存储模块30,被设置为将数据存储到类型对应的分区中;
下发模块40,被设置为根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
在上述实施例的基础上,作为一种可选的实施方式,识别模块20被设置为:
通过正则表达式识别分类标签。
在上述实施例的基础上,作为一种可选的实施方式,一种分类标签识别工具用于识别一类分类标签。
在上述实施例的基础上,作为一种可选的实施方式,还包括:
对应关系确定模块,被设置为确定数据消费方接口与分区的对应关系。
在上述实施例的基础上,作为一种可选的实施方式,对应关系确定模块被设置为:
根据分类标签识别工具与数据消费方接口的第一对应关系以及分类标签识别工具与分区的第二对应关系,确定数据消费方接口与分区的对应关系。
在上述实施例的基础上,作为一种可选的实施方式,还包括:
第一绑定模块,被设置为绑定分类标签识别工具与数据消费方接口,得到第一对应关系。
在上述实施例的基础上,作为一种可选的实施方式,第一绑定模块被设置为:
在数据库或配置文件中绑定分类标签识别工具与数据消费方接口,得到第一对应关系。
在上述实施例的基础上,作为一种可选的实施方式,还包括:
第二绑定模块,被设置为绑定分类标签识别工具与分区,得到第二对应关系。
在上述实施例的基础上,作为一种可选的实施方式,第二绑定模块被设置为:
在数据库或配置文件中绑定分类标签识别工具与分区,得到第二对应关系。
在上述实施例的基础上,作为一种可选的实施方式,第二绑定模块被设置为:
将数据存储到类型对应的分区后,绑定分类标签识别工具与分区,得到第二对应关系。
在上述实施例的基础上,作为一种可选的实施方式,存储模块3被设置为:
将数据存储到类型对应的且为数据所属的topic对应的分区中。
在上述实施例的基础上,作为一种可选的实施方式,还包括:
更新模块,被设置为更新分类标签识别工具。
在上述实施例的基础上,作为一种可选的实施方式,还包括:
记录模块,被设置为记录分类识别工具识别分类标签成功与失败的次数。
在上述实施例的基础上,作为一种可选的实施方式,还包括:
计算模块,被设置为根据记录分类识别工具识别分类标签成功与失败的次数,计算分类识别工具的识别失败率。
在上述实施例的基础上,作为一种可选的实施方式,还包括:
判断模块,被设置为判断分类识别工具的识别失败率是否达到预设阈值;
提示模块,被设置为若分类识别工具的识别失败率达到预设阈值,则提示修正分类识别工具。
在上述实施例的基础上,作为一种可选的实施方式,还包括:
发送模块,被设置为若分类识别工具的识别失败率达到预设阈值,则向数据生产方发送分类标签修正提示。
本申请所提供的kafka消息数据的下发装置,数据生产方对topic下的数据进行分类并为其设置分类标签,然后将数据以及对应的分类标签下发给服务方,服务方使用分类标签识别工具识别数据的分类标签,并将数据存储到相应的分区,最后服务方依据数据消费方接口与分区的对应关系进行数据下发,这样可以在通过topic分类的基础之上,实现更加细致分类存储,可以避免kafka消息集成服务系统仅通过topic对数据进行分类时对topic资源的浪费,数据生产方新增数据类型不必再次申请topic,并且数据生产方能够主动控制数据消费方所消费的数据类型,另外当有新的数据消费方需要消费生产方指定数据类型时,只需配置对应关系即可实现消费方的接入,高效便捷。
本申请还提供了一种kafka消息数据的下发设备,参考图5所示,该设备包括存储器1和处理器2。
存储器1,被设置为存储计算机程序;
处理器2,被设置为执行计算机程序实现如下的步骤:
接收数据生产方下发的数据与数据的分类标签;通过分类标签识别工具识别分类标签,确定数据的类型;将数据存储到类型对应的分区中;根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
对于本申请所提供的设备的介绍请参照上述方法实施例,本申请在此不做赘述。
本申请所提供的kafka消息数据的下发设备,数据生产方对topic下的数据进行分类并为其设置分类标签,然后将数据以及对应的分类标签下发给服务方,服务方使用分类标签识别工具识别数据的分类标签,并将数据存储到相应的分区,最后服务方依据数据消费方接口与分区的对应关系进行数据下发,这样可以在通过topic分类的基础之上,实现更加细致分类存储,可以避免kafka消息集成服务系统仅通过topic对数据进行分类时对topic资源的浪费,数据生产方新增数据类型不必再次申请topic,并且数据生产方能够主动控制数据消费方所消费的数据类型,另外当有新的数据消费方需要消费生产方指定数据类型时,只需配置对应关系即可实现消费方的接入,高效便捷。
本申请还提供了一种计算机非易失性可读存储介质,该计算机非易失性可读存储介质上存储有计算机程序,计算机程序被处理器执行时可实现如下的步骤:
接收数据生产方下发的数据与数据的分类标签;通过分类标签识别工具识别分类标签,确定数据的类型;将数据存储到类型对应的分区中;根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
该计算机非易失性可读存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
对于本申请所提供的计算机非易失性可读存储介质的介绍请参照上述方法实施例,本申请在此不做赘述。
本申请所提供的计算机非易失性可读存储介质,数据生产方对topic下的数据进行分类并为其设置分类标签,然后将数据以及对应的分类标签下发给服务方,服务方使用分类标签识别工具识别数据的分类标签,并将数据存储到相应的分区,最后服务方依据数据消费方接口与分区的对应关系进行数据下发,这样可以在通过topic分类的基础之上,实现更加细致分类存储,可以避免kafka消息集成服务系统仅通过topic对数据进行分类时对topic资源的浪费,数据生产方新增数据类型不必再次申请topic,并且数据生产方能够主动控制数据消费方所消费的数据类型,另外当有新的数据消费方需要消费生产方指定数据类型时,只需配置对应关系即可实现消费方的接入,高效便捷。
本申请还提供了一种kafka消息集成服务系统,包括:
数据生产方、服务方以及数据消费方;
服务方,被设置为接收数据生产方下发的数据与数据的分类标签;通过分类标签识别工具识别分类标签,确定数据的类型;将数据存储到类型对应的分区中;根据数据消费方接口与分区的对应关系,回调数据消费方接口将对应的分区中的数据下发到数据消费方。
在上述实施例的基础上,作为一种可选的实施方式,服务方被设置为:
通过正则表达式识别分类标签。
在上述实施例的基础上,作为一种可选的实施方式,一种分类标签识别工具被设置为识别一类分类标签。
在上述实施例的基础上,作为一种可选的实施方式,服务方还被设置为:
确定数据消费方接口与分区的对应关系。
在上述实施例的基础上,作为一种可选的实施方式,服务方被设置为:
根据分类标签识别工具与数据消费方接口的第一对应关系以及分类标签识别工具与分区的第二对应关系,确定数据消费方接口与分区的对应关系。
在上述实施例的基础上,作为一种可选的实施方式,服务方还被设置为:
绑定分类标签识别工具与数据消费方接口,得到第一对应关系。
在上述实施例的基础上,作为一种可选的实施方式,服务方被设置为:
在数据库或配置文件中绑定分类标签识别工具与数据消费方接口,得到第一对应关系。
在上述实施例的基础上,作为一种可选的实施方式,服务方还被设置为:
绑定分类标签识别工具与分区,得到第二对应关系。
在上述实施例的基础上,作为一种可选的实施方式,服务方被设置为:
在数据库或配置文件中绑定分类标签识别工具与分区,得到第二对应关系。
在上述实施例的基础上,作为一种可选的实施方式,服务方被设置为:
将数据存储到类型对应的分区后,绑定分类标签识别工具与分区,得到第二对应关系。
在上述实施例的基础上,作为一种可选的实施方式,服务方被设置为:
将数据存储到类型对应的且为数据所属的topic对应的分区中。
在上述实施例的基础上,作为一种可选的实施方式,服务方还被设置为:
更新分类标签识别工具。
在上述实施例的基础上,作为一种可选的实施方式,服务方还被设置为:
记录分类识别工具识别分类标签成功与失败的次数。
在上述实施例的基础上,作为一种可选的实施方式,服务方还被设置为:
根据记录分类识别工具识别分类标签成功与失败的次数,计算分类识别工具的识别失败率。
在上述实施例的基础上,作为一种可选的实施方式,服务方还被设置为:
判断分类识别工具的识别失败率是否达到预设阈值;
若分类识别工具的识别失败率达到预设阈值,则提示修正分类识别工具。
在上述实施例的基础上,作为一种可选的实施方式,服务方还被设置为:
若分类识别工具的识别失败率达到预设阈值,则向数据生产方发送分类标签修正提示。
对于本申请所提供的kafka消息集成服务系统的介绍请参照上述方法实施例,本申请在此不做赘述。
本申请所提供的kafka消息集成服务系统,数据生产方对topic下的数据进行分类并为其
设置分类标签,然后将数据以及对应的分类标签下发给服务方,服务方使用分类标签识别工具识别数据的分类标签,并将数据存储到相应的分区,最后服务方依据数据消费方接口与分区的对应关系进行数据下发,这样可以在通过topic分类的基础之上,实现更加细致分类存储,可以避免kafka消息集成服务系统仅通过topic对数据进行分类时对topic资源的浪费,数据生产方新增数据类型不必再次申请topic,并且数据生产方能够主动控制数据消费方所消费的数据类型,另外当有新的数据消费方需要消费生产方指定数据类型时,只需配置对应关系即可实现消费方的接入,高效便捷。
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置、设备以及计算机非易失性可读存储介质而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上对本申请所提供的kafka消息数据的下发方法、装置、设备、计算机非易失性可读存储介质以及kafka消息集成服务系统进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围。
Claims (20)
- 一种kafka消息数据的下发方法,其特征在于,包括:接收数据生产方下发的数据与所述数据的分类标签;通过分类标签识别工具识别所述分类标签,确定所述数据的类型;将所述数据存储到所述类型对应的分区中;根据数据消费方接口与分区的对应关系,回调所述数据消费方接口将对应的所述分区中的数据下发到数据消费方。
- 根据权利要求1所述的kafka消息数据的下发方法,其特征在于,所述通过分类标签识别工具识别所述分类标签包括:通过正则表达式识别所述分类标签。
- 根据权利要求1所述的kafka消息数据的下发方法,其特征在于,一种所述分类标签识别工具用于识别一类所述分类标签。
- 根据权利要求1所述的kafka消息数据的下发方法,其特征在于,所述根据数据消费方接口与分区的对应关系,通过所述数据消费方接口将对应的所述分区中的数据下发到数据消费方前还包括:确定数据消费方接口与分区的对应关系。
- 根据权利要求4所述的kafka消息数据的下发方法,其特征在于,所述确定数据消费方接口与分区的对应关系包括:根据所述分类标签识别工具与所述数据消费方接口的第一对应关系以及所述分类标签识别工具与所述分区的第二对应关系,确定所述数据消费方接口与分区的对应关系。
- 根据权利要求5所述的kafka消息数据的下发方法,其特征在于,还包括:绑定所述分类标签识别工具与所述数据消费方接口,得到所述第一对应关系。
- 根据权利要求6所述的kafka消息数据的下发方法,其特征在于,所述绑定所述分类标签识别工具与所述数据消费方接口,得到所述第一对应关系包括:在数据库或配置文件中绑定所述分类标签识别工具与所述数据消费方接口,得到所述第一对应关系。
- 根据权利要求5所述的kafka消息数据的下发方法,其特征在于,还包括:绑定所述分类标签识别工具与所述分区,得到所述第二对应关系。
- 根据权利要求8所述的kafka消息数据的下发方法,其特征在于,所述绑定所述分类标签识别工具与所述分区,得到所述第二对应关系包括:在数据库或配置文件中绑定所述分类标签识别工具与所述分区,得到所述第二对应 关系。
- 根据权利要求8所述的kafka消息数据的下发方法,其特征在于,所述绑定所述分类标签识别工具与所述分区,得到所述第二对应关系包括:将所述数据存储到所述类型对应的分区后,绑定所述分类标签识别工具与所述分区,得到所述第二对应关系。
- 根据权利要求1所述的kafka消息数据的下发方法,其特征在于,所述将所述数据存储到分区中包括:将所述数据存储到所述类型对应的且为所述数据所属的topic对应的分区中。
- 根据权利要求1所述的kafka消息数据的下发方法,其特征在于,还包括:更新所述分类标签识别工具。
- 根据权利要求1所述的kafka消息数据的下发方法,其特征在于,还包括:记录所述分类识别工具识别所述分类标签成功与失败的次数。
- 根据权利要求13所述的kafka消息数据的下发方法,其特征在于,还包括:根据记录所述分类识别工具识别所述分类标签成功与失败的次数,计算所述分类识别工具的识别失败率。
- 根据权利要求14所述的kafka消息数据的下发方法,其特征在于,还包括:判断所述分类识别工具的识别失败率是否达到预设阈值;若所述分类识别工具的识别失败率达到所述预设阈值,则提示修正所述分类识别工具。
- 根据权利要求15所述的kafka消息数据的下发方法,其特征在于,还包括:若所述分类识别工具的识别失败率达到所述预设阈值,则向所述数据生产方发送分类标签修正提示。
- 一种kafka消息数据的下发装置,其特征在于,包括:接收模块,被设置为接收数据生产方下发的数据与所述数据的分类标签;识别模块,被设置为通过分类标签识别工具识别所述分类标签,确定所述数据的类型;存储模块,被设置为将所述数据存储到所述类型对应的分区中;下发模块,被设置为根据数据消费方接口与分区的对应关系,回调所述数据消费方接口将对应的所述分区中的数据下发到数据消费方。
- 一种kafka消息数据的下发设备,其特征在于,包括:存储器,被设置为存储计算机程序;处理器,被设置为执行所述计算机程序时实现如权利要求1至16任一项所述的kafka消息数据的下发方法的步骤。
- 一种计算机非易失性可读存储介质,其特征在于,所述计算机非易失性可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至16任一项所述的kafka消息数据的下发方法的步骤。
- 一种kafka消息集成服务系统,其特征在于,包括:数据生产方、服务方以及数据消费方;所述服务方,被设置为接收所述数据生产方下发的数据与所述数据的分类标签;通过分类标签识别工具识别所述分类标签,确定所述数据的类型;将所述数据存储到所述类型对应的分区中;根据数据消费方接口与分区的对应关系,回调所述数据消费方接口将对应的所述分区中的数据下发到所述数据消费方。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211518302.9A CN115543662B (zh) | 2022-11-30 | 2022-11-30 | 一种kafka消息数据的下发方法及相关装置 |
| CN202211518302.9 | 2022-11-30 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024113705A1 true WO2024113705A1 (zh) | 2024-06-06 |
Family
ID=84722562
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/095599 Ceased WO2024113705A1 (zh) | 2022-11-30 | 2023-05-22 | 一种kafka消息数据的下发方法及相关装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115543662B (zh) |
| WO (1) | WO2024113705A1 (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115543662B (zh) * | 2022-11-30 | 2023-03-21 | 苏州浪潮智能科技有限公司 | 一种kafka消息数据的下发方法及相关装置 |
| CN116821128A (zh) * | 2023-06-21 | 2023-09-29 | 中国联合网络通信集团有限公司 | 话单数据处理方法、装置、设备及存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110099234A1 (en) * | 2009-10-26 | 2011-04-28 | Jha Ruchir P | Efficient utilization of read-ahead buffer by partitioning read-ahead buffer in correspondence with selectors |
| CN112380040A (zh) * | 2021-01-18 | 2021-02-19 | 北京美摄网络科技有限公司 | 一种消息处理的方法、装置、电子设备及存储介质 |
| CN115328678A (zh) * | 2022-08-19 | 2022-11-11 | 济南浪潮数据技术有限公司 | 一种消息系统服务装置及数据处理设备 |
| CN115543662A (zh) * | 2022-11-30 | 2022-12-30 | 苏州浪潮智能科技有限公司 | 一种kafka消息数据的下发方法及相关装置 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112333087B (zh) * | 2020-11-18 | 2023-03-28 | 平安消费金融有限公司 | 消费消息处理方法及相关设备 |
| CN112491998B (zh) * | 2020-11-18 | 2023-08-08 | 平安消费金融有限公司 | 消息推送方法及相关设备 |
| CN114827049B (zh) * | 2022-03-02 | 2023-05-09 | 厦门服云信息科技有限公司 | 一种基于kafka的堆积数据消费方法、终端设备及存储介质 |
-
2022
- 2022-11-30 CN CN202211518302.9A patent/CN115543662B/zh active Active
-
2023
- 2023-05-22 WO PCT/CN2023/095599 patent/WO2024113705A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110099234A1 (en) * | 2009-10-26 | 2011-04-28 | Jha Ruchir P | Efficient utilization of read-ahead buffer by partitioning read-ahead buffer in correspondence with selectors |
| CN112380040A (zh) * | 2021-01-18 | 2021-02-19 | 北京美摄网络科技有限公司 | 一种消息处理的方法、装置、电子设备及存储介质 |
| CN115328678A (zh) * | 2022-08-19 | 2022-11-11 | 济南浪潮数据技术有限公司 | 一种消息系统服务装置及数据处理设备 |
| CN115543662A (zh) * | 2022-11-30 | 2022-12-30 | 苏州浪潮智能科技有限公司 | 一种kafka消息数据的下发方法及相关装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115543662B (zh) | 2023-03-21 |
| CN115543662A (zh) | 2022-12-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20230139628A1 (en) | Supporting automation of customer service | |
| US20160117624A1 (en) | Intelligent meeting enhancement system | |
| CN109152061B (zh) | 通道调配方法、装置、服务器及存储介质 | |
| US20180211223A1 (en) | Data Processing System with Machine Learning Engine to Provide Automated Collaboration Assistance Functions | |
| CN110262889A (zh) | 一种链路追踪方法及装置 | |
| US10297255B2 (en) | Data processing system with machine learning engine to provide automated collaboration assistance functions | |
| WO2024113705A1 (zh) | 一种kafka消息数据的下发方法及相关装置 | |
| US10972297B2 (en) | Data processing system with machine learning engine to provide automated collaboration assistance functions | |
| CN113360300B (zh) | 接口调用链路生成方法、装置、设备及可读存储介质 | |
| CN110099130A (zh) | 配置更新方法、装置及服务器 | |
| CN108140176A (zh) | 从对通信的本地搜索和远程搜索中并行地识别搜索结果 | |
| CN107203464A (zh) | 业务问题的定位方法以及装置 | |
| CN102724272B (zh) | 一种电视台业务发布数据的备份方法 | |
| CN112073395B (zh) | 一种文件分发方法和装置 | |
| CN114996281A (zh) | 数据处理系统、方法、装置、电子设备及存储介质 | |
| CN113808589A (zh) | 坐席通话方法、计算机设备和存储介质 | |
| CN115730170A (zh) | 消息数据的处理方法、装置和服务器 | |
| CN115866017A (zh) | 消息处理方法、装置、通信设备及存储介质 | |
| CN111833029A (zh) | 理赔数据审核方法及系统、计算机可读存储介质 | |
| CN112613955A (zh) | 订单处理方法、装置、电子设备及存储介质 | |
| US11023479B2 (en) | Managing asynchronous analytics operation based on communication exchange | |
| CN113935295B (zh) | 一种估值表汇总方法、装置、设备及介质 | |
| CN115391445A (zh) | 一种数据推送方法和相关装置 | |
| CN114547512A (zh) | 一种信息处理方法、装置、计算机设备和存储介质 | |
| CN113285855B (zh) | 服务器监控方法及系统 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23895871 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 23895871 Country of ref document: EP Kind code of ref document: A1 |