Method, device and electronic device for constructing online feature library

By building a combination of Redis and HBase databases, the high update rate and large storage space requirements of the online feature library when storing features are solved, and efficient feature storage is achieved.

CN113850271BActive Publication Date: 2025-09-26BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110952910.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2025-09-26
Estimated Expiration
2041-08-19

AI Technical Summary

Technical Problem

Existing online feature libraries cannot simultaneously meet the requirements of high update rate and large storage space when storing features, resulting in low storage efficiency.

Method used

Two feature libraries are constructed: one is a redis database for high update rate, and the other is an hbase database for large storage space, which respectively meet the feature storage requirements of different update frequencies and adopt a dual-write method for feature storage.

Benefits of technology

The storage efficiency of the online feature library is improved, meeting the demand for high update rate and solving the problem of large storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113850271B_ABST
    Figure CN113850271B_ABST
Patent Text Reader

Abstract

The present disclosure discloses a method, device and electronic device for constructing an online feature library, which relates to the fields of artificial intelligence technology such as data production, big data, and cloud services. Specific solution: When constructing an online feature library, first determine the update frequency of the features to be stored; the update frequency includes a first update frequency and a second update frequency, and the first update frequency is higher than the second update frequency; and according to the update frequency, respectively determine a first feature library for storing features updated based on the first update frequency, and a second feature library for storing features updated based on the second update frequency; the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library; in this way, the first feature library can meet the demand for a higher update rate, thereby improving the storage efficiency of the online feature library, and the second feature library can meet the demand for a larger storage space, thereby solving the problem of insufficient storage space in the online feature library.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a method, device, and electronic device for constructing an online feature library, and specifically to artificial intelligence technologies such as data production, big data, and cloud services. Background Art

[0002] As the amount of network data continues to increase, how to obtain important information from massive data has become an essential skill for people in all walks of life.

[0003] Given that existing artificial intelligence algorithms rely on features extracted from data, and the extracted features are of great significance for data mining, after obtaining important information from massive data, we can further extract features from the important information and store the extracted features for subsequent use.

[0004] Therefore, how to construct an online feature library for storing features is crucial. Summary of the Invention

[0005] The present disclosure provides a method, device and electronic device for constructing an online feature library.

[0006] According to a first aspect of the present disclosure, a method for constructing an online feature library is provided. The method for constructing an online feature library may include:

[0007] Determine an update frequency of the feature to be stored; wherein the update frequency includes a first update frequency and a second update frequency, and the first update frequency is higher than the second update frequency.

[0008] According to the update frequency, a first feature library and a second feature library are respectively determined; wherein the first feature library is used to store features updated based on the first update frequency, and the second feature library is used to store features updated based on the second update frequency; the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library.

[0009] An online feature library for storing the features is constructed based on the first feature library and the second feature library.

[0010] According to a second aspect of the present disclosure, a method for online storage of features is provided. The method for online storage of features may include:

[0011] Determines the update frequency of the features to be stored.

[0012] According to the update frequency, a target feature library corresponding to the update frequency is determined from the online feature library.

[0013] The features to be stored are stored in the target feature library.

[0014] According to a third aspect of the present disclosure, a device for constructing an online feature library is provided. The device for constructing an online feature library may include:

[0015] A determination unit is used to determine an update frequency of the feature to be stored; wherein the update frequency includes a first update frequency and a second update frequency, and the first update frequency is higher than the second update frequency.

[0016] A processing unit is used to determine a first feature library and a second feature library respectively according to the update frequency; wherein the first feature library is used to store features updated based on the first update frequency, and the second feature library is used to store features updated based on the second update frequency; the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library.

[0017] The first construction unit is configured to construct an online feature library for storing the features based on the first feature library and the second feature library.

[0018] According to a fourth aspect of the present disclosure, a characteristic online storage device is provided, and the characteristic online storage device may include:

[0019] The determining unit is used to determine the update frequency of the feature to be stored.

[0020] The processing unit is configured to determine, based on the update frequency, a target feature library corresponding to the update frequency from the online feature library.

[0021] A storage unit is used to store the features to be stored in the target feature library.

[0022] According to a fifth aspect of the present disclosure, an electronic device is provided, which may include:

[0023] at least one processor; and

[0024] a memory communicatively connected to the at least one processor; wherein,

[0025] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for constructing an online feature library described in the first aspect above; or, so that the at least one processor can execute the method for online storage of features described in the second aspect above.

[0026] According to a sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method for constructing an online feature library described in the first aspect above; or, to execute the method for online storage of features described in the second aspect above.

[0027] According to the seventh aspect of the present disclosure, a computer program product is provided, comprising: a computer program, wherein the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the method described in the first aspect.

[0028] According to the technical solution disclosed in the present invention, an online feature library can be constructed based on the first feature library and the second feature library, and the first feature library can meet the demand for a higher update rate, effectively improving the storage efficiency of the online feature library, and the second feature library can meet the demand for a larger storage space, effectively solving the problem of storage space of the online feature library.

[0029] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0031] Figure 1 1 is a flow chart of a method for constructing an online feature library according to the first embodiment of the present disclosure;

[0032] Figure 2 This is a schematic diagram of the design of an online feature library provided by an embodiment of the present disclosure;

[0033] Figure 3 This is a schematic diagram of the design of an online feature library and an offline feature library provided in an embodiment of the present disclosure;

[0034] Figure 4 is a flowchart of a characteristic online storage method provided according to the second embodiment of the present disclosure;

[0035] Figure 5 3 is a schematic structural diagram of an online feature library construction device provided according to the third embodiment of the present disclosure;

[0036] Figure 6 is a structural diagram of an online storage device according to the features provided in the fourth embodiment of the present disclosure;

[0037] Figure 7 It is a schematic block diagram of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0038] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0039] In the embodiments of the present disclosure, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. In the text description of the present disclosure, the character " / " generally indicates that the previous and next associated objects are in an "or" relationship. In addition, in the embodiments of the present disclosure, "first", "second", "third", "fourth", "fifth" and "sixth" are only used to distinguish the contents of different objects and have no other special meanings.

[0040] The technical solutions provided by the embodiments of the present disclosure can be applied to scenarios such as big data. As the amount of network data continues to increase, the massive amount of network data often includes some redundant data. Therefore, it is possible to extract important information from the massive amount of data. Given that existing artificial intelligence algorithms rely on features extracted from data, and that extracted features are of great significance for data mining, it is possible to further extract features from the extracted important information and store the extracted features for subsequent use.

[0041] When building an online feature library, given that existing features are updated in the form of aggregate tables, the update frequency usually includes daily updates and weekly updates. Among them, the daily feature update method requires a higher write rate for the online feature library, and the weekly feature update method requires a higher storage space for the online feature library. Therefore, considering the existing feature update requirements, namely the high write rate requirement and the large storage space requirement, when building an online feature library for storing features, two different feature update requirements can be combined to build an online feature library. Among them, one online feature library is a database with fast update and query speed, which is used to meet the write rate requirement of the online feature library when storing features, and the other online feature library is a low-priced and inexpensive database, which is used to meet the large storage space requirement when storing features. In this way, based on the update requirements of existing features, an online feature library that meets the update requirements can be built in a targeted manner, so that the constructed online feature library can meet both the write rate requirement of the online feature library and the large storage space requirement when storing features.

[0042] Based on the above technical concepts, the present disclosure provides a method for constructing an online feature library. The following describes the method in detail through specific embodiments. It is understood that the following specific embodiments may be combined with each other, and that the same or similar concepts or processes may not be described in detail in some embodiments.

[0043] Example 1

[0044] Figure 1 This is a flow chart of a method for constructing an online feature library according to the first embodiment of the present disclosure. The method for constructing an online feature library can be executed by software and / or hardware devices. For example, the hardware device can be a terminal or a server. Figure 1 As shown, the method for constructing the online feature library may include:

[0045] S101. Determine an update frequency of a feature to be stored; wherein the update frequency includes a first update frequency and a second update frequency, and the first update frequency is higher than the second update frequency.

[0046] Among them, the update frequency of the features to be stored can be understood as the online feature library that needs to be built this time. The update frequency of the features to be stored when used to store features later can indicate the construction requirements of the online feature library to a certain extent.

[0047] For example, the first update frequency can be the update frequency of the existing daily update feature, and the second update frequency can be the update frequency of the existing weekly update feature. In addition, the first update frequency can also be the update frequency of the weekly update feature, and the second update frequency can also be the update frequency of the biweekly update feature. The specific settings can be based on actual business needs. Here, the embodiment of the present disclosure is only described by taking the example that the first update frequency can be the update frequency of the existing daily update feature and the second update frequency can be the update frequency of the existing weekly update feature, but it does not mean that the embodiment of the present disclosure is limited to this.

[0048] Given that the features to be stored in the online feature library to be constructed include features updated based on the first update frequency and features updated based on the second update frequency when subsequently storing features, when constructing the online feature library, online feature libraries applicable to two different update frequencies may be determined respectively according to the two different update frequencies, that is, the following S102 is executed:

[0049] S102. Determine a first feature library and a second feature library respectively according to the update frequency; wherein the first feature library is used to store features updated based on the first update frequency, and the second feature library is used to store features updated based on the second update frequency, the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library.

[0050] When determining the first feature library and the second feature library respectively according to the update frequency, given that the first update frequency is higher than the second update frequency, it means that when storing the features updated based on the first update frequency, it is necessary to complete the feature update in a shorter time than the features updated based on the second update frequency, and the update rate requirement for the online feature library is higher. Therefore, when designing the first feature library for storing the features updated based on the first update frequency, the first feature library needs to meet the high update rate requirement; and when storing the features updated based on the second update frequency, given that the second update frequency is lower than the first update frequency, usually, the feature quantity updated based on the second update frequency requires more feature quantities to be updated than the feature quantity updated based on the first update frequency, and the storage space requirement for the online feature library is higher. Therefore, when designing the second feature library for storing the features updated based on the second update frequency, the second feature library needs to meet the storage space requirement.

[0051] Taking the example of a daily update frequency and a weekly update frequency as the first example, given the fast update and query speeds of the Redis database, the Redis database can be used as the first feature library for storing features based on daily updates. This allows the Redis database to meet the high update rate requirements, effectively improving the storage efficiency of the online feature library. Furthermore, given the HBase database's low-cost storage and ability to operate with multiple, less powerful storage devices, the HBase database can be used as the second feature library for storing features based on weekly updates. This allows the HBase database to meet the larger storage space requirements, effectively solving the storage space issues of the online feature library.

[0052] It is understandable that the first feature library can be other storage media besides the redis database, for example, an ssdb database, or a storage medium developed by the enterprise with the characteristics of fast update and query speed. It can be set according to actual needs. Here, the embodiment of the present disclosure is described as the first feature library being a redis database, but it does not mean that the embodiment of the present disclosure is limited to this. Similarly, the second feature library can be other storage media besides the hbase database, for example, cassandra or mongodb, etc., which have the characteristics of low-cost storage. It can be set according to actual needs. Here, the embodiment of the present disclosure is described as the second feature library being an hbase database, but it does not mean that the embodiment of the present disclosure is limited to this.

[0053] After determining the first feature library and the second feature library for meeting different update frequency requirements according to the update frequency, an online feature library for storing features can be constructed based on the first feature library and the second feature library, that is, the following S103 is executed:

[0054] S103: Construct an online feature library for storing features based on the first feature library and the second feature library.

[0055] When constructing an online feature library for storing features based on the first feature library and the second feature library, the first feature library and the second feature library can be directly determined as the online feature library, that is, the online feature library adopts the design scheme of the first feature library and the second feature library. The first feature library in the online feature library constructed in this way can meet the demand of a higher update rate, effectively improving the storage efficiency of the online feature library. The second feature library in the online feature library can meet the demand of a larger storage space, effectively solving the problem of storage space of the online feature library.

[0056] Taking the first feature library as redis database and the second feature library as hbase database as an example, the online feature library constructed adopts the design scheme of redis database and hbase database. For an example, see Figure 2 As shown, Figure 2 This is a design schematic diagram of an online feature library provided by an embodiment of the present disclosure, wherein the Redis database is used to store features based on daily updates, so that the demand for a higher update rate can be met through the Redis database, which can effectively improve the storage efficiency of the online feature library; the HBase database is used to store features based on weekly updates, so that the demand for a larger storage space can be met through the HBase database, which can effectively solve the problem of storage space in the online feature library; in this way, when there is a subsequent prediction task that needs to obtain features, features can be obtained from the Redis database and the HBase database to perform the prediction task.

[0057] After testing, the online feature library adopts the design of Redis database and HBase database. Compared with the existing online feature library design, the storage time based on daily updated features is reduced from 3 hours to 30 minutes, and the storage space based on weekly updated features is reduced from 1TB of memory to 300GB of memory and 1TB of hard disk space.

[0058] It can be seen that in the embodiment of the present disclosure, when constructing an online feature library for storing features, the update frequency of the features to be stored can be determined first; the update frequency includes a first update frequency and a second update frequency, and the first update frequency is higher than the second update frequency; and according to the update frequency, a first feature library for storing features updated based on the first update frequency and a second feature library for storing features updated based on the second update frequency are determined respectively; the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library; in this way, in the online feature library constructed based on the first feature library and the second feature library, the first feature library can meet the demand of a higher update rate, effectively improving the storage efficiency of the online feature library, and the second feature library can meet the demand of a larger storage space, effectively solving the problem of storage space of the online feature library.

[0059] Based on the above Figure 1In the illustrated embodiment, after constructing an online feature library for storing features based on the first and second feature libraries, subsequent feature storage can be performed based on the feature update frequency, storing the features in the corresponding first or second feature library. It is understood that after constructing the online feature library for storing features, the feature storage logic corresponding to the first and second feature libraries in the online feature library must be determined; thus, subsequent feature storage can be performed based on the storage logic corresponding to the first and second feature libraries.

[0060] For example, for the first feature library, when determining its corresponding feature storage logic, it is taken into account that the objects to which the features to be stored belong are different, such as people or objects. Therefore, when storing the features through the first feature library, it is necessary to first set a keyword for the target object to which the features to be stored belong in the first feature library. When setting the keyword of the target object in the first feature library, the keyword can be the identifier of the target object, which is used to uniquely identify the target object. In addition, it can also include a preset feature prefix, which is used to indicate whether the features of the target object are stored in the first feature library, that is, the keyword of the target object in the first feature library includes the preset feature prefix and the identifier of the target object.

[0061] Typically, the features to be stored include the attributes of the features and the feature values ​​of the features. When storing the features to be stored in the first feature library, the first preset data format can be used for storage, wherein the key fields included in the first preset data format are used to store the attributes of the features, and the value fields included in the first preset data format are used to store the feature values ​​of the features. In this way, after determining the feature storage logic corresponding to the first feature library, the features updated based on the first update frequency can be accurately stored in the first feature library according to the feature storage logic, so that the first feature library can meet the requirements of a higher update rate, which can effectively improve the storage efficiency of the online feature library.

[0062] It can be understood that when storing features through the first preset data format of the first feature library, the features to be stored are single-dimensional features or multi-dimensional features. For example, if the feature is a single-dimensional feature, the key field in the first preset data format is the slot identifier corresponding to the feature, such as slot id; if the feature is a multi-dimensional feature, the key field in the first preset data format is the slot identifier corresponding to the feature and the dimension of the feature, such as slot id and dimension.

[0063] Taking the first feature library as a redis database as an example, when storing the features to be stored through the redis database, the preset feature prefix and the unique identifier of the target object can be used as the key in the redis database to uniquely identify the target object. For the features to be stored, including the attributes of the features and the feature values ​​of the features, the redis hash data format can be used as the first preset data format to store the features, wherein the hashkey field included in the redis hash data format is used to store the attributes of the features, and the hashvalue field included in the redis hash data format is used to store the feature values. In addition, when the feature is a single-dimensional feature, the slot id can be used as the hash key field in the redis hash data format; when the feature is a multi-dimensional feature, the slot id and the dimension can be used as the hash key field in the redis hash data format.

[0064] It should be noted that in the embodiment of the present disclosure, when saving features in the redis hash data format, when storing the features in the redis database, the redis database supports incremental feature updates; and when reading feature values ​​from the redis database, the redis database supports returning partial feature values ​​as needed.

[0065] It can be understood that when the updated features are updated in the form of daily aggregation tables, that is, updated daily, the feature values ​​generated by each daily aggregation table are always updated together in the object dimension. Therefore, for each daily aggregation table, an update time will be saved, indicating the update date of the feature corresponding to the daily aggregation table.

[0066] For example, for the second feature library, when determining its corresponding feature storage logic, it is taken into account that the objects to which the features to be stored belong are different, such as people or objects. Therefore, when storing the features through the second feature library, it is necessary to first set a keyword for the target object to which the features to be stored belong in the second feature library. When setting the keyword of the target object in the second feature library, the keyword can be the identifier of the target object, which is used to uniquely identify the target object. In addition, it can also include a preset feature prefix, which is used to indicate whether the features of the target object are stored in the second feature library, that is, the keyword of the target object in the second feature library includes the preset feature prefix and the identifier of the target object.

[0067] Typically, the features to be stored include the attributes of the features and the feature values ​​of the features. When storing the features to be stored in the second feature library, the second preset data format can be used for storage, wherein the column fields included in the second preset data format are used to store the attributes of the features, and the value fields included in the second preset data format are used to store the feature values ​​of the features. In this way, after determining the feature storage logic corresponding to the second feature library, the features updated based on the second update frequency can be accurately stored in the second feature library according to the feature storage logic, so that the second feature library can meet the requirements of a higher update rate, which can effectively improve the storage efficiency of the online feature library.

[0068] It can be understood that when storing features through the second preset data format of the second feature library, the features to be stored are single-dimensional features or multi-dimensional features. For example, if the feature is a single-dimensional feature, the column field in the second preset data format is the slot identifier corresponding to the feature, such as slot id; if the feature is a multi-dimensional feature, the column field in the second preset data format is the slot identifier corresponding to the feature and the dimension of the feature, such as slot id and dimension.

[0069] Taking the HBase database as an example, when the second feature library is used to store features in the HBase database and column storage is supported, a preset feature prefix and the unique identifier of the target object can be used as the rowkey in the HBase database to uniquely identify the target object. For the features to be stored, including the attributes of the features and the feature values ​​of the features, the column and value data format can be used as the second preset data format to store the features, wherein the column field is used to store the attributes of the features, and the value field is used to store the feature values ​​of the features. In addition, when the feature is a single-dimensional feature, the slot ID can be used as the column field in the column and value data format; when the feature is a multidimensional feature, the slot ID and the dimension can be used as the column field in the column and value data format.

[0070] It should be noted that in the embodiment of the present disclosure, when saving features in the data format of column and value, when storing the features in the HBase database, the HBase database supports incremental feature updates; and when reading feature values ​​from the HBase database, the HBase database supports returning partial feature values ​​according to demand.

[0071] In conjunction with the above description, after determining the feature storage logic corresponding to the first feature library, features updated based on the first update frequency can be accurately stored in the first feature library based on the feature storage logic corresponding to the first feature library, thereby meeting the requirement for a higher update rate through the first feature library, thereby effectively improving the storage efficiency of the online feature library. Furthermore, after determining the feature storage logic corresponding to the second feature library, features updated based on the second update frequency can be accurately stored in the second feature library based on the feature storage logic corresponding to the second feature library, thereby meeting the requirement for a higher update rate through the second feature library, thereby effectively improving the storage efficiency of the online feature library.

[0072] Based on the above embodiment, when storing features corresponding to data through the online feature library constructed based on the first feature library and the second feature library, since each day's data needs to store features corresponding to a time slice, and considering the scarcity of storage space in the online feature library, it is possible to consider constructing an offline feature library in addition to constructing the online feature library, and use the constructed offline feature library as a backup database for the online feature library, that is, using the online feature library and offline feature library as a feature storage solution. For an example, see Figure 3 As shown, Figure 3 This is a design schematic diagram of an online feature library and an offline feature library provided by an embodiment of the present disclosure. Features can be stored in the online feature library and the offline feature library respectively in a double-write manner. In addition, considering the scarcity of storage space in the online feature library, the online feature library can only save the features of the most recent update, while the offline feature library can save the features updated within a preset time period according to the business. In addition to the features of the most recent update, the features updated within the preset time period can also include the features updated in the previous time period. In this way, the features updated in the previous time period can be stored in the offline feature library without occupying the storage space of the online feature library, so as to prepare for the subsequent use of the features updated in the previous time period, thereby providing a feature basis for subsequent use. The length of the preset time period can be set according to actual needs. Here, the embodiment of the present disclosure does not impose specific restrictions on the specific length of the preset time period.

[0073] For example, the offline feature database can be a hive database, or other databases, such as a presto database, which can be set according to actual needs.

[0074] Taking the offline feature library as a Hive database as an example, when storing data features in the constructed Hive database, it is also necessary to determine the feature storage logic corresponding to the Hive database, as shown in Table 1 below:

[0075] Table 1

[0076]

[0077] As shown in Table 1, id represents the identifier of the person or object to which the feature belongs, source represents the name of the aggregation table containing the data corresponding to the calculated feature, fea represents the feature storage, success indicates whether the feature was successfully saved to the online feature library, ext represents a reserved field, event_day represents the partition time, and event_action represents the partition task. id, source, fea, success, and event_day are required when storing features in the offline feature library; ext and event_action are further extended when storing features in the offline feature library and do not need to be set.

[0078] After the online feature library of the first feature library and the second feature library is constructed through the above embodiment, the online feature library can be put into use. During the application of the online feature library, when there are features to be stored, the features to be stored can be stored in the first feature library or the second feature library in the online feature library in a targeted manner according to the update frequency of the features to be stored. For details, please refer to the following Figure 4 The second embodiment is shown.

[0079] Example 2

[0080] Figure 4 This is a flow chart of a characteristic online storage method provided in accordance with the second embodiment of the present disclosure. The characteristic online storage method can be executed by software and / or hardware devices. For example, the hardware device can be a terminal or a server. For example, see Figure 4 As shown, the online storage method of this feature may include:

[0081] S401: Determine the update frequency of the features to be stored.

[0082] For example, the update frequency can be daily, weekly, or bi-monthly, and can be set according to actual needs. Here, the embodiment of the present disclosure does not impose any specific restrictions on the update frequency.

[0083] For example, when obtaining the features to be stored, you can first obtain the data to be stored, and determine the pluggable feature operator corresponding to the data to be stored, and then calculate the data to be stored based on the pluggable feature operator to obtain the features of the data to be stored, which can be recorded as the features to be stored, thereby obtaining the features to be stored.

[0084] It can be understood that in the embodiments of the present disclosure, when calculating the stored data based on the pluggable feature operator, if the new data added daily or weekly does not involve the previous window data, only the features of the new data can be calculated; and the features of the new data can be stored in the online feature library; if the new data added daily or weekly involves the previous window data, it is necessary to recalculate the features of the one-year window data, and store the recalculated features of the one-year window data in the online feature library to replace the previously saved features.

[0085] For example, when determining the update frequency of the feature to be stored, the update frequency identifier of the feature to be stored can be received as input, and the update characteristics of the feature to be stored can be determined by the update frequency identifier. The update frequency of the feature to be stored can also be obtained by other means. The specific setting can be made according to actual business needs. Here, the embodiment of the present disclosure does not impose specific restrictions on the method of determining the update frequency of the feature to be stored.

[0086] After determining the update frequency of the feature to be stored, a target feature library corresponding to the update frequency can be determined from the online feature library according to the update frequency, that is, the following S402 is executed:

[0087] S402: According to the update frequency, determine a target feature library corresponding to the update frequency from the online feature library.

[0088] For example, the online feature database may include two update frequencies, each corresponding to a feature database, and a database corresponding to each update frequency, which can meet the storage requirements of the features when storing features updated based on the update frequency.

[0089] For example, if the update frequency is daily, the corresponding target feature library can be a Redis database, an SSDB database, or a proprietary storage medium with fast update and query speeds. These databases can meet the high update rate requirements, effectively improving the storage efficiency of the online feature library. If the update frequency is daily, the corresponding target feature library can be an HBase database, or a storage medium with low-cost storage, such as Cassandra or MongoDB, to meet the large storage space requirements, effectively solving the storage space problem of the online feature library.

[0090] After determining the target feature library corresponding to the update frequency from the online feature library, the features to be stored can be stored in the target feature library in a targeted manner, that is, the following S403 is executed:

[0091] S403: Store the features to be stored in the target feature library.

[0092] For example, if the update frequency is daily and the corresponding target feature library is a Redis database, the features to be stored can be stored in the Redis database. This allows the Redis database to meet the high update rate requirement, effectively improving the storage efficiency of the online feature library. If the update frequency is daily and the corresponding target feature library is an HBase database, the features to be stored can be stored in the HBase database. This allows the HBase database to meet the large storage space requirement, effectively solving the storage space problem of the online feature library.

[0093] As can be seen, in the disclosed embodiments, when storing features, the update frequency of the features to be stored can be determined first. Based on the update frequency, a target feature library corresponding to the update frequency is determined from the online feature library, and the features to be stored are then stored in the target feature library. In this way, based on the update frequency of the features to be stored, the features to be stored can be specifically stored in the target feature library corresponding to the update frequency, thereby satisfying the storage requirements of the features to be stored through the target feature library.

[0094] Based on the above Figure 4 In the embodiment shown, for example, the update frequency of the features to be stored may include a first update frequency or a second update frequency, and the first update frequency is higher than the second update frequency. For example, when determining a target feature library corresponding to the update frequency from an online feature library based on the update frequency, the following steps may be included:

[0095] If the update frequency is the first update frequency, the first feature library in the online feature library is determined as the target feature library. If the update frequency is the second update frequency, the second feature library in the online feature library is determined as the target feature library; wherein the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library.

[0096] It should be noted that the description of the first update frequency, the second update frequency, the first feature library and the second feature library is the same as above. Figure 1 In the embodiment shown, the descriptions of the first update frequency, the second update frequency, the first feature library, and the second feature library are similar, and can be found in the above descriptions. Figure 1 In the illustrated embodiment, the related descriptions of the first update frequency, the second update frequency, the first feature library, and the second feature library will not be repeated in detail in the embodiment of the present disclosure.

[0097] Correspondingly, if the target feature library is the first feature library, when storing the features to be stored in the target feature library, the preset feature prefix and the identifier of the target object to which the features to be stored belong can be determined as keywords of the target object in the first feature library; wherein, the preset feature prefix is ​​used to indicate whether the features to be stored of the target object are stored in the first feature library; the features to be stored of the target object are stored in the first feature library using the first preset data format, wherein the key fields included in the first preset data format are used to store the attributes of the features to be stored, and the value fields included in the first preset data format are used to store the feature values ​​of the features to be stored.

[0098] In this way, when storing the features to be stored in the first feature library, the keywords of the target object in the first feature library and the first preset data format can be used to accurately store the features updated based on the first update frequency in the first feature library, so as to meet the requirements of a higher update rate through the first feature library, which can effectively improve the storage efficiency of the online feature library.

[0099] Taking the first feature library as a redis database as an example, when storing the features to be stored through the redis database, the preset feature prefix and the unique identifier of the target object can be used as the key in the redis database to uniquely identify the target object. For the features to be stored, including the attributes of the features and the feature values ​​of the features, the redis hash data format can be used as the first preset data format to store the features, wherein the hashkey field included in the redis hash data format is used to store the attributes of the features, and the hashvalue field included in the redis hash data format is used to store the feature values. In addition, when the feature is a single-dimensional feature, the slot id can be used as the hash key field in the redis hash data format; when the feature is a multi-dimensional feature, the slot id and the dimension can be used as the hash key field in the redis hash data format.

[0100] It should be noted that in the embodiment of the present disclosure, when saving features in the redis hash data format, when storing the features in the redis database, the redis database supports incremental feature updates; and when reading feature values ​​from the redis database, the redis database supports returning partial feature values ​​as needed.

[0101] If the target feature library is the second feature library, when storing the feature to be stored in the target feature library, the preset feature prefix and the identifier of the target object to which the feature to be stored belongs can be determined as the keyword of the target object in the second feature library; wherein, the preset feature prefix is ​​used to indicate whether the feature to be stored of the target object is stored in the second feature library; the feature to be stored of the target object is stored in the second feature library using the second preset data format, wherein the column field included in the second preset data format is used to store the attributes of the feature to be stored, and the value field included in the second preset data format is used to store the feature value of the feature to be stored.

[0102] When storing the features to be stored in the second feature library, the keywords of the target object in the second feature library and the second preset data format can be used to accurately store the features updated based on the second update frequency in the second feature library, so as to meet the requirements of a higher update rate through the second feature library, thereby effectively improving the storage efficiency of the online feature library.

[0103] Taking the HBase database as an example, when the second feature library is used to store features in the HBase database and column storage is supported, a preset feature prefix and the unique identifier of the target object can be used as the rowkey in the HBase database to uniquely identify the target object. For the features to be stored, including the attributes of the features and the feature values ​​of the features, the column and value data format can be used as the second preset data format to store the features, wherein the column field is used to store the attributes of the features, and the value field is used to store the feature values ​​of the features. In addition, when the feature is a single-dimensional feature, the slot ID can be used as the column field in the column and value data format; when the feature is a multidimensional feature, the slot ID and the dimension can be used as the column field in the column and value data format.

[0104] It should be noted that in the embodiment of the present disclosure, when saving features in the data format of column and value, when storing the features in the HBase database, the HBase database supports incremental feature updates; and when reading feature values ​​from the HBase database, the HBase database supports returning partial feature values ​​according to demand.

[0105] In addition, it should be noted that in the embodiments of the present disclosure, when storing features to be stored in the online feature library, if the storage fails, resulting in only some features and feature values ​​being successfully stored in the online feature library, the features that failed to be stored can be recorded and the features that failed to be stored can be stored again. If a downstream task urgently needs to use the features in the online feature library, the update date of the successfully stored features will be saved in the online feature library. The downstream task will determine whether the features in the online feature library can meet the task requirements based on the timeliness of the features.

[0106] Furthermore, given that each day's data requires the storage of features corresponding to a time slice, and given the limited storage space in the online feature library, it is possible to consider building an offline feature library alongside the online feature library, using the offline feature library as a backup database for the online feature library. This approach, in other words, employing a dual-write feature library approach, writing the features to be stored to both the online and offline feature libraries. This approach further improves feature storage efficiency compared to first writing the features to be stored to the offline feature library and then synchronizing them to the online feature library.

[0107] It can be understood that when certain features stored in the online feature library are no longer needed by downstream tasks, these features can be marked for deletion in both the online database and the offline feature library. In this way, when the features are stored next time, these features and their corresponding feature values ​​can be deleted in both the online database and the offline feature library. This can achieve the update of the online feature library and the offline feature library, avoid storing invalid features in the online feature library and the offline feature library, and thus save storage space for the online feature library and the offline feature library.

[0108] Example 3

[0109] Figure 5 This is a schematic diagram of the structure of the online feature library construction device 50 provided in accordance with the third embodiment of the present disclosure. Figure 5 As shown, the online feature library construction device 50 may include:

[0110] The determining unit 501 is configured to determine an update frequency of the feature to be stored; wherein the update frequency includes a first update frequency and a second update frequency, and the first update frequency is higher than the second update frequency.

[0111] The processing unit 502 is used to determine a first feature library and a second feature library respectively according to the update frequency; wherein the first feature library is used to store features updated based on the first update frequency, and the second feature library is used to store features updated based on the second update frequency; the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library.

[0112] The first constructing unit 503 is configured to construct an online feature library for storing features based on the first feature library and the second feature library.

[0113] Optionally, the keyword of the target object to which the feature belongs in the first feature library includes a preset feature prefix and an identifier of the target object; wherein the preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the first feature library.

[0114] The features of the target object are stored in a first preset data format, wherein the key fields included in the first preset data format are used to store attributes of the features, and the value fields included in the first preset data format are used to store feature values ​​of the features.

[0115] Optionally, if the feature is a single-dimensional feature, the key field in the first preset data format is the slot identifier corresponding to the feature; if the feature is a multidimensional feature, the key field in the first preset data format is the slot identifier corresponding to the feature and the dimension of the feature.

[0116] Optionally, the keyword of the target object to which the feature belongs in the second feature library includes a preset feature prefix and an identifier of the target object; wherein the preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the second feature library.

[0117] The characteristics of the target object are stored in a second preset data format, wherein the column fields included in the second preset data format are used to store attributes of the characteristics, and the value fields included in the second preset data format are used to store characteristic values ​​of the characteristics.

[0118] Optionally, if the feature is a single-dimensional feature, the column field in the second preset data format is the slot identifier corresponding to the feature; if the feature is a multi-dimensional feature, the column field in the second preset data format is the slot identifier corresponding to the feature and the dimension of the feature.

[0119] Optionally, the online feature library construction device 50 further includes a second construction unit.

[0120] The second construction unit is used to construct an offline feature library. The offline feature library is a backup database of the online feature library. The offline feature library is used to store features updated within a preset time period.

[0121] The online feature library construction device 50 provided in the embodiment of the present disclosure can execute the technical solution of the online feature library construction method shown in any of the above embodiments. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the online feature library construction method. The implementation principle and beneficial effects of the online feature library construction method will not be repeated here.

[0122] Example 4

[0123] Figure 6 This is a structural diagram of an online storage device 60 according to the features provided in the fourth embodiment of the present disclosure. For example, see Figure 6 As shown, the online storage device 60 of this feature may include:

[0124] The determining unit 601 is configured to determine the update frequency of the feature to be stored.

[0125] The processing unit 602 is configured to determine, according to the update frequency, a target feature library corresponding to the update frequency from the online feature library.

[0126] The storage unit 603 is used to store the features to be stored in the target feature library.

[0127] Optionally, the update frequency includes a first update frequency or a second update frequency, and the first update frequency is higher than the second update frequency; the processing unit 602 includes a first processing module and a second processing module.

[0128] The first processing module is configured to determine a first feature library in the online feature library as a target feature library if the update frequency is the first update frequency.

[0129] The second processing module is used to determine the second feature library in the online feature library as the target feature library if the update frequency is the second update frequency; wherein the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library.

[0130] Optionally, if the target feature library is the first feature library, the storage unit 603 includes a first storage module and a second storage module.

[0131] The first storage module is used to determine the preset feature prefix and the identifier of the target object to which the feature to be stored belongs as the keyword of the target object in the first feature library; wherein the preset feature prefix is ​​used to indicate whether the feature to be stored of the target object is stored in the first feature library.

[0132] The second storage module is used to store the to-be-stored features of the target object in the first feature library using the first preset data format, wherein the key fields included in the first preset data format are used to store the attributes of the to-be-stored features, and the value fields included in the first preset data format are used to store the feature values ​​of the to-be-stored features.

[0133] Optionally, if the target feature library is the second feature library, the storage unit 603 includes a third storage module and a fourth storage module.

[0134] The third storage module is used to determine the preset feature prefix and the identifier of the target object to which the feature to be stored belongs as the keyword of the target object in the second feature library; wherein the preset feature prefix is ​​used to indicate whether the feature to be stored of the target object is stored in the second feature library.

[0135] The fourth storage module is used to store the to-be-stored features of the target object in the second feature library using the second preset data format, wherein the column fields included in the second preset data format are used to store the attributes of the to-be-stored features, and the value fields included in the second preset data format are used to store the feature values ​​of the to-be-stored features.

[0136] Optionally, the storage module also includes a fifth storage module.

[0137] The fifth storage module is used to store the features to be stored in the target feature library and the offline feature library respectively.

[0138] The characteristic online storage device 60 provided in the embodiment of the present disclosure can execute the technical solution of the characteristic online storage method shown in any of the above embodiments. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the characteristic online storage method. Please refer to the implementation principle and beneficial effects of the characteristic online storage method, and no further details will be given here.

[0139] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0140] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the method for constructing an online feature library provided in any of the above embodiments, or the solution for the online storage method of features.

[0141] Figure 7is a schematic block diagram of an electronic device provided according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided for example only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0142] like Figure 7 As shown, the electronic device 70 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the device 70 can also be stored in the RAM 703. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0143] Various components in device 70 are connected to I / O interface 705, including an input unit 706, such as a keyboard, mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, optical disk, etc.; and a communication unit 709, such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows device 70 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0144] The computing unit 701 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the method for constructing an online feature library or the method for online storage of features. For example, in some embodiments, the method for constructing an online feature library or the method for online storage of features can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 70 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the method for constructing an online feature library or the method for online storage of features described above can be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the online feature library construction method or the online feature storage method in any other appropriate manner (for example, by means of firmware).

[0145] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0146] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0147] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer 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 foregoing.

[0148] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0149] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0150] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.

[0151] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0152] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A method for constructing an online feature library, comprising: Determining an update frequency of the feature to be stored; wherein the update frequency includes a first update frequency and a second update frequency, and the first update frequency is higher than the second update frequency; According to the update frequency, a first feature library and a second feature library are respectively determined; wherein, the first feature library is used to store features updated based on the first update frequency, and the second feature library is used to store features updated based on the second update frequency; the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library; in the first feature library, the keyword of the target object to which the feature belongs includes a first preset feature prefix and an identifier of the target object, the first preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the first feature library, and the feature of the target object is stored in a first preset data format The first preset data format includes a key field and a value field, the key field is used to store the attributes of the feature, if the feature is a single-dimensional feature, the key field is the slot identifier corresponding to the feature; in the second feature library, the keyword of the target object to which the feature belongs includes a second preset feature prefix and the identifier of the target object, the second preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the second feature library, the feature of the target object is stored in the second preset data format, the second preset data format includes a column field and a value field, the column field is used to store the attributes of the feature, if the feature is a single-dimensional feature, the column field is the slot identifier corresponding to the feature; An online feature library for storing the features is constructed based on the first feature library and the second feature library.

2. The method according to claim 1, wherein The value field included in the first preset data format is used to store the feature value of the feature.

3. The method according to claim 1, If the feature is a multi-dimensional feature, the key fields in the first preset data format are the slot identifier corresponding to the feature and the dimension of the feature.

4. The method according to claim 1, wherein The value field included in the second preset data format is used to store the feature value of the feature.

5. The method according to claim 1, If the feature is a multi-dimensional feature, the column fields in the second preset data format are the slot identifier corresponding to the feature and the dimension of the feature.

6. The method according to any one of claims 1 to 5, further comprising: An offline feature library is constructed, where the offline feature library is a backup database of the online feature library and is used to store features updated within a preset time period.

7. A method for online storage of features, comprising: Determining an update frequency of the feature to be stored, wherein the update frequency includes a first update frequency or a second update frequency, and the first update frequency is higher than the second update frequency; If the update frequency is the first update frequency, the first feature library in the online feature library is determined as the target feature library; the first preset feature prefix and the identifier of the target object to which the feature to be stored belongs are determined as keywords of the target object in the first feature library, and the feature to be stored of the target object is stored in the first feature library using a first preset data format, the first preset data format including a key field and a value field, the first preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the first feature library, the key field is used to store the attribute of the feature, and if the feature is a one-dimensional feature, the key field is the slot identifier corresponding to the feature; If the update frequency is the second update frequency, the second feature library in the online feature library is determined as the target feature library; the second preset feature prefix and the identifier of the target object to which the feature to be stored belongs are determined as keywords of the target object in the second feature library, and the feature to be stored of the target object is stored in the second feature library using a second preset data format, the second preset data format including a column field and a value field, the second preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the second feature library, the column field is used to store the attribute of the feature, and if the feature is a one-dimensional feature, the column field is the slot identifier corresponding to the feature; The update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library; The features to be stored are stored in the target feature library.

8. The method according to claim 7, wherein: The value field included in the first preset data format is used to store the feature value of the feature to be stored.

9. The method according to claim 7, wherein: The value field included in the second preset data format is used to store the feature value of the feature to be stored.

10. The method according to any one of claims 7 to 9, wherein storing the features to be stored in the target feature library comprises: The features to be stored are stored in the target feature library and the offline feature library respectively.

11. A device for constructing an online feature library, comprising: a determining unit, configured to determine an update frequency of the feature to be stored; wherein the update frequency includes a first update frequency and a second update frequency, and the first update frequency is higher than the second update frequency; The processing unit is configured to determine a first feature library and a second feature library respectively according to the update frequency; wherein the first feature library is used to store features updated based on the first update frequency, and the second feature library is used to store features updated based on the second update frequency; the update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library; in the first feature library, the keyword of the target object to which the feature belongs includes a first preset feature prefix and an identifier of the target object, the first preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the first feature library, and the feature of the target object adopts a first preset data format The first preset data format includes a key field and a value field, the key field is used to store the attribute of the feature, if the feature is a single-dimensional feature, the key field is the slot identifier corresponding to the feature; in the second feature library, the keyword of the target object to which the feature belongs includes a second preset feature prefix and the identifier of the target object, the second preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the second feature library, the feature of the target object is stored in the second preset data format, the second preset data format includes a column field and a value field, the column field is used to store the attribute of the feature, if the feature is a single-dimensional feature, the column field is the slot identifier corresponding to the feature; The first construction unit is configured to construct an online feature library for storing the features based on the first feature library and the second feature library.

12. The device according to claim 11, wherein The value field included in the first preset data format is used to store the feature value of the feature.

13. The device according to claim 11, If the feature is a multi-dimensional feature, the key fields in the first preset data format are the slot identifier corresponding to the feature and the dimension of the feature.

14. The device according to claim 11, wherein The value field included in the second preset data format is used to store the feature value of the feature.

15. The device according to claim 11, If the feature is a multi-dimensional feature, the column fields in the second preset data format are the slot identifier corresponding to the feature and the dimension of the feature.

16. The device according to any one of claims 11 to 15, further comprising a second building unit; The second construction unit is configured to construct an offline feature library, where the offline feature library is a backup database of the online feature library and is configured to store features updated within a preset time period.

17. A characteristic online storage device comprising: a determining unit, configured to determine an update frequency of the feature to be stored, wherein the update frequency includes a first update frequency or a second update frequency, and the first update frequency is higher than the second update frequency; The processing unit includes a first processing module and a second processing module; the first processing module is configured to determine the first feature library in the online feature library as the target feature library if the update frequency is the first update frequency; the second processing module is configured to determine the second feature library in the online feature library as the target feature library if the update frequency is the second update frequency; if the target feature library is the first feature library, the storage unit includes a first storage module and a second storage module; if the target feature library is the second feature library, the storage unit includes a third storage module and a fourth storage module; The first storage module is configured to determine a first preset feature prefix and an identifier of a target object to which the feature to be stored belongs as a keyword for the target object in the first feature library, wherein the first preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the first feature library; The second storage module is configured to store the to-be-stored feature of the target object in the first feature library using a first preset data format, where the first preset data format includes a key field and a value field, where the key field is used to store an attribute of the feature; if the feature is a one-dimensional feature, the key field is a slot identifier corresponding to the feature; The third storage module is configured to determine a second preset feature prefix and an identifier of a target object to which the feature to be stored belongs as a keyword for the target object in the second feature library, wherein the second preset feature prefix is ​​used to indicate whether the feature of the target object is stored in the second feature library; The fourth storage module is configured to store the to-be-stored feature of the target object in the second feature library using a second preset data format, wherein the second preset data format includes a column field and a value field, wherein the column field is used to store attributes of the feature; if the feature is a one-dimensional feature, the column field is a slot identifier corresponding to the feature; The update rate of the first feature library is higher than the update rate of the second feature library, and the storage space of the second feature library is larger than the storage space of the first feature library; A storage unit is used to store the features to be stored in the target feature library.

18. The device according to claim 17, wherein The value field included in the first preset data format is used to store the feature value of the feature to be stored.

19. The device according to claim 17, wherein The value field included in the second preset data format is used to store the feature value of the feature to be stored.

20. The device according to any one of claims 17 to 19, wherein the storage module further comprises a fifth storage module; The fifth storage module is used to store the features to be stored in the target feature library and the offline feature library respectively.

21. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for constructing an online feature library according to any one of claims 1 to 6; or so that the at least one processor can execute the online storage method of the features according to any one of claims 7 to 10.

22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the method for constructing an online feature library according to any one of claims 1 to 6; or to execute the method for online storage of features according to any one of claims 7 to 10.

23. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method for constructing an online feature library according to any one of claims 1 to 6; or implements the steps of the method for online storage of features according to any one of claims 7 to 10.

Citation Information

Patent Citations

  • Data partition storage method, device and system

    CN111930848A