A method and device for processing heterogeneous stream data
By using standardized configuration files to match the configuration of heterogeneous flow data for processing, the problem of high development and maintenance costs in multi-type heterogeneous flow data processing is solved, standardized conversion and flexible configuration of heterogeneous flow data are realized, and operations are simplified. dimension process.
Patent Information
- Application Number
- CN202111344441.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-11-15
AI Technical Summary
When existing technology processes multiple types of heterogeneous stream data, it is necessary to develop separate scripts or programs for each type of data, resulting in high development and maintenance costs, and modifying data conversion rules requires re-development of code, making operation and maintenance complex.
Adopt the preset standardized configuration file and process it through the standardized configuration that matches the real-time stream data to achieve standardized conversion of heterogeneous stream data, and update the configuration file when necessary to change the processing method to avoid modifying the underlying code.
It reduces development and maintenance costs, improves work efficiency, simplifies the operation and maintenance of the data processing system, and realizes unified processing and flexible configuration of heterogeneous flow data.
Smart Images

Figure CN114064720B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for processing heterogeneous stream data. Background Art
[0002] In big data development, whether it is batch or real-time stream processing, you usually encounter the situation where you need to convert multiple types of heterogeneous stream data into one type of target data or a few types of target data, and then further process them. However, each type of data requires a script or program to process it before it can be converted into target data, and each program or script needs to be scheduled and managed separately. Especially as time goes by, more and more types of data are connected, and the developers for each type of data are different, which will make subsequent operation and maintenance more and more difficult.
[0003] When converting multiple types of heterogeneous stream data into target data, the existing technology has a separate script or program for each type of data, and can only convert one type of data at a time. This method has relatively high development and maintenance costs when there are dozens or even hundreds of types of data that need to be converted, because each type of data needs to develop a script or program separately, resulting in high maintenance costs. If the data conversion rules need to be modified, the code needs to be redeveloped. Summary of the invention
[0004] The embodiments of the present application provide a method and device for processing heterogeneous stream data, which are used to utilize a preset standardized configuration file to achieve standardized conversion of heterogeneous stream data, save costs, and improve work efficiency.
[0005] A method for processing heterogeneous stream data provided by an embodiment of the present application includes:
[0006] Get real-time streaming data to be processed;
[0007] When there is a standardized configuration matching the real-time streaming data in the preset standardized configuration files, the real-time streaming data is processed using the standardized configuration matching the real-time streaming data.
[0008] In the embodiment of the present application, by acquiring the real-time streaming data to be processed, when there is a standardized configuration matching the real-time streaming data in the pre-set standardized configuration file, the real-time streaming data is processed using the standardized configuration matching the real-time streaming data, thereby realizing standardized conversion processing of heterogeneous streaming data, and when it is necessary to change the standardized processing method of the streaming data, it is only necessary to update the standardized configuration file without modifying the underlying code of the data processing, thereby saving costs, simplifying the operation and maintenance of the data processing system, and improving work efficiency.
[0009] Optionally, before obtaining the real-time streaming data to be processed, the method further includes: loading a standardized configuration from a preset standardized configuration file into a Spark broadcast variable.
[0010] Optionally, a standardized configuration matching the real-time streaming data is determined in the following manner:
[0011] For each standardized configuration in the Spark broadcast variable, determine whether the standardized configuration matches the real-time streaming data.
[0012] Optionally, for each standardized configuration in the Spark broadcast variable, determining whether the standardized configuration matches the real-time stream data specifically includes:
[0013] For each standardized configuration, when a field in the standardized configuration exists in the real-time streaming data and the values of the fields are the same, it is determined that the standardized configuration matches the real-time streaming data.
[0014] Optionally, the method further comprises:
[0015] Monitor whether the standardized configuration needs to be updated, and when it needs to be updated, update the standardized configuration in the standardized configuration file to the Spark broadcast variable.
[0016] Optionally, each standardized configuration includes: filtering conditions for filtering out useless data, a combination of all filtering conditions, a data processing method, and a writing object of target stream data; the target stream data is data obtained after processing the real-time stream data.
[0017] Optionally, the real-time streaming data is processed using a standardized configuration matching the real-time streaming data, specifically including:
[0018] For each standardized configuration matching the real-time stream data, respectively judging whether the real-time stream data satisfies each filtering condition in the standardized configuration, obtaining a judgment result corresponding to each filtering condition, and combining the judgment results according to the combination method to obtain a combination result;
[0019] When the combination result meets the preset condition, the real-time stream data is processed according to the data processing method.
[0020] Optionally, load standardized configuration from a preset standardized configuration file into the Spark broadcast variable, including:
[0021] Read the standardized configuration line by line from the preset standardized configuration file;
[0022] For each line of standardized configuration, convert the line of standardized configuration from a JSON string to a JSON object, and use one or a combination of the following fields in the JSON object to construct a Spark broadcast variable:
[0023] A first field for identifying whether the real-time streaming data matches the row standardized configuration;
[0024] A second field for indicating a filtering condition for the real-time streaming data of the type;
[0025] A third field for indicating a combination of all filtering conditions in the second field;
[0026] A fourth field for indicating the data processing method;
[0027] The fifth field is used to indicate the writing object of the target stream data.
[0028] An embodiment of the present application provides a heterogeneous stream data processing device, including: a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory, and execute any of the above methods according to the obtained program.
[0029] Furthermore, according to an embodiment, for example, a computer program product for a computer is provided, which includes software code portions, and when the product is run on the computer, these software code portions are used to perform the steps of the method defined above. The computer program product may include a computer-readable medium having the software code portions stored thereon. Furthermore, the computer program product may be directly loaded into the internal memory of the computer and / or sent via a network through at least one of an upload process, a download process, and a push process.
[0030] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A schematic diagram of the heterogeneous stream data processing principle provided in an embodiment of the present application;
[0033] Figure 2A schematic diagram of the overall process of heterogeneous stream data processing provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of the main process of heterogeneous stream data processing provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of a sub-process for loading a standardized configuration provided in an embodiment of the present application;
[0036] Figure 5 A schematic diagram of a data standardization sub-process provided in an embodiment of the present application;
[0037] Figure 6 A schematic diagram of a process for processing heterogeneous stream data provided in an embodiment of the present application;
[0038] Figure 7 A schematic diagram of the structure of a heterogeneous stream data processing device provided in an embodiment of the present application;
[0039] Figure 8 A schematic diagram of the structure of a heterogeneous stream data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] The embodiments of the present application provide a method and device for processing heterogeneous stream data, so as to realize the standardization of heterogeneous stream data, save costs and improve work efficiency.
[0042] Among them, the method and the device are based on the same application concept. Since the method and the device solve the problem in a similar principle, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.
[0043] The following is a detailed description of each embodiment of the present application in conjunction with the accompanying drawings. It should be noted that the display order of the embodiments of the present application only represents the order of the embodiments, and does not represent the advantages and disadvantages of the technical solutions provided by the embodiments.
[0044] The technical solution provided by the embodiment of the present application manages the various types of data accessed through a configuration file. Each time a type of data is accessed, only one record needs to be added to the configuration file. If the data conversion rules change, only the configuration needs to be modified, and the same applies to deletion. Of course, the configuration file is only used to manage the configuration. Another core of the embodiment of the present application is a general program, which is the main body used to process data conversion.
[0045] Terminology explanation:
[0046] Spark streaming computing: Spark is a fast and versatile large-scale data processing engine. In the embodiments of this application, the Spark streaming computing engine (Spark structured streaming) is used to implement Spark distributed quasi-real-time streaming computing. In the embodiments of this application, Spark's latest streaming computing framework Spark structured streaming is used to implement it. Thanks to the batch-stream integration feature of this framework, the embodiments of this application can be applied to the calculation of batch data and streaming data at the same time, but in the embodiments of this application, the relevant use in the calculation of streaming data is mainly described.
[0047] Executor: Executor is the execution unit of Spark tasks, running on worker nodes. In fact, it is a collection of computing resources (CPU cores, memory). The memory and CPU on a worker are shared by multiple executors.
[0048] Spark broadcast variables: In Spark, because the real logic of the operator is sent to the Executor to run, when the Executor needs to reference external variables, Spark broadcast variables need to be used. The advantage of Spark broadcast variables is that each task does not need to carry a copy of the variable, but each node's Executor corresponds to a copy, which greatly reduces the number of copies of the variable and saves memory.
[0049] JSON: JSON (JavaScript Object Notation) is a lightweight data exchange format that uses a text format that is completely independent of the programming language to store and represent data.
[0050] Kafka: is a high-throughput distributed publish-subscribe messaging system that handles all action stream data from consumers on a website.
[0051] Topic: Each message published to the Kafka cluster has a category, which is called a Topic.
[0052] The purpose of the embodiments of the present application is to provide a solution for converting multiple heterogeneous JSON stream data (i.e., stream data with different structures) into target JSON stream data with one or more structures, completing data filtering, completion, data conversion and other tasks during the conversion process, and then forwarding the data to the specified Topic in Kafka.
[0053] The general process of data processing is as follows Figure 1 As shown in the figure, the types of source stream data (such as source stream data 1, source stream data 2, source stream data 3, etc.) and target stream data (target stream data 1, target stream data 2, target stream data 3, etc.) are different. Generally, multiple source data are converted into a few target data, that is, Figure 1 The n shown in can be greater than m, and of course can also be equal to m.
[0054] In order to more comprehensively explain the implementation method of the embodiment of the present application, the specific implementation process of the embodiment of the present application will be explained from three aspects: overall design, configuration file design and detailed processing flow.
[0055] 1. Overall process:
[0056] See also Figure 2 The entire standardization processing program is developed based on Spark structured streaming. Spark job listeners (Streaming Query Listeners, SQL) are used to monitor whether the standardization configuration needs to be updated or loaded. If a configuration update instruction or configuration load instruction arrives, the listener will update the content of the standardization configuration file (referred to as the configuration file) to the Spark broadcast variable. When the standardized data (such as Figure 2 When the real-time streaming data shown in (that is, the data that needs to be standardized, that is, the source streaming data) arrives, Spark's Executor will obtain this configuration from the Spark broadcast variable and standardize the real-time streaming data according to this configuration. It may be necessary to call the function in the standardization function library for standardization, and finally obtain the target streaming data, that is, the standardized data.
[0057] Among them, Figure 2 The real-time streaming data given in the data can come from various application systems, for example. After being standardized, these data are converted into standardized data and provided to downstream processing. During the standardization process, it may be necessary to use a standardized function library to support data processing to achieve functions such as formatting, data completion, and data conversion for each field of the data.
[0058] Among them, the standardized function library, for example Figure 2As shown, one or a combination of the following standardized functions may be included: SQL function, default value processing function, timestamp processing function, time standardization function, string concatenation function, date standardization function, replacement function, etc. These listed functions are all commonly used functions in the prior art, and will not be explained in detail here. The above functions are only examples, and new functions can be added or existing functions can be deleted as needed in actual applications.
[0059] 2. Configuration file design:
[0060] In order to transform the data standardization processing work into the maintenance process of the standardized configuration file, in the embodiment of the present application, for example, the following fields can be defined in the JSON structure of the standardized configuration file:
[0061] dataIdentity: This field is used to determine whether the source stream data (that is, the data that needs to be standardized) matches the current configuration. The determination method is to determine whether all the fields in the identity under dataIdentity exist in the source stream data and the values must be equal.
[0062] There are two fields in the lower layer of dataIdentity, relation and identity. Among them, identity is a JSON array, and each JSON array has two fields, namely the target field name (for example, represented as "field") and the target field value (for example, represented as "v1", which is used to set the value of key f1 in the data to be processed to v1). The value corresponding to the target field name in the processed JSON array is equal to the target field value. The key corresponding to the target field name exists in the processed JSON array, and there is a relationship between the value corresponding to the key and the target field value. The relationship type is represented by op, such as single comparison value comparison or multiple comparison value comparison, which is further explained below. There can be multiple identities under dataIdentity, and the relationship between identities is represented by relation. The relation currently only supports and, indicating that the identities are in an "and" relationship.
[0063] filters: This field indicates the filter conditions corresponding to the stream data of the type indicated by dataIdentity.
[0064] The filtering condition is used to filter out unused data, and may include, for example, one or a combination of the following contents: a filtering condition name filterNm, a field name field, a value name value, and a comparison symbol op.
[0065] The filters field may contain multiple sets of filter conditions. For example, three sets of filter conditions are included. The filterNm of the first set of filter conditions is "nm1", the field is "fi1", the value is "v1", and the op is a "single comparison value comparison symbol"; the filterNm of the second set of filter conditions is "nm2", the field is "fi2", the value is ["v2", "v3", ...], and the op is a "multiple comparison value comparison symbol"; the filterNm of the third set of filter conditions is "nm3", the field is "fi3", the value is "v2", and the op is a "single comparison value comparison symbol".
[0066] Among them, a Boolean value is obtained by comparing the value of the field in the source stream data currently being processed with the value according to op.
[0067] For example: for the filter condition filterNmA, the value corresponding to the field with key field in the JSON data currently being processed is valA, the value of value in the filter condition filterNmA is valB, and the value of op is "=", then: if valA is equal to valB, it returns "true", indicating that the value in the condition and the data is equal, otherwise it returns "false".
[0068] These Boolean values ("true", "false") will be combined and calculated in the manner specified by filterPattern, and the target data whose final combination result is returned as "true" will be retained (specifically described in steps 503 and 504 in the subsequent data standardization sub-process).
[0069] filterPattern: This field indicates the combination of all filter conditions in filters, such as "and, or, not", and combinations with brackets, variables, etc. For example: nm1&&(nm2||nm3), which means that the condition of nm1 must be met, and only one of the conditions of nm2 and nm3 needs to be met. This combination can express more complex conditions.
[0070] For example, "filterPattern":"(nm1&&nm2)||nm3" means that the Boolean value corresponding to the filter condition where filterNm is nm1 is ANDed with the Boolean value corresponding to the filter condition where filterNm is nm2, and the result is ORed with the Boolean value corresponding to the filter condition where filterNm is nm3.
[0071] filterPattern also has two simplified values: one is "&&", which means that the relationship between the filter conditions is all "and"; the other is "||", which means that the relationship between the filter conditions is all "or".
[0072] stdMap: This field indicates the specific data processing method, that is, the specific method of standardizing the source stream data.
[0073] stdMap reflects the mapping rules between the fields of the source stream data and the target stream data.
[0074] The mapping rule may be, for example, a simple one-to-one mapping. For example, if the standardized field is the customer number, the customer number may be directly obtained from the data to be processed;
[0075] The mapping rule may also be the result of processing by the above function. For example, the standardized field is age, and the data to be processed only contains birthday. The function is a function for calculating age, and the parameter is birthday, and the age is finally calculated.
[0076] Alternatively, the default value may be used directly, that is, the field of the source stream data is directly replaced with the preset value to obtain the field of the target stream data.
[0077] The following is a detailed explanation of each field in stdMap:
[0078] Each set of processing rules contains three fields: stdField, srcField, and default. Among them, stdField represents the name of the converted field, that is, the field name of the target stream data; srcField represents the method for obtaining the new value. The specific method is: when srcField.pType is equal to field, it means that the value of the field in srcField.value in the processed data can be directly obtained. When srcField.pType is equal to func, it means that the new value is generated by the specified function. The value of srcField.Value is a JSON object with two fields, namely func and parm. func represents the function name of the function to be used, and parm is a JSON array, which represents the parameter list required by the function to be used. For example, func represents the concatenation function connStr(), which requires three parameters: string type (string), field type (field), and function type (func). Among them, the string type directly takes the value in pValue (that is, there are two fields in the parameter, one is pType and the other is value, and the value of this value is taken), while the field type needs to obtain the corresponding value from the data to be processed, and its key is the value in pValue. The function type is similar to connStr(), and also has various types of parameters, similar to the nesting of functions. Finally, these three parameters are passed to the concatenation function connStr() to complete the calculation.
[0079] toTopic: indicates the Kafka topic to which the target stream data is to be written, i.e. the writing object of the target stream data. After the source stream data is standardized, the target stream data to be written to multiple topics is obtained, and the method of writing it directly to the specified topic of the specified Kafka is used. Whatever data is needed by the downstream, it is directly read from Kafka.
[0080] In summary, the JSON string is the configuration file required for data standardization conversion in the embodiment of the present application. After the entire program is running, only this configuration file needs to be written and / or modified, and there is no need to modify the underlying code required for data processing. Figure 2 To run the program in the Executor shown in the figure, you only need to modify the previous standardized configuration file.
[0081] 3. Detailed process of standardization:
[0082] In order to facilitate the description of the overall process provided by the embodiment of the present application and to simplify the flowchart, in the embodiment of the present application, the overall process (main process) is described first, and the sub-process of loading the standardized configuration file and the sub-process of performing standardized processing on the data in the overall process are described separately later.
[0083] like Figure 3 As shown, the main process includes, for example:
[0084] Step S301: first load the standardized configuration file, that is, execute the sub-process of loading the standardized configuration file. For details, please refer to the subsequent combined Figure 4 Detailed description.
[0085] It should be noted that the configuration loading in this step includes not only initial loading, that is, loading the initially set standardized configuration file into the Spark broadcast variable; it also includes subsequent updates, that is, when the configuration is updated, the latest standardized configuration file needs to be reloaded into the Spark broadcast variable. After each update of the standardized configuration file, the update can be triggered manually or automatically. For example, the update method can be to create an empty file std_update in the specified directory. The job listener will monitor whether this std_update file exists. If it exists, the configuration in the annotated configuration file will be reloaded into the Spark broadcast variable.
[0086] In summary, step S301 is equivalent to loading the standardized configuration from the preset standardized configuration file into the Spark broadcast variable; and, further, monitoring whether the standardized configuration needs to be updated, and when it needs to be updated, updating the standardized configuration in the standardized configuration file into the Spark broadcast variable.
[0087] Step S302: Get a JSON string data from Kafka, and then convert the JSON string into a JSON object data1.
[0088] Data1 is the real-time stream data to be processed. Step S302 is equivalent to obtaining the real-time stream data to be processed, where the real-time stream data is the data that needs to be standardized and converted, that is, the source stream data.
[0089] In an embodiment of the present application, source stream data of different structures from different systems can be processed according to a preset standardized configuration file to obtain target stream data that conforms to a unified standard in structure. Therefore, the data processing solution provided in the embodiment of the present application is called a processing solution for heterogeneous stream data.
[0090] The following steps specifically describe how to use a preset standardized configuration file to perform standardized conversion on the real-time streaming data:
[0091] Step S303: Obtain the standardized configuration allStdConf from the Spark broadcast variable;
[0092] In the subsequent steps, you need to extract each configuration data from allStdConf one by one and match it with data1;
[0093] That is, there may be multiple configuration data in the standardized configuration allStdConf, and the embodiment of the present application extracts each configuration data one by one and matches it with data1 respectively. Specifically:
[0094] Step S304: Get a record (fields, Map (fv, List (StdConf))) from allStdConf, that is, a piece of configuration data, and record the Map (fv, List (StdConf)) therein as stdMap;
[0095] Among them, fields represents the field name of the standardized configuration, StdConf includes filters, filterPattern, toTopic, and fieldMap instances, and fv represents the result of concatenating the field values of the fields in fields according to the corresponding order of the fields in the standardized configuration.
[0096] Step S305, obtain the values corresponding to all fields in fields from data1, and concatenate them in the order of the fields in fields, recorded as fv1; for example, the values in fields are f1, f2, and f3 respectively, and the values of keys f1, f2, and f3 obtained from the data to be processed are a, f, and b respectively, and after concatenation, they are afb.
[0097] It should be noted that the above step S304 and step S305 can be executed in parallel.
[0098] Step S306, determine whether fv=fv1 exists in stdMap. If so, that is, there is fv equal to fv1 in stdMap, execute step S307; otherwise, execute step S309.
[0099] That is, in the embodiment of the present application, multiple standardized configurations are obtained from the Spark broadcast variable, each standardized configuration includes (fields, Map(fv, List(StdConf)));
[0100] For each standardized configuration:
[0101] When all the fields in the fields in the standardized configuration exist in the real-time stream data data1, the field values of all the fields are obtained from the real-time stream data, and all the fields are spliced in the order of the fields to obtain the splicing result fv1;
[0102] When fv1 exists in Map(fv, List(StdConf)) in the standardized configuration, it is determined that the standardized configuration matches the real-time stream data successfully.
[0103] Step S307, obtain the standardized configuration List (StdConf) corresponding to fv1 from stdMap, recorded as stdConfs;
[0104] That is to say, in the embodiment of the present application, it is necessary to find a standardized configuration that matches the real-time streaming data to be processed from the Spark broadcast variable, and use the successfully matched standardized configuration to perform standardized conversion processing on the real-time streaming data.
[0105] Step S308: Perform standardization conversion on the data of data1 according to the standardization configuration stdConfs determined in step S307, that is, perform standardization processing on the data. For details, please refer to the subsequent combined Figure 5 Detailed description of
[0106] Step S309: If it is determined in step S306 that there is no fv equal to fv1 in stdMap, then continue to determine whether all records in allStdConf have been traversed. If not, execute step S304, that is, continue to obtain the next configuration data from allStdConf; otherwise, exit the matching process.
[0107] Step S310: If all the records in allStdConf are traversed, then all standardized result data are collected (because there may be multiple StdConfs, so one piece of data to be processed data1 can be processed into multiple result data), that is, the standardized conversion described in the above step S307 is completed (that is, the standardized conversion is performed). Figure 5 The standardized data obtained after the data standardization sub-process shown in the figure obtains the target stream data corresponding to the source stream data data1 and sends it through Kafka.
[0108] The following describes the sub-process of loading standardized configurations and the sub-process of performing standardized processing on data in the above overall process.
[0109] Sub-process of loading standardized configuration (i.e. the process of loading the standardized configuration in the preset standardized file into the Spark broadcast variable):
[0110] like Figure 4 As shown, the sub-process of loading the standardized configuration file includes, for example:
[0111] Step S401, read a line of configuration from a standardized configuration file, and convert the standardized configuration from a JSON string into a JSON object JSONObj;
[0112] In the embodiment of the present application, the pre-set standardized configuration file includes multiple lines of configuration. In the process of loading the standardized configuration file, the configuration in the standardized configuration file is read line by line. Each line of configuration includes one or a combination of the following fields:
[0113] dataIdentity field, fileters field, filterPattern field, stdMap field, toTopic field.
[0114] That is, in the embodiment of the present application, for each row of standardized configuration, the row of standardized configuration is converted from a JSON string to a JSON object JSONObj, and a Spark broadcast variable is constructed using one or a combination of the fields in JSONObj.
[0115] The processing of the corresponding fields mentioned in the following steps, if the field does not exist in the read configuration, means that the steps corresponding to the field can be omitted.
[0116] Step S402: extract all field names (ie, field values) in the dataIdentity field in the JSON object JSONObj and put them into a list list.
[0117] Step S403, sort the field names in the list list in lexicographic order, record the reordered list as list1, then concatenate the values of list1 in order, and record the concatenation result as key, for example, the values in list1 are cf1, cf2, cf3, and the concatenation result is cf1cf2cf3. Concatenate the field values corresponding to field in the corresponding order of field in list1, and record the concatenation result as fv.
[0118] Step S404: extract the value of filters from JSONObj and assemble them in a list form. The assembled list is recorded as filters;
[0119] Step S405, extract the value of filterPattern from JSONObj and record it as filterPattern; extract the value of toTopic and record it as toTopic;
[0120] Step S406, extract the value of stdMap from JSONObj, and convert it into a mapping between the target field stdField and the source field SrcField: Map(stdField, SrcField), and record the mapping as fieldMap, that is, fieldMap represents the mapping relationship between the target field stdField and the source field SrcField.
[0121] Among them, stdField is the name of the target field, and its type is string. SrcField gives the way to construct the target field, and its structure is (pType, value, func, default). Among them, pType represents the way to construct the target field value, and its value can be: field, string, func, among which field means that the value of value in SrcField is the field name in the data to be processed, and the target field directly takes the value of the field in the processed data; string means that the value of value in SrcField is the specified string, and the target field directly takes the value; func means that the value of the target field is generated by the specified function, which is the value corresponding to the func field in SrcField; when the value of the target field obtained by pType is empty, the default value is used; value represents the field name or literal value in the data to be processed; func is the function name.
[0122] It should be noted that the above steps S402, S404, S405, and S406 can be performed separately and there is no requirement for the order of each other. The order of the steps listed in the embodiment of the present application is only an example, but not limited to this, and these steps can also be performed simultaneously.
[0123] Step S407: Use the filters, filterPattern, toTopic, and fieldMap determined in steps S404, S405, and S406 to build an instance StdConf (filters, filterPattern, toTopic, fieldMap), and use all the fields extracted from the current configuration (i.e., the configuration read in step S401) and the StdConf to generate a tuple (key, fields, fv, StdConf).
[0124] That is to say, each line of configuration in the standardized configuration file in the embodiment of the present application will correspond to a tuple (key, fields, fv, StdConf) after the loading sub-process described in the embodiment of the present application.
[0125] Step S408: determine whether all rows of configurations in the standardized configuration file have been processed by the above steps. If there are unprocessed configurations, continue to execute step S401 to continue reading the next row of configurations in the standardized configuration file; otherwise, if all configurations in the standardized configuration file have been processed by the above steps, execute step S409;
[0126] Step S409: Use the tuple (key, fields, fv, StdConf) obtained in step S407 to form a set. Each row of configuration corresponds to a tuple. Therefore, the set includes multiple tuples. According to the key and fields in the set, aggregate and transform into the structure of (key, fields, List (fv, StdConf)), that is, collect the data with the same key and fields values together, and further aggregate and transform into (fields, Map (fv, List (StdConf))) according to the fv in the (key, fields, List (fv, StdConf)) structure, that is, for List (fv, StdConf) in (key, fields, List (fv, StdConf), collect the StdConf with the same fv to form The mapping of fv and List(StdConf) is stored in Map, that is, Map(fv,List(StdConf)). Map(fv,List(StdConf)) and fields form a tuple (fields,Map(fv,List(StdConf))). Finally, all standardized configurations are collected, with fields as the key and Map(fv,List(StdConf)) as the value, and put into Map, that is, Map(fields,Map(fv,List(StdConf))) structure, which is recorded as allStdConf.
[0127] Step S410: put the configuration allStdConf into the Spark broadcast variable, that is, use allStdConf as the Spark broadcast variable.
[0128] In summary, through the above steps, it is possible to read the standardized configuration line by line from the preset standardized configuration file, convert each line of standardized configuration from a JSON string to a JSON object JSONObj, and construct a Spark broadcast variable (i.e., allStdConf) using one or a combination of the following fields in each JSONObj:
[0129] dataIdentity field, fileters field, filterPattern field, stdMap field, toTopic field.
[0130] like Figure 5 As shown, the sub-process of performing standardization processing on data includes, for example:
[0131] Step S501, read a record from stdConfs (i.e., the standardized configuration that successfully matches data1, there may be one standardized configuration that successfully matches data1, or there may be multiple standardized configurations that successfully match data1), record it as stdConf, and start matching data1;
[0132] Step S502, according to data1, calculate the results of all filters in filters in stdConfs, that is, the members of stdConf are (filters, filterPattern, toTopic, fieldMap), the calculation method is to judge whether the data to be processed data1 meets the condition according to the condition in the filter, get the judgment result, combine these results according to filterPattern, and return the combined result to the variable fs;
[0133] Step S503: If the value of the variable fs is "true", that is, the preset condition is met, then step S505 is executed; otherwise, step S504 is executed;
[0134] Step S504, determine whether the traversal of stdConfs is complete, if the traversal is complete, execute step S514, otherwise execute step S501;
[0135] Step S505: Get the fieldMap in stdConf, and iteratively get the records in the fieldMap.
[0136] Step S506: record any record in fieldMap as (stdField, SrcField).
[0137] That is to say, in the embodiment of the present application, there are multiple records in the fieldMap in stdConf, and the following operations of steps S507 to S512 are performed for each record (stdField, SrcField):
[0138] Step S507, determine the value of SrcField.pType, that is, determine the value of the pType field in the SrcField structure. pType indicates the calculation method of the standardized value, and its value can be: field, string, func, where field indicates that the value of value in SrcField is the field name in the data to be processed, and the target field directly takes the value of the field in the processed data; string indicates that the value of value in SrcField is the specified string, and the target field directly takes the value; func indicates that the value of the target field is generated by a specified function, and the function is the value corresponding to the func field in SrcField.
[0139] If the value of the pType field is equal to field, execute step S508; if the value of the pType field is equal to string, execute step S509; if the value of the pType field is equal to func, execute step S510;
[0140] Step S508, take the value of value from SrcField and record it as field1, and get the value of field1 from the JSON object of data1 as the value of the variable stdVal;
[0141] Step S509, taking SrcField.value as the value of the variable stdVal, that is, taking the value of value from SrcField as the value of the variable stdVal;
[0142] Step S510: search for a function with the function name func in SrcField from a preset standardized function library, execute the function, and use the function execution result as the value of the variable stdVal;
[0143] Step S511: If stdVal is still an invalid value (null value) after calculation in the above step S508, step S509 or step S510, the value of default in SrcField is used as the value of the variable stdVal.
[0144] Step S512: record the target field name stdField and the target field value stdVal as a tuple (stdField, stdVal). Collect all tuples (stdField, stdVal) together, call the toMap function to convert them into a map Map (stdField, stdVal), which is the final standardized result. In other words, the target fields are processed one by one, and all target fields and values need to be collected together as a list of tuples, and this list of tuples is converted into a Map through the toMap function.
[0145] Step S513, determine whether the traversal of fieldMap in stdConf is complete, if not, execute step S505, if completed, execute step S504.
[0146] Step S514, collect all standardized data results, that is, collect the Map (stdField, stdVal) obtained in step S512, and return it to the outer process, that is, continue to execute the next step in the above main process: determine whether all the records in allStdConf have been traversed.
[0147] In summary, the above description has provided a detailed description of the entire standardization process provided by the embodiment of the present application through the description of the main process of standardization processing, the sub-process of standardization configuration loading, and the data standardization sub-process.
[0148] Through the solution provided by the embodiment of the present application, code development can be achieved once, and there is basically no need to modify the code afterwards. Only the configuration needs to be modified, and there is no need to redevelop the code, which greatly saves the later development cost. In the later stage, only the data service needs to be focused. In addition, operation and maintenance are relatively simple, and only one set of code needs to be maintained.
[0149] See also Figure 6 , a heterogeneous stream data processing method provided by an embodiment of the present application includes:
[0150] S101, obtaining real-time stream data to be processed;
[0151] This step, for example, includes step S301 and step S302 in the above-mentioned main flow of standardization processing.
[0152] S102: When a standardized configuration matching the real-time streaming data exists in the pre-set standardized configuration file, the real-time streaming data is processed using the standardized configuration matching the real-time streaming data.
[0153] This step, for example, includes steps S303 to S309 in the above-mentioned main flow of standardization processing.
[0154] Finally, step S310 may be adopted to collect all standardized result data and send it through Kafka.
[0155] Optionally, before obtaining the real-time streaming data to be processed, the method further includes: loading a standardized configuration from a preset standardized configuration file into a Spark broadcast variable.
[0156] That is, before obtaining the real-time streaming data to be processed, the above-mentioned sub-process of loading the standardized configuration is executed.
[0157] Optionally, a standardized configuration matching the real-time streaming data is determined in the following manner:
[0158] For each standardized configuration in the Spark broadcast variable, determine whether the standardized configuration matches the real-time streaming data.
[0159] Optionally, for each standardized configuration in the Spark broadcast variable, determining whether the standardized configuration matches the real-time stream data specifically includes:
[0160] For each standardized configuration, when a field in the standardized configuration exists in the real-time streaming data and the values of the fields are the same, it is determined that the standardized configuration matches the real-time streaming data.
[0161] That is to say, the fv in the standardized configuration (fields, Map(fv, List(StdConf))) described in the above step S304 needs to be equal to the fv1 described in the step S305, which means that the standardized configuration (fields, Map(fv, List(StdConf))) matches the real-time stream data data1.
[0162] Optionally, the method further comprises:
[0163] Monitor whether the standardized configuration needs to be updated. When an update is required, update the standardized configuration in the standardized configuration file to the Spark broadcast variable. For example, after each update of the standardized configuration file, the update can be manually triggered. The update method is to create an empty std_update file in the specified directory. The job listener will monitor whether this file exists. If it exists, the configuration in the configuration file will be reloaded into the Spark broadcast variable.
[0164] That is to say, in the embodiment of the present application, multiple standardized configurations can be obtained from the Spark broadcast variable, the multiple standardized configurations can be matched with the real-time streaming data one by one, and the real-time streaming data can be subjected to standardized conversion using the successfully matched standardized configurations.
[0165] For example, the above-mentioned standardized configuration allStdConf may contain multiple configuration data, and the embodiment of the present application extracts each configuration data one by one and matches it with data1 respectively, which specifically includes steps S304 to S306 in the above-mentioned standardization processing main flow.
[0166] Optionally, each standardized configuration includes: filtering conditions for filtering out useless data (such as the above-mentioned filters), a combination of all filtering conditions (such as the above-mentioned filterPattern), a data processing method (such as the above-mentioned fieldMap), and a writing object of the target stream data (such as the above-mentioned toTopic); the target stream data is the data obtained after processing the real-time stream data.
[0167] Optionally, the real-time streaming data is processed using a standardized configuration matching the real-time streaming data, specifically including:
[0168] For each standardized configuration matching the real-time stream data, determine whether the real-time stream data satisfies each filtering condition in the standardized configuration, obtain a determination result corresponding to each filtering condition, and combine the determination results according to the combination method to obtain a combination result (e.g., the above-mentioned fs);
[0169] When the combination result satisfies a preset condition (for example, the value of the variable fs mentioned above is "true"), the real-time stream data is processed according to the data processing method.
[0170] Finally, the processing results are collected and written to ToTopic, which is then sent through Kafka.
[0171] Optionally, load standardized configuration from a preset standardized configuration file into the Spark broadcast variable, including:
[0172] Read the standardized configuration line by line from the preset standardized configuration file;
[0173] For each line of standardized configuration, convert the line of standardized configuration from a JSON string to a JSON object (such as the JSONObj described above), and construct a Spark broadcast variable using one or a combination of the following fields in the JSON object:
[0174] A first field (such as the dataIdentity field) used to identify whether the real-time streaming data matches the standardized configuration of the row;
[0175] A second field (such as the fileters field) for indicating filtering conditions for the type of real-time streaming data;
[0176] A third field (such as the filterPattern field) used to indicate a combination of all filter conditions in the second field;
[0177] A fourth field for indicating a data processing method (such as the stdMap field);
[0178] The fifth field (eg, the toTopic field) is used to indicate the writing object of the target stream data. For example, the fifth field is used to indicate the topic of the target Kafka to which the target stream data is written.
[0179] For example, loading a standardized configuration from a preset standardized configuration file into a Spark broadcast variable specifically includes the steps described in the above-mentioned sub-process of loading the standardized configuration, which will not be repeated here.
[0180] Corresponding to the above method (the corresponding explanations or examples will not be repeated later), see Figure 7 , a data processing device provided in an embodiment of the present application includes:
[0181] The first unit 21 is used to obtain real-time stream data to be processed;
[0182] The second unit 22 is configured to process the real-time streaming data using the standardized configuration matching the real-time streaming data when there is a standardized configuration matching the real-time streaming data in the preset standardized configuration files.
[0183] Optionally, before acquiring the real-time stream data to be processed, the first unit 21 is further used to: load a standardized configuration from a preset standardized configuration file into a Spark broadcast variable.
[0184] Optionally, the second unit 22 determines a standardized configuration matching the real-time stream data in the following manner:
[0185] For each standardized configuration in the Spark broadcast variable, determine whether the standardized configuration matches the real-time streaming data.
[0186] Optionally, for each standardized configuration in the Spark broadcast variable, determining whether the standardized configuration matches the real-time stream data specifically includes:
[0187] For each standardized configuration, when a field in the standardized configuration exists in the real-time streaming data and the values of the fields are the same, it is determined that the standardized configuration matches the real-time streaming data.
[0188] Optionally, the first unit 21 is further used for:
[0189] Monitor whether the standardized configuration needs to be updated, and when it needs to be updated, update the standardized configuration in the standardized configuration file to the Spark broadcast variable.
[0190] Optionally, each standardized configuration includes: filtering conditions for filtering out useless data, a combination of all filtering conditions, a data processing method, and a writing object of target stream data; the target stream data is data obtained after processing the real-time stream data.
[0191] Optionally, the real-time streaming data is processed using a standardized configuration matching the real-time streaming data, specifically including:
[0192] For each standardized configuration matching the real-time stream data, respectively judging whether the real-time stream data satisfies each filtering condition in the standardized configuration, obtaining a judgment result corresponding to each filtering condition, and combining the judgment results according to the combination method to obtain a combination result;
[0193] When the combination result meets the preset condition, the real-time stream data is processed according to the data processing method.
[0194] Optionally, load standardized configuration from a preset standardized configuration file into the Spark broadcast variable, including:
[0195] Read the standardized configuration line by line from the preset standardized configuration file;
[0196] For each line of standardized configuration, convert the line of standardized configuration from a JSON string to a JSON object, and use one or a combination of the following fields in the JSON object to construct a Spark broadcast variable:
[0197] A first field for identifying whether the real-time streaming data matches the row standardized configuration;
[0198] A second field for indicating a filtering condition for the real-time streaming data of the type;
[0199] A third field for indicating a combination of all filtering conditions in the second field;
[0200] A fourth field for indicating the data processing method;
[0201] The fifth field is used to indicate the writing object of the target stream data.
[0202] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0203] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0204] The embodiment of the present application provides another heterogeneous stream data processing device, which can also be called a computing device, and the computing device can specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. For example, the computing device may include a central processing unit (CPU), a memory, and may also include input / output devices, etc. (not shown in the figure), the input device may include a keyboard, a mouse, a touch screen, etc., and the output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.
[0205] For example, see Figure 8 , the embodiment of the present application provides another heterogeneous stream data processing device including:
[0206] The processor 500 is used to read the program in the memory 520 and execute the following process:
[0207] Get real-time streaming data to be processed;
[0208] When there is a standardized configuration matching the real-time streaming data in the preset standardized configuration files, the real-time streaming data is processed using the standardized configuration matching the real-time streaming data.
[0209] Optionally, before obtaining the real-time streaming data to be processed, the processor 500 is further configured to read the program in the memory 520 and execute the following process: loading a standardized configuration from a preset standardized configuration file into a Spark broadcast variable.
[0210] Optionally, the processor 500 determines a standardized configuration matching the real-time streaming data in the following manner:
[0211] For each standardized configuration in the Spark broadcast variable, determine whether the standardized configuration matches the real-time streaming data.
[0212] Optionally, for each standardized configuration in the Spark broadcast variable, determining whether the standardized configuration matches the real-time stream data specifically includes:
[0213] For each standardized configuration, when a field in the standardized configuration exists in the real-time streaming data and the values of the fields are the same, it is determined that the standardized configuration matches the real-time streaming data.
[0214] Optionally, the processor 500 is further configured to read a program in the memory 520 and execute the following process:
[0215] Monitor whether the standardized configuration needs to be updated, and when it needs to be updated, update the standardized configuration in the standardized configuration file to the Spark broadcast variable.
[0216] Optionally, each standardized configuration includes: filtering conditions for filtering out useless data, a combination of all filtering conditions, a data processing method, and a writing object of target stream data; the target stream data is data obtained after processing the real-time stream data.
[0217] Optionally, the real-time streaming data is processed using a standardized configuration matching the real-time streaming data, specifically including:
[0218] For each standardized configuration matching the real-time stream data, respectively judging whether the real-time stream data satisfies each filtering condition in the standardized configuration, obtaining a judgment result corresponding to each filtering condition, and combining the judgment results according to the combination method to obtain a combination result;
[0219] When the combination result meets the preset condition, the real-time stream data is processed according to the data processing method.
[0220] Optionally, load standardized configuration from a preset standardized configuration file into the Spark broadcast variable, including:
[0221] Read the standardized configuration line by line from the preset standardized configuration file;
[0222] For each line of standardized configuration, convert the line of standardized configuration from a JSON string to a JSON object, and use one or a combination of the following fields in the JSON object to construct a Spark broadcast variable:
[0223] A first field for identifying whether the real-time streaming data matches the row standardized configuration;
[0224] A second field for indicating a filtering condition for the real-time streaming data of the type;
[0225] A third field for indicating a combination of all filtering conditions in the second field;
[0226] A fourth field for indicating the data processing method;
[0227] The fifth field is used to indicate the writing object of the target stream data.
[0228] The transceiver 510 is configured to receive and send data under the control of the processor 500 .
[0229] Among them, Figure 8 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 500 and memory represented by memory 520. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 510 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 500 is responsible for managing the bus architecture and general processing, and the memory 520 may store data used by the processor 500 when performing operations.
[0230] The processor 500 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a complex programmable logic device (CPLD).
[0231] The present application embodiment also provides a computer program product or computer program, which includes a computer instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device performs any heterogeneous stream data processing method in the above embodiment. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0232] The embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the apparatus provided in the embodiment of the present application, which includes a program for executing any of the methods provided in the embodiment of the present application. The computer-readable storage medium may be a non-transitory computer-readable medium.
[0233] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0234] 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 and optical storage, etc.) that contain computer-usable program code.
[0235] 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.
[0236] 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 comprising 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.
[0237] 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 in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0238] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for processing heterogeneous stream data, It is characterized in that The method includes: Load standardized configuration from the pre-set standardized configuration file into Spark broadcast variables; Get the real-time stream data to be processed, where each JSON string data obtained from Kafka is converted into a JSON object; Obtain standardized configuration from the Spark broadcast variable, and traverse the configuration data in the standardized configuration, each configuration data includes a field name fields of the standardized configuration, and a mapping relationship between a splicing result fv and standardized configuration information StdConf, and the splicing result fv is obtained by splicing the field values of the field in fields according to the corresponding order of the fields in the fields in the standardized configuration; When all the fields in the fields of the currently traversed configuration data exist in the JSON object, the field values of all the fields are obtained from the JSON object, and the fields are concatenated in the order of the fields to obtain a concatenation result fv1; When the splicing result fv1 exists in the splicing result fv of the configuration data, it is determined that the configuration data matches the JSON object successfully, and the JSON object is standardizedly converted using the standardized configuration information StdConf that has a mapping relationship with the splicing result fv1; Each piece of standardized configuration information StdConf includes: filtering conditions for filtering out useless data, a combination of all filtering conditions, a data processing method, and a writing object of target stream data; the target stream data is data obtained after processing the real-time stream data, and the standardized configuration information StdConf having a mapping relationship with the splicing result fv1 is used to perform standardized conversion on the JSON object, specifically including: Determine respectively whether the JSON object satisfies each filtering condition in the standardized configuration information StdConf, obtain the judgment result corresponding to each filtering condition, and combine the judgment results according to the combination method to obtain the combined result; when the combined result meets the preset condition, process the JSON object according to the data processing method to obtain the target data stream; write the target data stream according to the write object.
2. The method according to claim 1, It is characterized in that The method further includes: Monitor whether the standardized configuration needs to be updated, and when it needs to be updated, update the standardized configuration in the standardized configuration file to the Spark broadcast variable.
3. The method according to claim 1, It is characterized in that Load standardized configuration from the preset standardized configuration file into Spark broadcast variables, including: Read the standardized configuration line by line from the preset standardized configuration file; For each line of standardized configuration, convert the line of standardized configuration from a JSON string to a JSON object, and use one or a combination of the following fields in the JSON object to construct a Spark broadcast variable: A first field for identifying whether the real-time streaming data matches the row standardized configuration; A second field for indicating a filtering condition for real-time stream data of a corresponding type; A third field for indicating a combination of all filtering conditions in the second field; A fourth field for indicating the data processing method; The fifth field is used to indicate the writing object of the target stream data.
4. A heterogeneous stream data processing device, It is characterized in that include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 3 according to the obtained program.
5. A computer program product for use with a computer, It is characterized in that include: A software code portion, when the product is run on the computer, the software code portion is used to execute the method according to any one of claims 1 to 3.
6. The computer program product according to claim 5, It is characterized in that The computer program product comprises a computer readable medium having the software code portions stored thereon, and / or, The computer program product can be directly loaded into the internal memory of the computer and / or sent via a network through at least one of an upload process, a download process and a push process.
7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the method according to any one of claims 1 to 3.
