Feature storage method and device, feature reading method and device, medium, equipment and product
By using the compression processing and matching technology of feature groups in feature storage and reading, the problem of feature data management in Key-Value storage structure in complex e-commerce scenarios is solved, and efficient storage and reading of feature data is realized, reducing the system pressure.
Patent Information
- Application Number
- CN202411187299.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-11-22
AI Technical Summary
The existing Key-Value storage structure is difficult to effectively manage a large amount of feature data in complex e-commerce scenarios, resulting in excessive pressure on feature storage and reading, which cannot meet the actual application needs.
By determining the target feature group to which the feature belongs in multiple feature groups, obtaining other preset feature data except the target feature, performing compression processing, and writing compressed data into the preset database, or from multiple features when reading The feature group compressed data is matched in each preset database to improve read efficiency.
Through compressed storage and reading of feature groups, the storage pressure and read throughput of feature data are significantly reduced, and the processing capability and efficiency of the system are improved.
Smart Images

Figure CN119002819A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to a feature storage method, a feature reading method, a device, a medium, a device and a product. Background Art
[0002] At present, feature data is usually stored in the database in a Key-Value storage structure. As the actual application scenarios become more complex, more and more features need to be stored, resulting in greater pressure on feature storage. For example, in e-commerce scenarios, by using the product ID (Identity document) as the key and the product features as the value in the forward index, in actual e-commerce scenarios, the number of products can usually reach more than 100 million, and there are many features to be stored. The superposition of the product and feature levels requires a larger storage level, which puts great pressure on feature storage. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a feature storage method, the method comprising: In response to monitoring a storage request for feature data of a first feature, determining a target feature group to which the first feature belongs from a plurality of feature groups, wherein each of the feature groups includes a plurality of preset features; Acquire feature data of a second feature, where the second feature includes other preset features in the target feature group except the first feature; compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group; The feature group compressed data is written into a preset database corresponding to the target feature group.
[0005] In a second aspect, the present disclosure provides a feature reading method, the method further comprising: receiving a feature reading request, the feature reading request including an entity identifier of a third feature to be read, an identifier of a feature group to which the third feature belongs, and an identifier of the third feature; Determine, from a plurality of preset databases, a target preset database corresponding to the feature group to which the third feature belongs, each of the preset databases storing a plurality of feature group compressed data, the feature group compressed data being stored in the preset database based on the feature storage method described in the first aspect of the present disclosure; Determine, from among the plurality of feature group compressed data stored in the target preset database, target feature group compressed data that matches the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs; According to the target feature group compressed data, feature data corresponding to the identifier of the third feature is determined.
[0006] In a third aspect, the present disclosure provides a feature storage device, the device comprising: A first determining module, configured to determine, in response to monitoring a storage request for feature data of a first feature, a target feature group to which the first feature belongs from a plurality of feature groups, wherein each of the feature groups includes a plurality of preset features; an acquisition module, configured to acquire feature data of a second feature, wherein the second feature includes other preset features in the target feature group except the first feature; A compression module, used for compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group; The storage module is used to write the feature group compressed data into a preset database corresponding to the target feature group.
[0007] In a fourth aspect, the present disclosure provides a feature reading device, the device comprising: a second receiving module, configured to receive a feature reading request, wherein the feature reading request includes an entity identifier of a third feature to be read, an identifier of a feature group to which the third feature belongs, and an identifier of the third feature; A second determination module is used to determine, from a plurality of preset databases, a target preset database corresponding to the feature group to which the third feature belongs, each of the preset databases storing a plurality of feature group compressed data, the feature group compressed data being stored in the preset database based on the feature storage method described in the first aspect of the present disclosure; A third determination module is used to determine, from the plurality of feature group compressed data stored in the target preset database, target feature group compressed data that matches the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs; The fourth determination module is used to determine the feature data corresponding to the identifier of the third feature according to the target feature group compressed data.
[0008] In a fifth aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect or the second aspect of the present disclosure.
[0009] In a sixth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect or the second aspect of the present disclosure.
[0010] In a seventh aspect, the present disclosure provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect or the second aspect of the present disclosure.
[0011] Through the above technical solution, in response to monitoring a storage request for feature data of a first feature, a target feature group to which the first feature belongs is determined in a plurality of feature groups, feature data of other preset features in the target feature group except the first feature is obtained, the feature data of the first feature and the feature data of the second feature are compressed to obtain feature group compressed data corresponding to the target feature group, and then the feature group compressed data is written into a preset database corresponding to the target feature group. Each feature group includes a plurality of preset features. Thus, by setting feature groups, features are divided into corresponding feature groups. When it is necessary to store feature data of a certain feature, the feature group to which the feature belongs is taken as the object, and all feature data in the feature group are compressed and stored. In addition, the feature group contains a plurality of preset features, which is conducive to improving the compression ratio of the feature, thereby effectively reducing the pressure of feature storage.
[0012] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 is a flowchart of a feature storage method provided according to an embodiment of the present disclosure; Figure 2 is a flow chart of a feature reading method provided according to an embodiment of the present disclosure; Figure 3 is a block diagram of a feature storage device provided according to an embodiment of the present disclosure; Figure 4is a block diagram of a feature reading device provided according to an embodiment of the present disclosure; Figure 5 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0014] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0015] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0016] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0017] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0018] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0019] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0020] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0021] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0022] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0023] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0024] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0025] As described in the background technology, the current method of storing feature data through the Key-Value storage structure cannot cope with the increasingly complex feature requirements in actual applications, and the pressure of feature storage is increasing. At the same time, in actual application scenarios, it is also necessary to read the stored features for different businesses. As the number of features increases, there is a problem of high throughput pressure for reading feature data.
[0026] In order to solve the above technical problems, the present disclosure provides a feature storage method, a feature reading method, an apparatus, a medium, a device and a product.
[0027] Figure 1 FIG. 1 is a flow chart of a feature storage method provided according to an embodiment of the present disclosure. Figure 1 As shown, the feature storage method provided by the present disclosure may include steps 11 to 14.
[0028] In step 11, in response to monitoring a storage request for feature data of a first feature, a target feature group to which the first feature belongs is determined from among a plurality of feature groups.
[0029] Each feature group includes multiple preset features.
[0030] In the solution provided by the present disclosure, multiple feature groups can be set, and each feature group can have a unique identifier, such as the name of the feature group. In addition, which features are included in each feature group, that is, the multiple preset features included in each feature group can be set, and each preset feature can have a unique identifier, such as the name of the preset feature.
[0031] The feature group and the preset features included in the feature group can be set according to actual needs. For example, it can be set according to the actual business scenario, that is, set the feature group corresponding to the business scenario, and set the preset features contained in the feature group according to the features required by the business scenario. For example, in an e-commerce scenario, for the business of the same item of goods, it can be divided into recall, sorting, and filtering stages. In this way, the recall stage, sorting stage, and filtering stage of the business of the same item of goods can be divided into three different business scenarios, and feature groups are set separately, and the preset features contained in the feature groups are set.
[0032] Optionally, in the application scenario of the present disclosure, a feature platform and a feature configuration center may be provided. The feature platform may implement feature registration, and features may be used after registration. When registering a feature, basic information of the feature may be registered, such as the name of the feature, the type of feature, the business domain of the feature, and other information. In addition, if the feature is a preset feature in a feature group, it is also necessary to specify the feature group to which the preset feature belongs during registration. After the feature registration is completed, the basic information of the feature may be synchronized to the feature configuration center, and when the basic information of the feature is needed later, it may be directly obtained from the feature configuration center.
[0033] Based on this, if a storage request for feature data of a first feature is intercepted, in response thereto, the feature group to which the first feature belongs can be determined from among multiple feature groups as the target feature group. For example, the feature group to which the first feature belongs can be determined by the feature configuration center.
[0034] It should be noted that, for the purpose of clearer explanation, the present disclosure provides a processing method for the first feature. In an actual application scenario, multiple first features may exist at the same time, and each first feature may adopt the processing method provided by the present disclosure.
[0035] Optionally, the method provided by the present disclosure may further include the following steps: receiving a feature writing request, the feature writing request being used to trigger a writing operation of writing feature data of a first feature into a preset feature library; In response to detecting that the write operation is complete, a storage request is generated.
[0036] In the application scenarios of the present disclosure, a preset feature library may be provided to store registered features and their corresponding feature data. For example, in an e-commerce scenario, the preset feature library may be a commodity feature library, which stores commodity features and feature data corresponding to the commodity features.
[0037] Based on this, if there is new feature data, it can be written to the preset feature library first. The writing of feature data to the preset feature library can be achieved through a feature write request. Optionally, a feature write request can be initiated through a message queue. The feature write request, as a message in the message queue, can carry multiple features that need to be written. As mentioned above, the present disclosure mainly describes the relevant processing methods using a single first feature as an example. For the case of multiple features, the processing method of the first feature can be referred to.
[0038] Thus, after receiving the feature write request, a write operation is triggered to write the feature data of the first feature into the preset feature library, the feature data of the first feature is written into the preset feature library, and the write operation is completed. In response to detecting that the write operation is completed, the above storage request is generated.
[0039] For example, after the above-mentioned write operation is completed, a trigger message related to the write (i.e., a storage request) will be sent to the queue. The trigger message may include the feature data of the first feature written by the write operation. The feature distribution service consumes the trigger message, that is, it listens to the storage request and can obtain the feature data of the first feature that has been written.
[0040] Therefore, when new feature data is written into the preset feature library, the storage of the feature data to the underlying database can be automatically triggered.
[0041] In step 12, feature data of the second feature is obtained.
[0042] The second feature includes other preset features in the target feature group except the first feature.
[0043] Optionally, feature data of the second feature may be read from a preset feature library.
[0044] In step 13, the feature data of the first feature and the feature data of the second feature are compressed to obtain feature group compressed data corresponding to the target feature group.
[0045] In a possible implementation, the feature data of the first feature and the feature data of the second feature can be directly compressed using a preset compression algorithm to obtain feature group compressed data corresponding to the target feature group. The preset compression algorithm may include but is not limited to a lossless compression algorithm (such as Huffman coding, etc.), a lossy compression algorithm, etc.
[0046] In another possible implementation, step 13 may include the following steps: Serializing the feature data of the first feature and the feature data of the second feature to obtain a first bytecode file; The first bytecode file is compressed according to a preset compression algorithm to obtain feature group compressed data corresponding to the target feature group.
[0047] Optionally, the feature data of the first feature and the feature data of the second feature may be serialized according to a preset serialization format to obtain a byte sequence as a first bytecode file. For example, the preset serialization format may include but is not limited to JSON, XML, Protocol Buffers, etc.
[0048] After the first bytecode file is obtained, the first bytecode file may be compressed according to a preset compression algorithm to obtain feature group compressed data corresponding to the target feature group.
[0049] In this way, the feature group compressed data corresponding to the target feature group includes the latest feature data of all features in the target feature group.
[0050] In step 14, the feature group compressed data is written into a preset database corresponding to the target feature group.
[0051] The preset database may be a database based on a forward index.
[0052] In the application scenarios of the present disclosure, corresponding preset data may be set for different feature groups. For example, in the recall, filtering, and sorting stages described above, preset databases may be set for the corresponding feature groups.
[0053] Optionally, the primary key of the feature group compressed data in the preset database can be generated based on the entity identifier of the first feature and the identifier of the target feature group. For example, splicing according to certain rules. Among them, the identifier of the target feature group can be the name of the target feature group. For example, for an e-commerce scenario, the entity identifier can be a product ID, and the primary key can be spliced based on the product ID and the name of the target feature group.
[0054] Through the above technical solution, in response to monitoring a storage request for feature data of a first feature, a target feature group to which the first feature belongs is determined in a plurality of feature groups, feature data of other preset features in the target feature group except the first feature is obtained, the feature data of the first feature and the feature data of the second feature are compressed to obtain feature group compressed data corresponding to the target feature group, and then the feature group compressed data is written into a preset database corresponding to the target feature group. Each feature group includes a plurality of preset features. Thus, by setting feature groups, features are divided into corresponding feature groups. When it is necessary to store feature data of a certain feature, the feature group to which the feature belongs is taken as the object, and all feature data in the feature group are compressed and stored. In addition, the feature group contains a plurality of preset features, which is conducive to improving the compression ratio of the feature, thereby effectively reducing the pressure of feature storage.
[0055] Figure 2 FIG. 1 is a flow chart of a feature reading method provided according to an embodiment of the present disclosure. Figure 2 As shown, the feature reading method provided by the present disclosure may include steps 21 to 24.
[0056] In step 21, a feature read request is received.
[0057] The feature reading request may include the entity identifier of the third feature to be read, the identifier of the feature group to which the third feature belongs, and the identifier of the third feature.
[0058] Optionally, a characteristic read request can be generated by: determining an identity of a third feature to be read; Determine the entity identifier of the third feature according to the entity targeted by the target business scenario; Determine, according to the feature group corresponding to the target business scenario, an identifier of the feature group to which the third feature belongs; A feature reading request is generated according to the entity identifier of the third feature, the identifier of the feature group to which the third feature belongs, and the identifier of the third feature.
[0059] In some cases, it may not be necessary to read all the features in the feature group, therefore, the identifier of the third feature to be read may be determined to specify the feature data of which features need to be read through the feature reading request.
[0060] In actual applications, different features may need to be read for different business scenarios, see the business scenario examples for recall, filtering, and sorting stages described above. Based on this, for the target business scenario, the entity identifier of the third feature can be determined according to the entity targeted by the target business scenario, and the identifier of the feature group to which the third feature belongs can also be determined according to the feature group corresponding to the target business scenario.
[0061] Based on this, a feature reading request may be generated according to the entity identifier of the third feature, the identifier of the feature group to which the third feature belongs, and the identifier of the third feature.
[0062] Through the above method, feature reading requests can be designed according to different business requirements to effectively avoid erroneous reading of feature data of irrelevant features.
[0063] In step 22, a target preset database corresponding to the feature group to which the third feature belongs is determined from among the plurality of preset databases.
[0064] Each preset database stores multiple feature group compressed data, and the feature group compressed data is stored in the preset database based on the feature storage method provided by any embodiment of the present disclosure. The method of storing the feature group compressed data in the preset database has been given above and will not be repeated here.
[0065] As mentioned above, the feature group to which the preset feature belongs can be known, and the preset database corresponding to the feature group can also be referred to. In this way, the preset database corresponding to the feature group to which the third feature belongs can be determined from multiple preset databases as the target preset database.
[0066] In step 23, target feature group compressed data that matches the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs is determined from the plurality of feature group compressed data stored in the target preset database.
[0067] In step 24, feature data corresponding to the identifier of the third feature is determined based on the target feature group compressed data.
[0068] Among them, according to the target feature group compressed data and the compression method used when compressing the target feature group compressed data, the features contained in the target feature group compressed data and their feature data, that is, the feature data of each feature in the feature group to which the third feature belongs, can be obtained.
[0069] In a possible implementation, the compressed data of the target feature group may be decompressed by a decompression algorithm corresponding to a preset compression method to obtain feature data of each feature in the feature group to which the third feature belongs. Furthermore, the feature data that matches the identifier of the third feature in the feature data of the feature group to which the third feature belongs is determined as the feature data corresponding to the identifier of the third feature.
[0070] In another possible implementation, step 24 may include the following steps: Decompressing the compressed data of the target feature group according to a preset decompression algorithm to obtain a second bytecode file; Deserialize the second bytecode file to obtain feature data of the feature group to which the third feature belongs; Feature data that matches the identifier of the third feature among the feature data of the feature group to which the third feature belongs is determined as feature data corresponding to the identifier of the third feature.
[0071] Through the above technical solution, a feature reading request is received, and a target preset database corresponding to the feature group to which the third feature belongs is determined in multiple preset databases, wherein each preset database stores multiple feature group compressed data, and the feature group compressed data is stored in the preset database based on the feature storage method provided by the present disclosure, and the target feature group compressed data matching the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs is determined among the multiple feature group compressed data stored in the target preset database, and then the feature data corresponding to the identifier of the third feature is determined according to the target feature group compressed data. Thus, by setting the feature group, the features are divided into corresponding feature groups, and by reading the feature group compressed data, the feature data of all features in the feature group can be obtained at one time, without reading each feature separately, which is conducive to improving the throughput of feature data reading. Based on this, by setting the features related to a specific business in the same feature group, the feature group compressed data of the corresponding feature group can be read in the specific business, and the feature data of all features required by the specific business can be obtained at one time, thereby maximizing the throughput of the business and reducing redundant throughput.
[0072] Figure 3 is a block diagram of a feature storage device provided according to an embodiment of the present disclosure. Figure 3 As shown, the feature storage device 30 may include: A first determining module 31 is configured to determine, in response to monitoring a storage request for feature data of a first feature, a target feature group to which the first feature belongs from a plurality of feature groups, wherein each of the feature groups includes a plurality of preset features; An acquisition module 32, configured to acquire feature data of a second feature, where the second feature includes other preset features in the target feature group except the first feature; A compression module 33, configured to compress the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group; The storage module 34 is used to write the feature group compressed data into a preset database corresponding to the target feature group.
[0073] Optionally, the device 30 further includes: A first receiving module, used for receiving a feature writing request, wherein the feature writing request is used for triggering a writing operation of writing feature data of the first feature into a preset feature library; The first generating module is used to generate the storage request in response to detecting that the write operation is completed.
[0074] Optionally, the acquisition module 32 includes: The feature data of the second feature is read from the preset feature library.
[0075] Optionally, the compression module 33 includes: A first processing submodule, configured to perform serialization processing on the feature data of the first feature and the feature data of the second feature to obtain a first bytecode file; The compression submodule is used to compress the first bytecode file according to a preset compression algorithm to obtain feature group compressed data corresponding to the target feature group.
[0076] Optionally, the preset database is a database based on a forward index, and a primary key of the feature group compressed data in the preset database is generated based on an entity identifier of the first feature and an identifier of the target feature group.
[0077] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0078] Figure 4 is a block diagram of a feature reading device provided according to an embodiment of the present disclosure. Figure 4 As shown, the feature reading device 40 may include: A second receiving module 41 is used to receive a feature reading request, wherein the feature reading request includes an entity identifier of a third feature to be read, an identifier of a feature group to which the third feature belongs, and an identifier of the third feature; A second determining module 42 is used to determine, from a plurality of preset databases, a target preset database corresponding to the feature group to which the third feature belongs, each of the preset databases storing a plurality of feature group compressed data, the feature group compressed data being stored in the preset database based on the feature storage method described in any embodiment of the present disclosure; A third determination module 43 is used to determine, from the plurality of feature group compressed data stored in the target preset database, target feature group compressed data that matches the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs; The fourth determination module 44 is used to determine the feature data corresponding to the identifier of the third feature according to the target feature group compressed data.
[0079] Optionally, the fourth determining module 44 includes: A decompression submodule, used for decompressing the target feature group compressed data according to a preset decompression algorithm to obtain a second bytecode file; A second processing submodule is used to perform deserialization processing on the second bytecode file to obtain feature data of the feature group to which the third feature belongs; The determination submodule is used to determine the feature data matching the identifier of the third feature in the feature data of the feature group to which the third feature belongs as the feature data corresponding to the identifier of the third feature.
[0080] Optionally, the feature read request is generated by the following modules: a fifth determination module, configured to determine an identifier of a third feature to be read; A sixth determination module, configured to determine an entity identifier of the third feature according to an entity targeted by the target business scenario; a seventh determination module, configured to determine, according to the feature group corresponding to the target business scenario, an identifier of the feature group to which the third feature belongs; The second generating module is used to generate the feature reading request according to the entity identifier of the third feature, the identifier of the feature group to which the third feature belongs, and the identifier of the third feature.
[0081] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0082] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0083] like Figure 5As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0084] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0085] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0086] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0087] In some embodiments, any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) can be used for communication, and can be interconnected with 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0088] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0089] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: In response to monitoring a storage request for feature data of a first feature, determining a target feature group to which the first feature belongs in a plurality of feature groups, wherein each of the feature groups includes a plurality of preset features; acquiring feature data of a second feature, wherein the second feature includes other preset features in the target feature group except the first feature; compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group; and writing the feature group compressed data into a preset database corresponding to the target feature group.
[0090] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: A feature reading request is received, wherein the feature reading request includes an entity identifier of a third feature to be read, an identifier of a feature group to which the third feature belongs, and an identifier of the third feature; a target preset database corresponding to the feature group to which the third feature belongs is determined from a plurality of preset databases, wherein each of the preset databases stores a plurality of feature group compressed data, and the feature group compressed data is stored in the preset database based on the feature storage method disclosed herein; among the plurality of feature group compressed data stored in the target preset database, target feature group compressed data matching the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs is determined; and feature data corresponding to the identifier of the third feature is determined based on the target feature group compressed data.
[0091] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0092] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0093] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the first determination module may also be described as "a module that determines, in response to monitoring a storage request for feature data of a first feature, a target feature group to which the first feature belongs among multiple feature groups".
[0094] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0095] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may 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.
[0096] According to one or more embodiments of the present disclosure, a feature storage method is provided, the method comprising: In response to monitoring a storage request for feature data of a first feature, determining a target feature group to which the first feature belongs from a plurality of feature groups, wherein each of the feature groups includes a plurality of preset features; Acquire feature data of a second feature, where the second feature includes other preset features in the target feature group except the first feature; compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group; The feature group compressed data is written into a preset database corresponding to the target feature group.
[0097] According to one or more embodiments of the present disclosure, a feature storage method is provided, the method further comprising: receiving a feature writing request, wherein the feature writing request is used to trigger a writing operation of writing feature data of the first feature into a preset feature library; In response to detecting that the write operation is complete, the storage request is generated.
[0098] According to one or more embodiments of the present disclosure, a feature storage method is provided, wherein obtaining feature data of a second feature includes: The feature data of the second feature is read from the preset feature library.
[0099] According to one or more embodiments of the present disclosure, a feature storage method is provided, wherein compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group includes: Serializing the feature data of the first feature and the feature data of the second feature to obtain a first bytecode file; The first bytecode file is compressed according to a preset compression algorithm to obtain feature group compressed data corresponding to the target feature group.
[0100] According to one or more embodiments of the present disclosure, a feature storage method is provided, wherein the preset database is a database based on a forward index, and the primary key of the feature group compressed data in the preset database is generated based on the entity identifier of the first feature and the identifier of the target feature group.
[0101] According to one or more embodiments of the present disclosure, a feature reading method is provided, the method further comprising: receiving a feature reading request, the feature reading request including an entity identifier of a third feature to be read, an identifier of a feature group to which the third feature belongs, and an identifier of the third feature; Determine, from a plurality of preset databases, a target preset database corresponding to the feature group to which the third feature belongs, each of the preset databases storing a plurality of feature group compressed data, the feature group compressed data being stored in the preset database based on the feature storage method described in any embodiment of the present disclosure; Determine, from among the plurality of feature group compressed data stored in the target preset database, target feature group compressed data that matches the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs; According to the target feature group compressed data, feature data corresponding to the identifier of the third feature is determined.
[0102] According to one or more embodiments of the present disclosure, a feature reading method is provided, wherein the step of compressing the target feature group data and determining feature data corresponding to the identifier of the third feature includes: Decompressing the target feature group compressed data according to a preset decompression algorithm to obtain a second bytecode file; Deserialize the second bytecode file to obtain feature data of the feature group to which the third feature belongs; Feature data that matches the identifier of the third feature among the feature data of the feature group to which the third feature belongs is determined as feature data corresponding to the identifier of the third feature.
[0103] According to one or more embodiments of the present disclosure, a feature reading method is provided, wherein the feature reading request is generated in the following manner: determining an identity of a third feature to be read; Determining an entity identifier of the third feature according to an entity targeted by the target business scenario; Determining, according to the feature group corresponding to the target business scenario, an identifier of the feature group to which the third feature belongs; The feature reading request is generated according to the entity identifier of the third feature, the identifier of the feature group to which the third feature belongs, and the identifier of the third feature.
[0104] According to one or more embodiments of the present disclosure, a feature storage device is provided, the device comprising: A first determining module, configured to determine, in response to monitoring a storage request for feature data of a first feature, a target feature group to which the first feature belongs from a plurality of feature groups, wherein each of the feature groups includes a plurality of preset features; an acquisition module, configured to acquire feature data of a second feature, wherein the second feature includes other preset features in the target feature group except the first feature; A compression module, used for compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group; The storage module is used to write the feature group compressed data into a preset database corresponding to the target feature group.
[0105] According to one or more embodiments of the present disclosure, a feature reading device is provided, the device comprising: a second receiving module, configured to receive a feature reading request, wherein the feature reading request includes an entity identifier of a third feature to be read, an identifier of a feature group to which the third feature belongs, and an identifier of the third feature; A second determination module is used to determine, from a plurality of preset databases, a target preset database corresponding to the feature group to which the third feature belongs, each of the preset databases storing a plurality of feature group compressed data, the feature group compressed data being stored in the preset database based on the feature storage method provided in any embodiment of the present disclosure; A third determination module is used to determine, from the plurality of feature group compressed data stored in the target preset database, target feature group compressed data that matches the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs; The fourth determination module is used to determine the feature data corresponding to the identifier of the third feature according to the target feature group compressed data.
[0106] According to one or more embodiments of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processing device, the steps of the feature storage method or feature reading method provided by any embodiment of the present disclosure are implemented.
[0107] According to one or more embodiments of the present disclosure, there is provided an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the feature storage method or feature reading method provided in any embodiment of the present disclosure.
[0108] According to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of the feature storage method or feature reading method provided by any embodiment of the present disclosure.
[0109] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0110] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0111] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A feature storage method, characterized in that: The method comprises: In response to monitoring a storage request for feature data of a first feature, determining a target feature group to which the first feature belongs from a plurality of feature groups, wherein each of the feature groups includes a plurality of preset features; Acquire feature data of a second feature, where the second feature includes other preset features in the target feature group except the first feature; compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group; The feature group compressed data is written into a preset database corresponding to the target feature group.
2. The method according to claim 1, characterized in that The method further comprises: receiving a feature writing request, wherein the feature writing request is used to trigger a writing operation of writing feature data of the first feature into a preset feature library; In response to detecting that the write operation is complete, the storage request is generated.
3. The method according to claim 2, characterized in that The step of obtaining the feature data of the second feature includes: The feature data of the second feature is read from the preset feature library.
4. The method according to claim 1, characterized in that: The compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group includes: Serializing the feature data of the first feature and the feature data of the second feature to obtain a first bytecode file; The first bytecode file is compressed according to a preset compression algorithm to obtain feature group compressed data corresponding to the target feature group.
5. The method according to claim 1, characterized in that The preset database is a database based on a forward index, and a primary key of the feature group compressed data in the preset database is generated based on an entity identifier of the first feature and an identifier of the target feature group.
6. A feature reading method, characterized in that: The method further comprises: receiving a feature reading request, the feature reading request including an entity identifier of a third feature to be read, an identifier of a feature group to which the third feature belongs, and an identifier of the third feature; Determine, from a plurality of preset databases, a target preset database corresponding to the feature group to which the third feature belongs, each of the preset databases storing a plurality of feature group compressed data, the feature group compressed data being stored in the preset database based on the feature storage method according to any one of claims 1 to 5; Determine, from among the plurality of feature group compressed data stored in the target preset database, target feature group compressed data that matches the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs; According to the target feature group compressed data, feature data corresponding to the identifier of the third feature is determined.
7. The method according to claim 6, characterized in that The compressing data according to the target feature group to determine feature data corresponding to the identifier of the third feature includes: Decompressing the target feature group compressed data according to a preset decompression algorithm to obtain a second bytecode file; Deserialize the second bytecode file to obtain feature data of the feature group to which the third feature belongs; Feature data that matches the identifier of the third feature among the feature data of the feature group to which the third feature belongs is determined as feature data corresponding to the identifier of the third feature.
8. The method according to claim 6, characterized in that The feature read request is generated in the following way: determining an identity of a third feature to be read; Determining an entity identifier of the third feature according to an entity targeted by the target business scenario; Determining, according to the feature group corresponding to the target business scenario, an identifier of the feature group to which the third feature belongs; The feature reading request is generated according to the entity identifier of the third feature, the identifier of the feature group to which the third feature belongs, and the identifier of the third feature.
9. A feature storage device, characterized in that: The device comprises: A first determining module, configured to determine, in response to monitoring a storage request for feature data of a first feature, a target feature group to which the first feature belongs from a plurality of feature groups, wherein each of the feature groups includes a plurality of preset features; an acquisition module, configured to acquire feature data of a second feature, wherein the second feature includes other preset features in the target feature group except the first feature; A compression module, used for compressing the feature data of the first feature and the feature data of the second feature to obtain feature group compressed data corresponding to the target feature group; The storage module is used to write the feature group compressed data into a preset database corresponding to the target feature group.
10. A feature reading device, characterized in that: The device comprises: a second receiving module, configured to receive a feature reading request, wherein the feature reading request includes an entity identifier of a third feature to be read, an identifier of a feature group to which the third feature belongs, and an identifier of the third feature; A second determination module is used to determine, from a plurality of preset databases, a target preset database corresponding to the feature group to which the third feature belongs, each of the preset databases storing a plurality of feature group compressed data, the feature group compressed data being stored in the preset database based on the feature storage method according to any one of claims 1 to 5; A third determination module is used to determine, from the plurality of feature group compressed data stored in the target preset database, target feature group compressed data that matches the entity identifier of the third feature and the identifier of the feature group to which the third feature belongs; The fourth determination module is used to determine the feature data corresponding to the identifier of the third feature according to the target feature group compressed data.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 8 are implemented.
12. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 8.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
