CN111176705B - Feature library upgrading method and device - Google Patents

Feature library upgrading method and device Download PDF

Info

Publication number
CN111176705B
CN111176705B CN201911262764.7A CN201911262764A CN111176705B CN 111176705 B CN111176705 B CN 111176705B CN 201911262764 A CN201911262764 A CN 201911262764A CN 111176705 B CN111176705 B CN 111176705B
Authority
CN
China
Prior art keywords
feature
value
record
field
library
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.)
Active
Application number
CN201911262764.7A
Other languages
Chinese (zh)
Other versions
CN111176705A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911262764.7A priority Critical patent/CN111176705B/en
Publication of CN111176705A publication Critical patent/CN111176705A/en
Application granted granted Critical
Publication of CN111176705B publication Critical patent/CN111176705B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a method for upgrading a feature library, which comprises the following steps: receiving an upgrade instruction of a feature library, wherein the feature library comprises feature records of features, the feature records comprise first fields and second fields configured for the features, and the first fields are assigned as pre-update feature values of the features; acquiring a stock upgrading file of the feature library according to the upgrading instruction; acquiring a first characteristic value of the characteristic from the stock upgrading file; in the feature record of the feature, assigning the second field as the first feature value to obtain an updated feature record of the feature; and writing the updated feature record into the feature library to replace the feature record of the feature in the feature library, thereby realizing the continuous updating of the feature library.

Description

Feature library upgrading method and device
Technical Field
The present application relates to the field of computer and communication technologies, and in particular, to a method and apparatus for upgrading a feature library.
Background
The algorithm model needs to be optimized and iterated along with the change of the application scene, namely the algorithm model is upgraded from an old algorithm model to a new algorithm model. The new algorithm model obtained by upgrading cannot be compatible with the old algorithm model, so that the feature library of the algorithm model needs to be correspondingly upgraded.
In the prior art, the feature library needs to be upgraded by stopping, that is, the user cannot be served during the upgrade of the feature library.
Disclosure of Invention
The embodiment of the application provides a method and a device for upgrading a feature library, which are used for realizing the upgrading of the feature library without stopping service.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned in part by the practice of the application.
According to an aspect of the embodiments of the present application, there is provided a method for upgrading a feature library, including:
receiving an upgrade instruction of a feature library, wherein the feature library comprises feature records of features, the feature records comprise first fields and second fields configured for the features, and the first fields are assigned as pre-update feature values of the features;
acquiring a stock upgrading file of the feature library according to the upgrading instruction;
acquiring a first characteristic value of the characteristic from the stock upgrading file;
in the feature record of the feature, assigning the second field as the first feature value to obtain an updated feature record of the feature;
and writing the updated feature record into the feature library to replace the feature record of the feature in the feature library.
According to an aspect of the embodiments of the present application, there is provided an upgrade apparatus for a feature library, including:
the device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving an upgrading instruction of a feature library, the feature library comprises a feature record of a feature, the feature record comprises a first field and a second field which are configured for the feature, and the first field is assigned to be a pre-update feature value of the feature;
the stock upgrading file acquisition module is used for acquiring the stock upgrading file of the feature library according to the upgrading instruction;
the first characteristic value acquisition module is used for acquiring a first characteristic value of the characteristic from the stock upgrading file;
the updating module is used for assigning the second field to the first characteristic value in the characteristic record of the characteristic to obtain an updated characteristic record of the characteristic;
and the writing module is used for writing the updated feature record into the feature library so as to replace the feature record of the feature in the feature library.
In some embodiments of the present application, the pre-update feature value and the post-update feature value of the feature are stored by configuring a dual field, i.e., a first field and a second field, for each feature in the feature record. Because the reading and writing operation of the feature records in the feature library occurs in the storage layer without influencing the external retrieval service provided by the retrieval layer, the service can be provided to the outside according to the data in the cache of the retrieval layer in the upgrading process of the feature library, and the continuous updating of the feature library is realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art. In the drawings:
FIG. 1 is a flow diagram illustrating a method of upgrading a feature library according to one embodiment;
FIG. 2 is a flow chart showing steps subsequent to step 110, according to one embodiment;
FIG. 3 is a flow chart of step 250 of the corresponding embodiment of FIG. 1 in one embodiment;
FIG. 4 is a flow chart of step 250 of the corresponding embodiment of FIG. 1 in another embodiment;
FIG. 5 is a flow chart of steps in one embodiment following step 190 of the corresponding embodiment of FIG. 1;
FIG. 6 is a flow chart of steps in one embodiment after step 530 of the corresponding embodiment of FIG. 5;
FIG. 7 is a flow chart of steps in one embodiment following step 650 of the corresponding embodiment of FIG. 6;
FIG. 8 is an upgrade state diagram illustrating a feature library, according to one embodiment;
FIG. 9 is a schematic diagram illustrating a process for upgrading a feature library according to one embodiment;
FIG. 10 is a block diagram of an upgrade apparatus of a feature library, shown according to one embodiment;
fig. 11 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present application. One skilled in the relevant art will recognize, however, that the aspects of the application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
FIG. 1 is a flowchart of a method for upgrading a feature library according to an embodiment, as shown in FIG. 1, the method at least includes steps 110-190, specifically as follows:
step 110, receiving an upgrade instruction of a feature library, wherein the feature library comprises feature records of features, the feature records comprise first fields and second fields configured for the features, and the first fields are assigned as feature values before update of the features.
The feature library is used to store information about features, such as feature values of the features. The feature library is updated by, for example, adding new features to the feature library, updating feature values of original features, deleting features, etc., which are not particularly limited herein. It will be appreciated that in the feature library, features are represented by feature identifications.
Specifically, in the feature library, the related information of the feature is represented as a feature record, that is, a feature record corresponds to the related information of a feature.
In the scheme of the disclosure, the feature record of the feature at least comprises a feature identifier of the feature, a first field and a second field, wherein the first field and the second field are used for representing feature values of the feature. In one embodiment, the feature record may be: fea_id entity_idFenature 0 feature1, wherein Fea_id represents a feature identifier, entity_id represents a data entity representation, feature0 is a first field, and feature1 is a second field.
In the upgrading process of the feature library, feature value updating of the feature is involved, that is, in each upgrading process, there is a feature corresponding to a feature value before updating (i.e., a feature value before updating) and a feature value after updating.
In the solution of the present embodiment, in order to avoid copying the feature library, two fields are configured in the feature record for the feature to store the feature value corresponding to the before update and the feature value corresponding to the after update, respectively.
In particular, in this embodiment, the first field is used to store a pre-update feature value of the feature, that is, in the feature record, the first field is assigned a pre-update feature value. And when the feature is not updated, the second field in the feature record is not assigned.
And 130, acquiring a stock upgrading file of the feature library according to the upgrading instruction.
For upgrading of the feature library, the stock upgrading is related to the updating of the feature library in full quantity. In particular, for features present in a feature library, the features may not necessarily have active update behavior, thus requiring stock upgrades.
That is, the upgrade instructions of the present disclosure are initiated to perform an inventory upgrade of the feature library, and thus, the inventory upgrade of the feature library is initiated based on the upgrade instructions.
The stock upgrade file refers to an upgrade package required for stock upgrade. Therefore, the stock upgrading file indicates that the features in the feature library correspond to the updated feature values, so that the stock upgrading of the feature library is performed according to the stock upgrading file.
In one embodiment, the stock upgrade file may be a pre-configured file.
Step 150, obtaining the first feature value of the feature from the stock upgrade file.
The first feature value refers to an updated feature value of the feature indicated by the stock upgrade file.
In step 170, in the feature record of the feature, the second field is assigned as the first feature value, so as to obtain an updated feature record of the feature.
The feature record of the feature originates from a feature library, i.e. for updating the feature, the feature record of the feature is correspondingly read from the feature library and a second field in the read feature record is assigned as the first feature value, which second field corresponds to the second feature value of the feature (updated feature value).
The updated feature record refers to a feature record obtained by assigning the second field as the first feature value in the feature record of the feature.
And step 190, writing the updated feature record into the feature library to replace the feature record of the feature in the feature library.
Since the updated feature record is obtained by editing the feature record read from the feature library, the updated feature record is written into the feature library, that is, the feature record of the feature in the feature library is replaced by the updated feature record.
To this end, in the scheme of the present disclosure, the pre-update feature value and the post-update feature value of the feature are stored by configuring a double field, i.e., a first field and a second field, for each feature in the feature record. Because the reading and writing operation of the feature records in the feature library occurs in the storage layer without affecting the external retrieval service provided by the retrieval layer, the retrieval layer can continue to provide the external service in the upgrading process of the feature library, and the continuous updating of the feature library is realized.
In one embodiment, as shown in FIG. 2, after step 110, the method further comprises:
step 210, an incremental upgrade file of the feature library is obtained, the incremental upgrade file indicating the feature to be written.
For upgrades to feature libraries, incremental upgrades are also involved. The incremental upgrade refers to adding features in the feature library or updating only features needing to be updated in the feature library.
The feature to be written refers to a feature that needs to write the updated feature record into the feature library in the incremental updating process, and specifically, the feature to be written may be a new feature or a feature that performs feature value updating.
In other words, in the incremental upgrade process, at least one of feature addition and feature value update is involved. The features newly added in the incremental upgrading process are called as newly added features, and features needing to be updated with feature values in the feature library in the upgrading process are called as updated features.
The incremental upgrade file of the feature library is a file packet for incremental upgrade of the feature library, and the incremental upgrade file can be a file independent of the stock upgrade file, an upgrade file which is generated correspondingly because of the update of the feature library caused by the triggering of a service layer in the stock upgrade process, or an upgrade file which is generated correspondingly because of the update of a certain feature due to the operation logic configured in the algorithm model in the stock upgrade process. Of course, the above is merely an exemplary example, and in other embodiments, the incremental upgrade file may be derived from other scenarios requiring incremental upgrades to the feature library.
The incremental upgrade file at least indicates the feature value of the feature to be written after incremental upgrade, and the feature value of the feature to be written after incremental upgrade is the new feature value of the feature to be written. Specifically, for the newly added feature, the feature value of the newly added feature indicated in the incremental upgrade file is the new feature value of the newly added feature, and for the updated feature, the feature value of the updated feature indicated in the incremental upgrade file is the new feature value of the updated feature.
Step 230, obtaining new feature values corresponding to the features to be written according to the incremental upgrade file. Step 250, generating a writing feature record for the feature to be written according to the new feature value, wherein in the writing feature record, the first field of the feature to be written is assigned as the old feature value of the feature to be written, and the second field is assigned as the new feature value.
As described above, the feature to be written may be a newly added feature or an updated feature. For the updated feature, the old feature value of the updated feature is the current feature value of the updated feature, i.e. the feature value before incremental upgrade.
For the newly added feature, the old feature value of the newly added feature may be a preset feature value, in other words, for the newly added feature, a feature value is preset as its old feature value. In another embodiment, when the feature library corresponds to an algorithm model, the old feature value of the newly added feature may be a feature value of the feature under the old algorithm model, and the new feature value of the corresponding newly added feature is a feature value of the feature under the new algorithm model.
Therefore, on the basis of acquiring the new characteristic value and the old characteristic value of the characteristic to be written, a written characteristic record is correspondingly generated for the characteristic to be written.
Step 270, writing the writing feature record into the feature library. And writing the writing feature record of the feature to be written into a feature library to realize the upgrading of the feature to be written.
In one embodiment, the feature library corresponds to an algorithm model, and the feature library is updated after the algorithm model is updated from an old algorithm model to a new algorithm model; the feature to be written comprises an added feature, in this embodiment, step 230 comprises:
and obtaining a third characteristic value of the newly added characteristic under the new algorithm model according to the increment upgrading file, and taking the third characteristic value as the new characteristic value.
For the algorithm model, due to the change of a specific application scene, optimization and iteration are needed correspondingly, namely, the algorithm model is upgraded, but the upgraded algorithm model cannot be compatible with the old algorithm model, and then, the stock data of the algorithm model, namely, the feature library of the algorithm model, is needed to be upgraded correspondingly.
The algorithm model before upgrade is called the old algorithm model. The updated algorithm model is referred to as a new algorithm model.
The incremental upgrade file comprises a third characteristic value of the new added feature under a new algorithm model, so that the third characteristic value of the new added feature is correspondingly obtained from the incremental upgrade file and is used as a new characteristic value. In this embodiment, as shown in FIG. 3, step 250 includes:
step 310, obtaining a second characteristic value of the newly added characteristic under the old algorithm model, and taking the second characteristic value as the old characteristic value; and
step 330, obtain an initial feature record configured for the newly added feature.
In step 350, in the initial feature record, the first field is assigned as an old feature value, and the second field is assigned as a new feature value, so as to obtain a written feature record of the new feature.
The second feature value of the new feature under the old algorithm model may be a feature value specified in the incremental upgrade file, or may be a feature value that is pre-configured, which is not specifically limited herein.
For the newly added feature, the feature record of the newly added feature is not included in the feature library, and in order to obtain the written feature record of the newly added feature, an initial feature record is configured for the newly added feature in advance. It will be appreciated that the initial feature record is correspondingly configured with a first field and a second field for the newly added feature. Further, the initial feature record also includes a feature representation of the new feature.
Further, in the initial feature record of the new feature, the first field is assigned as the old feature value of the new feature, and the second field is assigned as the new feature value of the new feature, so as to obtain the written feature record of the new feature.
In one embodiment, the feature to be written includes an update feature, as shown in FIG. 4, step 250, includes:
step 410, obtaining a feature record of the updated feature from the feature library, and taking the value of the first field in the feature record of the updated feature as the old feature value.
In step 430, in the feature record of the updated feature, the second field is assigned as a new feature value, and a written feature record of the updated feature is obtained.
For the updated feature, a feature record of the updated feature is stored in the feature library. Thus, the feature record of the updated feature is read from the feature library, and the value of the first field in the read feature record is the old feature value of the updated feature. And then, a second field in the feature record of the updated feature is assigned as a new feature value of the updated feature, and a written feature record of the updated feature is correspondingly obtained.
In one embodiment, the incremental upgrade file indicates the feature to be deleted, and after step 210, the method further comprises: and deleting the feature records of the features to be deleted in the feature library.
In one embodiment, as shown in FIG. 5, after step 190, the method further comprises:
step 510, traversing the feature records in the feature library according to the stock upgrade file.
And step 530, if traversing to determine that the features in the feature library are updated, loading new model data of the algorithm model corresponding to the feature library into the cache.
The stock upgrade file indicates feature values of features contained in the feature library before the feature library upgrade is performed, in other words, features contained in the feature library before the feature library upgrade is performed can be known from the stock upgrade file. Therefore, traversing is carried out in the feature library according to the stock upgrading file, so that whether the features related in the stock upgrading file are all upgraded or not can be obtained, and if the features are all upgraded, the completion of the stock upgrading is indicated; otherwise, if the features involved in the stock upgrade file are not all upgraded, the stock upgrade is not completed.
For the algorithm model, stock upgrading is regarded as supporting a new algorithm model, and if the feature library finishes stock upgrading, the feature library after finishing stock upgrading can at least support the new algorithm model. Therefore, after the stock upgrade is completed, new model data of the algorithm model is loaded into the cache, so that the new model data can be based on which the new algorithm model can be retrieved.
The new model data is used to describe the new algorithm model and, similarly, the old model data is used to describe the old algorithm model.
It is worth mentioning that for retrieval, the storage layer is not directly accessed, i.e. the feature library is not accessed, but the data in the cache is used for retrieval. In the writing process of the feature library, the written data is correspondingly and synchronously updated into the cache, in other words, the cache comprises the old feature value and the new feature value of the feature along with the upgrading.
In the upgrading process, the cache also comprises old model data of the algorithm model. That is, after the stock upgrade is completed, the cache includes the old feature value, the new feature value and the old model data of the feature, and after the new model data is loaded into the cache, on the one hand, the new model data and the new feature value of the feature can be searched; on the other hand, the retrieval may be performed based on old model data and old feature values of the features. That is, the search service may switch the algorithm model for searching.
After the upgrade is started and during the incomplete stock upgrade, the old model data and the old feature values of the features are included in the cache, so that a retrieval service can be provided based on the old algorithm model. From the above, in the whole upgrading process, the cache is always provided with the data required by the retrieval service, so that the continuous upgrading of the feature library is realized.
In one embodiment, the old model data including the algorithm model is stored in the cache, and when the feature record is written into the feature library, the values of the first field and the values of the second field are saved in the cache, as shown in fig. 6, and after step 530, the method further includes:
step 610, a search request is received, the search request including an indication identifier, the indication identifier being used to indicate a search in a first field or a search in a second field.
Step 630, if the indication identifier indicates to search in the first field, searching is performed in the first field according to the old model data, and a first search result is obtained.
If the indication identifier indicates to search in the second field, the step 650 searches in the second field according to the new model data to obtain a second search result.
As described above, after the stock upgrade is completed and the new model data is loaded into the cache, the retrieval service under the new algorithm model and the old algorithm model may be provided based on the data in the cache.
The feature record in the cache comprises a first field and a second feature field, wherein the value of the first field corresponds to the old feature value of the feature, and the value of the second field corresponds to the new feature value of the special diagnosis. For a feature library, old feature values of features can support an old algorithm model to provide retrieval services; the new feature values of the features may support the new algorithm model to provide retrieval services.
On the basis, if the indication mark in the search request indicates to search in the first field, namely searching in the old characteristic value, searching in the first field according to the old model data, and correspondingly obtaining a first search result; and if the indication mark in the search request indicates to search in the second field, namely searching in the new characteristic value, searching in the second field according to the new model data, and correspondingly obtaining a second search result.
In one embodiment, as shown in FIG. 7, after step 650, the method further comprises:
and step 710, calculating test parameters according to the second search result, wherein the test parameters are used for representing the performance of the new algorithm model indicated by the new model data.
Step 730, if the test parameter meets the preset condition, generating an upgrade confirmation instruction, deleting the value of the first field and deleting the old model data according to the upgrade confirmation instruction.
And 750, if the test parameters do not meet the preset conditions, generating a rollback instruction, and deleting the value of the second field and the new model data according to the rollback instruction.
For algorithm model upgrades, it is generally necessary to validate a new algorithm model, and the validation test performed is called an AB test (ABTest).
In the AB test of the new algorithm model, the testing party sends a search request, and the indication mark in the search request indicates to search in the second field, and based on the search request, a second search result is obtained.
After the second search result is obtained, the test parameters are calculated according to the second search result. In one embodiment, the test parameters may be recall, accuracy of search results, and other parameters that may measure the performance of the new algorithm model.
In one embodiment, the predetermined condition may be a parameter range set for the test parameter. In an embodiment, the parameter range may be set according to the value of the test parameter calculated from the first search result. In other embodiments, the parameter range may also be set according to practical experience, and is not specifically limited herein.
If the test parameters meet the preset conditions, the new algorithm model is evolved or meets the requirements compared with the old algorithm model, so that an upgrade confirmation instruction is correspondingly generated to delete the old data in the cache and retrieval layer according to the upgrade confirmation instruction. Specifically, the old data includes a value of the first field and old model data.
In one embodiment, after the upgrade confirmation instruction is generated, the upgrade confirmation instruction is sent to the terminal so that the user can confirm the upgrade confirmation instruction in the terminal, and therefore after the upgrade confirmation instruction is confirmed, old data in the cache and retrieval layer is deleted according to the upgrade confirmation instruction.
Further, after deleting old data in the cache and retrieval layer, assigning the first field as a value of the second field for the retrieval record in the feature library, and emptying the value of the second field.
If the test parameters do not meet the preset conditions, the new algorithm model is degraded compared with the old algorithm model or the new algorithm model does not meet the requirements, so that a rollback instruction is correspondingly generated, and new data in the cache and retrieval layer are deleted according to the rollback instruction. Specifically, the new data includes the value of the second field and the new model data.
In an embodiment, the algorithm model comprises at least two feature libraries, the method further comprising, after deleting the value of the first field and deleting old model data according to the upgrade confirmation instruction:
and receiving an upgrading instruction sent for the next feature library.
If the full feature library of the algorithm model is larger, if the full feature library is upgraded, the cost of the cache layer is larger. Therefore, in order to solve the problem, the features of the algorithm model are partitioned into at least two feature libraries, and then the library is upgraded at granularity, so that the overhead of a cache layer is reduced.
Furthermore, the upgrade state of each feature library can be displayed in the terminal. FIG. 8 is an upgrade state diagram illustrating a feature library, according to one embodiment.
Before upgrading, as shown in fig. 8, a feature library to be upgraded and a state of the feature library are displayed in a user interface of the terminal, wherein the state of the feature library includes to be upgraded and the upgrading is completed. As shown in I in fig. 8, the feature library to be upgraded includes a feature library a, a feature library B, and a feature library C, and the user interface further includes a status display box 810, where "upgrade" in the status display box 810 indicates that the feature library is in a state to be upgraded.
Further, the status display box 810 may also be used as an operation portal through which an upgrade instruction of the corresponding feature library is sent. As shown in I in fig. 8, a status display box 810 next to the displayed feature library a is considered an operational portal to feature library a. If the user operates the operation entry, namely, the user is regarded as sending the upgrading instruction corresponding to the feature library A, after the server receives the upgrading instruction, the service correspondingly upgrades the feature library A according to the method disclosed by the disclosure.
As shown in fig. 8 II, during the upgrade of feature library a, the progress of the upgrade of feature library a is fed back through progress bar 820.
After the feature library finishes stock upgrading, the feature library enters an upgrading switching state. The upgrade switching state is a state in which new and old model data are stored in the cache. As shown in fig. 8 III, the upgrade switching status is displayed through the second status display box 830.
In another embodiment, after the second status display box 810 is displayed, a prompt dialog box may be correspondingly displayed, where the prompt dialog box is used to prompt the user whether to confirm the upgrade confirmation instruction, and if the user indicates confirmation, step 730 is performed to implement upgrading of the feature library a.
After the upgrading of the feature library A is completed, the upgrading state of the feature library A is correspondingly updated. As shown in IV in fig. 8, the upgrade status of feature library a is complete, and the status of feature libraries B and C remain to be upgraded.
The method of the present disclosure is described below in connection with a specific embodiment.
Fig. 9 is a schematic diagram showing a process of upgrading a feature library in the present embodiment, and as shown in fig. 9, the incremental upgrade 910 and the stock upgrade 920 are performed after an upgrade instruction of the feature library is received. It should be noted that the incremental upgrade 910 and the stock upgrade 920 have no front-back dependency, and the stock upgrade 920 may be performed while the incremental upgrade 910 is performed.
In the process of the storage upgrading, the upgrading of the characteristics is related, and the upgrading process of the characteristics is expressed as follows: the first field in the feature record remains unchanged and the value of the second field is newly added.
In the incremental upgrading process, feature addition, feature update and feature deletion are involved. Wherein, the new process of the characteristics is expressed as follows: adding the value of the first field of the feature and adding the value of the second field; the process of feature update appears as follows: updating the value of the first field and newly adding/updating the value of the second field; the process of feature deletion is represented as: and deleting the feature record of the feature.
After the inventory upgrade 920 is completed, an upgrade switch state 930 is entered. In the upgrade switching state 930, retrieval with new or old feature values, respectively, is supported. Further, during the upgrade switching state 930, rollback may also be performed as per step 750. In the upgrade switching state 930, if the user confirms the upgrade confirmation instruction, the value of the first field and the old model data may be deleted according to the upgrade confirmation instruction, that is, the process of deleting the old data 940 is entered, and if the old data is deleted, the upgrade process of the feature library is ended, and the incremental upgrade process is correspondingly ended.
The following describes apparatus embodiments of the present application that may be used to perform the methods of the above-described embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments described above in the present application.
FIG. 10 is an upgrade apparatus 1000 of a feature library, according to one embodiment, as shown in FIG. 10, comprising:
the receiving module 1010 is configured to receive an upgrade instruction of a feature library, where the feature library includes a feature record of a feature, and the feature record includes a first field configured for the feature and a second field, and the first field is assigned as a pre-update feature value of the feature.
The stock upgrade file obtaining module 1030 is configured to obtain, according to the upgrade instruction, a stock upgrade file of the feature library, where the stock upgrade file indicates a feature to be updated.
The first feature value obtaining module 1050 is configured to obtain a first feature value of a feature to be updated from the stock upgrade file.
And an updating module 1070, configured to assign the second field to the first feature value in the feature record of the feature to be updated, so as to obtain an updated feature record of the feature to be updated.
The writing module 1090 is configured to write the updated feature record into the feature library to replace the feature record of the feature to be updated in the feature library.
In one embodiment, the apparatus further comprises:
the incremental upgrade file acquisition module is used for acquiring an incremental upgrade file of the feature library, wherein the incremental upgrade file indicates the feature to be written;
the new characteristic value acquisition module is used for acquiring a new characteristic value corresponding to the characteristic to be written according to the incremental upgrade file;
the writing feature record generation module is used for generating a writing feature record for the feature to be written according to the new feature value, wherein in the writing feature record, a first field of the feature to be written is assigned as an old feature value of the feature to be written, and a second field is assigned as the new feature value;
And the second writing module is used for writing the writing feature record into the feature library.
In one embodiment, the feature library corresponds to an algorithm model, and the feature library is updated after the algorithm model is updated from an old algorithm model to a new algorithm model; the feature to be written comprises a newly added feature, and a new feature value acquisition module comprises:
the third characteristic value acquisition unit is used for acquiring a third characteristic value of the newly added characteristic under the new algorithm model according to the increment upgrading file, and taking the third characteristic value as a new characteristic value;
in this embodiment, the writing feature record generating module includes:
the second characteristic value acquisition unit is used for acquiring a second characteristic value of the newly added characteristic under the old algorithm model, and taking the second characteristic value as the old characteristic value; and
and the initial feature record acquisition unit is used for acquiring the initial feature record configured for the newly added feature.
The first writing feature record obtaining unit is used for assigning the first field as an old feature value and assigning the second field as a new feature value in the initial feature record to obtain the writing feature record of the new feature.
In another embodiment, the feature to be written includes an update feature, and the write feature record generation module includes:
And the feature record acquisition unit is used for acquiring a feature record of the updated feature from the feature library, and taking the value of the first field in the feature record of the updated feature as an old feature value.
And the second writing feature record obtaining unit is used for assigning the second field as a new feature value in the feature record of the updated feature to obtain the writing feature record of the updated feature.
In one embodiment, the incremental upgrade file indicates a feature to be deleted, the apparatus further comprising:
and the deleting module is used for deleting the feature records of the features to be deleted in the feature library.
In one embodiment, the apparatus further comprises:
and the traversing module is used for traversing the feature records in the feature library according to the stock upgrading file.
And the loading module is used for loading new model data of the algorithm model corresponding to the feature library into the cache if the feature in the feature library is traversed and confirmed to finish stock upgrading.
In an embodiment, old model data including an algorithm model in the cache, values of the first field and values of the second field are saved to the cache when the feature record is written to the feature library, the apparatus further comprising:
the search request receiving module is used for receiving a search request, and the search request comprises an indication identifier, wherein the indication identifier is used for indicating searching in a first field or searching in a second field.
The first search result obtaining module is used for searching in the first field according to the old model data if the indication mark indicates searching in the first field, so as to obtain a first search result;
and the second search result obtaining module is used for searching in the second field according to the new model data if the indication mark indicates searching in the second field, so as to obtain a second search result.
In one embodiment, the apparatus further comprises:
and the test parameter calculation module is used for calculating test parameters according to the second search result, wherein the test parameters are used for representing the performance of the new algorithm model indicated by the new model data.
And the upgrade confirmation instruction generation module is used for generating an upgrade confirmation instruction if the test parameters meet preset conditions, and deleting the value of the first field and deleting old model data according to the upgrade confirmation instruction.
And the rollback instruction generation module is used for generating a rollback instruction if the test parameters do not meet the preset conditions, and deleting the value of the second field and the new model data according to the rollback instruction.
In an embodiment, the algorithm model comprises at least two feature libraries, the apparatus further comprising:
and the second upgrade instruction receiving module is used for receiving the upgrade instruction sent by the next feature library.
The implementation process of the functions and roles of each module/unit in the above device is specifically shown in the implementation process of the corresponding steps in the upgrading method of the feature library, and will not be described herein again.
It is to be understood that these modules may be implemented in hardware, software, or a combination of both. When implemented in hardware, these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, the modules may be implemented as one or more computer programs executing on one or more processors.
References herein to "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
Fig. 11 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
It should be noted that, the computer system 1100 of the electronic device shown in fig. 11 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 11, the computer system 1100 includes a central processing unit (Central Processing Unit, CPU) 1101 that can perform various appropriate actions and processes, such as performing the method described in the above embodiment, according to a program stored in a Read-Only Memory (ROM) 1102 or a program loaded from a storage section 1108 into a random access Memory (Random Access Memory, RAM) 1103. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An Input/Output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input section 1106 including a keyboard, a mouse, and the like; an output portion 1107 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and a speaker; a storage section 1108 including a hard disk or the like; and a communication section 1109 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. The drive 1110 is also connected to the I/O interface 1105 as needed. Removable media 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in drive 1110, so that a computer program read therefrom is installed as needed in storage section 1108.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 1109, and/or installed from the removable media 1111. When executed by a Central Processing Unit (CPU) 1101, performs the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to implement the methods described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, in accordance with embodiments of the present application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a usb disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method for upgrading a feature library, comprising:
receiving an upgrade instruction of a feature library, wherein the feature library comprises feature records of features, the feature records comprise first fields and second fields configured for the features, and the first fields are assigned as pre-update feature values of the features;
acquiring a stock upgrading file of the feature library according to the upgrading instruction;
acquiring a first characteristic value of the characteristic from the stock upgrading file;
in the feature record of the feature, assigning the second field as the first feature value to obtain an updated feature record of the feature;
Writing the updated feature record into the feature library to replace the feature record of the feature in the feature library;
traversing the feature records in the feature library according to the stock upgrading file;
if traversing determines that the characteristics in the characteristic library finish stock upgrading, loading new model data of an algorithm model corresponding to the characteristic library into a cache; wherein the cache includes old model data of the algorithm model, and when a feature record is written into the feature library, the value of the first field and the value of the second field are saved into the cache;
receiving a search request, wherein the search request comprises an indication identifier, and the indication identifier is used for indicating to search in a first field of the cache or search in a second field of the cache;
if the indication mark indicates to search in the first field, searching is carried out in the cached first field according to the old model data to obtain a first search result;
and if the indication mark indicates to search in the second field, searching in the cached second field according to the new model data to obtain a second search result.
2. The method of claim 1, wherein after receiving the upgrade instruction for the feature library, the method further comprises:
acquiring an incremental upgrade file of the feature library, wherein the incremental upgrade file indicates features to be written;
acquiring a new feature value corresponding to the feature to be written according to the increment upgrading file;
generating a writing feature record for the feature to be written according to the new feature value, wherein in the writing feature record, a first field of the feature to be written is assigned as an old feature value of the feature to be written, and a second field is assigned as the new feature value;
and writing the writing feature record into the feature library.
3. The method of claim 2, wherein the feature library corresponds to an algorithm model, and wherein the updating of the feature library is performed after the algorithm model is updated from an old algorithm model to a new algorithm model;
the feature to be written includes a new feature, and the obtaining, according to the incremental upgrade file, a new feature value corresponding to the feature to be written includes:
acquiring a third characteristic value of the new added feature under the new algorithm model according to the incremental upgrade file, and taking the third characteristic value as a new characteristic value;
The generating a writing feature record for the feature to be written according to the new feature value comprises the following steps:
acquiring a second characteristic value of the newly added characteristic under the old algorithm model, and taking the second characteristic value as an old characteristic value; and
acquiring an initial feature record configured for the newly added feature;
and in the initial feature record, assigning the first field as the old feature value, and assigning the second field as the new feature value to obtain the written feature record of the new feature.
4. The method according to claim 2, wherein the feature to be written comprises an updated feature, and wherein generating a written feature record for the feature to be written based on the new feature value comprises:
acquiring a feature record of the updated feature from the feature library, and taking the value of a first field in the feature record of the updated feature as the old feature value;
and in the feature record of the updated feature, assigning the second field as the new feature value to obtain the written feature record of the updated feature.
5. The method of claim 2, wherein the incremental upgrade file indicates a feature to be deleted, and wherein after the incremental upgrade file for the feature library is obtained, the method further comprises:
And deleting the feature record of the feature to be deleted in the feature library.
6. The method according to any one of claims 1 to 5, wherein said retrieving in said cached second field according to said new model data, after obtaining a second retrieval result, further comprises:
calculating test parameters according to the second search result, wherein the test parameters are used for representing the performance of a new algorithm model indicated by the new model data;
if the test parameters meet preset conditions, generating an upgrade confirmation instruction, deleting the value of a first field and deleting the old model data according to the upgrade confirmation instruction;
and if the test parameters do not meet the preset conditions, generating a rollback instruction, and deleting the value of the second field and the new model data according to the rollback instruction.
7. The method of claim 6, wherein the algorithm model includes at least two feature libraries, wherein after deleting the value of the first field and deleting the old model data according to the upgrade confirmation instruction, the method further comprises:
and receiving an upgrading instruction sent for the next feature library.
8. An upgrade apparatus for a feature library, comprising:
The device comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving an upgrading instruction of a feature library, the feature library comprises a feature record of a feature, the feature record comprises a first field and a second field which are configured for the feature, and the first field is assigned to be a pre-update feature value of the feature;
the stock upgrading file acquisition module is used for acquiring the stock upgrading file of the feature library according to the upgrading instruction;
the first characteristic value acquisition module is used for acquiring a first characteristic value of the characteristic from the stock upgrading file;
the updating module is used for assigning the second field to the first characteristic value in the characteristic record of the characteristic to obtain an updated characteristic record of the characteristic;
the writing module is used for writing the updated feature record into the feature library so as to replace the feature record of the feature in the feature library;
traversing the feature records in the feature library according to the stock upgrading file;
if traversing determines that the characteristics in the characteristic library finish stock upgrading, loading new model data of an algorithm model corresponding to the characteristic library into a cache; wherein the cache includes old model data of the algorithm model, and when a feature record is written into the feature library, the value of the first field and the value of the second field are saved into the cache;
Receiving a search request, wherein the search request comprises an indication identifier, and the indication identifier is used for indicating to search in a first field of the cache or search in a second field of the cache;
if the indication mark indicates to search in the first field, searching is carried out in the cached first field according to the old model data to obtain a first search result;
and if the indication mark indicates to search in the second field, searching in the cached second field according to the new model data to obtain a second search result.
9. The apparatus of claim 8, wherein the apparatus further comprises:
the incremental upgrade file acquisition module is used for acquiring an incremental upgrade file of the feature library, wherein the incremental upgrade file indicates the feature to be written;
the new characteristic value acquisition module is used for acquiring a new characteristic value corresponding to the characteristic to be written according to the increment upgrading file;
a writing feature record generating module, configured to generate a writing feature record for the feature to be written according to the new feature value, where a first field of the feature to be written is assigned as an old feature value of the feature to be written, and a second field is assigned as the new feature value;
And the second writing module is used for writing the writing feature record into the feature library.
10. The apparatus of claim 9, wherein the feature library corresponds to an algorithm model, and wherein the feature library is updated after the algorithm model is updated from an old algorithm model to a new algorithm model; the feature to be written comprises a new feature, and the new feature value acquisition module comprises:
a third feature value obtaining unit, configured to obtain a third feature value of the new feature under the new algorithm model according to the incremental upgrade file, and use the third feature value as a new feature value;
the writing characteristic record generating module comprises:
the second characteristic value acquisition unit is used for acquiring a second characteristic value of the newly added characteristic under the old algorithm model, and taking the second characteristic value as an old characteristic value; and
an initial feature record obtaining unit, configured to obtain an initial feature record configured for the newly added feature;
and the first writing feature record obtaining unit is used for assigning the first field as the old feature value and assigning the second field as the new feature value in the initial feature record to obtain the writing feature record of the new feature.
CN201911262764.7A 2019-12-10 2019-12-10 Feature library upgrading method and device Active CN111176705B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911262764.7A CN111176705B (en) 2019-12-10 2019-12-10 Feature library upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911262764.7A CN111176705B (en) 2019-12-10 2019-12-10 Feature library upgrading method and device

Publications (2)

Publication Number Publication Date
CN111176705A CN111176705A (en) 2020-05-19
CN111176705B true CN111176705B (en) 2024-01-30

Family

ID=70650325

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911262764.7A Active CN111176705B (en) 2019-12-10 2019-12-10 Feature library upgrading method and device

Country Status (1)

Country Link
CN (1) CN111176705B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522570B (en) * 2020-06-19 2023-09-05 杭州海康威视数字技术股份有限公司 Target library updating method and device, electronic equipment and machine-readable storage medium
CN112948246B (en) * 2021-02-26 2023-08-04 北京百度网讯科技有限公司 AB test control method, device and equipment of data platform and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0307421D0 (en) * 2003-03-31 2003-05-07 Matsushita Electric Ind Co Ltd Method and apparatus for upgrading software
CN102156646A (en) * 2010-02-11 2011-08-17 华为技术有限公司 Feature library upgrading method and device thereof
CN106815049A (en) * 2016-12-29 2017-06-09 杭州迪普科技股份有限公司 The method and device of feature database upgrading

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0307421D0 (en) * 2003-03-31 2003-05-07 Matsushita Electric Ind Co Ltd Method and apparatus for upgrading software
CN102156646A (en) * 2010-02-11 2011-08-17 华为技术有限公司 Feature library upgrading method and device thereof
CN106815049A (en) * 2016-12-29 2017-06-09 杭州迪普科技股份有限公司 The method and device of feature database upgrading

Also Published As

Publication number Publication date
CN111176705A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN109766362B (en) Data processing method and device
CN107797820B (en) Method and device for generating patch
CN111176705B (en) Feature library upgrading method and device
CN110096302A (en) Software data storage, upgrade method, device, equipment and storage medium
CN110781658B (en) Resume analysis method, resume analysis device, electronic equipment and storage medium
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN111124480B (en) Method and device for generating application program package, electronic equipment and storage medium
WO2008069431A1 (en) Download server and method for installing and updating application program using partitioning of shared library
CN107368513B (en) Method and device for updating client database
CN112764792B (en) Method and device for upgrading associated server version application and electronic equipment
CN115827162A (en) Method, device, medium and equipment for intelligently processing mirror image warehouse data
CN113377770A (en) Data processing method and device
CN112650521A (en) Software development kit SDK (software development kit) hot repair method and device and electronic equipment
WO2017036197A1 (en) Method and device for managing network element model
CN111399849A (en) Method and system for determining application program installation package
CN115543967A (en) Data migration method and device, electronic equipment and computer readable medium
US7389515B1 (en) Application deflation system and method
CN110716946B (en) Method and device for updating feature rule matching library, storage medium and electronic equipment
CN111625232B (en) Method and device for generating application program installation package, readable medium and electronic equipment
CN111399841B (en) Code processing method and device based on blockchain, storage medium and electronic equipment
CN113722279B (en) Method, device, equipment and storage medium for determining size of folder
CN112951437B (en) Medical data management method, medical data management device, storage medium and electronic equipment
CN112416401B (en) Data updating method, device and equipment
CN109996262B (en) AC starting method and device
CN113961601A (en) Request processing method, device, 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
GR01 Patent grant
GR01 Patent grant