Data processing method and device, medium and computing device

By using at least two storage modules and a metadata repository subscription mechanism in the database, the problem of low data acquisition efficiency is solved, the target real-time data is quickly acquired, and the data processing efficiency of Internet enterprises is improved.

CN113553327BActive Publication Date: 2024-08-23HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110763610.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-06
Publication Date
2024-08-23
Estimated Expiration
2041-07-06

AI Technical Summary

Technical Problem

In Internet companies, the efficiency of data acquisition in databases is low, especially when training neural networks. It is inconvenient for data users to obtain multiple feature data, resulting in low efficiency.

Method used

Use at least two storage modules (such as message queues and offline databases) to store and obtain real-time data, and separate updated and non-updated data through metadata repository subscription and query to improve data acquisition efficiency.

Benefits of technology

It realizes the quick and convenient acquisition of required target real-time data, improves the efficiency of data acquisition, and reduces the processing complexity and business impact of data users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553327B
    Figure CN113553327B
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a data processing method and apparatus, a medium and a computing device. The data processing method includes: receiving total real-time data to be stored; writing the total real-time data into a first storage module and a second storage module; obtaining target real-time data to be read from the first storage module and the second storage module, and outputting the target real-time data. The embodiments of the present disclosure enable the required target real-time data to be obtained quickly and conveniently, thereby improving the efficiency of data acquisition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of database technology, and more specifically, the embodiments of the present disclosure relate to a data processing method and apparatus, a medium, and a computing device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] In Internet companies, databases are widely used. For example, with the development of artificial intelligence technology, algorithms are widely used. Artificial intelligence neural networks are often used for automatic recommendations in the fields of video recommendation, product recommendation, song recommendation, etc. The training basis of neural networks is a large number of feature data, such as user characteristics such as age and gender, or song characteristics such as the number of likes, number of plays, and singers. These features can be stored in the database of Internet companies. When the algorithm team within the company wants to train their own neural networks, they can obtain the feature data required for network training from the database. Therefore, this involves the storage of data in the database and the processing of reading.

[0004] In the related art, in terms of data storage and reading processing, there is still the problem that it is inconvenient for data users to obtain required data from the database, and the data acquisition efficiency is low. Summary of the invention

[0005] In this context, embodiments of the present disclosure are intended to provide a data processing method and apparatus, a computer-readable storage medium, and a computing device to improve data acquisition efficiency.

[0006] In a first aspect of an embodiment of the present disclosure, a data processing method is provided, comprising: receiving total real-time data to be stored; writing the total real-time data into a first storage module and a second storage module; obtaining target real-time data to be read from the first storage module and the second storage module, and outputting the target real-time data.

[0007] In one embodiment of the present disclosure, writing the total real-time data into a first storage module and a second storage module includes: writing the total real-time data into a message queue and an offline database; wherein, the first storage module is the message queue, and the second storage module is the offline database.

[0008] In another embodiment of the present disclosure, the obtaining of the target real-time data to be read from the first storage module and the second storage module includes: based on the metadata repository, querying the subscribed real-time data subscribed to in the total real-time data; obtaining the first real-time data that has been updated in the subscribed real-time data from the first storage module, and obtaining the second real-time data that has not been updated in the subscribed real-time data from the second storage module; and using the first real-time data and the second real-time data as the target real-time data.

[0009] In another embodiment of the present disclosure, the first storage module is a message queue; based on the metadata repository, the subscribed real-time data subscribed by the total real-time data is queried, and the first real-time data updated in the subscribed real-time data is obtained from the first storage module, including: based on the metadata repository, querying the consumption message unit in the message queue corresponding to the subscription real-time data; obtaining the first real-time data from the message queue, and distributing the first real-time data to the corresponding consumption message unit in the message queue.

[0010] In another embodiment of the present disclosure, the second storage module is a column storage database; the method further includes: writing the offline data to be stored into the column storage database; in response to a read request for target offline data in the offline data, obtaining the target offline data from the column storage database, and outputting the target offline data.

[0011] In another embodiment of the present disclosure, obtaining the target offline data from the column storage database includes: querying a metadata repository based on a data subscription identifier corresponding to the target offline data to obtain a data identifier of the target offline data corresponding to the data subscription identifier, and a storage location of the target offline data in the column storage database; and reading the target offline data corresponding to the data identifier from the column storage database according to the storage location.

[0012] In another embodiment of the present disclosure, the second storage module is a column storage database; the method further includes: reading feature group metadata corresponding to multiple object features to be processed, and obtaining a column family identifier of the feature group corresponding to the multiple object features in the column storage database; the feature group includes the multiple object features belonging to the same object; and performing corresponding data processing on the multiple object features of the same object at a column family storage location corresponding to the column family identifier in the column storage database.

[0013] In the second aspect of the embodiment of the present disclosure, a data processing device is provided, which includes: a data receiving module for receiving total real-time data to be stored; a write processing module for writing the total real-time data into a first storage module and a second storage module; and a read processing module for obtaining target real-time data to be read from the first storage module and the second storage module, and outputting the target real-time data.

[0014] In one embodiment of the present disclosure, the write processing module, when used to write the total real-time data into the first storage module and the second storage module, includes: writing the total real-time data into a message queue and an offline database; wherein, the first storage module is the message queue, and the second storage module is the offline database.

[0015] In another embodiment of the present disclosure, the reading processing module, when used to obtain the target real-time data to be read from the first storage module and the second storage module, includes: based on the metadata repository, querying the subscribed real-time data subscribed to in the total real-time data; obtaining the first real-time data that has been updated in the subscribed real-time data from the first storage module, and obtaining the second real-time data that has not been updated in the subscribed real-time data from the second storage module; and using the first real-time data and the second real-time data as the target real-time data.

[0016] In another embodiment of the present disclosure, the reading processing module, when used to query the subscribed real-time data subscribed by the total real-time data and obtain the first real-time data updated in the subscribed real-time data from the first storage module, includes: based on the metadata repository, querying the consumption message unit in the message queue corresponding to the subscribed real-time data; obtaining the first real-time data from the message queue, and distributing the first real-time data to the corresponding consumption message unit in the message queue; wherein, the first storage module is a message queue.

[0017] In another embodiment of the present disclosure, the write processing module is further used to: write the offline data to be stored into a column storage database; the second storage module is a column storage database; the read processing module is further used to: respond to a read request for target offline data in the offline data, obtain the target offline data from the column storage database, and output the target offline data.

[0018] In another embodiment of the present disclosure, the reading processing module, when used to obtain the target offline data from the column storage database, includes: based on the data subscription identifier corresponding to the target offline data, querying the metadata repository to obtain the data identifier of the target offline data corresponding to the data subscription identifier, and the storage location of the target offline data in the column storage database; according to the storage location, reading the target offline data corresponding to the data identifier from the column storage database.

[0019] In another embodiment of the present disclosure, the reading and processing module is further used to: read the feature group metadata corresponding to the multiple object features to be processed, and obtain the column family identifier of the feature group corresponding to the multiple object features in the column storage database; the feature group includes multiple object features belonging to the same object; the second storage module is a column storage database; in the column family storage location corresponding to the column family identifier in the column storage database, perform corresponding data processing on the multiple object features of the same object.

[0020] In a third aspect of an embodiment of the present disclosure, a storage system is provided, the system comprising: a first storage module, a second storage module, and the data processing device described in any embodiment of the present disclosure.

[0021] In a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the data processing method of any embodiment of the present disclosure is implemented.

[0022] In the fifth aspect of the embodiments of the present disclosure, a computing device is provided, which may include a memory and a processor, wherein the memory is used to store computer instructions that can be executed on the processor, and the processor is used to implement the data processing method described in any embodiment of the present disclosure when executing the computer instructions.

[0023] The data processing method and apparatus, computer-readable storage medium and computing device provided by the embodiments of the present disclosure store total real-time data by at least two storage modules, and obtain the target real-time data to be read through the at least two storage modules, so that the required target real-time data can be obtained quickly and conveniently, thereby improving the data acquisition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0025] Figure 1A flowchart of a data processing method according to an embodiment of the present disclosure is schematically shown;

[0026] Figure 2 The schematic diagram shows a principle framework diagram of data processing according to an embodiment of the present disclosure;

[0027] Figure 3 A flowchart schematically shows another data processing method according to an embodiment of the present disclosure;

[0028] Figure 4 A flowchart of writing a real-time feature according to an embodiment of the present disclosure is schematically shown;

[0029] Figure 5 A flowchart of reading offline data according to an embodiment of the present disclosure is schematically shown;

[0030] Figure 6 The structure diagram of a data processing device according to an embodiment of the present disclosure is schematically shown;

[0031] Figure 7 A schematic diagram schematically shows a computer-readable storage medium according to an embodiment of the present disclosure;

[0032] Figure 8 A schematic diagram of the structure of a computing device according to an embodiment of the present disclosure is shown schematically.

[0033] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0034] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0035] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0036] According to the embodiments of the present disclosure, a data processing method and apparatus, a computer-readable storage medium and a computing device are proposed. In this document, it should be understood that any number of elements in the drawings is for illustration and not for limitation, and any naming is only for distinction and does not have any limiting meaning.

[0037] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.

[0038] In the storage and use of data, one type of data is "real-time data". In the related art, for the storage of real-time data, a message queue can usually be used, through which the updated real-time data is pushed to the data user in a timely manner. However, the inventors found that this method has limitations. Due to the real-time characteristics of real-time data, the latest real-time data is usually pushed to the data user through a message queue. If the data user wants to obtain more real-time data when training a neural network algorithm, it will be very inconvenient. For example, the data user needs to store and manage the previous real-time data by himself, which also reduces the efficiency of data acquisition.

[0039] Based on this, the present disclosure provides a data processing method. Figure 1 The flow of a data processing method according to an embodiment of the present disclosure is schematically shown. For example, the method may be executed by a storage system, and specifically may be executed by a data processing device in the storage system. Figure 1 As shown, the data processing method may include the following processing:

[0040] In step 100, total real-time data to be stored is received.

[0041] In this step, the total real-time data is relative to the target real-time data to be read later, and the total real-time data at least includes the target real-time data to be read. For example, assuming that the target real-time data to be read by the data user in the subsequent steps includes "the number of times the song has been played in the last 5 minutes" (for the convenience of description, it can be called the first real-time feature) and "the number of likes for the song in the last 5 minutes" (can be called the second real-time feature), then the total real-time data received in this step can include at least the above-mentioned first real-time feature and the second real-time feature, and in addition, it can also include other real-time features such as "the number of comments on the song in the last hour".

[0042] In addition, the total real-time feature can be received by a data warehouse. For example, a real-time warehouse in the data warehouse can collect information and produce the total real-time data, and send the produced total real-time data to the data processing device of this embodiment, so that the data processing device can store the total real-time data.

[0043] In step 102, the total real-time data is written into the first storage module and the second storage module.

[0044] In one example, the first storage module may be a message queue, such as Kafka. The second storage module may be an offline database, such as Hbase. Figure 2 As shown in FIG. 1 , the total real-time data 21 can be written into the first storage module 22 and the second storage module 23. For example, the total real-time data can be written into kafka and Hbase at the same time.

[0045] In step 104, target real-time data to be read is acquired from the first storage module and the second storage module, and the target real-time data is output.

[0046] The target real-time data may be data that the data user wants to read. For example, the data user wants to obtain the first real-time feature and the second real-time feature of the above example to train the neural network model using these features. Then the first real-time feature and the second real-time feature may be referred to as the target real-time data.

[0047] In this step, the target real-time data to be read can be obtained from the first storage module and the second storage module, and the target real-time data can be provided to the data user.

[0048] It should be noted that, on the one hand, the total real-time data in this embodiment is written into at least two different storage modules, that is, the storage modules into which the total real-time data is written can be more than two, and the number of modules is not limited to two. On the other hand, this embodiment describes the characteristics of real-time data when it is stored, that is, it is written into at least two storage modules; and the characteristics of real-time data when it is read, that is, the target real-time data to be read can be obtained through at least two storage modules.

[0049] For a clearer understanding, an example is given below: Assume that the total real-time data received includes d1, d2, d3 and d4, wherein the real-time data d1 and d2 are written in the first storage module, and the real-time data d3 and d4 are written in the second storage module. And assume that the target real-time data to be read by the data user is "d1+d2+d3", then the data processing device of this embodiment can read d1 and d2 by the first storage module, and read d3 by the second storage module, so that all the target real-time data can be obtained and fed back to the data user. In the related art, the data user can only read d1 and d2 by the first storage module, and the real-time data d3 must be obtained from another channel, which is more cumbersome, reduces the efficiency of data acquisition, and also affects the processing progress of the business using the data.

[0050] The data processing method of this embodiment stores total real-time data by at least two storage modules, and obtains the target real-time data to be read through the at least two storage modules, so that the required target real-time data can be obtained quickly and conveniently, thereby improving the data acquisition efficiency.

[0051] In another embodiment, in order to further improve the efficiency of acquiring data in the storage system, a method of acquiring data by subscription is provided in the embodiment of the present disclosure. In the following example description, the acquisition process of real-time data is still taken as an example to illustrate how to acquire real-time data by subscription.

[0052] For example, the subscription may be a subscription table constructed by the data user according to the data required by the user, and the subscription table may be stored in the storage system of the embodiment of the present disclosure and used as metadata when reading data. The subscription table may be stored in the metadata repository in the storage system. The following Table 1 illustrates a form of a subscription table that may be used:

[0053] Table 1 The first subscription table

[0054]

[0055]

[0056] Table 2 Second subscription table

[0057] Field Name Field Type Field Description id bigint Auto-increment primary key feature_sub_id bigint Feature Subscription Name feature_id bigint Feature ID creator string Creator modifier string Modified by db_create_time timestamp Creation time db_update_time timestamp Modification time

[0058] As shown above, a feature subscription name "feature_sub_name" can correspond to a subscription. For example, if a data user wants to use real-time data d1 and d2, then a subscription information under a corresponding feature subscription name can be created; if another data user wants to use real-time data d1, d2, and d4, then a subscription information under another corresponding feature subscription name can be created.

[0059] In the above example, the subscription information under the same feature subscription name may include two subscription tables, namely the first subscription table and the second subscription table. It should be noted that this embodiment does not limit the number of subscription tables to two. For example, the first subscription table and the second subscription table mentioned above can be combined into one subscription table. Among them, the second subscription table sets which real-time data to subscribe to specifically. These real-time data can use "feature_id" as the data identifier, and the number of subscribed real-time data can be at least one. In this embodiment, the subscribed real-time data can be referred to as "subscribed real-time data".

[0060] In addition, taking the first storage module as a message queue, and the message queue may be, for example, Kafka, in the second subscription table, a consumption message unit in the message queue corresponding to the subscription real-time data is set, and the consumption message unit is Kafka Topic.

[0061] In addition, the "creator / creation time" in the first subscription table and the second subscription table may be the user who created the subscription information and the corresponding creation time. Similarly, the "modifier / modification time" may be the user who modified the subscription information and the corresponding modification time, for example, the user who modified the subscription real-time data or the Kafka Topic corresponding to the subscription real-time data. The storage system may provide multiple APIs for modifying the above subscription information, through which subscription information may be added, updated, deleted or searched.

[0062] Based on the subscription information of the above example, Figure 3 The flow of another data processing method according to an embodiment of the present disclosure is schematically shown, in which the first subscription table and the second subscription table stored in the metadata repository are used to obtain the target real-time data to be read from the first storage module and the second storage module. Figure 3 As shown, the method may include the following processing:

[0063] In step 300, in response to receiving a read request for target real-time data, the subscribed real-time data subscribed from the total real-time data is queried based on the metadata repository.

[0064] For example, in this step, a read request for the target real-time data may be received, and the read request may carry the feature subscription name and the date range of the target real-time data to be obtained, for example, the date range may be data from August 5 to August 7. The target real-time data in this embodiment is the subscribed real-time data, which is the real-time data that the data user wants to obtain.

[0065] The subscribed real-time data of this embodiment may include two parts: one part is the updated first real-time data, and the other part is the unupdated second real-time data.

[0066] For example, suppose that when the total real-time data is initially written, it includes real-time data r1, real-time data r2, and real-time data r3, and these real-time data are written to Kafka and Hbase at the same time. Among them, real-time data r1 and real-time data r2 are updated more frequently, for example, new data is generated every 2 minutes, while real-time data r3 is updated less frequently, for example, new data is generated only once every 2 hours. In a subscription created by the data user, the above-mentioned real-time data r1, real-time data r2, and real-time data r3 are subscribed, and it is assumed that when the data user sends a read request for the subscribed real-time data, the first real-time data that is updated is the above-mentioned real-time data r1 and real-time data r2. These updated real-time data will be pushed in time through Kafka. However, due to the long update time interval of real-time data r3, it has not been updated yet, which is called the second real-time data that has not been updated. The second real-time data will not be in Kafka. Kafka stores the updated real-time data.

[0067] In the above case, the real-time data subscription will obtain real-time data r1 and real-time data r2 from Kafka, while real-time data r3 can be obtained from Hbase.

[0068] In this step, when querying the subscribed real-time data based on the metadata repository, the storage location information in Kafka corresponding to the feature subscription name and the storage location information in Hbase corresponding to the feature subscription name can be obtained according to the first subscription table in Table 1 (the storage location information in Hbase is not shown in Table 1). According to these storage location information, the storage location of the subscribed real-time data corresponding to the feature subscription name can be known. Among them, the storage location information in Kafka can include a Kafka Topic, that is, the Topic is a consumption message unit in the message queue corresponding to the subscribed real-time data.

[0069] In step 302, the first real-time data that is updated in the subscribed real-time data is obtained from the first storage module, and the second real-time data that is not updated in the subscribed real-time data is obtained from the second storage module.

[0070] Based on the Kafka Topic, the first real-time data r1 and r2 in the subscribed real-time data can be obtained from the Kafka message queue, and the first real-time data can be distributed to the Topic in Kafka. That is, the real-time data r1 and r2 subscribed by the user are obtained from Kafka and distributed to the subscribed Kafka Topic. Subsequently, Kafka will push the real-time data in the Topic to the data user.

[0071] Here is an explanation of the advantages of performing the above data distribution: by distributing the required real-time data to the corresponding subscription topic according to the real-time data subscribed by each data user, it is possible to reduce the traffic pressure of the data consumption task, reduce the export traffic, and reduce the consumption of unnecessary processing resources. For example, assuming that there are 100 real-time data received in total, and the data user only subscribes to 10 of them, compared to sending all 100 real-time data to the data user, only sending the subscribed 10 real-time data according to the data user's subscription, it is no longer necessary to send the other 90 unsubscribed data, thereby reducing the export traffic.

[0072] In addition, the second real-time data r3 may also be acquired according to the storage location information in Hbase corresponding to the feature subscription name.

[0073] Among them, when querying the metadata repository, in addition to the above-mentioned storage location information, the feature_id corresponding to the feature subscription name can also be queried according to the second subscription table in Table 2. Based on these feature_ids, that is, data identifiers, and combined with the date range of the target real-time data carried in the read request, the real-time data corresponding to the data identifier and date range can be obtained from the above-mentioned storage location.

[0074] In addition, it should be noted that even if the same real-time data is stored in Kafka and Hbase, for example, the above real-time data r1 to r3 are stored in Kafka and Hbase, but when reading real-time data, the real-time data in Kafka can be obtained first, and the real-time data that cannot be obtained from Kafka can be obtained from Hbase. For example, in the above example, the updated first real-time data r1 and r2 can be obtained from Kafka first, and since there is no r3 in Kafka, the second real-time data r3 that has not been updated can be obtained from Hbase.

[0075] like Figure 2 In other words, the first real-time data is acquired by the first storage module, and the second real-time data is acquired by the second storage module, that is, the subscribed real-time data is acquired by at least two different storage modules.

[0076] In step 304, the acquired first real-time data and second real-time data are used as target real-time data and fed back to the data user who sent the read request.

[0077] The sum of the first real-time data r1, r2 and the second real-time data r3 obtained above is called the subscribed real-time data, which is also the target real-time data. This step can return the subscribed real-time data to the reader.

[0078] The data processing method of this embodiment stores the total real-time data by at least two storage modules, and obtains the target real-time data to be read through the at least two storage modules, so that the required target real-time data can be obtained quickly and conveniently, thereby improving the data acquisition efficiency; and by adopting the message queue as the first storage module and the offline database as the second storage module, it is possible to push the updated real-time data to the user quickly and timely through the message queue, and also store the unupdated real-time data through the offline database, so as to facilitate the combination of the offline database and the message queue to realize faster acquisition of the target real-time data to be read and provide it to the user.

[0079] In addition, in the above-mentioned embodiment, by acquiring the target real-time data according to the subscription of the data user, the subscribed real-time data can be queried based on the metadata repository, and the real-time data can be acquired according to the subscribed real-time data. This subscription method facilitates the data reading of the data user. For example, the user only needs to provide the feature subscription name he created to obtain the target real-time data he wants, and no longer needs to enter more and more cumbersome data acquisition basis information, which also helps to improve the efficiency of data acquisition.

[0080] In yet another embodiment, the method of the disclosed embodiment further provides a unit of data storage called a "feature group", which includes multiple object features belonging to the same object. For example, in the related art, the data model of the data warehouse is divided into various subject domains and business domains, resulting in the frequent acquisition of multiple feature data of an entity object from multiple tables. Taking song features as an example, a song can be used as an entity object, and its features may include: song style, number of song plays, number of comments, number of likes, and other object features. If these features are stored in different tables according to subject domains / business domains during data storage, then these features need to be acquired from multiple tables such as the play fact table, comment fact table, and like fact table, reducing the efficiency of data acquisition.

[0081] Therefore, the feature group provided by the embodiment of the present disclosure puts multiple object features belonging to the same object into one feature group, and the one feature group may correspond to a table of Hbase, specifically, may correspond to a column family (CF) in Hbase. For example, taking the object as a user, all user features may be stored as a feature group in a CF table of Hbase, so that when acquiring data, it can be acquired from one table, which is helpful to improve the efficiency of data acquisition compared to acquiring data from multiple tables in the above-mentioned related art.

[0082] For example: when multiple object features belonging to the same object need to be processed, the processing may include writing or reading, and the feature group metadata corresponding to the multiple object features may be queried to obtain the column family CF identifier of the feature group corresponding to the multiple object features in the column storage database (for example, HBase). Based on the CF identifier, data processing is performed on the multiple object features of the same object in the corresponding column family storage location in the column storage database, for example, writing these object features to the above-mentioned column family storage location, or reading the multiple object features of the same object from the above-mentioned column family storage location CF. Since the processing of these object features is all on one table, the data processing efficiency is high.

[0083] The third subscription table in Table 3 below illustrates the definition of several fields included in the feature group, and the fourth subscription table in Table 4 illustrates the fields included in the feature table. The data in the embodiments of the present disclosure may be features.

[0084] Table 3 The third subscription table

[0085]

[0086]

[0087] Table 4 The fourth subscription table

[0088]

[0089] According to Table 3 and Table 4 above, the type of specific data can be obtained, such as 0 for offline data and 1 for real-time data. In addition, according to the fields such as feature_group_id, feature_name and feature_type in Table 4, it is possible to know which features are included in a feature group. The same feature group can include both offline data and real-time data. In addition, according to Table 3, the specific storage location of the feature group can be obtained, such as the topic in Kafka or the CF in Hbase. In addition, as mentioned in the previous example, the first subscription table can include the storage location information in Hbase corresponding to the feature subscription name. The storage location information can be the feature group ID-feature_group_id corresponding to the feature subscription name. According to the feature_group_id, querying the third subscription table can know the ColumnFamily of this feature group stored in Hbase.

[0090] For the metadata of the first subscription table, the second subscription table, the third subscription table, and the fourth subscription table, an API interface for managing these metadata can be provided. Through these API interfaces, operations such as searching, deleting, updating, and adding metadata such as feature groups / features / subscription information can be performed. The following are examples of several metadata management APIs, which are not limited to the specific implementation:

[0091] Table 5 Metadata management API

[0092]

[0093]

[0094] In addition, in the above example, the second storage module takes a column storage database as an example, for example, Hbase. The advantage of column storage is that it is convenient to add features. For example, if you want to add an object feature to a feature group, or for some intermediate processing features that need to be stored, such as Embedding features, you can easily add them in the column storage database, making better use of sharing and avoiding repeated calculations.

[0095] Based on the above definition of "feature group", when writing real-time features, you can follow Figure 4 The process shown is executed. Figure 4 As shown, the following processing may be included:

[0096] In step 400, the real-time data to be written and the feature group name are received.

[0097] In this step, a write request for real-time data may be received, and the write request may include at least the real-time data to be written and the feature group name feature_group_name to which the real-time data belongs. For example, the real-time feature "number of comments on a song in the last 2 minutes" belongs to the "song" feature group. In addition, the write request may also include other information, such as the primary key of the real-time data in the CF table in Hbase, etc.

[0098] In step 402, the metadata repository is queried according to the feature group name to obtain offline database information and message queue information corresponding to the feature group name.

[0099] For example, the third subscription table can be queried to obtain HBase connection information such as hbase_info, hbase_table, and hbase_cf corresponding to the feature group name, and Kafka connection information and Kafkatopic information corresponding to the feature group name can also be obtained.

[0100] If the above offline database information and message queue information are not acquired successfully, the process ends. If the acquisition is successful, continue to step 404.

[0101] In step 404, feature metadata is obtained based on the real-time data to be written, and it is verified whether the features match and whether the types match.

[0102] For example, the fourth subscription table can be used to check whether the real-time data to be written belongs to this feature group, whether there is corresponding feature metadata (i.e., feature definition corresponding to the fourth subscription table), and whether the feature type matches can also be determined based on feature_type. If these checks are not completely passed, for example, the type does not match, or there is no corresponding metadata, the writing process can be terminated; if the checks are passed, step 406 can be continued.

[0103] In step 406, the real-time data is written into the message queue and the offline database simultaneously.

[0104] For example, the real-time data to be written can be written to the CF of Hbase and the Topic of Kafka at the same time. If the writing is not successful, the process can be terminated and an error message can be returned.

[0105] In addition, if the writing is successful, the audit information of this writing can be reported. The audit information can include, but is not limited to: the data identification of the writing, the production task corresponding to the written data, the writing time, etc. Similarly, after the real-time data reading operation, the audit information of the reading can also be reported, which can include, for example: the data identification of the reading data, the consumption task corresponding to the reading data, the reading time, etc.

[0106] In any embodiment of the present disclosure, audit information can be reported for data writing or reading, which will not be described in detail later. The reporting of audit information helps to track data. For example, by querying audit information, you can easily know the production and consumption tasks of data, as well as the update time of the data, which data user has subscribed to the data, and other information. The embodiment of the present disclosure can also provide an API interface for reporting or querying audit information. For example, through API- / api / feature / audit / add, audit information of data reading and writing tasks can be reported.

[0107] In another example, when reading target real-time data, the read request for the target real-time data may include a Figure 3The feature subscription name and the date range of the target real-time data to be obtained are shown. Based on this information, the metadata repository can be queried to query the storage location information in Hbase corresponding to the feature subscription name. The storage location information can include the feature group corresponding to the subscribed real-time data, and the hbase_table, hbase_cf and other information corresponding to the feature group in Hbase.

[0108] When reading subscribed real-time data, you can first obtain it from Kafka. If it cannot be obtained from Kafka, you can obtain it from the Hbase table based on the above hbase_table, hbase_cf and other information.

[0109] In addition, in order to improve the efficiency of data reading, the real-time data obtained from the Kafka or Hbase table can be stored in the local cache. When reading this data later, it can be read from the local cache to speed up the efficiency of data acquisition.

[0110] In another embodiment of the present disclosure, a data processing method is provided, in which the data read includes not only real-time data but also offline data. For example, a data user wants to read some data for training a neural network model, and the data to be read includes both real-time data and offline data. The real-time data to be read can be referred to as target real-time data, and the offline data to be read can be referred to as target offline data.

[0111] Can be combined with Figure 2 As shown, when writing data, the offline data produced by the offline warehouse can be written into the offline database, which is Figure 2 The second storage module in the example may be Hbase; the first storage module may be Kafka. Figure 2 In one example, the target real-time data to be read by the data user includes the updated first real-time data and the unupdated second real-time data, and the target offline data is also to be read. Then, the first real-time data can be obtained from the first storage module, and the second real-time data and the target offline data can be obtained from the second storage module.

[0112] If the data user needs to use both real-time data and offline data when training a model, the data processing method of the embodiment of the present disclosure can be adopted to simultaneously obtain the required target real-time data and target offline data through at least the first storage module and the second storage module, so that the data user can obtain data more conveniently and quickly.

[0113] The feature group provided by the embodiment of the present disclosure can also be used in the process of writing and reading offline data. For example, when writing offline data, at least the offline data to be written and the feature group name can be carried in the write request, and the metadata repository can be queried based on the feature group name to obtain the Hbase connection information, hbase_table, hbase_cf, etc. corresponding to the feature group, and based on this information, the offline data can be written into the CF table of Hbase.

[0114] Figure 5 This shows a process of reading offline data, which may include:

[0115] In step 500, a read request for target offline data is received, where the read request at least includes a feature subscription name and a data date range.

[0116] In this step, the target offline data is the offline data to be read, and the feature subscription name is the data subscription identifier corresponding to the target offline data. The data date range, for example, may be the offline data to be read from August 5 to August 7.

[0117] In step 502, based on the data subscription identifier corresponding to the target offline data, the metadata repository is queried to obtain the data identifier of the target offline data corresponding to the data subscription identifier and the storage location of the target offline data in the column storage database.

[0118] In this step, the metadata repository can be queried based on the feature subscription name to obtain a list of features specifically subscribed by the user. For example, the data identifier feature_name of the target offline data corresponding to the data subscription identifier can be obtained according to the fourth subscription table, and the storage location of the target offline data in the column storage database can be obtained according to the third subscription table, such as hbase_info, hbase_table, and hbase_cf.

[0119] In step 504, according to the storage location, the target offline data corresponding to the data identifier is read from the column storage database.

[0120] For example, the target offline data can be read according to the storage information such as feature_name, hbase_info, hbase_table and hbase_cf, and fed back to the data user.

[0121] In order to implement the data processing method of any embodiment of the present disclosure, the embodiment of the present disclosure also provides a data processing device. Figure 6The structure diagram of the data processing device according to an embodiment of the present disclosure is schematically shown. In the following description, the functions of each module of the device will be briefly described, and the detailed processing can be combined with the description of the data processing method of any embodiment of the present disclosure.

[0122] like Figure 6 As shown, the device may include: a data receiving module 61 , a writing processing module 62 and a reading processing module 63 .

[0123] The data receiving module 61 is used to receive the total real-time data to be stored.

[0124] The write processing module 62 is used to write the total real-time data into the first storage module and the second storage module.

[0125] The reading processing module 63 is used to obtain the target real-time data to be read from the first storage module and the second storage module, and output the target real-time data.

[0126] In one example, the write processing module 62, when used to write the total real-time data into a first storage module and a second storage module, includes: writing the total real-time data into a message queue and an offline database; wherein the first storage module is the message queue, and the second storage module is the offline database.

[0127] In one example, the reading processing module 63, when used to obtain the target real-time data to be read from the first storage module and the second storage module, includes: based on the metadata repository, querying the subscribed real-time data subscribed by the total real-time data; obtaining the first real-time data that has been updated in the subscribed real-time data from the first storage module, and obtaining the second real-time data that has not been updated in the subscribed real-time data from the second storage module; and using the first real-time data and the second real-time data as the target real-time data.

[0128] In one example, the reading processing module 63, when used to query the subscribed real-time data subscribed by the total real-time data and obtain the first real-time data updated in the subscribed real-time data from the first storage module, includes: based on the metadata repository, querying the consumption message unit in the message queue corresponding to the subscribed real-time data; obtaining the first real-time data from the message queue, and distributing the first real-time data to the corresponding consumption message unit in the message queue; wherein the first storage module is a message queue.

[0129] In one example, the write processing module 62 is further used to: write the offline data to be stored into a column storage database; the second storage module is a column storage database. The read processing module 63 is further used to: respond to a read request for target offline data in the offline data, obtain the target offline data from the column storage database, and output the target offline data.

[0130] In one example, the reading processing module 63, when used to obtain the target offline data from the column storage database, includes: based on the data subscription identifier corresponding to the target offline data, querying the metadata repository to obtain the data identifier of the target offline data corresponding to the data subscription identifier, and the storage location of the target offline data in the column storage database; according to the storage location, reading the target offline data corresponding to the data identifier from the column storage database.

[0131] In one example, the reading processing module 63 is also used to: read the feature group metadata corresponding to the multiple object features to be processed, and obtain the column family identifier of the feature group corresponding to the multiple object features in the column storage database; the feature group includes the multiple object features belonging to the same object; the second storage module is a column storage database; in the column family storage location corresponding to the column family identifier in the column storage database, perform corresponding data processing on the multiple object features of the same object.

[0132] It should be noted that, although several units / modules or sub-units / modules of the data processing device are mentioned in the above detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above may be embodied in one unit / module. Conversely, the features and functions of one unit / module described above may be further divided into multiple units / modules to be embodied.

[0133] The embodiments of the present disclosure also provide a storage system, which may include a first storage module, a second storage module, and the data processing device described in any embodiment of the present disclosure. For example, the first storage module may be a Kafka message queue, and the second storage module may be an Hbase column storage database. The data processing device may execute the data processing method of any embodiment of the present disclosure, for example, the total real-time data received may be stored in the first storage module and the second storage module at the same time, and the target real-time data to be read may be obtained from the first storage module and the second storage module. For another example, the data processing device may also query the subscribed real-time data based on the metadata repository, and obtain the first real-time data that has been updated in the subscribed real-time data from the first storage module, and obtain the second real-time data that has not been updated in the subscribed real-time data from the second storage module.

[0134] The present disclosure also provides a computer-readable storage medium. Figure 7 As shown, the storage medium stores a computer program 701, and when the computer program 701 is executed by a processor, the data processing method of any embodiment of the present disclosure can be executed.

[0135] An embodiment of the present disclosure further provides a computing device, which may include a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement the data processing method of any embodiment of the present disclosure when executing the computer instructions.

[0136] Figure 8 An example of a structure of the computing device is shown in FIG. Figure 8 As shown, the computing device 80 may include, but is not limited to: a processor 81 , a memory 82 , and a bus 83 connecting different system components (including the memory 82 and the processor 81 ).

[0137] The memory 82 stores computer instructions, which can be executed by the processor 81, so that the processor 81 can execute the advertising push method of any embodiment of the present disclosure. The memory 82 may include a random access memory unit RAM 821, a cache memory unit 822 and / or a read-only memory unit ROM 823. The memory 82 may also include: a program tool 825 having a set of program modules 824, the program modules 824 including but not limited to: an operating system, one or more application programs, other program modules and program data, and one or more combinations of these program modules may include the implementation of a network environment.

[0138] The bus 83 may include, for example, a data bus, an address bus, and a control bus. The computing device 80 may also communicate with an external device 85 through an I / O interface 84. The external device 85 may be, for example, a keyboard, a Bluetooth device, etc. The computing device 80 may also communicate with one or more networks through a network adapter 86. For example, the network may be a local area network, a wide area network, a public network, etc. Figure 8 As shown, the network adapter 86 can also communicate with other modules of the computing device 80 via the bus 83 .

[0139] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0140] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.

Claims

1. A data processing method, the method comprising: receiving total real-time data to be stored; The real-time data is real-time, and the total real-time data at least includes target real-time data to be read, and the target real-time data is data to be read by a data user; Writing the total real-time data into the first storage module and the second storage module; Acquire target real-time data to be read from the first storage module and the second storage module, and output the target real-time data; The step of obtaining the target real-time data to be read from the first storage module and the second storage module includes: Based on the metadata repository, query the subscribed real-time data subscribed by the total real-time data; Acquire the first real-time data updated in the subscribed real-time data from the first storage module, and acquire the second real-time data not updated in the subscribed real-time data from the second storage module; Using the first real-time data and the second real-time data as the target real-time data; The second storage module is a column storage database; the method further includes: Reading feature group metadata corresponding to a plurality of object features to be processed, and obtaining a column family identifier of a feature group corresponding to the plurality of object features in the column storage database; the feature group includes the plurality of object features belonging to the same object; In the column family storage location corresponding to the column family identifier in the column storage database, corresponding data processing is performed on the multiple object features of the same object.

2. The method according to claim 1, wherein writing the total real-time data into the first storage module and the second storage module comprises: Writing the total real-time data into a message queue and an offline database; The first storage module is the message queue, and the second storage module is the offline database.

3. The method according to claim 1, wherein the first storage module is a message queue; The querying of the subscribed real-time data subscribed to in the total real-time data based on the metadata repository, and obtaining the first real-time data updated in the subscribed real-time data from the first storage module, includes: Based on the metadata repository, querying the consumption message unit in the message queue corresponding to the subscribed real-time data; The first real-time data is obtained from the message queue, and the first real-time data is distributed to the corresponding message consumption unit in the message queue.

4. The method according to any one of claims 1 to 3, wherein the second storage module is a column storage database; the method further comprises: Writing the offline data to be stored into the column storage database; In response to a read request for target offline data in the offline data, the target offline data is acquired from the column storage database, and the target offline data is output.

5. According to the method of claim 4, the step of obtaining the target offline data from the column storage database comprises: Based on the data subscription identifier corresponding to the target offline data, query the metadata repository to obtain the data identifier of the target offline data corresponding to the data subscription identifier and the storage location of the target offline data in the column storage database; According to the storage location, the target offline data corresponding to the data identifier is read from the column storage database.

6. A data processing device, comprising: A data receiving module, used for receiving total real-time data to be stored; The real-time data is real-time, and the total real-time data at least includes target real-time data to be read, and the target real-time data is data to be read by a data user; A writing processing module, used for writing the total real-time data into the first storage module and the second storage module; A reading processing module, used for acquiring target real-time data to be read from the first storage module and the second storage module, and outputting the target real-time data; The reading processing module, when used to obtain the target real-time data to be read from the first storage module and the second storage module, includes: based on the metadata repository, querying the subscribed real-time data subscribed from the total real-time data; Acquire the first real-time data updated in the subscribed real-time data from the first storage module, and acquire the second real-time data not updated in the subscribed real-time data from the second storage module; use the first real-time data and the second real-time data as the target real-time data; The reading and processing module is also used to: read the feature group metadata corresponding to the multiple object features to be processed, and obtain the column family identifier of the feature group corresponding to the multiple object features in the column storage database; the feature group includes the multiple object features belonging to the same object; the second storage module is a column storage database; in the column storage database, at the column family storage position corresponding to the column family identifier, perform corresponding data processing on the multiple object features of the same object.

7. The device according to claim 6, The write processing module, when used to write the total real-time data into the first storage module and the second storage module, includes: The total real-time data is written into a message queue and an offline database; wherein the first storage module is the message queue, and the second storage module is the offline database.

8. The device according to claim 6, The reading processing module, when used to query the subscribed real-time data subscribed to in the total real-time data and obtain the first real-time data updated in the subscribed real-time data from the first storage module, includes: Based on the metadata repository, querying the consumption message unit in the message queue corresponding to the subscribed real-time data; The first real-time data is obtained from the message queue, and the first real-time data is distributed to the corresponding message consumption unit in the message queue; wherein the first storage module is a message queue.

9. The device according to any one of claims 6 to 8, The write processing module is further used to: write the offline data to be stored into the column storage database; the second storage module is a column storage database; The read processing module is further used to: in response to a read request for target offline data in the offline data, obtain the target offline data from the column storage database, and output the target offline data.

10. The device according to claim 9, The reading processing module, when used to obtain the target offline data from the column storage database, includes: Based on the data subscription identifier corresponding to the target offline data, query the metadata repository to obtain the data identifier of the target offline data corresponding to the data subscription identifier and the storage location of the target offline data in the column storage database; according to the storage location, read the target offline data corresponding to the data identifier from the column storage database.

11. A storage system, comprising: A first storage module, a second storage module, and the data processing device according to any one of claims 6 to 10.

12. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 5 of the present disclosure is implemented.

13. A computing device, comprising a memory and a processor, wherein the memory is used to store computer instructions executable on the processor, and the processor is used to implement the method described in any one of claims 1 to 5 of the present disclosure when executing the computer instructions.