Feature calculation method and device, equipment and medium
By determining the operator dependency relationship of the feature operator in feature calculation and performing feature calculations based on this relationship, the problem of not always reading the target feature in the cache during feature reading is solved, and the system operation performance and search are improved performance.
Patent Information
- Application Number
- CN202311022174.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2025-02-21
AI Technical Summary
In the calculation and read and write operation of feature dimensions, because the read of features is random, in application scenarios with large feature magnitude, the mutual influence in feature cache causes greater losses to the system's computing performance and search performance in application scenarios with large feature magnitudes. .
By obtaining the preset feature set and the preset feature operator set, the operator dependency relationship of the feature operator is determined based on the feature calculation dependency relationship, and the feature calculation is performed based on the operator dependency relationship to ensure that the dependent feature is calculated first, so as to The target feature can be read in the cache every time the feature is queryed.
This method can reduce the number of feature read and write times, improve the system's operating performance, ensure that the target feature can always be read in the cache during feature reading, and reduce system performance loss.
Smart Images

Figure CN119493974A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a feature calculation method, apparatus, device, and medium. Background Art
[0002] When a search engine retrieves search results based on a user's search keyword, it calculates and ranks the features of each potentially recalled object based on a ranking model to determine the search recall object. The features input to the ranking model are first read from the corresponding feature cache. If the feature is not found, the feature is calculated and written to the cache for next use. The feature cache is a hash table.
[0003] However, during the implementation of this invention, we discovered at least the following technical issues in the prior art: Because the features are read in random order and all features are independent of each other during the calculation and reading and writing of the aforementioned feature dimensions, each use of any feature requires a cache hit check. In applications with a large number of features, the mutual influence of different feature read and write processes in the feature cache significantly impacts the system's computational performance and also affects the system's search performance. Summary of the Invention
[0004] The embodiments of the present invention provide a feature calculation method, apparatus, device and medium, which can ensure that the target feature can always be read in the cache during feature reading, reduce the number of feature reading and writing times, and thus improve system operation performance.
[0005] In a first aspect, an embodiment of the present invention provides a feature calculation method, the method comprising:
[0006] Get the preset feature set and preset feature operator set;
[0007] Determining an operator dependency relationship among each feature operator in the preset feature operator set according to a feature calculation dependency relationship among each feature in the preset feature set;
[0008] The features associated with each of the feature operators are calculated according to the operator dependency relationship to obtain target cache features.
[0009] In a second aspect, an embodiment of the present invention further provides a feature calculation device, the device comprising:
[0010] A feature and operator acquisition module, used to obtain a preset feature set and a preset feature operator set;
[0011] An operator dependency analysis module, configured to determine the operator dependency of each feature operator in the preset feature operator set based on the feature calculation dependency between each feature in the preset feature set;
[0012] The feature calculation module is used to calculate the features associated with each feature operator according to the operator dependency relationship to obtain the target cache features.
[0013] In a third aspect, an embodiment of the present invention further provides a computer device, comprising:
[0014] one or more processors;
[0015] a memory for storing one or more programs;
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the feature calculation method provided by any embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the feature calculation method provided in any embodiment of the present invention.
[0018] The embodiments of the above invention have the following advantages or beneficial effects:
[0019] The embodiment of the present invention obtains a preset feature set and a preset feature operator set each time feature calculation is required; then, based on the feature calculation dependency between the features in the preset feature set, the operator dependency of each feature operator in the preset feature operator set is determined; thus, the features associated with each feature operator can be calculated based on the operator dependency to obtain the target cache feature, that is, the dependent features are calculated first, so that the dependent features can be found each time the features are queried. The technical solution of the embodiment of the present invention solves the problem that the target features cannot always be read in the cache during feature reading, thereby triggering the execution of feature calculation and cache update operations, affecting system performance. It can ensure that the target features can always be read in the cache during feature reading, reducing the number of feature reading and writing times, thereby improving system performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flow chart of a feature calculation method provided by an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of the relationship between features and feature operator calculations provided by an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of a feature operator dependency relationship provided by an embodiment of the present invention;
[0023] Figure 4 This is a flow chart of a feature calculation method provided by an embodiment of the present invention;
[0024] Figure 5 It is a directed acyclic graph of feature operator dependencies provided by an embodiment of the present invention;
[0025] Figure 6 is a sorted directed acyclic graph provided by an embodiment of the present invention;
[0026] Figure 7 This is a flow chart of a feature calculation method provided by an embodiment of the present invention;
[0027] Figure 8 This is a comparison diagram of different feature storage methods provided by an embodiment of the present invention;
[0028] Figure 9 1 is a schematic structural diagram of a feature calculation device provided by an embodiment of the present invention;
[0029] Figure 10 It is a structural diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.
[0031] Figure 1 This is a flowchart of a feature calculation method provided in an embodiment of the present invention. This embodiment is applicable to scenarios where feature calculation is required as input for deep learning models with analytical capabilities. This method can be performed by a feature calculation device, which can be implemented using software and / or hardware and integrated into a computer device with application development capabilities.
[0032] like Figure 1 As shown, the feature calculation method of this embodiment includes the following steps:
[0033] S110: Obtain a preset feature set and a preset feature operator set.
[0034] The preset feature set contains multiple preset feature information. Each feature is generated by a unique feature operator and is the smallest data unit required by the functional model it is input into. The specific meaning of each feature is determined by the specific functional model application scenario and model analysis function that requires the feature.
[0035] For example, in the application scenario of a search system, the search system needs to search the database based on the keywords entered by the user. The search process can be to analyze and score a large number of objects related to the search keywords through one or more ranking models built into the search engine, and sort them according to the scoring results, and finally feed back the top-ranked objects to the user as the target objects of the search recall. The features required by the ranking model for ranking analysis can be attribute features of one or more dimensions of objects related to the search keywords, environmental-related features, and other features that can affect the ranking analysis results. The feature content and number of features of objects associated with different search keywords can be different.
[0036] A feature operator is an operation class used to calculate features. Each feature operator can calculate several features, and the calculation of these features may depend on other features, which may also belong to other feature operators. The calculation rules for different features in a feature operator can also be predetermined based on the feature extraction object and scenario.
[0037] Further, the relationship between the feature operator and the feature calculation can be referred to Figure 2 The characteristic calculation relationship diagram shown in Figure 2 In the figure, the entire range of the block diagram represents the range of features calculated by feature operator 1. Within this range, feature operator 1 can be used to calculate features 1, 2, and 3. The calculation of feature 1 also requires the eigenvalue of feature 5, meaning that the calculation of feature 1 depends on feature 5, and the calculation of feature 2 depends on feature 7.
[0038] S120: Determine an operator dependency relationship among each feature operator in the preset feature operator set according to a feature calculation dependency relationship among each feature in the preset feature set.
[0039] In the prior art, the feature calculation process is based on a single feature. If a feature is needed, it is calculated according to the calculation rules in the corresponding feature operator. When the calculation rules depend on other features, it is necessary to query the corresponding dependent features. If the dependent features cannot be directly queried from the feature cache, it may enter a nested loop of feature query and calculation until the required features can be calculated. Then, the feature cache is updated according to the calculated features. The process of updating the feature cache is the process of writing to the hash table. During this process of writing to the hash table, feature queries can no longer be performed, which will affect the reading and writing of other features and affect system performance.
[0040] In this embodiment, an operator dependency relationship is proposed, and feature calculation processing is performed based on feature operators, hoping that multiple features within the same feature operator can complete calculations synchronously.
[0041] Specifically, the operator dependency between feature operators is determined based on the feature computational dependency between features in a preset feature set. That is, when a feature computational dependency exists between any two different features in the preset feature set, it can be determined that the first feature operator is dependent on the second feature dependency operator, where the first feature operator is an operator that has a computational association relationship with the active dependent feature of the two different features, and the second feature operator is an operator that has a computational association relationship with the dependent feature of the two different features, thereby establishing a relationship between the first feature operator and the second feature operator.
[0042] Now refer to Figure 3 The dependency between the features and feature operators shown in is explained. Figure 3 In the example, feature operator 1 can be used to calculate feature 1, feature 2, and feature 3. The calculation of feature 1 also requires the eigenvalue of feature 5, that is, the calculation of feature 1 depends on feature 5, feature 1 is the active dependent feature, and feature 5 is the dependent feature. And the calculation of feature 2 depends on feature 7, feature 2 is the active dependent feature, and feature 7 is the dependent feature. Feature 5 is calculated by feature operator 2, and the calculation of feature 5 depends on feature 6. Feature 6 is calculated and determined by feature operator 3. Feature 7, on which feature 2 depends, is calculated by feature operator 3. Based on the feature calculation dependency relationship between the above features, it can be determined that feature operator 1 depends on feature operator 2 and feature operator 3, and feature operator 2 depends on feature operator 3. Feature operator 4 is independent of other feature operators and is used to calculate feature 8.
[0043] S130 , calculating the features associated with each of the feature operators according to the operator dependency relationship to obtain target cache features.
[0044] When calculating features based on operator dependencies, we don't calculate them sequentially by feature number. Instead, we start from the lowest-level dependent feature operator in the dependency relationship. This ensures that the features that each operator depends on are always calculated in advance, allowing queries to the feature cache to always find them. Similarly, for each feature operator, the lowest-level dependent feature operator is equivalent to the root node among the many nodes with which it is mapped.
[0045] by Figure 3Taking the dependency relationship of feature operators in as an example, we can first calculate features 6 and 7 corresponding to feature operator 3, then calculate features 4 and 5 corresponding to feature operator 2, and then calculate features 1, 2, and 3 in feature operator 1. Based on this calculation order, in the calculation process of the post-calculated features, the dependent features on which they depend can be directly read from the cache without entering the nested loop of feature query and calculation. This ensures that each feature query can be queried, so that after one feature calculation, multiple features corresponding to multiple feature operators can be obtained, reducing the subsequent feature calculations and the number of feature reading and writing, thereby improving the performance of the system and the sorting analysis speed of the sorting model.
[0046] The technical solution of this embodiment is to obtain a preset feature set and a preset feature operator set each time feature calculation is required; then, based on the feature calculation dependency between each feature in the preset feature set, the operator dependency of each feature operator in the preset feature operator set is determined; thus, the features associated with each feature operator can be calculated according to the operator dependency to obtain the target cache feature, that is, the dependent features are calculated first, so that the dependent features can be found each time the features are queried. The technical solution of the embodiment of the present invention solves the problem that the target features cannot always be read in the cache during feature reading, thereby triggering the execution of feature calculation and cache update operations, affecting system performance. It can ensure that the target features can always be read in the cache during feature reading, reducing the number of feature reading and writing times, thereby improving system performance.
[0047] Figure 4 This is a flowchart of a feature calculation method provided in another embodiment of the present invention. This embodiment, which shares the same inventive concept as the feature calculation method in the previous embodiment, further describes a process for analyzing feature operator dependencies. This method can be performed by a feature calculation device, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.
[0048] like Figure 4 As shown, the feature calculation method of this embodiment includes the following steps:
[0049] S210: Obtain a preset feature set and a preset feature operator set.
[0050] S220 . Determine an operator dependency relationship among each feature operator in the preset feature operator set according to a feature calculation dependency relationship among each feature in the preset feature set.
[0051] S230: Construct an operator dependency directed acyclic graph according to the operator dependency relationship.
[0052] In this embodiment, in order to make the dependency relationship between each feature operator more clearly presented and to facilitate the management of the feature operators, a directed acyclic graph (DAG) data structure is introduced in the process of calculating features to manage the feature operators and sort out the dependency relationship of the feature operators.
[0053] A directed acyclic graph (DAG) is a data structure in graph theory and computer science. It is a directed graph without loops. When constructing a DAG, each feature operator is treated as a single node, and the dependencies between feature operators serve as the relationships between nodes.
[0054] For example, Figure 3 The relationship between the features and feature operators in the construct operator-dependent directed acyclic graph can be obtained. Figure 5 The directed acyclic graph DAG shown in . Specifically, Figure 5 The figure shows two directed acyclic graphs, DAG1 and DAG2. The feature operators in DAG1 are located on related dependency paths, while the feature operators in DAG2 are independent of the dependency paths in DAG1. Different sets of feature operators with unrelated dependency paths can form different DAGs, which can then be used as separate subsets of feature operators for subsequent analysis and processing.
[0055] S240 , performing topological sorting based on the operator dependency directed acyclic graph to determine a calculation order of dependency features of each feature operator.
[0056] In this step, each DAG's feature operators are topologically sorted to determine the order in which their dependent features are calculated, thereby further determining the order in which features are calculated. After sorting, the associated features of each feature operator are calculated one by one, ensuring that dependent features are always calculated in advance and that the feature cache is always hit.
[0057] Specifically, topological sorting is to arrange all vertices in a directed acyclic graph into a linear sequence according to their direction dependency order. In the case where multiple operator dependency directed acyclic graphs are constructed based on the operator dependency relationship, the multiple operator dependency directed acyclic graphs can be topologically sorted simultaneously, and the candidate can also perform independent calculations and read and write operations on the feature operators belonging to different DAGs. For example, Figure 5 By topologically sorting the two DAGs in Figure 6 The topological sorting results shown can be Figure 6 The order of the feature operators in the two DAG sorting results is adjusted, and the calculation of the two sets of feature operators is performed synchronously.
[0058] S250 , according to the dependent feature calculation order, sequentially calculate features that have a calculation association relationship with each feature operator to obtain target cache features.
[0059] Specifically, when performing feature calculation, the feature operators may be calculated sequentially from front to back according to the order in which they are sorted in the DAG topology.
[0060] by Figure 6 For the sorting results of DAG1, the order of feature calculation for each feature operator is feature operator 3 -> 2 -> 1. During the calculation process, all features within each feature operator are calculated once to obtain the target cached features. The feature calculation order is features 6 and 7 in feature operator 3, followed by features 4 and 5 in feature operator 2, and finally features 1, 2, and 3 in feature operator 1. During this calculation process, features 5 and 7, on which features 1 and 2 depend, respectively, are calculated and can be queried. This eliminates the need to wait for feature 5 to be calculated and query other features on which feature 5 depends while calculating feature 1.
[0061] The technical solution of this embodiment is to obtain a preset feature set and a preset feature operator set each time feature calculation is required; then, based on the feature calculation dependency between each feature in the preset feature set, determine the operator dependency of each feature operator in the preset feature operator set, and construct an operator dependency directed acyclic graph based on the operator dependency to manage each feature operator, perform topological sorting based on the operator dependency directed acyclic graph, and determine the dependent feature calculation order of each feature operator, so that the features associated with each feature operator can be calculated according to the dependent feature calculation order to obtain the target cache feature, that is, the dependent feature is calculated first, so that the dependent feature can be found each time the feature is queried. The technical solution of the embodiment of the present invention solves the problem that the target feature cannot always be read in the cache during feature reading, thereby triggering the execution of feature calculation and cache update operations, affecting system performance. It can ensure that the target feature can always be read in the cache during feature reading, reduce the number of feature reading and writing times, and thus improve system operation performance. Specifically, the computation and read / write operations of feature operators belonging to different DAGs are completely independent. For feature operators within the same DAG, after topological sorting, the read / write operations of each feature operator are also independent and secure. This embodiment can also significantly increase the system's parallelism and significantly reduce the interaction between different feature read / write operations.
[0062] Figure 7This is a flowchart of a feature calculation method provided in another embodiment of the present invention. This embodiment, which shares the same inventive concept as the feature calculation method in the previous embodiment, further describes a scheme for caching the calculated target cache features. This method can be performed by a feature calculation device, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.
[0063] like Figure 7 As shown, the feature calculation method of this embodiment includes the following steps:
[0064] S310: Obtain a preset feature set and a preset feature operator set.
[0065] S320: Determine an operator dependency relationship among each feature operator in the preset feature operator set according to a feature calculation dependency relationship among each feature in the preset feature set.
[0066] In this embodiment, the operator dependency relationship can also be managed by a directed acyclic graph to manage the feature operators.
[0067] S330 , calculating the features associated with each of the feature operators according to the operator dependency relationship to obtain target cache features.
[0068] S340: Cache the target cache feature using the feature operator as a storage dimension.
[0069] Typically, when caching features, the feature is stored based on the feature dimension. When querying features, you can query and read individual features using the feature identifier. If no feature is found, you can calculate the feature.
[0070] In this embodiment, feature storage is performed based on feature operators as the dimension. Each feature operator is stored in the order of its operator number, and the feature values of features that have a computational association relationship with each feature operator are stored as associated data of each feature operator, which can reduce the number of read and write times of the feature cache.
[0071] For example, the feature caching method in this embodiment is used to perform feature caching, and the storage results of feature caching in the prior art are compared. Figure 8 The comparison diagram of feature storage forms is shown in the figure. Figure 8 On the left, the features are stored in the order of feature numbers. Figure 8On the right side, features are saved by feature operator. Each feature operator stores the feature values of its associated features. When reading features, at least one feature operator object is read at a time to retrieve all features within the corresponding feature operator. This reduces the number of reads and writes for a feature operator with 10 features from 10 to just one. For feature operators with hundreds of features, the reduction in reads and writes is even greater.
[0072] It should be noted that in order to avoid repeated calculation of features, the feature cache is a data structure that stores features. Before calculating the features, it is read from the cache and will not be calculated again from the cache.
[0073] The technical solution of this embodiment is to obtain a preset feature set and a preset feature operator set each time feature calculation is required; then, based on the feature calculation dependency between the features in the preset feature set, the operator dependency of each feature operator in the preset feature operator set is determined; thereby, the features associated with each feature operator can be calculated based on the operator dependency to obtain the target cache feature, and the target cache feature can be cached with the feature operator as the storage dimension. The technical solution of the embodiment of the present invention solves the problem that the target feature cannot always be read in the cache during feature reading, thereby triggering the execution of feature calculation and cache update operations, affecting system performance. It can ensure that the target feature can always be read in the cache during feature reading, reducing the number of feature read and write times, thereby improving system performance.
[0074] Figure 9 This is a structural diagram of a feature calculation device provided in an embodiment of the present invention. This embodiment is applicable to situations where feature calculation is required for input features of a deep learning model with analysis capabilities. The device can be implemented by software and / or hardware and integrated into a computer terminal device with application development capabilities.
[0075] like Figure 9 As shown, the feature calculation device includes: a feature and operator acquisition module 410, an operator dependency analysis module 420 and a feature calculation module 430.
[0076] Among them, the feature and operator acquisition module 410 is used to obtain a preset feature set and a preset feature operator set; the operator dependency analysis module 420 is used to determine the operator dependency of each feature operator in the preset feature operator set based on the feature calculation dependency between each feature in the preset feature set; the feature calculation module 430 is used to calculate the features associated with each feature operator according to the operator dependency to obtain the target cache feature.
[0077] The technical solution of this embodiment is to obtain a preset feature set and a preset feature operator set each time feature calculation is required; then, based on the feature calculation dependency between each feature in the preset feature set, the operator dependency of each feature operator in the preset feature operator set is determined; thus, the features associated with each feature operator can be calculated according to the operator dependency to obtain the target cache feature, that is, the dependent features are calculated first, so that the dependent features can be found each time the features are queried. The technical solution of the embodiment of the present invention solves the problem that the target features cannot always be read in the cache during feature reading, thereby triggering the execution of feature calculation and cache update operations, affecting system performance. It can ensure that the target features can always be read in the cache during feature reading, reducing the number of feature reading and writing times, thereby improving system performance.
[0078] Optionally, the operator dependency analysis module 420 is specifically configured to:
[0079] In the case where there is a feature computation dependency relationship between any two different features in the preset feature set, it is determined that a first feature operator depends on a second feature operator, wherein the first feature dependency operator is an operator having a computation association relationship with an active dependency feature of the two features, and the second feature operator is an operator having a computation association relationship with a dependent feature of the two features.
[0080] Optionally, the operator dependency analysis module 420 may be further configured to:
[0081] Constructing an operator dependency directed acyclic graph according to the operator dependency relationship;
[0082] A topological sorting is performed based on the operator dependency directed acyclic graph to determine the dependency feature calculation order of each feature operator.
[0083] Optionally, the feature calculation module 430 is specifically configured to:
[0084] According to the dependent feature calculation order, features that have a calculation association relationship with each feature operator are calculated in sequence.
[0085] Optionally, the feature calculation module 430 may also be used to:
[0086] When multiple operator dependency directed acyclic graphs are constructed according to the operator dependency relationships, topological sorting is synchronously performed on the multiple operator dependency directed acyclic graphs, and feature calculation is synchronously performed based on the multiple sorting results.
[0087] Optionally, the feature calculation device further includes a feature storage module, which is used to cache the target cache feature after obtaining the target cache feature, using the feature operator as a storage dimension.
[0088] Optionally, the feature storage module is specifically used to:
[0089] Each feature operator is stored in the order of its operator number, and the feature value of a feature that has a computational association relationship with each feature operator is stored as association data of each feature operator.
[0090] The feature calculation device provided in the embodiment of the present invention can execute the feature calculation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0091] Figure 10 A schematic structural diagram of a computer device provided in an embodiment of the present invention. Figure 10 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 10 The computer device 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention. The computer device 12 can be any terminal device with computing capabilities, such as an intelligent controller, a server, a mobile phone, or other terminal devices.
[0092] like Figure 10 As shown, computer device 12 is implemented as a general-purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).
[0093] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0094] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0095] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 10 Not shown, often called a "hard drive"). Although Figure 10 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0096] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0097] The computer device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via the bus 18. It should be understood that although Figure 10 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0098] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the feature calculation method provided in the embodiment of the present invention, which includes:
[0099] Get the preset feature set and preset feature operator set;
[0100] Determining an operator dependency relationship among each feature operator in the preset feature operator set according to a feature calculation dependency relationship among each feature in the preset feature set;
[0101] The features associated with each of the feature operators are calculated according to the operator dependency relationship to obtain target cache features.
[0102] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the feature calculation method provided by any embodiment of the present invention is implemented.
[0103] Get the preset feature set and preset feature operator set;
[0104] Determining an operator dependency relationship among each feature operator in the preset feature operator set according to a feature calculation dependency relationship among each feature in the preset feature set;
[0105] The features associated with each of the feature operators are calculated according to the operator dependency relationship to obtain target cache features.
[0106] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: 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 this document, a computer-readable storage medium can 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.
[0107] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0108] Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0109] The computer program code for performing the operations of the present invention can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can 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 cases involving a remote computer, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0110] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computer device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
[0111] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A feature calculation method, characterized in that: include: Obtain a preset feature set and a preset feature operator set; Determining the operator dependency relationship of each feature operator in the preset feature operator set according to the feature calculation dependency relationship between each feature in the preset feature set; The features associated with each of the feature operators are calculated according to the operator dependency relationship to obtain target cache features.
2. The method according to claim 1, characterized in that The determining, according to the feature calculation dependency relationship between the features in the preset feature set, the operator dependency relationship of each feature operator in the preset feature operator set comprises: In the case where there is a feature computational dependency relationship between any two different features in the preset feature set, it is determined that the first feature operator depends on the second feature operator, wherein the first feature operator is an operator having a computational association relationship with an active dependent feature of the two features, and the second feature operator is an operator having a computational association relationship with a dependent feature of the two features.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Constructing an operator dependency directed acyclic graph according to the operator dependency relationship; A topological sorting is performed based on the operator dependency directed acyclic graph to determine a calculation order of dependency features of each feature operator.
4. The method according to claim 3, characterized in that: The calculating the features associated with each of the feature operators according to the operator dependency relationship includes: According to the dependent feature calculation sequence, features having a calculation association relationship with each feature operator are calculated in sequence.
5. The method according to claim 3, characterized in that: The method further comprises: When multiple operator dependency directed acyclic graphs are constructed according to the operator dependency relationships, topological sorting is synchronously performed on the multiple operator dependency directed acyclic graphs, and feature calculation is synchronously performed based on the multiple sorting results.
6. The method according to claim 1, characterized in that After obtaining the target cache characteristics, the following steps are included: The target cache feature is cached with the feature operator as the storage dimension.
7. The method according to claim 6, characterized in that The step of caching the target cache feature by taking the feature operator as the storage dimension includes: Each feature operator is stored in the order of its operator number, and a feature value of a feature having a computational association relationship with each feature operator is stored as association data of each feature operator.
8. A feature calculation device, characterized in that: include: A feature and operator acquisition module, used to acquire a preset feature set and a preset feature operator set; An operator dependency analysis module, used to determine the operator dependency of each feature operator in the preset feature operator set according to the feature calculation dependency between each feature in the preset feature set; The feature calculation module is used to calculate the features associated with each of the feature operators according to the operator dependency relationship to obtain the target cache features.
9. A computer device, characterized in that: The computer device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the feature calculation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the feature calculation method as described in any one of claims 1 to 7 is implemented.