CN109783337B - Model service method, system, apparatus and computer readable storage medium - Google Patents

Model service method, system, apparatus and computer readable storage medium Download PDF

Info

Publication number
CN109783337B
CN109783337B CN201811557396.4A CN201811557396A CN109783337B CN 109783337 B CN109783337 B CN 109783337B CN 201811557396 A CN201811557396 A CN 201811557396A CN 109783337 B CN109783337 B CN 109783337B
Authority
CN
China
Prior art keywords
data
feature
loss value
data feature
discarded
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
CN201811557396.4A
Other languages
Chinese (zh)
Other versions
CN109783337A (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 Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201811557396.4A priority Critical patent/CN109783337B/en
Publication of CN109783337A publication Critical patent/CN109783337A/en
Application granted granted Critical
Publication of CN109783337B publication Critical patent/CN109783337B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present application is directed to model service methods, systems, apparatuses, and computer-readable storage media. The model service method comprises the following steps: obtaining a system performance index; calculating a performance index and a loss value for at least one data feature; obtaining a discarded feature list based on the performance indicator and the loss value of the at least one data feature; and when the system performance index meets the set condition, ignoring corresponding operation of at least one data feature in the discarded feature list according to the discarded feature list, and obtaining a prediction result according to the rest data features. According to the embodiment of the invention, the loss value and the performance index of each data feature are calculated firstly, the discarded feature list is generated according to the loss value and the performance index, and the operation of part of the data features in the discarded feature list is omitted according to the discarded feature list, so that the usability and the precision of the model are ensured on the premise of reducing the service risk.

Description

Model service method, system, apparatus and computer readable storage medium
Technical Field
The present application relates to the field of computer software applications, and more particularly, to a model service method, system, apparatus, and computer-readable storage medium.
Background
At present, the AI and big data are widely applied, and the model service is an important way for applying the machine learning algorithm in the actual business scene. The method mainly comprises the steps of developing a mature neural network model, packaging the neural network model into an online service (hereinafter referred to as a model service), receiving a real-time data request by an external interface (such as http or rpc), extracting data characteristics contained in the request by the model service, calling an extended data service attached to the model service to extract richer data characteristics, and finally making a prediction result and returning the prediction result to a requester by taking the data as input by an algorithm model. Typical application examples are online model services such as internet search ranking, advertisement click-through rate prediction, and the like.
A model service is a limited capability service whose service capability is typically expressed in terms of requests per second of response. In an actual business scene, the request pressure received by the service fluctuates with various conditions, such as time interval difference, product end updating, operation activities and the like, and the model service can cause response delay due to the sharp increase of the request pressure, and serious conditions such as machine resource overload and even downtime occur. To prevent a full collapse of the model service, a downgrading policy, such as limiting partial traffic, is typically initiated when the request pressure or service load exceeds a certain threshold.
Existing destaging strategies include two types: one is based on the ip network segment from which the data request comes, and part of the request is randomly discarded to limit the visiting flow; the other method is to automatically predict the importance of the traffic by using a statistical model based on http header information of the data request and discard the traffic with low importance.
However, both existing methods of downgrading strategies, while able to achieve the goal of limiting traffic, have significant disadvantages:
in the first method, because different traffic may contain different data information, and the load caused to the model service is different, the method of randomly discarding part of requests is not comprehensive and efficient;
the second method, since the traffic source is each individual user for the internet 2C service, it is difficult to define whether access of a certain user is important or unimportant.
In summary, the existing model service solution for the traffic limitation still needs to be improved.
Disclosure of Invention
In view of the problems in the related art, the present application discloses an improved model service method, system, apparatus and computer readable storage medium to better solve the problem of traffic limitation.
In a first aspect, an embodiment of the present invention provides a model service method, including:
acquiring a system performance index;
calculating a performance index and a loss value of at least one data feature, wherein the performance index of the data feature represents the resource use condition of the corresponding data feature, and the loss value of the data feature represents the influence degree of the corresponding data feature on the precision of the prediction result;
obtaining a discarded feature list based on the performance indicator and the loss value of the at least one data feature; and
and when the system performance index meets a set condition, ignoring at least one data feature in the discarding feature list according to the discarding feature list, and obtaining a prediction result based on a model according to the rest data features.
Optionally, the calculating a performance indicator of the at least one data feature comprises:
recording a log of the at least one data characteristic at each processing link;
and performing summary statistics on the logs of each processing link according to the at least one data characteristic to obtain a performance index of the at least one data characteristic.
Optionally, the calculating the loss value comprises:
randomly discarding a data characteristic and then carrying out primary prediction to obtain a prediction result; and
calculating a loss value for the discarded data feature based on the pre-discarded prediction and the post-discarded prediction.
Optionally, the calculating a loss value of the discarded data feature based on the prediction result before discarding and the prediction result after discarding includes:
and calculating the average value of the difference of the prediction results before discarding and the prediction results after discarding based on the multiple times of calculation, and taking the average value as the loss value of the corresponding discarded data characteristic.
Optionally, the method further comprises: and adjusting the sampling frequency to adjust the ratio of each data characteristic in the at least one data characteristic.
Optionally, the obtaining a discarded feature list based on the performance index and the loss value of each data feature includes:
and inputting the set degradation target and the performance index and loss value of the at least one data feature into an optimization model to obtain the discarded feature list, wherein the optimization model aims at minimizing the precision loss of the model service to obtain an optimal solution meeting the conditions.
Optionally, the method further comprises: and normalizing the performance index and the loss value of the at least one data characteristic before inputting the set degradation target and the performance index and the loss value of the at least one data characteristic into the optimization model.
Optionally, the performance indicator of each data feature includes: the performance index comprises processing time and storage space of each data characteristic, and the optimization model is as follows:
Figure BDA0001912325350000031
Figure BDA0001912325350000032
Figure BDA0001912325350000033
wherein n represents n data features, normaize (acc _ loss) i ) Normalization process, normal (t _ cost), representing the loss value for the ith data feature i ) Indicating that the processing time for the ith data feature is normalized, normal (c _ cost) i ) And normalizing the storage space of the ith data characteristic, wherein X% represents a time degradation target in the set degradation targets, and Y represents a storage degradation target in the set degradation targets.
Optionally, the system performance indicators include: CPU usage, storage usage, IO usage, network bandwidth usage, traffic load, and response time.
In a second aspect, an embodiment of the present invention provides a model service system, including:
the system index detection module is used for acquiring system performance indexes;
the index and loss value acquisition module is used for calculating a performance index and a loss value of at least one data feature, the performance index of the data feature represents the resource use condition of the corresponding data feature, and the loss value of the data feature represents the influence degree of the corresponding data feature on the precision of the prediction result;
a list generation module for obtaining a discarded feature list based on the performance index and the loss value of the at least one data feature;
the first prediction module is used for obtaining a prediction result according to all data characteristics when the system performance index does not meet a set condition;
and the second prediction module is used for ignoring operation related to at least one data feature in the discarded feature list according to the discarded feature list and obtaining a prediction result according to the rest data features when the system performance index meets a set condition.
Optionally, the index and loss value obtaining module includes:
the log recording unit is used for recording the log of the at least one data characteristic in each processing link;
and the log summarizing unit is used for summarizing and counting the logs in each processing link according to the at least one data characteristic so as to obtain the performance index of the at least one data characteristic.
The simulation prediction unit is used for performing model prediction again after randomly discarding a data feature to obtain a prediction result;
a loss value calculation unit for calculating a loss value of the discarded data feature based on the prediction result before discarding and the prediction result after discarding.
Optionally, the loss value calculation unit includes:
and calculating the average value of the difference of the prediction results before discarding and the prediction results after discarding based on the multiple times of calculation, and taking the average value as the loss value of the corresponding discarded data characteristic.
Optionally, the method further comprises: and the sampling frequency adjusting module is used for adjusting the sampling frequency so as to adjust the proportion of each data characteristic in the at least one data characteristic.
Optionally, the list generating module includes:
and inputting the set degradation target and the performance index and loss value of the at least one data feature into an optimization model to obtain the discarded feature list, wherein the optimization model aims at minimizing the precision loss of the model service to obtain an optimal solution meeting the conditions.
Optionally, the method further comprises: and normalizing the performance index and the loss value of the at least one data characteristic before inputting the set degradation target and the performance index and the loss value of the at least one data characteristic into the optimization model.
Optionally, the performance indicators of each data feature include: the performance index comprises processing time and storage space of each data feature, and the optimization model is as follows:
Figure BDA0001912325350000051
Figure BDA0001912325350000052
Figure BDA0001912325350000053
wherein n represents n data features, normaize (acc _ loss) i ) Normalization process, normalization (t _ cost), representing loss value for ith data feature i ) Indicating that the processing time for the ith data feature is normalized, normal (c _ cost) i ) And normalizing the storage space of the ith data characteristic, wherein X% represents a time degradation target in the set degradation targets, and Y represents a storage degradation target in the set degradation targets.
Optionally, the system performance indicators include: CPU usage, storage usage, IO usage, network bandwidth usage, traffic load, and response time.
In a third aspect, a model service device is provided, which includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform any of the model service methods described above.
In a fourth aspect, a computer-readable storage medium is provided, storing computer instructions that, when executed, implement the model service method of any of the above.
In a fifth aspect, embodiments of the present invention provide a computer program product, including a computer program product, the computer program including program instructions, which, when executed by a model service device, cause the model service device to perform any one of the monitoring methods described above.
The technical scheme provided by the embodiment of the application can have the following beneficial effects: according to the model service method, the loss value and the performance index of each data feature are calculated firstly, then the discard feature list is generated according to the loss value and the performance index, when the performance index of the system reaches a set condition, the processing of a part of data features is omitted according to the discard feature list, and the usability and the precision of the model are guaranteed on the premise of reducing the service risk.
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 present application and together with the description, serve to explain the principles of the application.
FIG. 1 is a flow diagram illustrating an exemplary existing model service;
FIG. 2 is a flow chart of a method for providing model services according to an embodiment;
FIG. 3 is a flowchart of a model service method according to the second embodiment;
FIG. 4 is a block diagram showing a model service system provided in the third embodiment;
fig. 5 is a detailed structural diagram of an index and loss value obtaining module 402 in the model service system according to the fourth embodiment;
fig. 6 is a block diagram illustrating a structure of a model service device according to a fifth embodiment;
fig. 7 is a block diagram illustrating another model service device according to a sixth embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
FIG. 1 is a flow diagram illustrating an exemplary prior art model service. The model service 100 includes steps S101-S104. Firstly, step S101 receives a real-time data request through an external interface (which may be http or rpc, etc.), extracts and sorts current data features included in the data request, then step S102 invokes a data service 200 attached to a model service, obtains richer extended data features from the data service, step S103 fuses the current data features and the extended data features to obtain fused data features, and finally step S104 inputs the fused data features into a trained neural network model to obtain a final prediction result and returns the final prediction result to a requesting party.
Based on the model service, the embodiment of the invention provides a technical scheme for carrying out flow limitation based on data characteristics. According to the technical scheme, the loss value and the performance index of each data feature are calculated firstly, then the discard feature list is generated according to the comprehensive comparison of the loss value and the performance index, corresponding operations of a part of data features are preferentially ignored according to the discard feature list, and the usability and the precision of the model are guaranteed on the premise of reducing the service risk.
Fig. 2 is a flowchart illustrating a method for providing a model service according to an embodiment. It should be understood that in this embodiment, some of the existing steps in fig. 1 are not shown or described in a relatively simple form. For example, the step of acquiring and receiving the real-time data request and extracting the current data feature contained in the data request from the real-time data request is not shown in the embodiment, and the step of acquiring the extended data feature from the external data service 300 and fusing the current data feature and the extended data feature is also not shown in the embodiment. It will be understood by those skilled in the art that the present embodiment may include some or all of these corresponding steps. The model service method includes the following steps.
In step S201, a system performance index is acquired.
In step S202, a performance index and a loss value for at least one data feature are calculated.
In step S203, a discarded feature list is obtained based on the performance index and the loss value of the at least one data feature.
In step S204, it is determined that the system performance index satisfies the set condition.
In step S205, at least one data feature in the discarded feature list is ignored according to the discarded feature list, and a prediction result is obtained according to the remaining data features.
In step S206, a prediction result is obtained according to all the data features.
In the embodiment of the disclosure, the performance index is monitored in real time, the performance index and the loss value of each data feature are calculated in real time, the performance index of the data feature represents the resource use condition of the corresponding data feature, the loss value represents the influence degree of the corresponding data feature on the precision of the output result of the neural network model, and the discarded feature list is generated according to the performance index and the loss of the data feature. In the daily work of the model service system, a prediction result is calculated according to all the data feature lists, when the system performance index reaches a set condition, according to the discarded feature list, the corresponding operation of at least one data feature in the discarded feature list is ignored, and the prediction result is obtained according to the rest data features.
According to the model service method provided by the embodiment, when the system performance index meets the set condition, the operation of discarding some data features in the feature list is omitted in the operation process, the service risk of the system is reduced by reducing the data features needing to be processed, and the availability and the precision of the model service are ensured to the maximum extent.
In some embodiments, calculating the performance indicator for the at least one data feature comprises:
recording a log of at least one data characteristic in each processing link;
and summarizing and counting the logs of each processing link according to at least one data characteristic to obtain the performance index of the at least one data characteristic.
In some embodiments, calculating the loss value comprises:
randomly discarding a data characteristic and then carrying out primary prediction to obtain a prediction result; and
loss values for the discarded data features are calculated based on the prediction results before discarding and the prediction results after discarding.
In some embodiments, calculating the loss value for the discarded data feature based on the pre-discarded prediction and the post-discarded prediction comprises:
and calculating the average value of the difference of the prediction results before discarding and the prediction results after discarding based on the multiple times of calculation, and taking the average value as the loss value of the corresponding discarded data characteristic.
In some embodiments, the model service method further includes: and adjusting the sampling frequency to adjust the ratio of each data characteristic in the at least one data characteristic.
In some embodiments, obtaining the discarded-feature list based on the performance indicator and the loss value for each data feature comprises:
and inputting the set degradation target and the performance index and loss value of at least one data feature into an optimization model to obtain a discarded feature list, wherein the optimization model aims at minimizing the precision loss of the model service to obtain an optimal solution meeting the conditions.
In some embodiments, further comprising: and normalizing the performance index and the loss value of the at least one data characteristic before inputting the set degradation target and the performance index and the loss value of the at least one data characteristic into the optimization model.
Fig. 3 is a flowchart of a model service method provided in the second embodiment. It should be understood that in this embodiment, some of the existing steps in fig. 1 are also not shown or described in a relatively simple form. It will be understood by those skilled in the art that the present embodiment encompasses some or all of these respective steps. The embodiment specifically includes the following steps
In step S301, a system performance index is acquired.
System performance indicators include, but are not limited to, the following: response time, throughput, resource usage, and number of clicks. Response time is the time it takes the system to service it. Throughput is how many transactions/requests/units of data the system can handle per unit of time, etc. The resource utilization rate comprises CPU occupancy rate, memory utilization rate, disk I/O and network I/O. The number of clicks is the number of times per unit time the system responds to the client request.
The system performance index can be obtained based on the collection step of the system performance index. The acquisition step is typically a periodic acquisition step. For example, system performance indicators are collected every 5 minutes or 1 hour by a timer. The system performance indicators may also come from other acquisition systems. For example, an acquisition system is deployed on a node where the acquisition system is located, and system performance indexes sent by the acquisition system are received periodically.
In step S302, a log of at least one data characteristic at each processing link is recorded.
In this step, the model services various links, such as a step of receiving a real-time data request and extracting current data features contained in the data request, a step of obtaining extended data features, and a step of fusing the current data features and the extended data features, and respectively records processing logs of one or more data features. For example, logging is performed when a data request is received, logging is performed when data features are extracted from the data request, logging is performed when extended data features are obtained from an external data service, and logging is also performed before and after calculation using a neural network model.
It should be appreciated that if all data requests are logged at all processing stages, there is too much pressure on system performance. Thus, in general, a log of one or more data characteristics at various processing segments is recorded based on the sampling frequency. For example, a data request is sampled every 10 minutes and a log of one or more data characteristics involved therein is randomly recorded. Since the data request received each time is different, the data characteristics obtained by each fusion are also different. Therefore, the following may occur: some data features log less frequently and some data features log more frequently. The frequency of occurrence of some data features may be increased by increasing the sampling frequency, for example, modifying a 10 minute sample-by-data request to a 5 minute sample-by-data request, and randomly logging one or more data features involved therein.
In step S303, a summary statistic is performed on the logs of each processing link according to at least one data feature to obtain a performance index of the at least one data feature.
Similarly, according to the log recorded in step S302, the start time and the end time of each data feature in each processing link can be obtained, and further the time used for processing each data feature can be obtained. And taking the storage space occupied by each data characteristic and/or the time used for processing each data characteristic as the resource use condition for representing one data characteristic.
Of course, the performance index of each data feature may be calculated in other manners, for example, if one data feature occurs with a higher frequency and another data feature occurs with a lower frequency, the resource usage of one data feature cannot be well characterized only by the storage space occupied by each data feature and/or the time used for processing each data feature, in which case, the frequency of the data feature may also be incorporated into the combination of the performance indexes.
In step S304, a data feature is randomly discarded and then prediction is performed again, and a prediction result is obtained based on the model.
As described above, when the existing model service works normally, a data request is input, and a prediction result is output via the neural network model. In this embodiment, when a data request is processed by using the neural network model, at least one data feature is randomly discarded in addition to a predicted result obtained through a normal processing procedure, and another predicted result is obtained based on the discarded data feature. The prediction result is not output to the requester but stored, for example, in a log.
In step S305, a loss value of the discarded data feature is calculated based on the prediction result before discarding and the prediction result after discarding.
In this step, the prediction result before discarding, that is, the prediction result output normally and the prediction result after discarding are subtracted, and a numerical value is obtained as a loss value of the discarded data feature.
That is, all data features and the rest data features after discarding the next data feature are input into the trained neural network model to obtain two prediction results. In this process, it is not difficult to implement since there is no need to modify the parameters and algorithmic logic of the neural network model. Moreover, since the neural network model is executed on a general GPU (graphics processor), the influence of calculating the two prediction results on the system load is negligible.
For the loss value of a data feature, it is preferable to calculate the prediction result before discarding and the prediction result after discarding respectively in the processing of multiple data requests, re-average the differences obtained by multiple subtractions, and use the average value as the loss value of the data feature.
It will be appreciated that the data characteristics contained in each data request sent to the model service are not identical, and the resulting extended data characteristics are also not identical, and therefore, the loss value for a particular data characteristic calculated at one time and the loss value for that data characteristic calculated at another time may be based on different combinations of data characteristics. Therefore, will be flatThe mean value is used as a loss value of the data characteristic, and can smooth out the accidental fluctuation of single calculation. To illustrate, based on the feature set [ x ] 1 ,x 2 ,...,x i ,...,x n-1 ,x n ]And [ x ] 1 ,x 2 ,...,x i ,...,x n-1 ]To obtain x n Based on the feature set [ y ] 1 ,y 2 ,...,x i ,...,x n-1 ,x n ]And [ y 1 ,y 2 ,...,x i ,...,x n-1 ]To obtain x n Another loss value of (2), x obtained twice n Average loss value as x n The loss value of (c).
In step S306, a discarded feature list is obtained based on the performance index and the loss value of the at least one data feature.
The discard feature list includes a plurality of data features. Any of the plurality of data features may be from a data request or from an extended data feature. As described above, the performance index represents the resource usage of one data feature, the loss value represents the degree of influence of the corresponding data feature on the accuracy of the prediction result, and all data features can be sorted based on the combination of the performance index and the loss value. For example, a first weight of the performance index is set, a second weight of the loss value is set, sorting is performed from large to small based on the weights of the performance index and the loss value, and a plurality of corresponding data features are selected from large to small and placed in a discarded feature list. Of course, the sum of the performance index and the loss value can also be directly adopted to obtain a sorting result, and then a discarded feature list is obtained according to the sorting result.
In step S307, it is determined that the system performance index satisfies the set condition. When the system performance index satisfies the set condition, step S308 is executed, otherwise, step S309 is executed.
In step S308, a corresponding operation of at least one data feature in the discarded feature list is omitted according to the discarded feature list, and a prediction result is obtained according to the remaining data features.
In step S309, a prediction result is obtained according to all the data features.
The conditions are set to be configured in a configuration file or based on a configuration interface in advance. Since the performance index contains one or more indices, the setting condition may be a regular expression created based on the one or more indices.
It should be understood that all data features in step S309, where all data features include the data feature obtained by fusing the extracted data feature and the extended data feature in the data request. Accordingly, step S308 ignores the respective operation of discarding one or more data features in the feature list at any processing stage. For example, when a data feature needs to be extended, the data feature is not extended, and for example, when the data feature is input to the neural network model, the data feature is not input.
In addition, the discard feature list is a list obtained during processing of a plurality of previous data requests. For the current data request, the data features possibly involved are not in the discarded feature list, and then the corresponding operation of one or more data features is ignored for the next data request. And so on.
In order to better understand the present invention, the above embodiments are specifically described below using mathematical expressions.
Assume model input feature space is R n Then each data request is represented as [ x ] 1 ,x 2 ,...,x i ,...,x n-1 ,x n ]And n represents the number of data features that can be obtained by extraction from the data request and from an external data service.
a) Performance indicators for data features are defined as time cost and storage cost
Time cost, which is the average time consumed per request of the data in the latest N requests and recorded as t _ cost by recording the entry and exit times of each function of feature extraction, processing, query, etc. in the data request (all or random sampling) respectively i
Storage cost, which can be estimated in advance based on the type, value and storage structure of each feature dataThe storage cost of each data feature, recorded as s _ cost i
b) Data feature accuracy impact assessment
Sampling each time a data request is made and extracting a feature x i Meanwhile, calculating the deviation of the model prediction value of the characteristic which is reserved and discarded, and counting the average value of the influence on the precision when each characteristic is sampled for the latest M times:
Figure BDA0001912325350000131
c) destage policies
When the system performance index meets the preset condition, according to a degradation target (such as reduction of storage space by 20%, reduction of processing time consumption by 30% and the like), an optimization model is adopted, the performance index and the loss value of each data feature are input into the optimization model, and a current optimal discarded feature list is generated with the accuracy loss minimization as a target.
Normalizing the time cost and the storage cost of each data feature input into the optimization model, wherein the normalization processing is also performed on the loss statistic of each feature on the model precision;
and (4) solving the following optimization model through calculation to obtain a current optimal discarding characteristic list.
Figure BDA0001912325350000132
Figure BDA0001912325350000133
Figure BDA0001912325350000134
Wherein n represents n data features, normaize (acc _ loss) i ) Indicating normalization of the loss value of the ith data feature, normal (t _ cost) i ) Watch (CN)Shows the normalization of the processing time of the ith data feature, normalization (c _ cost) i ) The storage space of the ith data characteristic is normalized, the X% represents a time degradation target in the set degradation targets, namely a time consumption proportion value to be degraded, the Y represents a storage degradation target in the set degradation targets, namely a storage consumption proportion value to be degraded, v i ∈[0,1]This feature is either retained or discarded.
d) Performing destage operations
And in each link of the model service, ignoring the operation of discarding a plurality of data features in the feature list to obtain a prediction result.
Fig. 4 is a structural diagram of a model service system provided in the third embodiment. The model service system 400 includes:
the system index detection module 401 is configured to obtain a system performance index;
the index and loss value obtaining module 402 is configured to calculate a performance index and a loss value of at least one data feature, where the performance index of the data feature represents a resource usage condition of a corresponding data feature, and the loss value of the data feature represents an influence degree of the corresponding data feature on a precision of a prediction result;
the list generating module 403 is configured to obtain a discarded feature list based on the performance index and the loss value of the at least one data feature;
the first prediction module 404 is configured to obtain a prediction result according to all data characteristics when the system performance index does not meet the set condition;
the second prediction module 405 is configured to, when the system performance index meets a set condition, ignore operations related to at least one data feature in the discarded feature list according to the discarded feature list, and obtain a prediction result according to the remaining data features.
Fig. 5 is a detailed structural diagram of the index and loss value obtaining module 402 in the model service system according to the fourth embodiment. The index and loss value acquisition module includes:
the log recording unit is used for recording the log of at least one data characteristic in each processing link;
and the log summarizing unit is used for summarizing and counting the logs in each processing link according to at least one data characteristic so as to obtain the performance index of the at least one data characteristic.
The simulation prediction unit is used for performing model prediction again after randomly discarding a data feature to obtain a prediction result;
and a loss value calculation unit for calculating a loss value of the discarded data feature based on the prediction result before discarding and the prediction result after discarding.
In some embodiments, the loss value calculation unit includes:
and calculating the average value of the differences based on the prediction results before discarding and the prediction results after discarding obtained by multiple times of calculation, and taking the average value as the loss value of the discarded data characteristic.
In some embodiments, further comprising: and the sampling frequency adjusting module is used for adjusting the sampling frequency so as to adjust the proportion of each data characteristic in the at least one data characteristic.
In some embodiments, the list generation module comprises:
and inputting the set degradation target and the performance index and loss value of the at least one data feature into an optimization model to obtain a discarded feature list, wherein the optimization model aims at minimizing precision loss to obtain an optimal solution meeting the conditions.
In some embodiments, further comprising: and normalizing the performance index and the loss value of the at least one data characteristic before inputting the set degradation target and the performance index and the loss value of the at least one data characteristic into the optimization model.
In some embodiments, the performance indicators for each data feature include: the performance index comprises processing time and storage space of each data feature, and the optimization model is as follows:
Figure BDA0001912325350000151
Figure BDA0001912325350000152
Figure BDA0001912325350000153
wherein n represents n data features, normaize (acc _ loss) i ) Normalization process, normalization (t _ cost), representing loss value for ith data feature i ) Indicating that the processing time for the ith data feature is normalized, normal (c _ cost) i ) And normalizing the storage space of the ith data characteristic, wherein X% represents a time degradation target in the set degradation targets, and Y represents a storage degradation target in the set degradation targets.
In some embodiments, the system performance indicators include: CPU usage, storage usage, IO usage, network bandwidth usage, traffic load, and response time.
With regard to the model service system in the above embodiment, since the functions of the respective modules therein have been described in detail in the above embodiment of the interaction method, a relatively brief description is made.
Fig. 5 is a block diagram illustrating a model service apparatus performing a model service method according to an example embodiment. The model service device comprises a processor and a memory for storing processor-executable instructions;
wherein the processor is configured to perform any of the model service methods described above.
For example, model service apparatus 1200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to FIG. 6, model service 1200 can include one or more of the following components: processing component 1202, memory 1204, power component 1206, multimedia component 1208, audio component 1210, input/output (I/O) interface 1212, sensor component 1214, and communications component 1216.
The processing component 1202 generally controls the overall operation of the model service device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing components 1202 may include one or more processors 1220 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 1202 can include one or more modules that facilitate interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate interaction between the multimedia component 1208 and the processing component 1202.
The memory 1204 is configured to store various types of data to support operation at the device 1200. Examples of such data include instructions for any application or method operating on model service device 1200, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1204 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 1206 provide power to the various components of model service device 1200. The power components 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the model service device 1200.
The multimedia component 1208 includes a screen providing an output interface between the model service apparatus 1200 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 1200 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
Audio component 1210 is configured to output and/or input audio signals. For example, the audio component 1210 includes a Microphone (MIC) configured to receive an external audio signal when the model service apparatus 1200 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 1204 or transmitted via the communication component 1216. In some embodiments, audio assembly 1210 further includes a speaker for outputting audio signals.
The I/O interface 1212 provides an interface between the processing component 1202 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, an enable button, and a lock button.
The sensor assembly 1214 includes one or more sensors for providing state estimates of various aspects to the model service device 1200. For example, the sensor assembly 1214 may detect the open/closed state of the device 1200, the relative positioning of the components, such as the display and keypad of the model service apparatus 1200, the sensor assembly 1214 may also detect a change in the position of the model service apparatus 1200 or a component of the model service apparatus 1200, the presence or absence of user contact with the model service apparatus 1200, the orientation or acceleration/deceleration of the model service apparatus 1200, and a change in the temperature of the model service apparatus 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 1214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communications component 1216 is configured to facilitate communications between the model service apparatus 1200 and other devices, either wired or wirelessly. The model service device 1200 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 1216 receives the broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1216 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the model service apparatus 1200 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided that includes instructions, such as the memory 1204 that includes instructions, that are executable by the processor 1220 of the model service apparatus 1200 to perform the methods described above. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 7 is a block diagram illustrating a model service apparatus performing a model service method in accordance with an example embodiment. For example, the apparatus 1300 may be provided as a server. Referring to fig. 7, apparatus 1300 includes a processing component 1322, which further includes one or more processors, and memory resources, represented by memory 1332, for storing instructions, such as application programs, that may be executed by processing component 1322. The application programs stored in memory 1332 may include one or more modules that each correspond to a set of instructions. Further, processing component 1322 is configured to execute instructions to perform the model service method described above.
The apparatus 1300 may also include a power component 1326 configured to perform power management for the apparatus 1300, a wired or wireless network interface 1350 configured to connect the apparatus 1300 to a network, and an input-output (I/O) interface 1358. The apparatus 1300 may operate based on an operating system stored in the memory 1332, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program product, the computer program comprising program instructions which, when executed by a model service device, cause the model service device to perform the model service method described above.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention 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 invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (17)

1. A model service method, comprising:
obtaining a system performance index;
calculating a performance index and a loss value of at least one data feature, wherein the performance index of the data feature represents the resource use condition of the corresponding data feature, and the loss value of the data feature represents the influence degree of the corresponding data feature on the precision of the prediction result;
obtaining a discarded feature list based on the performance indicator and the loss value of the at least one data feature; and
when the system performance index meets a set condition, ignoring corresponding operation of at least one data feature in the discarding feature list according to the discarding feature list, and obtaining a prediction result based on a model according to the rest data features;
wherein the obtaining a discarded feature list based on the performance indicator and the loss value of each data feature comprises:
and inputting the set degradation target and the performance index and loss value of the at least one data feature into an optimization model to obtain the discarded feature list, wherein the optimization model is used for solving an optimal solution meeting the conditions by taking the precision loss minimization as a target.
2. The model service method of claim 1, wherein the calculating a performance metric for at least one data feature comprises:
recording a log of the at least one data characteristic at each processing link;
and summarizing and counting the logs of each processing link according to the at least one data characteristic to obtain the performance index of the at least one data characteristic.
3. The model service method of claim 1, wherein the calculating the loss value comprises:
randomly discarding a data characteristic and then carrying out primary prediction to obtain a prediction result; and
loss values for the discarded data features are calculated based on the prediction results before discarding and the prediction results after discarding.
4. The model service method of claim 3, wherein the calculating the loss value for the discarded data feature based on the pre-discarded prediction result and the post-discarded prediction result comprises:
and calculating the average value of the difference of the prediction results before discarding and the prediction results after discarding based on the multiple times of calculation, and taking the average value as the loss value of the corresponding discarded data characteristic.
5. The model service method of claim 1, further comprising: and adjusting the sampling frequency to adjust the ratio of each data characteristic in the at least one data characteristic.
6. The model service method of claim 1, further comprising: normalizing the performance indicators and loss values of the at least one data feature before inputting the set degradation goals and the performance indicators and loss values of the at least one data feature into the optimization model.
7. The model service method of claim 6, wherein the performance metrics for each data feature comprise: the performance index comprises processing time and storage space of each data feature, and the optimization model is as follows:
Figure FDA0003652259590000021
Figure FDA0003652259590000022
Figure FDA0003652259590000023
wherein n represents n data features, normaize (acc _ loss) i ) Indicating normalization of the loss value of the ith data feature, normal (t _ cost) i ) Representing attribution to processing time of ith data featureNormalization, normalization (c _ cost) i ) And normalizing the storage space of the ith data characteristic, wherein X% represents a time degradation target in the set degradation targets, and Y represents a storage degradation target in the set degradation targets.
8. The model service method of claim 1, wherein the system performance metrics comprise: CPU usage, storage usage, IO usage, network bandwidth usage, traffic load, and response time.
9. A model service system, comprising:
the system index detection module is used for acquiring system performance indexes;
the index and loss value acquisition module is used for calculating a performance index and a loss value of at least one data feature, the performance index of the data feature represents the resource use condition of the corresponding data feature, and the loss value of the data feature represents the influence degree of the corresponding data feature on the precision of the prediction result;
a list generation module for obtaining a discarded feature list based on the performance index and the loss value of the at least one data feature;
the first prediction module is used for obtaining a prediction result according to all data characteristics when the system performance index does not meet a set condition;
the second prediction module is used for neglecting corresponding operation of at least one data feature in the discarded feature list according to the discarded feature list and obtaining a prediction result according to the rest data features when the system performance index meets a set condition;
the list generation module inputs a set degradation target and the performance index and loss value of the at least one data feature into an optimization model to obtain the discarded feature list, wherein the optimization model aims at minimizing precision loss to obtain an optimal solution meeting conditions.
10. The model service system of claim 9, the metric and loss value acquisition module, comprising:
the log recording unit is used for recording the log of the at least one data characteristic in each processing link;
the log summarizing unit is used for summarizing and counting the logs of each processing link according to the at least one data characteristic so as to obtain the performance index of the at least one data characteristic;
the simulation prediction unit is used for performing prediction again after randomly discarding a data feature to obtain a prediction result;
and a loss value calculation unit for calculating a loss value of the discarded data feature based on the prediction result before discarding and the prediction result after discarding.
11. The model service system according to claim 10, wherein the loss value calculation unit includes:
and calculating the average value of the difference of the prediction results before discarding and the prediction results after discarding based on the multiple times of calculation, and taking the average value as the loss value of the discarded data characteristic.
12. The model service system of claim 9, further comprising: and the sampling frequency adjusting module is used for adjusting the sampling frequency so as to adjust the proportion of each data characteristic in the at least one data characteristic.
13. The model service system of claim 9 wherein the list generation module further normalizes the performance indicators and loss values of the at least one data feature prior to inputting the set degradation goals and the performance indicators and loss values of the at least one data feature into the optimization model.
14. The model service system of claim 13, wherein the performance metrics for each data feature comprise: the performance index comprises processing time and storage space of each data feature, and the optimization model is as follows:
Figure FDA0003652259590000041
Figure FDA0003652259590000042
Figure FDA0003652259590000043
wherein n represents n data features, normaize (acc _ loss) i ) Indicating normalization of the loss value of the ith data feature, normal (t _ cost) i ) Indicates the normalization of the processing time of the ith data feature, normalization (c _ cost) i ) And normalizing the storage space of the ith data characteristic, wherein X% represents a time degradation target in the set degradation targets, and Y represents a storage degradation target in the set degradation targets.
15. The model service system of claim 9, wherein the system performance metrics comprise: CPU usage, storage usage, IO usage, network bandwidth usage, traffic load, and response time.
16. A model service apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the model service method of any of the preceding claims 1 to 8.
17. A computer-readable storage medium, storing computer instructions which, when executed by a processor, control an apparatus in which the computer-readable storage medium is located to perform a method for implementing the model service of any one of claims 1 to 8.
CN201811557396.4A 2018-12-19 2018-12-19 Model service method, system, apparatus and computer readable storage medium Active CN109783337B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811557396.4A CN109783337B (en) 2018-12-19 2018-12-19 Model service method, system, apparatus and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811557396.4A CN109783337B (en) 2018-12-19 2018-12-19 Model service method, system, apparatus and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109783337A CN109783337A (en) 2019-05-21
CN109783337B true CN109783337B (en) 2022-08-30

Family

ID=66497342

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811557396.4A Active CN109783337B (en) 2018-12-19 2018-12-19 Model service method, system, apparatus and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109783337B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021006861A1 (en) * 2019-07-05 2021-01-14 Visa International Service Association Method and system using ai call prediction and cache
EP3809215A1 (en) * 2019-10-14 2021-04-21 Siemens Aktiengesellschaft Hierarchical optimisation of modular technical installations
CN113537387A (en) * 2021-08-04 2021-10-22 北京思特奇信息技术股份有限公司 Model design method and device for Internet online operation activities and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3077949A1 (en) * 2013-12-06 2016-10-12 Qualcomm Incorporated Methods and systems of generating application-specific models for the targeted protection of vital applications
CN107360026A (en) * 2017-07-07 2017-11-17 西安电子科技大学 Distributed message performance of middle piece is predicted and modeling method
CN108021984A (en) * 2016-11-01 2018-05-11 第四范式(北京)技术有限公司 Determine the method and system of the feature importance of machine learning sample
CN108038040A (en) * 2017-12-08 2018-05-15 上海市信息网络有限公司 Computer cluster performance indicator detection method, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10579748B2 (en) * 2015-03-31 2020-03-03 Ca, Inc. Capacity planning for systems with multiprocessor boards

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3077949A1 (en) * 2013-12-06 2016-10-12 Qualcomm Incorporated Methods and systems of generating application-specific models for the targeted protection of vital applications
CN108021984A (en) * 2016-11-01 2018-05-11 第四范式(北京)技术有限公司 Determine the method and system of the feature importance of machine learning sample
CN107360026A (en) * 2017-07-07 2017-11-17 西安电子科技大学 Distributed message performance of middle piece is predicted and modeling method
CN108038040A (en) * 2017-12-08 2018-05-15 上海市信息网络有限公司 Computer cluster performance indicator detection method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109783337A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
CN109408207B (en) Microservice access control method, microservice access control device and storage medium
CN110166371B (en) Flow control method and device, electronic equipment and storage medium
CN109783337B (en) Model service method, system, apparatus and computer readable storage medium
CN106528389B (en) Performance evaluation method and device for system fluency and terminal
US20170118298A1 (en) Method, device, and computer-readable medium for pushing information
CN109670632B (en) Advertisement click rate estimation method, advertisement click rate estimation device, electronic device and storage medium
CN110611829A (en) Video preloading method and device, electronic equipment and storage medium
WO2019062405A1 (en) Application program processing method and apparatus, storage medium, and electronic device
US10212194B2 (en) Server controlled throttling of client to server requests
CN111581174A (en) Resource management method and device based on distributed cluster system
CN114491943A (en) Information processing method, temperature prediction model training method and device and electronic equipment
CN113867927A (en) Resource allocation method, device, electronic equipment and storage medium
WO2019062404A1 (en) Application program processing method and apparatus, storage medium, and electronic device
KR102576636B1 (en) Method and apparatus for providing video stream based on machine learning
CN113254834A (en) Page content loading method and device, electronic equipment and readable storage medium
CN117453933A (en) Multimedia data recommendation method and device, electronic equipment and storage medium
US20170169467A1 (en) Information push method and device
US20220329580A1 (en) Methods for establishing social relationship and terminal
CN114518959A (en) Distributed node resource load balancing method and device and electronic equipment
CN114493310A (en) Method and device for determining risk value of task of operating system
CN112181508B (en) Page automatic refreshing method and device and computer equipment
CN114416505A (en) Data processing method and device, electronic equipment and storage medium
CN114189719A (en) Video information extraction method and device, electronic equipment and storage medium
CN113761343A (en) Information pushing method and device, terminal equipment and storage medium
CN113254212A (en) Processing method, mobile terminal and storage medium

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