Business processing method and device
By calculating the complexity factor of the input and output data in the business request, and performing billing processing based on the complexity of the target model, the problem of insufficient authenticity and accuracy of model-based business billing processing in the existing technology is solved, and the More accurate reflection of resource usage costs.
Patent Information
- Application Number
- CN202411370659.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-24
AI Technical Summary
Model-based business billing processing has shortcomings in terms of authenticity and accuracy, and cannot effectively reflect the actual resource usage cost of business requests.
By obtaining the input and output data in the business request, combining the complexity of the target model, the complexity factor of the input and output data is calculated, and the cost is based on these factors to reflect the actual resource cost of processing business requests.
The authenticity and accuracy of the business billing processing based on model -based business billing is improved to ensure that the billing results are closer to the actual resource usage.
Smart Images

Figure CN119359299A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a business processing method and device. Background Art
[0002] With the development of science and technology, the technical level of machine learning is improving day by day, so that machine learning technology can help us better understand and use data and reflect the value of data. At present, machine learning models trained with a large amount of data have been widely used in various scenarios of production and life.
[0003] In the billing service of model-based business processing, the billing is generally based on the number of tokens of the input data corresponding to the business request and the number of tokens of the output data of the model. This billing process is not flexible enough and does not reflect the actual resource usage cost of the business request, resulting in low authenticity and accuracy of model-based business billing.
[0004] Therefore, how to improve the authenticity and accuracy of model-based business billing processing needs to be studied. Summary of the invention
[0005] The embodiments of the present application provide a service processing method and device for improving the authenticity and accuracy of model-based service billing processing.
[0006] In a first aspect, an embodiment of the present application provides a business processing method, which can be applied to a cloud management platform, which is used to manage infrastructure, and the infrastructure can be a device, or a module of a device (such as a chip), or a system corresponding to a device, and the device can be a terminal device or a network device (such as a server). Based on this, the method includes:
[0007] Obtain a business request, wherein the business request includes input data and a model identifier; then, according to the model identifier, input the input data into a target model to obtain output data of the target model; then, determine a first complexity factor according to properties of the input data and the complexity of the target model, and determine a second complexity factor according to properties of the output data and the complexity of the target model; finally, perform billing processing on the business request according to the first complexity factor and the second complexity factor.
[0008] In the above method, the complexity factor is associated with the complexity of the target model, for example, the complexity factor is positively correlated with the complexity of the target model. Therefore, by calculating the billing of the target model processing the service request through the complexity factor, the actual resource usage cost of processing the service request can be reflected. In other words, the higher the complexity of the target model, the higher the actual resource usage cost of the service request, thereby ensuring the authenticity and accuracy of the model-based service billing processing.
[0009] In a possible implementation, the input data includes at least one of the following data: video data, image data, audio data, and text data; the output data includes at least one of the following data: video data, image data, audio data, and text data; wherein the attributes of the video data and the image data are image width and image height, and the attributes of the audio data and the text data are field length.
[0010] In the above implementation, the image data may be one or more frames of images in the video data, and the text data may be the corresponding text in the audio data. In order to reduce the difficulty of calculating the complexity factor, the video data may be considered as image data, and the audio data may be considered as text data. Based on this, it can be understood that: the input data includes image data and / or text data, and the input data includes image data and / or text data.
[0011] Optionally, the input data includes text data and image data, and the attributes of the input data are image width and image height; the output data includes text data, and the attributes of the output data are field length; or, the input data includes text data, and the attributes of the input data are field length; the output data includes image data, and the attributes of the output data are image width and image height; or, the input data includes text data and image data, and the attributes of the input data are image width and image height; the output data includes text data and image data, and the attributes of the output data are image width and image height; or, the input data includes text data, and the attributes of the input data are field length; the output data includes text data, and the attributes of the output data are field length.
[0012] A possible implementation method is that if the input data or output data includes image data, the complexity factor is calculated using the image width and image height, referring to the following formula (1); if the input data or output data does not include image data, the complexity factor is calculated using the field length, referring to the following formula (2).
[0013] Optionally, taking the input data including an image and text as an example, the attributes of the input data in this case are image width and image height, and the first complexity factor is calculated according to the following formula (1);
[0014]
[0015] Among them, S1 is the first complexity factor, width is the image width, height is the image height, x1, x2, and x3 are preset values according to the complexity of the model; exemplarily, x1 is negatively correlated with the complexity of the model, x2 is positively correlated with the complexity of the model, and x3 is negatively correlated with the complexity of the model.
[0016] Optionally, taking the output data including only text as an example, in this case, the attribute of the output data is the field length, and the second complexity factor is calculated according to the following formula (2);
[0017]
[0018] Among them, S2 is the second complexity factor, length is the field length of the data, x4 is a value preset according to the complexity of the model, and x4 is negatively correlated with the complexity of the model. That is, when the data is text data, the complexity factor is the ratio of the field length of the data to the preset value, and the preset value is associated with the complexity of the model.
[0019] In one possible implementation, the target model is associated with multiple complexity factors, which are preset according to the complexity of the target model. Each complexity factor is also associated with a preset range. The first complexity factor and the second complexity factor are determined according to the preset range and the attributes of the data.
[0020] In a possible implementation manner, the charging process for the service request according to the first complexity factor and the second complexity factor includes:
[0021] A first fee for the target model to process the business request is calculated based on the number of tokens of the input data and the first complexity factor, and the number of tokens of the output data and the second complexity factor.
[0022] The fee for the target model to process the service request can also be understood as the fee for the user to use the target model for the service request. Optionally, the first fee is calculated according to the following formula (3):
[0023]
[0024] Among them, cost1 is the first fee, token input is the number of tokens in the input data. output is the number of tokens of output data, factor input is the first complexity factor, factor output is the second complexity factor.
[0025] In a possible implementation manner, after calculating the first cost of the target model processing the service request, the method further includes:
[0026] Determine the charging currency type based on the request address corresponding to the business request; when the charging currency type is determined to be inconsistent with the billing currency type corresponding to the target model, calculate the second fee for the target model to process the business request based on the first fee and the current exchange rate.
[0027] In the above implementation, the request address can be understood as the region where the user is located when making a service request, that is, the charging currency type of the user's region (such as RMB, USD, EUR, etc.) is selected, and the final fee to be paid is automatically adjusted according to the current exchange rate to ensure that users in different regions enjoy the service billing processing of the regional price when using the same model service.
[0028] In a possible implementation, the method further includes: calculating the cost of processing the business of the target model in the second time period based on the cost of processing the business corresponding to at least one model in the first time period; wherein the first time period is the time period before the current moment, the second time period is the time period after the current moment, and the interval between the first time period and the second time period is the same.
[0029] The above implementation method predicts the cost of using the target model in the second period (or future period) through the costs of multiple models used by users in the first period (or historical period), thereby realizing the prediction of consumption.
[0030] In a possible implementation, the method further includes: recording the cost of processing the service of the target model according to a preset currency type, where the preset currency type corresponds to the billing currency type of the target model.
[0031] The above implementation method, when recording the expenses of using the target model, uses the currency type corresponding to the billing currency type of the target model for recording. This can ensure that the recorded expenses correspond to the currency type of the expenses recorded by the platform corresponding to the target model, so as to facilitate subsequent reconciliation and ensure the accuracy of the reconciliation.
[0032] In a second aspect, an embodiment of the present application provides a service processing device, including:
[0033] An acquisition module, used to acquire a business request, wherein the business request includes input data and a model identifier;
[0034] A processing module is used to input the input data into a target model according to the model identifier to obtain output data of the target model; determine a first complexity factor according to the attributes of the input data and the complexity of the target model, and determine a second complexity factor according to the attributes of the output data and the complexity of the target model; and perform billing processing on the service request according to the first complexity factor and the second complexity factor.
[0035] In a possible implementation, the input data includes at least one of the following data: video data, image data, audio data, and text data; the output data includes at least one of the following data: video data, image data, audio data, and text data; wherein the attributes of the video data and the image data are image width and image height, and the attributes of the audio data and the text data are field length.
[0036] In a possible implementation manner, the processing module is specifically used to:
[0037] A first fee for the target model to process the business request is calculated based on the number of tokens of the input data and the first complexity factor, and the number of tokens of the output data and the second complexity factor.
[0038] In a possible implementation manner, the processing module is further used for:
[0039] After calculating the first fee for the target model to process the business request, the charging currency type is determined according to the request address corresponding to the business request; when the charging currency type is determined to be inconsistent with the billing currency type corresponding to the target model, the second fee for the target model to process the business request is calculated based on the first fee and the exchange rate at the current moment.
[0040] In a possible implementation manner, the processing module is further used for:
[0041] The cost of processing business of the target model in the second time period is calculated based on the cost of processing business corresponding to at least one model in the first time period; wherein the first time period is the time period before the current moment, the second time period is the time period after the current moment, and the interval between the first time period and the second time period is the same.
[0042] In a possible implementation manner, the processing module is further used for:
[0043] The cost of processing the service of the target model is recorded according to a preset currency type, and the preset currency type corresponds to the billing currency type of the target model.
[0044] In a third aspect, an embodiment of the present application further provides a computer device, including:
[0045] A memory for storing program instructions;
[0046] The processor is used to call the program instructions stored in the memory and execute any one of the methods in the first aspect according to the obtained program.
[0047] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute any one of the methods described in the first aspect above.
[0048] In a fifth aspect, an embodiment of the present invention further provides a computer program product, wherein the computer program product comprises an executable program, and the executable program is executed by a processor to execute any one of the methods described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0051] Figure 2 A flowchart of a business processing method provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of the structure of a service processing device provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of a system architecture provided for an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0055] With the development of science and technology, the technical level of machine learning is improving day by day, so that machine learning technology can help us better understand and use data and reflect the value of data. At present, machine learning models trained with a large amount of data have been widely used in various scenarios of production and life. For example, Large Language Model (LLM).
[0056] In the billing service of model-based business processing, the billing is generally based on the number of tokens of input data corresponding to the business request and the number of tokens of output data of the model. For example, the price of each token of input data is 0.03 / thousand, and the price of each token of output data is 0.06 / thousand, so that the cost of model processing business requests can be obtained. Among them, token refers to the smallest unit of meaning that the model can understand and generate, and is the basic unit of the model. Tokens can represent words, parts of words, and characters. Tokens are assigned numerical values or identifiers, arranged in sequences or vectors, and are input or output from the model. They are the language components of the model. Because tokens are well known to those skilled in the art, this application does not introduce tokens in detail.
[0057] However, this price is generally set by model developers based on market demand, without considering issues such as the complexity of the model itself and resource consumption. This makes the billing process inflexible and fails to reflect the actual resource usage cost for the business request, resulting in low authenticity and accuracy in model-based business billing.
[0058] To this end, the present application provides a business processing method, which calculates the billing of the model processing the business request through a complexity factor associated with the complexity of the model, reflecting the actual resource usage cost of processing the business request, thereby improving the authenticity and accuracy of the model-based business billing processing.
[0059] Below, some technologies and terms designed in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0060] 1. Target Model
[0061] The target model refers to the model accessed by the user. Exemplarily, the user accesses the target model to perform business processing on the business request triggered by the user through the target model. In order to make the purpose, technical solution and advantages of this application clearer, the application scenario to which this application is applicable is introduced below.
[0062] Ginseng Figure 1 As shown, the user can send a service request (such as an access request, a query request, a translation request, etc.) to the server 120 through the client running on the terminal device 110, wherein the service request includes the model identifier (such as the model type, the name of the model, the index of the model, etc., which are not limited in this application) that the user needs to access, and input data. For example, the service request is that the user wants to use the GPT-4 model to analyze the number of people in an image. The input data of the service request includes an image and the query statement "analyze the number of people in the image".
[0063] At least one model (such as a GPT-4 model and a GPT-3.5 model) is stored in the server 120. After receiving the above service request, the server 120 uses the GPT-4 model as the target model and processes the service request according to the target model.
[0064] Exemplarily, the target model may be a Transformer model, which is a neural network model based on an attention mechanism for processing sequence data. The Transformer model is applied to multiple fields such as natural language processing (NLP), computer vision, speech recognition, and reinforcement learning. This application does not specifically limit the type of the target model.
[0065] 2. Complexity Factor
[0066] Based on the differences in functions, accuracy and other factors, different models have different model parameter quantities, neural network layers, neurons and other parameters, which leads to different complexity of different models, or different resources consumed during operation. It can be understood that the number of model parameters is positively correlated with the complexity of the model, the number of neural network layers of the model is positively correlated with the complexity of the model, and the complexity of the model is positively correlated with the resources consumed and latency during the model operation.
[0067] To this end, the present application implements the model's billing processing of business requests through the attributes of data (input data and output data) and the complexity of the model. Among them, the attributes of the data are used to indicate the amount of data requested by the business. Generally speaking, the larger the amount of data in a business request, the more complex the model processing is. In other words, the amount of data in a business request can reflect the complexity of the model's processing of the business request. To this end, the actual resource usage cost of processing the business request is reflected by the amount of data in the business request, thereby ensuring the authenticity and accuracy of the model-based business billing processing.
[0068] It can be understood that the data volume of a business request includes the input data and output data corresponding to the request, and therefore, the input data and output data correspond to different complexity factors. For ease of description, this application corresponds the input data to the first complexity factor (or input complexity factor), and corresponds the output data to the second complexity factor (or output complexity factor).
[0069] In a possible implementation, the input data includes at least one of the following data: video data, image data, audio data, and text data; similarly, the output data includes at least one of the following data: video data, image data, audio data, and text data. The attributes of the video data and image data are image width and image height, and the attributes of the audio data and text data are field length.
[0070] It can be understood that the image data can be one or more frames of images in the video data, and the text data can be the corresponding text in the audio data. Considering the difficulty of calculating the complexity factor, the video data is described as image data and the audio data is described as text data. That is, it can be understood that the input data includes image data and / or text data, and the input data includes image data and / or text data. Exemplarily, the following 4 possible situations can be included:
[0071] Case 1: The input data includes image data, that is, the attributes of the input data are image width and image height; the output data does not include image data (for example, only text data), that is, the attribute of the output data is field length. For example, the business request is: analyze how many people are there in the first image, the corresponding input data includes the first image, query text data (how many people), and the corresponding output data only includes the response text data (such as 3 people).
[0072] Case 2: The input data includes image data, that is, the attributes of the input data are image width and image height; the output data includes image data, that is, the attributes of the output data are image width and image height. For example, the business request is: find an image similar to the first image, the corresponding input data includes the first image, the query text data (similar images), and the corresponding output data includes the second image, that is, the second image is an image similar to the first image.
[0073] Case 3: The input data does not include image data, that is, the attribute of the input data is field length; the output data includes image data, that is, the attributes of the output data are image width and image height. For example, the business request is: find tiger images, the corresponding input data only includes query text data (tiger images), and the corresponding output data is images containing tigers.
[0074] Case 4: The input data does not include image data, that is, the attribute of the input data is field length; the output data does not include image data, that is, the attribute of the output data is field length. For example, the business request is: Will it rain tomorrow? The corresponding input data only includes query text data (whether it will rain), and the corresponding output data only includes response text data (such as light to moderate rain).
[0075] In a possible implementation, the input data or output data includes image data and text data. Because the amount of image data is often larger than that of text data, when image data is included, the complexity factor is calculated based on the image width and image height, referring to the following formula (1); if image data is not included, the complexity factor is calculated based on the field length, referring to the following formula (2). In other words, the attributes of the input data are image width and image height, or the attributes of the input data are field length. Similarly, the attributes of the output data are image width and image height, or the attributes of the output data are field length.
[0076] In a possible implementation, the input data includes an image as an example. In this case, the attributes of the input data are image width and image height. The first complexity factor is calculated according to the following formula (1):
[0077]
[0078] Wherein, S1 is the first complexity factor, width is the image width, height is the image height, x1, x2, and x3 are preset values according to the complexity of the model; illustratively, x1 is negatively correlated with the complexity of the model, x2 is positively correlated with the complexity of the model, and x3 is negatively correlated with the complexity of the model. illustratively, x1=512, x2=768, and x3=2048. It can be understood that in formula (1), the complexity of the model is reflected by x1, x2, and x3, so the x1, x2, and x3 corresponding to models of different complexities are different.
[0079] A possible implementation method is to take the output data not including an image as an example. In this case, the attribute of the output data is the field length. The second complexity factor is calculated according to the following formula (2):
[0080]
[0081] Among them, S2 is the second complexity factor, length is the field length of the data, x4 is a value preset according to the complexity of the model, and x4 is negatively correlated with the complexity of the model. That is, when the data is text data, the complexity factor is the ratio of the field length of the data to the preset value, and the preset value is associated with the complexity of the model. It can be understood that in formula (2), the complexity of the model is reflected by x4, so the x4 corresponding to models of different complexities is different.
[0082] It can be understood that when the input data does not include an image, the first complexity factor can be calculated according to formula (2); similarly, when the output data includes an image, the second complexity factor can be calculated according to formula (1); this application will not elaborate on this.
[0083] In the above description, in order to reduce the difficulty of calculating the complexity factor, the attributes of the data are summarized into two types, namely, the attributes corresponding to the image data (image width, image height), and the attributes corresponding to the text data (field length). It can be understood that in order to ensure the accuracy of the complexity factor calculation, the attributes of the data can also be subdivided into multiple types, such as the attributes corresponding to the video data (such as the number of image frames), the attributes corresponding to the audio data (such as the audio duration), the attributes corresponding to the image data, and the attributes corresponding to the text data (field length).
[0084] In a possible implementation, the data attributes may also include other attributes besides image width, image height, and field length. For example, when the data includes an image, the data attributes may also include image pixels, resolution, etc.; when the data is text, the data attributes may also include font, font size, etc.; it is understood that the present application may calculate the complexity factor based on different attributes of the data.
[0085] A possible implementation method is that each model is associated with multiple complexity factors, which are preset according to the complexity of the model. Each complexity factor is also associated with a preset range. The first complexity factor and the second complexity factor are determined according to the preset range and the attributes of the data. For example, a model is associated with 3 complexity factors, namely S1, S2, and S3; wherein S1 corresponds to the preset field length range [0-5), S2 corresponds to the preset field length range [5-10), and S3 corresponds to the preset field length range [10-15). If the field length of the input data belongs to the range [0-5), the first complexity factor is S1. It can be understood that this implementation method is also applicable to scenarios where the data attributes are image width and image height, which will not be elaborated in this application.
[0086] Based on the above description, Figure 2 The flowchart of a business processing method provided by an embodiment of the present application is exemplarily shown. The method can be applied to a cloud management platform, which is used to manage infrastructure. The infrastructure can be a device, or a module of a device (such as a chip), or a system corresponding to the device. The device can be a terminal device or a network device (such as a server). Figure 2 As shown, the process includes:
[0087] Step 210: Obtain a business request, where the business request includes input data and a model identifier.
[0088] In this process, the model identifier may be the name of the model, the model type, the index of the model, etc. Input data refers to data required for business processing, such as input data including a frame of image in video data, query text, etc., which is not specifically limited in this application.
[0089] Step 220: input the input data into the target model according to the model identifier to obtain the output data of the target model.
[0090] The target model can refer to the above-mentioned content, and this application will not elaborate on it here. For example, the input data includes an image and a query text "analyze the number of people in the image"; the corresponding output data includes a response text "a total of three people, one man and two women".
[0091] Step 230: determining a first complexity factor according to the attributes of the input data and the complexity of the target model, and determining a second complexity factor according to the attributes of the output data and the complexity of the target model.
[0092] Among them, the first complexity factor and the second complexity factor can refer to the above introduction to the complexity factor, and this application will not elaborate on them here.
[0093] Step 240: Perform billing processing on the service request according to the first complexity factor and the second complexity factor.
[0094] In a possible implementation, the first fee for the target model to process the service request is calculated based on the number of tokens of the input data and the first complexity factor, the number of tokens of the output data and the second complexity factor. Optionally, the first fee is calculated based on the following formula (3);
[0095]
[0096] Among them, cost1 is the first fee, token input is the number of tokens in the input data. output is the number of tokens of output data, factor input is the first complexity factor, factor output It is understandable that the first fee corresponds to the billing currency type of the target model. For example, if the billing currency type of the target model is US dollars, the currency type of the first fee is also US dollars.
[0097] In summary, the complexity factor is equivalent to the price corresponding to the token (the first complexity factor is equivalent to the token price of the input data, and the second complexity factor is equivalent to the token price of the output data). This application calculates the billing of the model processing the business request through the complexity factor associated with the complexity of the model, which is equivalent to reflecting the actual resource usage cost of processing the business request through the complexity of the model's processing of the business request, thereby improving the authenticity and accuracy of the model-based business billing processing.
[0098] A possible implementation method is to avoid the problem that the user cannot use the currency type of the first fee to pay the first fee in the region where the user is located in a cross-regional (such as cross-national) usage scenario. After calculating the first fee, the charging currency type is determined according to the request address corresponding to the business request, and when the determined charging currency type is inconsistent with the billing currency type corresponding to the target model, the second fee for the target model to process the business request is calculated based on the first fee and the current exchange rate.
[0099] It can be understood that the request address can be understood as the area where the user is located when making a service request. Assuming that the charging currency type in the user's area is RMB, and the charging currency type corresponding to the target model is USD, then according to the current exchange rate, the first fee (such as 1 USD) is converted into the second fee (such as 7 RMB). Optionally, the currency type includes but is not limited to: Euro, USD, RMB, Korean Won, etc., and this application does not make specific limitations on this.
[0100] In summary, the fees (first fees or second fees) for processing business requests by the target model can be understood as the fees that users need to pay for using the target model for business requests. In order to ensure the accuracy of these fees, users generally reconcile accounts periodically. However, based on the above description, the platform corresponding to the target model generally uses the billing currency type corresponding to the target model to record the cost of the target model, and users generally use the billing currency type corresponding to their region to record the cost of the target model. Therefore, it is easy to have problems such as wrong accounts, recalculated fees or unclear reconciliation.
[0101] To this end, when recording the fees paid for using the target model, this application records the fees for processing the business by the target model in accordance with the preset currency type, and the preset currency type corresponds to the billing currency type of the target model. In general, the preset currency type is consistent with the billing currency type of the target model. That is, the fees paid for using the target model are recorded in accordance with the billing currency type of the target model, so as to ensure that the recorded fees are consistent with the currency type of the fees recorded by the platform corresponding to the target model, so as to facilitate subsequent reconciliation and ensure the accuracy of the reconciliation.
[0102] As a possible implementation, the present application also provides a predictive charging method. Specifically, the cost of processing the business by the target model in the second time period is calculated based on the cost of processing the business corresponding to at least one model in the first time period; wherein the first time period is the time period before the current moment, and the second time period is the time period after the current moment, so the first time period can also be called a historical time period, and the second time period can also be called a future time period, and the interval between the first time period and the second time period is the same. For example, if the first time period is 24 hours before the current moment, then the second time period is 24 hours after the current moment. Optionally, the cost of processing the business by the target model in the second time period is calculated according to the following formula (4);
[0103]
[0104] Where cost2 is the cost of the target model processing business in the second period, n is the number of at least one model, n is an integer greater than 1 or equal to 1, f i is the fee for the i-th model to process business in the first period (or the fee paid by the user for using the i-th model to process business in the first period), where i is an integer greater than 1 or equal to 1 and less than or equal to n.
[0105] Based on the same technical concept, Figure 3 A schematic diagram of the structure of a business processing device provided in an embodiment of the present application is exemplarily shown, and the device can execute the process of the above-mentioned business processing method.
[0106] like Figure 3 As shown, the device specifically includes:
[0107] An acquisition module 310 is used to acquire a business request, wherein the business request includes input data and a model identifier;
[0108] The processing module 320 is used to input the input data into the target model according to the model identifier to obtain the output data of the target model; determine a first complexity factor according to the attributes of the input data and the complexity of the target model, and determine a second complexity factor according to the attributes of the output data and the complexity of the target model; and perform billing processing on the service request according to the first complexity factor and the second complexity factor.
[0109] In a possible implementation, the input data includes at least one of the following data: video data, image data, audio data, and text data; the output data includes at least one of the following data: video data, image data, audio data, and text data; wherein the attributes of the video data and the image data are image width and image height, and the attributes of the audio data and the text data are field length.
[0110] In a possible implementation, the processing module 320 is specifically configured to:
[0111] A first fee for the target model to process the business request is calculated based on the number of tokens of the input data and the first complexity factor, and the number of tokens of the output data and the second complexity factor.
[0112] In a possible implementation, the processing module 320 is further configured to:
[0113] After calculating the first fee for the target model to process the business request, the charging currency type is determined according to the request address corresponding to the business request; when the charging currency type is determined to be inconsistent with the billing currency type corresponding to the target model, the second fee for the target model to process the business request is calculated based on the first fee and the exchange rate at the current moment.
[0114] In a possible implementation, the processing module 320 is further configured to:
[0115] The cost of processing business of the target model in the second time period is calculated based on the cost of processing business corresponding to at least one model in the first time period; wherein the first time period is the time period before the current moment, the second time period is the time period after the current moment, and the interval between the first time period and the second time period is the same.
[0116] In a possible implementation, the processing module 320 is further configured to:
[0117] The cost of processing the service of the target model is recorded according to a preset currency type, and the preset currency type corresponds to the billing currency type of the target model.
[0118] Based on the same technical concept, Figure 4 A system architecture applicable to an embodiment of the present application is exemplarily shown, the system architecture includes a server 400, the server 400 may include a processor 410, a communication interface 420 and a memory 430, and the server 400 is used to execute the above-mentioned business processing method.
[0119] The communication interface 420 is used to obtain traffic data, which includes but is not limited to historical travel orders and vehicle locations.
[0120] The processor 410 is the control center of the server 400, and uses various interfaces and routes to connect various parts of the entire server 400, and executes various functions and processes data of the server 400 by running or executing software programs and / or modules stored in the memory 430, and calling data stored in the memory 430. Optionally, the processor 410 may include one or more processing units.
[0121] The memory 430 can be used to store software programs and modules. The processor 410 executes various functional applications and data processing by running the software programs and modules stored in the memory 430. The memory 430 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to business processing, etc. In addition, the memory 430 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0122] It should be noted that the above Figure 4 The structure shown is only an example and is not limited to this embodiment of the present application.
[0123] Based on the same technical concept, the embodiment of the present application also provides a computer device, including:
[0124] A memory for storing program instructions;
[0125] The processor is used to call the program instructions stored in the memory and execute the above-mentioned business processing method according to the obtained program.
[0126] Based on the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned business processing method.
[0127] Based on the same technical concept, the embodiment of the present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the above-mentioned method for determining the degree of regional congestion.
[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0129] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A business processing method, characterized in that: include: Obtaining a business request, wherein the business request includes input data and a model identifier; According to the model identifier, inputting the input data into a target model to obtain output data of the target model; Determining a first complexity factor according to the attributes of the input data and the complexity of the target model, and determining a second complexity factor according to the attributes of the output data and the complexity of the target model; The service request is charged according to the first complexity factor and the second complexity factor.
2. The method according to claim 1, characterized in that The input data includes at least one of the following data: video data, image data, audio data, text data; The output data includes at least one of the following data: video data, image data, audio data, text data; The attributes of the video data and the image data are image width and image height, and the attributes of the audio data and the text data are field length.
3. The method according to claim 1, characterized in that The performing charging processing on the service request according to the first complexity factor and the second complexity factor includes: A first fee for the target model to process the business request is calculated based on the number of tokens of the input data and the first complexity factor, and the number of tokens of the output data and the second complexity factor.
4. The method according to claim 3, characterized in that After calculating the first cost of the target model processing the service request, the method further includes: Determine the charging currency type according to the request address corresponding to the service request; When it is determined that the charging currency type is inconsistent with the charging currency type corresponding to the target model, a second fee for the target model to process the service request is calculated according to the first fee and the current exchange rate.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The cost of processing business of the target model in the second time period is calculated based on the cost of processing business corresponding to at least one model in the first time period; wherein the first time period is the time period before the current moment, the second time period is the time period after the current moment, and the interval between the first time period and the second time period is the same.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The cost of processing the service of the target model is recorded according to a preset currency type, and the preset currency type corresponds to the billing currency type of the target model.
7. A service processing device, characterized in that: include: An acquisition module, used to acquire a business request, wherein the business request includes input data and a model identifier; A processing module, used for inputting the input data into a target model according to the model identifier to obtain output data of the target model; Determining a first complexity factor according to the attributes of the input data and the complexity of the target model, and determining a second complexity factor according to the attributes of the output data and the complexity of the target model; The service request is charged according to the first complexity factor and the second complexity factor.
8. A computer device, characterized in that: include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 6 according to the obtained program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises an executable program, which is executed by a processor to implement the method according to any one of claims 1 to 6.