CN111259005A - Model calling method and device and computer storage medium - Google Patents

Model calling method and device and computer storage medium Download PDF

Info

Publication number
CN111259005A
CN111259005A CN202010019146.6A CN202010019146A CN111259005A CN 111259005 A CN111259005 A CN 111259005A CN 202010019146 A CN202010019146 A CN 202010019146A CN 111259005 A CN111259005 A CN 111259005A
Authority
CN
China
Prior art keywords
model
feature
features
update
global
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010019146.6A
Other languages
Chinese (zh)
Inventor
薛春军
赵守来
夏日
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Daily Youxian Technology Co.,Ltd.
Original Assignee
Beijing Missfresh Ecommerce Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Missfresh Ecommerce Co Ltd filed Critical Beijing Missfresh Ecommerce Co Ltd
Priority to CN202010019146.6A priority Critical patent/CN111259005A/en
Publication of CN111259005A publication Critical patent/CN111259005A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures

Abstract

The application discloses a model calling method and device and a computer storage medium, and belongs to the technical field of artificial intelligence. In this application, when the first model needs to be called, the first feature values corresponding to the first features included in the first model may be obtained from the global feature value set to determine the processing result of the first model. Therefore, all models can share the same global characteristic value set, and waste of computer resources is avoided. Secondly, in order to avoid the need of maintaining a global feature value set again after updating the model, an update marker can be configured for the model, the update marker is used for indicating whether the first model is updated, and feature values under different update markers are configured for each feature in the global feature value set, so that even if a certain model is updated subsequently, the updated model and the model before updating can still share the same global feature value set, and a global feature value set does not need to be configured separately, thereby further reducing the waste of computer resources.

Description

Model calling method and device and computer storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a model calling method, apparatus, and computer storage medium.
Background
In the technical field of artificial intelligence, when a trained model needs to be called to perform artificial intelligence processing on current test data, a plurality of features included in the model need to be determined first, so as to obtain a feature value of each feature in the plurality of features from the current test data, and then the feature value of each feature in the plurality of features is processed through the model, so that a processing result of the model can be obtained. For example, for a model for identifying whether a user is a malicious buyer, the model includes feature 1 "total amount of orders in the last month", and feature 2 "frequency of orders per day in the last month". When a user is identified as a malicious buyer through the model, the feature value corresponding to the feature 1 and the feature value corresponding to the feature 2 need to be determined first, and then the two feature values are processed based on the model to obtain an identification result for the user.
In the related art, for each model, a feature database is maintained, which includes feature values of each of a plurality of features of the model extracted based on user data. For example, for the model for identifying whether the user is a malicious buyer, a feature database is maintained, in which feature values corresponding to feature 1 and feature values corresponding to feature 2 are stored for each user. And subsequently, when a certain model needs to be called, directly obtaining a feature database corresponding to the model, and then determining a feature value of each feature in each feature corresponding to the model from the feature database. However, this calling method requires a feature database to be maintained for each model, resulting in a waste of computer resources.
Disclosure of Invention
The embodiment of the application provides a model calling method, a model calling device and a computer storage medium, which can avoid the waste of computer resources. The technical scheme is as follows:
in one aspect, a model calling method is provided, where the method includes:
determining an update marker of the first model and a plurality of first features included in the first model based on an identification of the first model to be invoked, the update marker indicating whether the first model has been updated;
obtaining a feature value of each of the plurality of first features from a global feature value set based on an update marker of the first model, each feature stored in the global feature value set comprising one or more feature values, each feature value of the one or more feature values corresponding to an update marker;
determining a processing result of the first model based on a feature value of each of the plurality of first features.
Optionally, the determining, based on the identification of the first model to be invoked, an update marker of the first model and a plurality of first features included in the first model includes:
acquiring a mapping file corresponding to the identifier of the first model from a mapping file set, wherein the mapping file set comprises a plurality of mapping files and a plurality of model identifiers in one-to-one correspondence with the plurality of mapping files, and each mapping file is used for configuring an update marker of the model indicated by the corresponding model identifier and a plurality of characteristics included by the indicated model;
determining, from the obtained mapping file, an update marker of the first model and a plurality of first features that the first model includes.
Optionally, each mapping file comprises an index of each feature that the corresponding model identification indicates the model comprises;
the determining, from the obtained mapping file, a plurality of first features included in the first model includes:
determining a plurality of first indexes included in the obtained mapping file;
obtaining a global index set corresponding to the update marker of the first model from a global index configuration file, wherein the global index configuration file comprises a plurality of global index sets and a plurality of update markers in one-to-one correspondence with the global index sets, and each global feature set comprises a plurality of features and indexes in one-to-one correspondence with the features;
and determining a plurality of first features which correspond to the first indexes one by one from the acquired global index set.
Optionally, the method further comprises:
determining a plurality of second features for training a second model, an identification of the second model, and an update marker for the second model;
generating an index for each of the plurality of second features;
adding the index of each of the plurality of second features and the plurality of second features in a global index set corresponding to an update marker of the second model in the global index profile;
and generating a mapping file corresponding to the identifier of the second model according to the index of each second feature in the plurality of second features and the update marker of the second model, and adding the generated mapping file in the mapping file set.
Optionally, the method further comprises:
receiving a model update instruction, wherein the model update instruction is used for indicating that an update marker of a third model is switched from a first update marker to a second update marker, the third model is any model, the first update marker is used for indicating that the third model is not updated, and the second update marker is used for indicating that the third model is updated;
for any third feature of a plurality of third features included in the third model, determining a third feature value corresponding to the any third feature and the first update marker from the global set of feature values;
adding a correspondence between the third feature value and the second update marker to the global set of feature values.
In another aspect, an apparatus for model invocation is provided, the apparatus includes:
a first determination module, configured to determine, based on an identification of a first model to be invoked, an update flag of the first model and a plurality of first features included in the first model, where the update flag is used to indicate whether the first model has been updated;
an obtaining module, configured to obtain a feature value of each of the plurality of first features from a global feature value set based on an update marker of the first model, where each feature stored in the global feature value set includes one or more feature values, and each feature value in the one or more feature values corresponds to one update marker;
a second determination module for determining a processing result of the first model based on a feature value of each of the plurality of first features.
Optionally, the first determining module includes:
an obtaining unit, configured to obtain a mapping file corresponding to an identifier of the first model from a set of mapping files, where the set of mapping files includes a plurality of mapping files and a plurality of model identifiers in one-to-one correspondence with the plurality of mapping files, and each mapping file is used to configure an update marker of a model indicated by the corresponding model identifier and a plurality of features included in the indicated model;
a determining unit, configured to determine, from the obtained mapping file, an update marker of the first model and a plurality of first features included in the first model.
Optionally, each mapping file comprises an index of each feature that the corresponding model identification indicates the model comprises;
the determining unit is configured to:
determining a plurality of first indexes included in the obtained mapping file;
obtaining a global index set corresponding to the update marker of the first model from a global index configuration file, wherein the global index configuration file comprises a plurality of global index sets and a plurality of update markers in one-to-one correspondence with the global index sets, and each global feature set comprises a plurality of features and indexes in one-to-one correspondence with the features;
and determining a plurality of first features which correspond to the first indexes one by one from the acquired global index set.
Optionally, the apparatus further comprises:
a third determination module to determine a plurality of second features for training a second model, an identification of the second model, and an update marker of the second model;
a first generating module for generating an index for each of the plurality of second features;
a first adding module, configured to add the index of each of the plurality of second features and the plurality of second features in a global index set corresponding to an update marker of the second model in the global index profile;
and the second generation module is used for generating a mapping file corresponding to the identifier of the second model according to the index of each second feature in the plurality of second features and the update marker of the second model, and adding the generated mapping file in the mapping file set.
Optionally, the apparatus further comprises:
a receiving module, configured to receive a model update instruction, where the model update instruction is used to indicate that an update marker of a third model is switched from a first update marker to a second update marker, the third model is any model, the first update marker is used to indicate that the third model is not updated, and the second update marker is used to indicate that the third model is updated;
a fourth determining module, configured to determine, for any third feature of multiple third features included in the third model, a third feature value corresponding to the any third feature and the first update marker from the global feature value set;
a second adding module, configured to add, to the global feature value set, a correspondence between the third feature value and the second update marker.
In another aspect, an apparatus for model invocation is provided, the apparatus includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of the model call method described above.
In another aspect, a computer-readable storage medium is provided, which stores instructions that, when executed by a processor, implement the steps of the above model calling method.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
in the present application, the feature values of the features included in each model are stored in one global feature value set. When the first model needs to be called, the first feature values corresponding to the first features included in the first model can be acquired from the global feature value set so as to determine the processing result of the first model. Therefore, the models can share the same global characteristic value set, and waste of computer resources is avoided. Secondly, in order to avoid the need of maintaining a global feature value set again after updating the model, an update marker can be configured for the model, the update marker is used for indicating whether the first model is updated, and feature values under different update markers are configured for each feature in the global feature value set, so that even if a certain model is updated subsequently, the updated model and the model before updating can still share the same global feature value set, and a global feature value set does not need to be configured separately, thereby further reducing the waste of computer resources.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a model calling method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a model calling process provided in an embodiment of the present application;
FIG. 3 is a block diagram of a model calling apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Before explaining the embodiments of the present application, an application scenario related to the embodiments of the present application is explained.
The on-line artificial intelligence algorithm service calls feature values of features included in the model in real time. For example, for a model for identifying whether a user is a malicious buyer, the model includes feature 1 "total amount of orders in the last month", and feature 2 "frequency of orders per day in the last month". When the online artificial intelligence service needs to identify malicious buyers intelligently through the model, for any buyer, the system needs to acquire the feature value corresponding to the feature 1 and the feature value corresponding to the feature 2. Since the feature values are updated in real time or at regular time (for example, for the model, as the transaction information increases on the e-commerce platform, for any buyer, the feature values corresponding to the feature 1 and the feature 2 change in real time, the system may update the stored feature values in real time, or update the stored feature values at regular time), and the model also needs to be updated in an irregular iteration. Therefore, for the trained model, how to maintain the characteristic values of the features included in the model affects the processing result of the model to a certain extent, thereby affecting the accuracy of the on-line artificial intelligence algorithm service. The model calling method provided by the embodiment of the application is applied to the scene of the online artificial intelligence algorithm service.
Note that, the feature values of the features included in a certain model may be referred to as feature data, and the features included in the model may be referred to as feature names, feature fields, or the like, which is not specifically limited in the embodiment of the present application.
The following explains the model calling method provided in the embodiment of the present application in detail.
Fig. 1 is a flowchart of a model invoking method provided in an embodiment of the present application, where the method may be applied to a server or a terminal, and the following embodiment is described by taking the application to the server as an example, and does not limit an execution subject of the model invoking method provided in the embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step 101: based on the identification of the first model to be invoked, an update marker of the first model and a plurality of first features included by the first model are determined, the update marker indicating whether the first model has been updated.
In the embodiment of the present application, in order to avoid the need to maintain a new set of feature values after a model is updated, an update marker is configured for any model. The update flag is used to indicate whether the first model has been updated, so that the feature values can be subsequently marked by the update flag without maintaining a new set of feature values.
Since the update marker is used to indicate whether the first model has been updated, the update marker may include a first update marker for indicating that the first model has not been updated and a second update marker for indicating that the second model has been updated. For example, for a model for identifying whether a user is a malicious buyer, if the update marker corresponding to the model is the first update marker, it indicates that the model is not updated currently, and if the update marker corresponding to the model is the second update marker, it indicates that the model is updated.
The model updating may refer to modification of a corresponding algorithm of the model, improvement of an input of the model, and the like, and will not be described in detail herein.
Further, since each model includes both an un-updated state and an updated state, in the embodiment of the present application, the update markers of each model may include both a first update marker and a second update marker.
The update flag may also be referred to as a version number. For example, the version number may be 1.0 and 2.0, where the version number 1.0 is used to indicate that the corresponding model is not updated, and the version number 2.0 is used to indicate that the corresponding model is updated. The name of the update marker is not actually limited in the embodiment of the present application.
Further, to facilitate management of the different models, a set of mapping files may be configured for all models included by the online artificial intelligence service. The mapping file set comprises a plurality of mapping files and a plurality of model identifications in one-to-one correspondence with the plurality of mapping files. Each mapping file is used to configure a corresponding model to identify an update marker of the indicated model and a plurality of features included by the indicated model. That is, each mapping file corresponds to a model, and the mapping file is used for describing the update marker of the corresponding model and a plurality of features included in the corresponding model.
Based on the configured mapping file set, in a possible implementation manner, the implementation process of step 101 may be: acquiring a mapping file corresponding to the identifier of the first model from the mapping file set; an update marker of the first model and a plurality of first features included in the first model are determined from the retrieved mapping file.
The mapping file may directly include the features included in the corresponding model, so that when the mapping file corresponding to the identifier of the first model is obtained, the plurality of first features included in the first model may be directly stored.
For example, table 1 is a set of mapping files provided in the embodiment of the present application. As shown in table 1, the set of mapping files includes mapping file 1 corresponding to model 1, mapping file 2 corresponding to model 2, mapping file N corresponding to model N, and the like. The mapping file 1 comprises features 10, 11, 12, 13 and a first update marker, and is used for indicating the features 10, 11, 12, 13 included in the model 1, and the update marker corresponding to the model 1 is the first update marker. The mapping file 2 includes features 12, 13, 14, 15 and a second update marker, which is used to indicate that the model 2 includes the features 12, 13, 14, 15, and the update marker corresponding to the model 2 is the second update marker. The mapping file N includes the features 15, 20, 25, 28 and a second update marker, and is used to indicate that the model N includes the features 15, 20, 25, 28, and the update marker corresponding to the model N is the second update marker.
TABLE 1
Model identification Mapping files
Model 1 Mapping File 1 (feature 10, feature 11, feature 12, feature 13, first update marker)
Model 2 Mapping File 2 (feature 12, feature 13, feature 14, feature 15, second update marker)
…… ……
Model N Mapping File N (feature 15, feature 20, feature 25, feature 28, second update marker)
Since there may be features that are the same between models, as shown in table 1 above, there are features 12 and 13 that are the same between model 1 and model 2, and features 15 that are the same between model 2 and model N. For example, for a model for identifying whether a user is a malicious buyer, the model includes a feature 1 "total amount of orders in the last month", and a feature 2 "frequency of orders per day in the last month", that is, the system determines whether a user is a malicious buyer through the feature 1 and the feature 2. For the model for identifying whether the user is a star buyer, the model may include feature 1 "total amount of orders in the last month" and feature 3 "credit record in the last year", that is, the system determines whether a user is a star buyer by feature 1 and feature 3. In this case, there is the same feature 1 between the two models.
Under the above scenario, if each mapping file directly includes the features of the corresponding model, repeated data may be stored in the mapping file corresponding to each model, thereby resulting in waste of storage resources. For example, for the set of mapping files shown in table 1, the same data is stored in mapping file 1 and mapping file 2, and the same data is stored in mapping file 2 and mapping file N. Therefore, in a possible implementation, an index (index) may be configured for each feature, the index is used for uniquely identifying the corresponding feature, and the storage space required by the index is much smaller than that of the corresponding feature. And meanwhile, configuring a global index configuration file aiming at the indexes of the features of all the models, wherein the global index configuration file is used for storing the indexes of the features of all the models. In this way, each mapping file only needs to include an index of the features of the corresponding model.
At this time, the map file set shown in table 1 can be converted into a map file set shown in table 2 below. As shown in table 2, the mapping file 1 corresponding to the model 1 only needs to include the index 10 corresponding to the feature 10, the index 11 corresponding to the feature 11, the index 12 corresponding to the feature 12, the index 13 corresponding to the feature 13, and the first update marker. The mapping file 2 corresponding to the model 2 only needs to include the index 12 corresponding to the feature 12, the index 13 corresponding to the feature 13, the index 14 corresponding to the feature 14, the index 15 corresponding to the feature 15, and the second update marker. The mapping file N corresponding to the model N only needs to include the index 15 corresponding to the feature 15, the index 20 corresponding to the feature 20, the index 25 corresponding to the feature 25, the index 28 corresponding to the feature 28, and the second update marker.
TABLE 2
Model identification Mapping files
Model 1 Mapping File 1 (index 10, index 11, index 12, index 13, first update marker)
Model 2 Mapping File 2 (index 12, index 13, index 14, index 15, second update marker)
…… ……
Model N Mapping File N (index 15, index 20, index 25, index 28, second update marker)
Comparing the two mapping file sets of table 1 and table 2, when an index is introduced for a feature, because the storage space required by the index is much smaller than the storage space of the corresponding feature, the storage resource required by each mapping file in the mapping file set shown in table 2 is smaller than the corresponding mapping file in the mapping file set shown in table 1.
In addition, since the update marker is configured for the model, and features of the same model before and after update may also change, in this embodiment of the present application, the global index configuration file includes a plurality of global index sets and a plurality of update markers in one-to-one correspondence with the global index sets, and each global feature set includes a plurality of features and indexes in one-to-one correspondence with the features. Since the update marker is used to indicate whether a model has been updated, two global index sets may be included in the global index profile, one global index set being an index for the features of each model before update, and the other global index set being an index for the features of each model after update.
Based on the setting of the global index configuration file, when the mapping file corresponding to the identifier of the first model is obtained, an implementation manner of determining a plurality of first features included in the first model from the obtained mapping file may be: determining a plurality of first indexes included in the obtained mapping file; obtaining a global index set corresponding to the update marker of the first model from the global index configuration file; and determining a plurality of first features which correspond to the first indexes one by one from the acquired global index set.
For example, table 3 is a global index profile provided in the embodiment of the present application. As shown in table 3, the global index profile includes two global index sets, a first global index set and a second global index set. The first global index set corresponds to the first update marker, that is, the first global index set is used to store indexes of features included in each model before update. The second global index set corresponds to the second update marker, that is, the second global index set is used to store indexes of features included in each updated model.
TABLE 3
Figure BDA0002360055320000101
It should be noted that the mapping file and the global index configuration file can be directly generated after model training. In a possible implementation manner, for any second model, after the second model is obtained through training, determining a plurality of second features used for training the second model, an identifier of the second model, and an update marker of the second model; generating an index for each of a plurality of second features; and adding the index of each second feature in the plurality of second features and the plurality of second features into a global index set corresponding to the update marker of the second model in the global index configuration file to update the global index configuration file. And generating a mapping file corresponding to the identifier of the second model according to the index of each second feature in the plurality of second features and the updating marker of the second model, and adding the generated mapping file into the mapping file set.
That is, for each model, a mapping file is maintained, and the mapping file is used for storing an index of the features included in the corresponding model and an update marker of the corresponding model, so that when a certain model needs to be called later, the calling disorder does not occur.
The global index profile may be stored in a redis database, which is a storage system storing data in a key-value manner, and will not be explained in detail herein.
And configuring a global index configuration file for all the models so as to store the features and the corresponding indexes of the models before updating and the features and the corresponding indexes of the models after updating. Thus, the memory consumption of the computer can be reduced.
The second model and the first model may be the same model or different models, and the second model is only an example of the second model, and the second model does not refer to a specific model.
Step 102: the feature value of each of the plurality of first features is obtained from a global feature value set based on an update marker of the first model, each feature stored in the global feature value set comprises one or more feature values, and each feature value in the one or more feature values corresponds to one update marker.
As shown in table 1, the features of different models may be the same, so in the embodiment of the present application, a global feature value set is maintained, and the global feature value set is used to store the feature values of the features of all models, so that the repeated storage of the feature values of the same features in different models can be avoided. In addition, since the feature values used by the model before the update and the model after the update may be different, each feature stored in the global feature value set includes one or more feature values, and each feature value in the one or more feature values corresponds to one update marker. That is, the feature values are marked so that the feature values can be associated with the update markers (i.e., version numbers), so that the feature values of the model before and after the update can be maintained together without separately maintaining another system for storing the feature values of the updated model.
For example, table 4 is a global feature value set provided in this embodiment, where the global feature value set includes all features of all models on a line, and each feature includes one or two feature values, and each feature value corresponds to an update flag. As shown in table 4, the feature 1 corresponds to the feature value 11 and the feature value 12, the feature value 11 corresponds to the first update flag, and the feature value 12 corresponds to the second update flag. Feature 2 corresponds to feature value 21 and feature value 21 corresponds to the first update marker.
TABLE 4
Feature(s) Characteristic value
Feature 1 A feature value 11 (first update marker) and a feature value 12 (second update marker)
Feature 2 Eigenvalue 21 (first update marker)
…… ……
Furthermore, in order to further reduce the space required for storage when storing the characteristic values, a prefix may be added directly in front of the characteristic values, the added prefix being used to indicate the corresponding update marker. For example, for the feature value 11, when the feature value 11 is stored in the global feature value set, the feature value 11 is stored in a format of 0 to feature value 11, which indicates that the feature value 11 corresponds to the first update marker. For the eigenvalue 12, when the eigenvalue 12 is stored in the global eigenvalue set, the eigenvalue 12 is stored in the format of 1-eigenvalue 12 for indicating that the eigenvalue 12 corresponds to the second update marker.
Due to the correspondence between the feature values and the update markers, when the model is updated, the feature values in the global feature value set need to be updated, so that when the model is called subsequently, the corresponding feature values can be accurately obtained according to the update markers of the model. In a possible implementation manner, when the model is updated, the implementation process that needs to update the feature values in the global feature value set may be: and receiving a model updating instruction, wherein the model updating instruction is used for indicating that an updating marker of a third model is switched from a first updating marker to a second updating marker, the third model is any model, the first updating marker is used for indicating that the third model is not updated, and the second updating marker is used for indicating that the third model is updated. For any third feature of the plurality of third features comprised by the third model, a third feature value is determined from the global set of feature values that corresponds to the any third feature and the first update marker. Adding a correspondence between a third feature value and a second update marker to the global feature value set.
That is, when a model is updated, for example, for an online artificial intelligence service, when a model is updated and then the online artificial intelligence service is restarted, a model update instruction for the model is received. At this time, a correspondence between one feature value and the second update marker is added to the global feature value set. So as to subsequently invoke either the pre-update or post-update model based on the first update marker and the second update marker.
Through the update of the update marker of the feature value, if a certain model is online again after being updated, the process of updating the feature value may still have a request for calling the model, and at this time, if the feature value is not updated, and data processing through the updated model is likely to be unsuccessful, the model before being updated may still be called to process data, so as to implement hot switching of the model. After all the feature values corresponding to the model are updated, the feature value corresponding to the first update marker may be deleted, and the second update marker may be replaced with the first update marker, so as to subsequently continue to update the model.
It should be noted that, because the feature values in the global feature value set are updated in real time or at regular time, after adding a corresponding relationship between a feature value and the second update marker, for the feature value of the same feature, if the feature value of the feature is updated, only the feature value corresponding to the second update marker is updated, and the feature value corresponding to the first update marker does not need to be updated.
The third model and the second model or the first model may be the same model or different models, and the third model is only an example, and the third model does not refer to a specific model.
Step 103: a processing result of the first model is determined based on a feature value of each of the plurality of first features.
After the feature value of each of the plurality of first features is obtained through steps 101 to 102, the feature value of each of the plurality of first features may be input into the first model to obtain the processing result of the first model.
The processing result of the first model may be a specific score, and thus the processing result may also be referred to as a scored result. For example, assuming that the first model is a model for identifying whether the user is a malicious buyer, the scoring result of the first model may be used to indicate the probability that the current user is a malicious buyer. In addition, when the system calls the model, the specific scoring result may not be displayed on the client, that is, the scoring result is not provided to the user. The system may obtain a determination result based on the scoring result, where the determination result is used to indicate whether the user is a malicious buyer. In one possible implementation, the system may set a probability threshold of 0.8, and determine that the current determined scoring result is "malicious buyer" if the current determined scoring result is greater than 0.8, and determine that the current determined scoring result is "not malicious buyer" if the current determined scoring result is less than or equal to 0.8. And then the judgment result is displayed on the client.
The above embodiment is further briefly explained by the schematic diagram of the model calling process shown in fig. 2. As shown in fig. 2, when the server detects a model calling instruction, the identifier of the model to be called carried in the model calling instruction is obtained, so as to obtain the target model identifier. And the server acquires the mapping file corresponding to the target model identifier from the mapping file set according to the target model identifier to obtain a target mapping file. An update marker and a plurality of indices are obtained from the target map file. And acquiring a global index set corresponding to the update marker from the global index configuration file according to the update marker to obtain a target global index set. A plurality of target features are obtained from the target global index set including a plurality of features in one-to-one correspondence with the plurality of indexes. And acquiring a feature value corresponding to the update marker from the global feature value set according to the target features and the update marker, and obtaining a plurality of target feature values corresponding to the target features one to one. Then, a processing result of the model indicated by the target model identification is determined according to the plurality of target characteristic values, that is, the plurality of target characteristic values are input to the model indicated by the target model identification, and an output of the model is the processing result.
The target model is identified as a model for identifying whether the user is a malicious buyer for further explanation. For the sake of convenience in the following description, a model for identifying whether a user is a malicious buyer is referred to as a malicious merchant identification model. When the server receives a call request aiming at the malicious merchant identification model, the corresponding mapping file is searched in the de-mapping file set according to the identification of the malicious merchant identification model, and the mapping file comprises an index corresponding to the characteristic 1, namely the total amount of orders in the last month, and an index corresponding to the characteristic 2, namely the frequency of orders in each day in the last month, which are called a target index 1 and a target index 2. The mapping file also includes an update marker corresponding to the malicious merchant identification model to indicate whether the currently invoked model is a pre-update model or an updated model. And if the model to be called currently is the malicious merchant identification model before updating, the updating marker is a first updating marker, and if the model to be called currently is the malicious merchant identification model after updating, the updating marker is a second updating marker. The following description will take the update flag as the second update flag.
And the server firstly acquires a global index set corresponding to the second updating marker according to the global index configuration file in the second updating marker. Then, the characteristic corresponding to the target index 1 is acquired from the global index set, and is the 'total order amount in the last month', and the characteristic corresponding to the target index 2 is the 'order frequency per day in the last month'. This process is essentially the process of finding what a particular feature is based on the index.
After the feature 1 and the feature 2 are determined, feature values corresponding to the two features can be obtained from the global feature value set, and then the feature values corresponding to the two features are determined according to the second updating marker obtained from the mapping file, at this time, the obtained feature values are all feature values which are updated synchronously after the model is updated, and then whether the user is a malicious buyer or not is identified through the updated model.
In the process of identifying whether the user is a malicious buyer or not through the updated model, if the model runs with a problem, it indicates that whether the user cannot be identified as the malicious buyer or not through the updated model currently, at this time, the malicious merchant identification model with the update marker as the first update marker may be called according to the process, so as to identify whether the user is a malicious buyer or not through a hot-swap manner, thereby avoiding the current online artificial intelligence service from being interrupted.
It should be noted that the calling process shown in fig. 2 is only used for illustration, and the detailed implementation manner in the calling model process may refer to the implementation manner in each step described above, and is not described herein one by one.
In the embodiment of the present application, feature values of features included in each model are stored in one global feature value set. When the first model needs to be called, the first feature values corresponding to the first features included in the first model can be acquired from the global feature value set so as to determine the processing result of the first model. Therefore, the models can share the same global characteristic value set, and waste of computer resources is avoided. Secondly, in order to avoid the need of maintaining a global feature value set again after updating the model, an update marker can be configured for the model, the update marker is used for indicating whether the first model is updated, and feature values under different update markers are configured for each feature in the global feature value set, so that even if a certain model is updated subsequently, the updated model and the model before updating can still share the same global feature value set, and a global feature value set does not need to be configured separately, thereby further reducing the waste of computer resources.
Fig. 3 is a schematic diagram of a model invoking device according to an embodiment of the present application. As shown in fig. 3, the apparatus 300 includes:
a first determining module 301, configured to determine, based on an identifier of a first model to be invoked, an update flag of the first model and a plurality of first features included in the first model, where the update flag is used to indicate whether the first model has been updated;
an obtaining module 302, configured to obtain a feature value of each of the plurality of first features from a global feature value set based on an update marker of the first model, where each feature stored in the global feature value set includes one or more feature values, and each feature value in the one or more feature values corresponds to one update marker;
a second determining module 303, configured to determine a processing result of the first model based on a feature value of each of the plurality of first features.
Optionally, the first determining module includes:
an obtaining unit, configured to obtain, from a mapping file set, a mapping file corresponding to an identifier of a first model, where the mapping file set includes a plurality of mapping files and a plurality of model identifiers in one-to-one correspondence with the plurality of mapping files, and each mapping file is used to configure an update marker of a model indicated by a corresponding model identifier and a plurality of features included in the indicated model;
and the determining unit is used for determining the updating marker of the first model and a plurality of first characteristics included by the first model from the acquired mapping file.
Optionally, each mapping file comprises an index of each feature that the corresponding model identification indicates the model comprises;
a determination unit configured to:
determining a plurality of first indexes included in the obtained mapping file;
obtaining a global index set corresponding to the update markers of the first model from a global index configuration file, wherein the global index configuration file comprises a plurality of global index sets and a plurality of update markers in one-to-one correspondence with the global index sets, and each global feature set comprises a plurality of features and indexes in one-to-one correspondence with the features;
and determining a plurality of first features which correspond to the first indexes one by one from the acquired global index set.
Optionally, the apparatus further comprises:
a third determination module to determine a plurality of second features for training the second model, an identification of the second model, and an update marker of the second model;
a first generation module for generating an index for each of a plurality of second features;
a first adding module, configured to add the index of each of the plurality of second features and the plurality of second features to a global index set corresponding to the update marker of the second model in a global index profile;
and the second generation module is used for generating a mapping file corresponding to the identifier of the second model according to the index of each second feature in the plurality of second features and the update marker of the second model, and adding the generated mapping file into the mapping file set.
Optionally, the apparatus further comprises:
the model updating module is used for receiving a model updating instruction, the model updating instruction is used for indicating that an updating marker of a third model is switched from a first updating marker to a second updating marker, the third model is any model, the first updating marker is used for indicating that the third model is not updated, and the second updating marker is used for indicating that the third model is updated;
a fourth determining module, configured to determine, for any third feature of multiple third features included in the third model, a third feature value corresponding to the any third feature and the first update marker from the global feature value set;
and the second adding module is used for adding the corresponding relation between the third characteristic value and the second updating marker in the global characteristic value set.
In the embodiment of the present application, feature values of features included in each model are stored in one global feature value set. When the first model needs to be called, the first feature values corresponding to the first features included in the first model can be acquired from the global feature value set so as to determine the processing result of the first model. Therefore, the models can share the same global characteristic value set, and waste of computer resources is avoided. Secondly, in order to avoid the need of maintaining a global feature value set again after updating the model, an update marker can be configured for the model, the update marker is used for indicating whether the first model is updated, and feature values under different update markers are configured for each feature in the global feature value set, so that even if a certain model is updated subsequently, the updated model and the model before updating can still share the same global feature value set, and a global feature value set does not need to be configured separately, thereby further reducing the waste of computer resources.
It should be noted that: the model calling device provided in the foregoing embodiment is only illustrated by the division of the functional modules when calling a model, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the model calling device and the model calling method provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiments and will not be described herein.
Fig. 4 is a schematic structural diagram of a server according to an embodiment of the present application. The server may be a server in a cluster of background servers. Specifically, the method comprises the following steps:
the server 400 includes a Central Processing Unit (CPU)401, a system memory 404 including a Random Access Memory (RAM)402 and a Read Only Memory (ROM)403, and a system bus 405 connecting the system memory 404 and the central processing unit 401. The server 400 also includes a basic input/output system (I/O system) 406, which facilitates the transfer of information between devices within the computer, and a mass storage device 407 for storing an operating system 413, application programs 414, and other program modules 415.
The basic input/output system 406 includes a display 408 for displaying information and an input device 409 such as a mouse, keyboard, etc. for user input of information. Wherein a display 408 and an input device 409 are connected to the central processing unit 401 through an input output controller 410 connected to the system bus 405. The basic input/output system 406 may also include an input/output controller 410 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input/output controller 410 may also provide output to a display screen, a printer, or other type of output device.
The mass storage device 407 is connected to the central processing unit 401 through a mass storage controller (not shown) connected to the system bus 405. The mass storage device 407 and its associated computer-readable media provide non-volatile storage for the server 400. That is, the mass storage device 407 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM drive.
Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 404 and mass storage device 407 described above may be collectively referred to as memory.
According to various embodiments of the present application, the server 400 may also operate as a remote computer connected to a network through a network, such as the Internet. That is, the server 400 may be connected to the network 412 through the network interface unit 411 connected to the system bus 405, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 411.
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing the model call method provided by embodiments of the present application.
Embodiments of the present application further provide a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of a server, enable the server to execute the model calling method provided in the foregoing embodiments.
Embodiments of the present application further provide a computer program product containing instructions, which when run on a server, cause the server to execute the model calling method provided in the foregoing embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for model invocation, the method comprising:
determining an update marker of the first model and a plurality of first features included in the first model based on an identification of the first model to be invoked, the update marker indicating whether the first model has been updated;
obtaining a feature value of each of the plurality of first features from a global feature value set based on an update marker of the first model, each feature stored in the global feature value set comprising one or more feature values, each feature value of the one or more feature values corresponding to an update marker;
determining a processing result of the first model based on a feature value of each of the plurality of first features.
2. The method of claim 1, wherein determining the update marker for the first model and the plurality of first features the first model comprises based on the identification of the first model to be invoked comprises:
acquiring a mapping file corresponding to the identifier of the first model from a mapping file set, wherein the mapping file set comprises a plurality of mapping files and a plurality of model identifiers in one-to-one correspondence with the plurality of mapping files, and each mapping file is used for configuring an update marker of the model indicated by the corresponding model identifier and a plurality of characteristics included by the indicated model;
determining, from the obtained mapping file, an update marker of the first model and a plurality of first features that the first model includes.
3. The method of claim 2, wherein each mapping file includes an index for each feature that the corresponding model identification indicates the model includes;
the determining, from the obtained mapping file, a plurality of first features included in the first model includes:
determining a plurality of first indexes included in the obtained mapping file;
obtaining a global index set corresponding to the update marker of the first model from a global index configuration file, wherein the global index configuration file comprises a plurality of global index sets and a plurality of update markers in one-to-one correspondence with the global index sets, and each global feature set comprises a plurality of features and indexes in one-to-one correspondence with the features;
and determining a plurality of first features which correspond to the first indexes one by one from the acquired global index set.
4. The method of claim 3, wherein the method further comprises:
determining a plurality of second features for training a second model, an identification of the second model, and an update marker for the second model;
generating an index for each of the plurality of second features;
adding the index of each of the plurality of second features and the plurality of second features in a global index set corresponding to an update marker of the second model in the global index profile;
and generating a mapping file corresponding to the identifier of the second model according to the index of each second feature in the plurality of second features and the update marker of the second model, and adding the generated mapping file in the mapping file set.
5. The method of any of claims 1 to 4, further comprising:
receiving a model update instruction, wherein the model update instruction is used for indicating that an update marker of a third model is switched from a first update marker to a second update marker, the third model is any model, the first update marker is used for indicating that the third model is not updated, and the second update marker is used for indicating that the third model is updated;
for any third feature of a plurality of third features included in the third model, determining a third feature value corresponding to the any third feature and the first update marker from the global set of feature values;
adding a correspondence between the third feature value and the second update marker to the global set of feature values.
6. An apparatus for model calling, the apparatus comprising:
a first determination module, configured to determine, based on an identification of a first model to be invoked, an update flag of the first model and a plurality of first features included in the first model, where the update flag is used to indicate whether the first model has been updated;
an obtaining module, configured to obtain a feature value of each of the plurality of first features from a global feature value set based on an update marker of the first model, where each feature stored in the global feature value set includes one or more feature values, and each feature value in the one or more feature values corresponds to one update marker;
a second determination module for determining a processing result of the first model based on a feature value of each of the plurality of first features.
7. The apparatus of claim 6, wherein the first determining module comprises:
an obtaining unit, configured to obtain a mapping file corresponding to an identifier of the first model from a set of mapping files, where the set of mapping files includes a plurality of mapping files and a plurality of model identifiers in one-to-one correspondence with the plurality of mapping files, and each mapping file is used to configure an update marker of a model indicated by the corresponding model identifier and a plurality of features included in the indicated model;
a determining unit, configured to determine, from the obtained mapping file, an update marker of the first model and a plurality of first features included in the first model.
8. The apparatus of claim 7, wherein each mapping file includes an index for each feature that the corresponding model identification indicates the model includes;
the determining unit is configured to:
determining a plurality of first indexes included in the obtained mapping file;
obtaining a global index set corresponding to the update marker of the first model from a global index configuration file, wherein the global index configuration file comprises a plurality of global index sets and a plurality of update markers in one-to-one correspondence with the global index sets, and each global feature set comprises a plurality of features and indexes in one-to-one correspondence with the features;
and determining a plurality of first features which correspond to the first indexes one by one from the acquired global index set.
9. An apparatus for model calling, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of the method of any of the above claims 1 to 5.
10. A computer-readable storage medium having stored thereon instructions which, when executed by a processor, carry out the steps of the method of any of the preceding claims 1 to 5.
CN202010019146.6A 2020-01-08 2020-01-08 Model calling method and device and computer storage medium Pending CN111259005A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010019146.6A CN111259005A (en) 2020-01-08 2020-01-08 Model calling method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010019146.6A CN111259005A (en) 2020-01-08 2020-01-08 Model calling method and device and computer storage medium

Publications (1)

Publication Number Publication Date
CN111259005A true CN111259005A (en) 2020-06-09

Family

ID=70952716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010019146.6A Pending CN111259005A (en) 2020-01-08 2020-01-08 Model calling method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN111259005A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704527A (en) * 2017-09-18 2018-02-16 华为技术有限公司 Date storage method, device and storage medium
CN109471874A (en) * 2018-10-30 2019-03-15 华为技术有限公司 Data analysis method, device and storage medium
CN110109912A (en) * 2018-01-15 2019-08-09 北京京东尚科信息技术有限公司 A kind of identifier generation method and device
CN110515944A (en) * 2019-08-16 2019-11-29 出门问问(苏州)信息科技有限公司 Date storage method, storage medium and electronic equipment based on distributed data base

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704527A (en) * 2017-09-18 2018-02-16 华为技术有限公司 Date storage method, device and storage medium
CN110109912A (en) * 2018-01-15 2019-08-09 北京京东尚科信息技术有限公司 A kind of identifier generation method and device
CN109471874A (en) * 2018-10-30 2019-03-15 华为技术有限公司 Data analysis method, device and storage medium
CN110515944A (en) * 2019-08-16 2019-11-29 出门问问(苏州)信息科技有限公司 Date storage method, storage medium and electronic equipment based on distributed data base

Similar Documents

Publication Publication Date Title
CN111506559B (en) Data storage method, device, electronic equipment and storage medium
CN108846753B (en) Method and apparatus for processing data
CN106874281B (en) Method and device for realizing database read-write separation
CN108536745B (en) Shell-based data table extraction method, terminal, equipment and storage medium
CN110046155B (en) Method, device and equipment for updating feature database and determining data features
CN112306993A (en) Data reading method, device and equipment based on Redis and readable storage medium
CN111435367A (en) Knowledge graph construction method, system, equipment and storage medium
CN107220375B (en) Data reading and writing method and server
CN107368513B (en) Method and device for updating client database
CN104573127B (en) Assess the method and system of data variance
CN114064073A (en) Software version upgrading method and device, computer equipment and storage medium
CN109597819B (en) Method and apparatus for updating a database
CN111259005A (en) Model calling method and device and computer storage medium
CN115732052A (en) Case report table generation method and device based on structured clinical project
CN115578180A (en) Bank outlet cash resource management method and device
US9092472B1 (en) Data merge based on logical segregation
CN114328632A (en) User data analysis method and device based on bitmap and computer equipment
CN110727677B (en) Method and device for tracing blood relationship of table in data warehouse
CN114528973A (en) Method for generating business processing model, business processing method and device
CN115794806A (en) Gridding processing system, method and device for financial data and computing equipment
CN111459737A (en) Problem positioning method and device, computer equipment and storage medium
CN110929207A (en) Data processing method, device and computer readable storage medium
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN113590213B (en) Component maintenance method, electronic device and storage medium
CN110728584B (en) Information processing method and device, readable storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211201

Address after: Room 084, No. 1-309, 3rd floor, commercial building, No. 9 Wangjing street, Chaoyang District, Beijing 100102

Applicant after: Beijing Daily Youxian Technology Co.,Ltd.

Address before: 100102 room 801, 08 / F, building 7, yard 34, Chuangyuan Road, Chaoyang District, Beijing

Applicant before: BEIJING MISSFRESH E-COMMERCE Co.,Ltd.

WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200609