CN113626342A - Model online testing method and device - Google Patents

Model online testing method and device Download PDF

Info

Publication number
CN113626342A
CN113626342A CN202111011314.8A CN202111011314A CN113626342A CN 113626342 A CN113626342 A CN 113626342A CN 202111011314 A CN202111011314 A CN 202111011314A CN 113626342 A CN113626342 A CN 113626342A
Authority
CN
China
Prior art keywords
model
tested
test
online
test result
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.)
Granted
Application number
CN202111011314.8A
Other languages
Chinese (zh)
Other versions
CN113626342B (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.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202111011314.8A priority Critical patent/CN113626342B/en
Publication of CN113626342A publication Critical patent/CN113626342A/en
Application granted granted Critical
Publication of CN113626342B publication Critical patent/CN113626342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Abstract

The specification discloses a model online test method and a model online test device, which can acquire various test samples and corresponding offline test results during offline testing of a to-be-tested model historically. And then deploying the model to be tested to the online environment, and inputting and deploying at least part of the test samples to the model to be tested in the online environment to obtain the online test result of each test sample. And finally, testing the model to be tested based on the online test result and the offline test result. Based on historical test samples and corresponding offline test results during offline testing, online testing is performed on the model to be tested deployed in the online environment, accuracy of test data is guaranteed, and accuracy of model test results is improved.

Description

Model online testing method and device
Technical Field
The application relates to the technical field of machine learning, in particular to a model online testing method and device.
Background
With the development of artificial intelligence technology, machine learning models are applied more and more widely. For example, information recommendation is more accurately performed on the user by training a recommendation model.
In order to ensure the accuracy of the online application of the model, the model is often required to be tested. At present, when a model test is performed, a tester usually simulates input data of the model artificially, and verifies an output result of the trained model in an online environment.
However, in the above test method, the artificially simulated data is often not accurate enough, and the online test environment is different from the online environment in which the model is actually applied, so that the accuracy of the model test result is low.
Disclosure of Invention
The embodiment of the specification provides a model online testing method and a model online testing device, which are used for partially solving the problems in the prior art.
The embodiment of the specification adopts the following technical scheme:
the model online testing method provided by the specification comprises the following steps:
determining a model to be tested;
obtaining a pre-stored model file corresponding to the identifier according to the identifier of the model to be tested, wherein the model file comprises a plurality of test samples and corresponding offline test results when the offline test is historically performed on the model to be tested;
deploying the model to be tested into an online environment;
inputting and deploying at least part of test samples into the to-be-tested model deployed in the online environment to obtain an online test result output by the to-be-tested model deployed in the online environment;
and testing the model to be tested according to the online test result and the offline test result.
Optionally, the testing the model to be tested according to the online test result and the offline test result specifically includes:
for each of the at least some test samples, determining a difference between an online test result and an offline test result for that test sample;
judging whether the difference between the online test result and the offline test result of each test sample is smaller than a preset threshold value;
if so, determining that the test of the model to be tested is normal;
if not, determining that the test of the model to be tested is abnormal.
Optionally, the testing the model to be tested according to the online test result and the offline test result specifically includes:
for each of the at least some test samples, determining a difference between an online test result and an offline test result for that test sample;
determining the number of samples with the difference smaller than a preset threshold value according to the difference between the online test result and the offline test result of each test sample;
judging whether the number of the samples exceeds a preset number;
if so, determining that the test of the model to be tested is normal;
if not, determining that the test of the model to be tested is abnormal.
Optionally, an original version model corresponding to the model to be tested is deployed in the online environment, and the original version model is used for executing a service according to current online flow;
the method further comprises the following steps:
and when the model to be tested is tested normally, switching the on-line flow from the model input to the original version model to the model to be tested, and executing the service through the model to be tested.
Optionally, pre-storing the model file corresponding to the identifier specifically includes:
obtaining a plurality of training samples which are used for training the model to be tested historically in advance;
respectively inputting each training sample into the model to be tested in an online environment, and determining a model output result corresponding to each training sample;
taking each training sample as a test sample of the model to be tested, and taking a model output result corresponding to each training sample as an offline test result corresponding to each test sample;
and storing the test sample of the model to be tested and the corresponding offline test result into the model file corresponding to the identifier.
Optionally, after storing into the model file corresponding to the identifier, the method further includes:
and adding a completion marking file to the model file, wherein the completion marking file represents that the model file is not changed any more.
Optionally, after storing into the model file corresponding to the identifier, the method further includes:
and encrypting the model file, so that after the model to be tested is deployed to an online environment, the model file is decrypted to test the model to be tested.
This specification provides a model online test device, including:
a determination module configured to determine a model to be tested;
the acquisition module is configured to acquire a pre-stored model file corresponding to the identifier according to the identifier of the model to be tested, wherein the model file comprises a plurality of test samples and corresponding offline test results when the model to be tested is subjected to offline test historically;
a deployment module configured to deploy the model to be tested into an online environment;
the output module is configured to input and deploy at least part of test samples into the to-be-tested model of the online environment to obtain an online test result output by the to-be-tested model deployed in the online environment;
and the test module is configured to test the model to be tested according to the online test result and the offline test result.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described model online testing method.
The electronic device provided by the specification comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the online model testing method.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
in this specification, each test sample and a corresponding offline test result of a historical offline test on a test model to be tested may be obtained, and then the test model to be tested is deployed in an online environment, and at least part of the test sample is input and deployed in the test model to be tested in the online environment, so as to obtain the online test result of each test sample. And finally, testing the model to be tested based on the online test result and the offline test result. Based on historical test samples and corresponding offline test results during offline testing, online testing is performed on the model to be tested deployed in the online environment, accuracy of test data is guaranteed, and accuracy of model test results is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a flowchart of a method for online testing a model according to an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of an online model testing apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of an electronic device implementing an online testing method for a model according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step based on the embodiments in the description belong to the protection scope of the present application.
At present, in order to ensure consistency between a prediction result after a model is online and a model training result, after the model training is completed, a tester simulates input data of the model based on human experience, and verifies accuracy of the model input result.
Taking the information recommendation model as an example, in the model training stage, the training of the information recommendation model can be performed based on historical user search data and historical click, browse and other data of the user. In order to guarantee the accuracy of the recommendation information after the information recommendation model is online, a tester can input different dish information, a recommendation list of related merchants aiming at different dish information is obtained through the information recommendation model, and the accuracy of the recommendation list is checked based on the preference of the tester.
On one hand, the accuracy of the output result of the model is verified manually, and the verification result is usually strongly dependent on the professional skill of a tester and has certain subjectivity. On the other hand, the model test is usually performed in an online environment, and the model needs to be deployed to the online environment for use, so that the accuracy of the model after being online cannot be guaranteed.
Based on the above existing problems, the present specification provides an online model testing method, and the following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a model online testing method provided in an embodiment of the present specification, which may specifically include the following steps:
s100: and determining a model to be tested.
S102: and obtaining a pre-stored model file corresponding to the identifier according to the identifier of the model to be tested.
With the rapid development of the internet and artificial intelligence technology, more and more services are executed through a machine learning model, and in order to ensure the normal operation of the services after the model is deployed on line, the trained model needs to be tested. Therefore, the present specification provides a model online test method, which can perform online test on a model deployed in an online environment based on test data of a historical offline test of the model.
The model online testing method may be executed by a server deployed by a model, the server may be a single server, or a system composed of a plurality of servers, such as a distributed server, or the like, and may be a physical server device or a cloud server.
Specifically, the server may determine the model to be tested from the trained service models. And then, according to the identifier of the model to be tested, obtaining a pre-stored model file corresponding to the identifier of the model to be tested from a database. The model file comprises a plurality of test samples and corresponding offline test results which are historically adopted when the model to be tested is subjected to offline test. The off-line test result corresponding to the test sample may be the accuracy of the output result of each test sample, or may be the output result obtained by the model to be tested, which is completed by training each test sample. Of course, the model file may also contain model data of the model to be tested.
Further, since each business model is usually trained offline, i.e., on-line environment, the model training process can be divided into a training phase and a testing phase. And in the training stage, parameter adjustment is carried out on the service model based on each training sample and the label thereof, and in the testing stage, the training effect of the model is evaluated based on each testing sample. Therefore, the test samples included in the model file in the description during the historical offline test may be a plurality of test samples tested at the test stage in the model training process.
Furthermore, when the data volume of the test sample tested under the model line in history is small, in order to ensure the accuracy of the online test result of the model, a plurality of training samples which are used for historically training the model to be tested can be obtained in advance, and in an offline environment (offline environment), each training sample is input into the trained model to be tested, so as to determine the model output result corresponding to each training sample. And then, taking each training sample as a to-be-tested sample of the to-be-tested model, taking a model output result corresponding to each training sample as an on-line test result corresponding to each test sample, and storing the on-line test result corresponding to the determined test sample set of the to-be-tested model into a model file corresponding to the identifier of the to-be-tested model according to the determined off-line test result corresponding to the test sample set of the to-be-tested model.
Of course, the test sample for performing the offline test in the model file may also be a test performed on the model to be tested before the online test after the model to be tested is trained. The adopted test sample can be business data generated by a user in a business platform historically or a training sample in a model training stage. The test sample for testing under the model line of which stage is specifically selected can be set as required.
S104: and deploying the model to be tested to an online environment.
S106: inputting and deploying at least part of test samples into the to-be-tested model deployed in the online environment to obtain an online test result output by the to-be-tested model deployed in the online environment.
Because the trained service model needs to be deployed to an online platform for use, the model to be tested can be deployed online and then tested in order to test the accuracy of the online function of the model.
Specifically, the model to be tested may be deployed to an online environment. The online environment refers to a system environment for providing a service to a user. And then, aiming at each test sample in at least part of the test samples, inputting and deploying the test sample into a to-be-tested model in an on-line environment to obtain an on-line test result output by the to-be-tested model.
The online test result may be an output result obtained by deploying each test sample to a to-be-tested model of the online environment. That is, the output result obtained by deploying each test sample to the on-line environment to be tested model is the on-line test result of each test sample.
In another embodiment, the on-line test result may be a composite result based on the output results of the test samples. Such as the accuracy of the output results for each test sample.
S108: and testing the model to be tested according to the online test result and the offline test result.
Because the normal operation of the model function is verified in the on-line testing process of the model, the accuracy of the on-line testing result can be checked by taking the off-line testing result as a reference.
Specifically, the model to be tested can be tested according to the online test result output by the model to be tested on line and the offline test result in the model file. And when the difference between the online test result and the offline test result is smaller than a preset threshold value, determining that the to-be-tested model has normal function, otherwise, determining that the to-be-tested model has abnormal function. Wherein the preset threshold value can be set based on needs.
For example, assuming that the preset threshold is 10%, when the accuracy of the output result of each test sample in the pre-stored model file is 80% and the on-line test result output on line based on the model to be tested is 78%, it may be determined that the model to be tested functions normally since the difference between the two results is less than the preset threshold.
In another embodiment of the present disclosure, the online test result and the offline test result may also correspond to each test sample respectively. Thus, for each of at least some of the test samples, a difference between the on-line test result and the off-line test result for that test sample may be determined. And judging whether the difference between the on-line test result and the off-line test result of each test sample is smaller than a preset threshold value. And when the difference between the online test result and the offline test result of each test sample is smaller than a preset threshold value, determining that the function test of the model to be tested is normal. Otherwise, determining that the function test of the model to be tested is abnormal, and debugging the model to be tested again. Wherein, the preset threshold value can be set based on the service index.
Taking the model to be tested as an Estimated Time of Arrival (ETA) model as an example, assume that the test sample includes order data of order 1 to order 3, and the preset Time error is 5 minutes, i.e. the preset threshold is equal to 5. In the off-line testing stage, the off-line estimated delivery time of order 1 is 12:00, the off-line estimated delivery time of order 2 is 12:20, and the off-line estimated delivery time of order 3 is 12:30 according to the ETA model.
In the online testing stage, data of each order is respectively input into a model to be tested deployed in an online environment, and the online testing results of each order are respectively: the on-line estimated delivery time for order 1 is 12:03, the on-line estimated delivery time for order 2 is 12:20, and the on-line estimated delivery time for order 3 is 12: 28. Because the time error between the on-line predicted delivery time of each order and the on-line predicted delivery time is less than 5 minutes, all the functions of the model to be tested on line can be considered to be normal.
In other embodiments of the present disclosure, if the error between the offline test result and the offline test result of a large number of test samples is small, the model to be tested may be considered to be functioning normally. Specifically, for each of at least some of the test samples, a difference between the on-line test result and the off-line test result for that test sample is determined. And determining the number of samples with the difference smaller than a preset threshold value according to the difference between the on-line test result and the off-line test result of each test sample. And then, judging whether the number of the samples exceeds a preset value, and when the number of the samples exceeds the preset value, indicating that the probability of the on-line test result being accurate is higher, and determining that the to-be-tested model is normal in function. Otherwise, the probability that the on-line test result is accurate is low, the abnormal function of the model to be tested can be determined, and the model to be tested can be debugged again. The preset threshold value and the preset numerical value can be set according to needs.
Further, the sample ratio with smaller difference is determined based on the number of samples with difference smaller than the preset threshold, and when the sample ratio with smaller difference exceeds the preset ratio, the to-be-tested model is determined to be normal in function, otherwise, the to-be-tested model is determined to be abnormal in function. Wherein the preset ratio can be set according to the requirement.
Continuing with the ETA model, assume that the test sample further includes order 4 and order 5, and the predetermined ratio is 90%. Wherein the offline projected delivery time for order 4 is 3:25 and the offline projected delivery time for order 5 is 2: 43. While the on-line estimated delivery time for order 4 is 3:40 and the on-line estimated delivery time for order 5 is 2: 16. Therefore, the estimated time error of order 4 is 15 minutes, and the estimated time error of order 5 is 27 minutes, which exceeds the preset time error by 5 minutes. Based on the difference between the offline expected delivery time and the online expected delivery time of each order, it can be determined that the sample proportion of the difference smaller than the preset threshold value is 60%, and the sample proportion is far smaller than the preset ratio value 90%, and it can be considered that the online test of the model is abnormal and needs to be debugged again.
Based on the model online testing method shown in fig. 1, each test sample and the corresponding offline test result of the to-be-tested model during offline testing can be obtained historically, then the to-be-tested model is deployed in the online environment, and at least part of the test samples are input and deployed into the to-be-tested model in the online environment, so as to obtain the online test result of each test sample. And finally, testing the model to be tested based on the online test result and the offline test result. The method and the device have the advantages that the test samples and the corresponding offline test results during the offline test in history are automatically stored, the model to be tested deployed in the online environment is automatically tested online, the accuracy of test data is guaranteed, and the accuracy of the model test results is improved.
After the online test result of the model to be tested is obtained in the specification, if the model to be tested is initially deployed and the online test function is normal, it can be determined that the model to be tested is successfully loaded, and a service can be executed based on the online flow. And if the model to be tested is initially deployed and the online test function is abnormal, determining that the loading of the model to be tested fails, and debugging the model again.
In order to avoid poor user experience caused by failure of online loading when the model is deployed for the first time, an initial version model can be published to part of users in a gray release mode, and the initial version model is published after the initial version model is loaded by part of users. Otherwise, the initial version model still needs to be debugged.
In addition, in order to ensure that the model still meets the business requirements over time, the model is usually required to be periodically iteratively updated and trained based on new training data.
In one or more embodiments of the present disclosure, after the model is update-trained, the updated model needs to be deployed into an online environment to replace the original version model before the update. Therefore, when switching the model versions, the model version which is trained last time can be determined as the model to be tested.
It should be noted that the model file of the model to be tested includes a new test sample and a corresponding offline test result used in the iterative model update training process.
In addition, in order to ensure the normal use of the online service, when the version of the deployed model in the online environment is updated, the model of the updated version can be deployed into the online environment under the condition that the original version model is not changed, so that the version is replaced after the online test of the model of the updated version passes. Otherwise, the original version model is still adopted to execute the business.
Therefore, when the model to be tested is tested normally, the online flow can be switched from the input to the original version model to the input to the model to be tested, and the business is executed through the model to be tested. The original version model is a model which is deployed on line and corresponds to the version to be tested, and in the online testing stage of the model to be tested, the original version model is still used for executing business based on the current online flow so as to ensure that the online service is not interrupted.
When the model files corresponding to the model identifications are stored in advance in the specification, a plurality of test samples and corresponding offline test results of offline tests of the models can be recorded in advance, model data and test data (test samples and offline test results) of trained models are stored in the model files corresponding to the model identifications, and a done mark file done file is added to each model file to indicate that the model files are prepared and are not changed any more.
In order to ensure the correctness of the model file, the model file of the model to be tested may also be encrypted, for example, by using a Message-Digest algorithm (MD 5). And after the model to be tested is deployed to the online environment, decrypting the model file of the model to be tested, and testing the model to be tested based on at least part of the test sample obtained by decryption.
In one or more embodiments of the present disclosure, the model to be tested may also be multiple models that are jointly trained, and then the multiple models that are jointly trained may be used as one integrated model, the whole input data of the integrated model is used as a test sample, and the output result of the whole model is used as an online test result, so as to perform online test on the integrated model.
Based on the model online testing method shown in fig. 1, the embodiment of the present specification further provides a schematic structural diagram of a model online testing apparatus, as shown in fig. 2.
Fig. 2 is a schematic structural diagram of a model online testing apparatus provided in an embodiment of the present disclosure, including:
a determination module 200 configured to determine a model to be tested;
an obtaining module 202, configured to obtain, according to the identifier of the model to be tested, a model file corresponding to the identifier, where the model file includes a plurality of test samples and corresponding offline test results during offline testing of the model to be tested historically;
a deployment module 204 configured to deploy the model to be tested into an online environment;
an output module 206 configured to input and deploy at least part of the test samples into the to-be-tested model deployed in the online environment to obtain an online test result output by the to-be-tested model deployed in the online environment;
the testing module 208 is configured to test the model to be tested according to the online testing result and the offline testing result.
Optionally, the testing module 208 is specifically configured to, for each of the at least some test samples, determine a difference between an online test result and an offline test result of the test sample, and determine whether the difference between the online test result and the offline test result of each test sample is smaller than a preset threshold, if yes, determine that the test of the model to be tested is normal, and if not, determine that the test of the model to be tested is abnormal.
Optionally, the testing module 208 is specifically configured to, for each of the at least some test samples, determine a difference between an online test result and an offline test result of the test sample, determine, according to the difference between the online test result and the offline test result of each test sample, a number of samples of which the difference is smaller than a preset threshold, determine whether the number of samples exceeds a preset value, if so, determine that the test of the model to be tested is normal, and if not, determine that the test of the model to be tested is abnormal.
Optionally, an original version model corresponding to the model to be tested is deployed in the online environment, the original version model is used to execute a service according to a current online flow, and the testing module 208 is further used to switch the online flow from being input to the original version model to being input to the model to be tested when the model to be tested is tested normally, and execute the service through the model to be tested.
Optionally, the obtaining module 202 is specifically configured to obtain a plurality of training samples that have historically been used for training the model to be tested, respectively input each training sample into the model to be tested in an online environment, determine a model output result corresponding to each training sample, use each training sample as a testing sample of the model to be tested, use a model output result corresponding to each training sample as an offline testing result corresponding to each testing sample, and store the testing sample of the model to be tested and the corresponding offline testing result into the model file corresponding to the identifier.
Optionally, the obtaining module 202 is further configured to add a completion flag file to the model file, where the completion flag file indicates that the model file is not changed any more.
Optionally, the obtaining module 202 is further configured to encrypt the model file, so that after the model to be tested is deployed in an online environment, the model file is decrypted to test the model to be tested.
Embodiments of the present specification further provide a computer-readable storage medium, where the storage medium stores a computer program, and the computer program can be used to execute the model online testing method provided in fig. 1.
According to the online model testing method shown in fig. 1, the embodiment of the present specification further provides a schematic structural diagram of the electronic device shown in fig. 3. As shown in fig. 3, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to implement the model online testing method shown in fig. 1.
Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and create a dedicated integrated circuit chip. Furthermore, nowadays, instead of manually generating an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardbyscript Description Language (vhigh Description Language), and so on, which are currently used in the most popular languages. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. An online model testing method, comprising:
determining a model to be tested;
obtaining a pre-stored model file corresponding to the identifier according to the identifier of the model to be tested, wherein the model file comprises a plurality of test samples and corresponding offline test results when the offline test is historically performed on the model to be tested;
deploying the model to be tested into an online environment;
inputting and deploying at least part of test samples into the to-be-tested model deployed in the online environment to obtain an online test result output by the to-be-tested model deployed in the online environment;
and testing the model to be tested according to the online test result and the offline test result.
2. The method of claim 1, wherein testing the model to be tested according to the online test result and the offline test result comprises:
for each of the at least some test samples, determining a difference between an online test result and an offline test result for that test sample;
judging whether the difference between the online test result and the offline test result of each test sample is smaller than a preset threshold value;
if so, determining that the test of the model to be tested is normal;
if not, determining that the test of the model to be tested is abnormal.
3. The method of claim 1, wherein testing the model to be tested according to the online test result and the offline test result comprises:
for each of the at least some test samples, determining a difference between an online test result and an offline test result for that test sample;
determining the number of samples with the difference smaller than a preset threshold value according to the difference between the online test result and the offline test result of each test sample;
judging whether the number of the samples exceeds a preset value or not;
if so, determining that the test of the model to be tested is normal;
if not, determining that the test of the model to be tested is abnormal.
4. The method of claim 2 or 3, wherein an original version model corresponding to the model to be tested has been deployed in the online environment, the original version model being used to execute a service according to a current online traffic;
the method further comprises the following steps:
and when the model to be tested is tested normally, switching the on-line flow from the model input to the original version model to the model to be tested, and executing the service through the model to be tested.
5. The method of claim 1, wherein pre-storing the model file corresponding to the identifier specifically includes:
obtaining a plurality of training samples which are used for training the model to be tested historically in advance;
respectively inputting each training sample into the model to be tested in an online environment, and determining a model output result corresponding to each training sample;
taking each training sample as a test sample of the model to be tested, and taking a model output result corresponding to each training sample as an offline test result corresponding to each test sample;
and storing the test sample of the model to be tested and the corresponding offline test result into the model file corresponding to the identifier.
6. The method of claim 5, wherein after storing into the model file corresponding to the identity, the method further comprises:
and adding a completion marking file to the model file, wherein the completion marking file represents that the model file is not changed any more.
7. The method of claim 5, wherein after storing into the model file corresponding to the identity, the method further comprises:
and encrypting the model file, so that after the model to be tested is deployed to an online environment, the model file is decrypted to test the model to be tested.
8. An in-line model testing apparatus, comprising:
a determination module configured to determine a model to be tested;
the acquisition module is configured to acquire a pre-stored model file corresponding to the identifier according to the identifier of the model to be tested, wherein the model file comprises a plurality of test samples and corresponding offline test results when the model to be tested is subjected to offline test historically;
a deployment module configured to deploy the model to be tested into an online environment;
the output module is configured to input and deploy at least part of test samples into the to-be-tested model of the online environment to obtain an online test result output by the to-be-tested model deployed in the online environment;
and the test module is configured to test the model to be tested according to the online test result and the offline test result.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 7 when executing the program.
CN202111011314.8A 2021-08-31 2021-08-31 Model online testing method and device Active CN113626342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111011314.8A CN113626342B (en) 2021-08-31 2021-08-31 Model online testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111011314.8A CN113626342B (en) 2021-08-31 2021-08-31 Model online testing method and device

Publications (2)

Publication Number Publication Date
CN113626342A true CN113626342A (en) 2021-11-09
CN113626342B CN113626342B (en) 2023-03-24

Family

ID=78388458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111011314.8A Active CN113626342B (en) 2021-08-31 2021-08-31 Model online testing method and device

Country Status (1)

Country Link
CN (1) CN113626342B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168565A (en) * 2021-12-10 2022-03-11 北京宇信科技集团股份有限公司 Backtracking test method, device and system of business rule model and decision engine

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109102030A (en) * 2018-08-23 2018-12-28 阿里巴巴集团控股有限公司 Control the method and device that on-time model updates
CN110083542A (en) * 2019-05-06 2019-08-02 百度在线网络技术(北京)有限公司 Model test Method, device and electronic equipment in a kind of recommender system
WO2019174395A1 (en) * 2018-03-13 2019-09-19 阿里巴巴集团控股有限公司 Method and apparatus for information recommendation, and device
CN111177222A (en) * 2019-12-26 2020-05-19 腾讯云计算(北京)有限责任公司 Model testing method and device, computing equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019174395A1 (en) * 2018-03-13 2019-09-19 阿里巴巴集团控股有限公司 Method and apparatus for information recommendation, and device
CN109102030A (en) * 2018-08-23 2018-12-28 阿里巴巴集团控股有限公司 Control the method and device that on-time model updates
CN110083542A (en) * 2019-05-06 2019-08-02 百度在线网络技术(北京)有限公司 Model test Method, device and electronic equipment in a kind of recommender system
CN111177222A (en) * 2019-12-26 2020-05-19 腾讯云计算(北京)有限责任公司 Model testing method and device, computing equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谢康宁: "在线测试系统的设计及开发", 《省市论文撷》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114168565A (en) * 2021-12-10 2022-03-11 北京宇信科技集团股份有限公司 Backtracking test method, device and system of business rule model and decision engine

Also Published As

Publication number Publication date
CN113626342B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
US9317401B2 (en) Prioritizing test cases using multiple variables
US10324830B2 (en) Conditional upgrade and installation of software based on risk-based validation
US20200089596A1 (en) Integrating Synthetic Performance Measurements with Continuous Delivery Pipelines
CN110674408B (en) Service platform, and real-time generation method and device of training sample
CN109062782B (en) Regression test case selection method, device and equipment
US11010505B2 (en) Simulation of virtual processors
CN111881019B (en) User interface testing method and device
CN105468529A (en) Accurate traversal method and apparatus for UI controls of android application
CN109902005B (en) Automatic testing method and system
CN110717536A (en) Method and device for generating training sample
CN108320071B (en) Business risk management method, device and equipment
CN111401766B (en) Model, service processing method, device and equipment
CN115238826B (en) Model training method and device, storage medium and electronic equipment
CN110046100B (en) Packet testing method, electronic device and medium
CN113626342B (en) Model online testing method and device
CN111722995B (en) Data processing method and device
CN113408254A (en) Page form information filling method, device, equipment and readable medium
CN109582388B (en) Parameter configuration method, device and equipment
CN115840704A (en) Simulation software testing method and device, storage medium and electronic equipment
CN116431467A (en) Page test method, device, equipment and medium
CN110704742B (en) Feature extraction method and device
CN110874322A (en) Test method and test server for application program
CN112559346A (en) Service testing method and device
CN114924857A (en) Redis-based distributed timing scheduling method and device and storage medium
CN114691526A (en) Test method and device

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