Resource adjustment method, cloud computing resource adjustment method, and computing device
By adjusting computing resources according to the document content, the problem of fixed resource configuration in the document parsing service is solved, processing efficiency is improved, resource waste is avoided, and response stability is ensured.
Patent Information
- Application Number
- CN202410696684.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-05-31
AI Technical Summary
In the existing technology, the computing resource configuration in the document parsing service is fixed, resulting in low processing efficiency and waste of resources, and cannot adapt to the differences in the content of different documents.
Through the correlation between data volume and request response time, the expected response time is determined, and the computing resources of the data processing service are adjusted to achieve the target response time, thereby optimizing resource allocation.
It improves data processing efficiency, avoids waste of computing resources, and ensures response stability of data processing.
Smart Images

Figure CN118277104B
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular to a resource adjustment method, a cloud computing resource adjustment method, a computing device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of computer technology, computers can be used to process various data, and the requirements for data processing efficiency are becoming higher and higher.
[0003] For example, the client can transmit the document to be parsed to the server, and the server can use the document parsing service therein to perform intelligent parsing on the document. During the intelligent parsing process, the document parsing service can call some algorithm services (such as optical character recognition services) to process the document accordingly. Usually, the algorithm service called by the document parsing service is configured with fixed computing resources, and the contents of different documents to be processed vary greatly. In the process of processing the document using the algorithm service, low processing efficiency or waste of computing resources may occur.
[0004] Therefore, there is an urgent need for a solution to reasonably adjust the computing resources of algorithm services. Summary of the invention
[0005] In view of this, an embodiment of this specification provides a resource adjustment method, which can improve data processing efficiency, avoid waste of computing resources, and ensure the response stability of data processing. One or more embodiments of this specification also relate to a cloud computing resource adjustment method, a resource adjustment device, a computing device, a computer-readable storage medium, and a computer program product.
[0006] According to a first aspect of an embodiment of this specification, a resource adjustment method is provided, including:
[0007] For the task data, using the correlation between the data volume and the request response time, determine the expected response time of calling the data processing service to process the task data;
[0008] Based on the existing computing resources of the data processing service, determining a target response time for the data processing service to process the task data based on the existing computing resources;
[0009] Determine, based on the target response time, the expected response time and the existing computing resources, the target computing resources required for the data processing service to process the task data according to the expected response time;
[0010] The existing computing resources are adjusted based on the target computing resources.
[0011] According to a second aspect of an embodiment of this specification, a resource adjustment method is provided, including:
[0012] Obtaining a target task for the document to be parsed, wherein the target task includes a processing task for at least one data type among images, texts, and tables;
[0013] Based on the target task, identifying data of at least one data type in the document to be parsed;
[0014] For the document to be parsed, using the correlation between the data volume and the request response time, determine the expected response time of invoking the data processing service to process the data of the at least one data type in the document to be parsed;
[0015] Based on the existing computing resources of the data processing service, determining a target response time for the data processing service to process the data of the at least one data type based on the existing computing resources;
[0016] Determining, based on the target response time, the expected response time, and the existing computing resources, target computing resources required for the data processing service to process the data of the at least one data type according to the expected response time;
[0017] The existing computing resources are adjusted based on the target computing resources.
[0018] According to a third aspect of an embodiment of this specification, a cloud computing resource adjustment method is provided, which is applied to a cloud computing platform, and includes:
[0019] For the task data uploaded to the cloud computing platform, using the correlation between the data volume and the request response time, determine the expected response time of invoking the data processing service to process the task data;
[0020] Based on the existing cloud computing resources of the data processing service, determining a target response time for the data processing service to process the task data based on the existing cloud computing resources, wherein the cloud computing resources include a container service or a container deployment environment;
[0021] Determining, based on the target response time, the expected response time, and the existing cloud computing resources, target cloud computing resources required for the data processing service to process the task data according to the expected response time;
[0022] Based on the target cloud computing resources, a resource management application program interface is called by using a service orchestration tool to adjust the existing cloud computing resources.
[0023] According to a fourth aspect of the embodiments of this specification, there is provided a computing device, including: a memory and a processor;
[0024] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned resource adjustment method are implemented.
[0025] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, storing a computer program / instruction, which implements the steps of the above-mentioned resource adjustment method when executed by a processor.
[0026] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned resource adjustment method when the computer program / instruction is executed in a processor.
[0027] In one embodiment of the specification, for task data, based on its data volume, the expected response time required for calling the data processing service for processing is determined, and based on the existing computing resources corresponding to the data analysis service, the target response time for processing based on the existing computing resources is determined; based on the expected response time, the target response time and the existing computing resources, the target computing resources required for processing the task data with the expected response time are predicted, and then the computing resources of the data processing service are adjusted. Since there is a certain linear correlation between the request response time of the service and the amount of data processed, there will be a linear correlation with the required computing resources accordingly, so the required target computing resources can be determined more accurately according to the request response time, and then reasonable resource adjustments can be made to ensure that the data processing efficiency is kept stable for different data, and to avoid the waste of computing resources. In addition, actively adjusting the computing resources before processing the task data can keep the response time of the data processing relatively stable, ensure that the response stability of the data processing is high, and the data processing effect is better. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a simple flow chart for adjusting computing resources provided by the related technology;
[0029] Figure 2 is a flow chart of a resource adjustment method provided in an embodiment of this specification;
[0030] Figure 3 This is a simplified flow chart of resource adjustment provided in an embodiment of this specification;
[0031] Figure 4 This is another simplified flow chart of resource adjustment provided by an embodiment of this specification;
[0032] Figure 5 is a schematic diagram of a processing process for a PDF document provided in an embodiment of this specification;
[0033] Figure 6 is a flow chart of another resource adjustment method provided by an embodiment of this specification;
[0034] Figure 7 is a flow chart of a cloud computing resource adjustment method provided in an embodiment of this specification;
[0035] Figure 8 It is a structural diagram of a resource adjustment device provided in an embodiment of this specification;
[0036] Fig. 9 is a structural diagram of another resource adjustment device provided in an embodiment of this specification;
[0037] Fig.10 It is a structural diagram of a cloud computing resource adjustment device provided in an embodiment of this specification;
[0038] Fig.11 It is a structural block diagram of a computing device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0039] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0040] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0041] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0042] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0043] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, which usually contains hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than 10 trillion model parameters. A large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as a large-scale language model (LLM), a multi-modal pre-training model, etc.
[0044] When the large model is actually applied, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. The large model can be widely used in natural language processing (NLP), computer vision and other fields, and can be specifically applied to computer vision tasks such as visual question answering (VQA), image caption (IC), image generation, and text-based sentiment classification, text summary generation, machine translation and other natural language processing tasks. The main application scenarios of the large model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc. The models involved in the embodiments of this specification include but are not limited to the above-mentioned large models, and can be any type of machine learning model. For example, it can be an end-to-end seq2seq model, a convolutional neural network (CNN) model, a Transformer model, and the like.
[0045] At present, the requirements for data processing effects are getting higher and higher, and it is expected that the data processing efficiency is high and the waste of computing resources is avoided as much as possible. For example, the document parsing service can be directly called for intelligent parsing of the document. The intelligent parsing process usually involves multiple subdivided data processing processes. The document parsing service can call downstream data processing services (also called algorithm services) to implement the corresponding data processing process. For example, the data processing service can include optical character recognition (OCR) service or natural language processing (NLP) service. With the extensive research of deep learning models, many data can be processed using deep learning models to ensure high data processing efficiency. For example, the data processing service can correspond to at least one deep learning algorithm model. The document parsing service can be an intelligent document processing (IDP) service. The IDP process includes obtaining file content described by the same structure for different types of files, that is, structured output of file content; it also includes stripping the file content from the corresponding file object and exporting it to a specified system.
[0046] The application corresponding to the document parsing service can be installed on the user's device. The user can use this application to specify the document to be parsed and trigger the document parsing service to perform intelligent document parsing and obtain the document parsing results through dialogue. The document parsing service can be deployed on the server side, and the user device can connect to the server side based on the application corresponding to the installed document parsing service. Usually, the data processing service called by the document parsing service is configured with fixed computing resources, and the contents of different documents to be processed vary greatly. Therefore, the data processing service has low processing efficiency for documents with more content or more pages, and more computing resources are idle for documents with less content, resulting in poor overall data processing effect.
[0047] To address the problem of poor data processing performance, the computing resources of the data processing service can be adjusted through dynamic scaling (Auto Scaling). Dynamic scaling is usually used in cloud computing and cluster management, which means that the system can automatically adjust computing resources according to the current workload, such as increasing computing resources to cope with high loads, or reducing computing resources to save costs.
[0048] In the related art, the goal of data processing services is to meet a certain QPS (Queries Per Second), that is, to make the data processing services process a set number of requests per unit time, so as to passively scale computing resources for data processing services. This type of scaling is more suitable for services with a strong linear relationship between QPS and service performance, such as services for querying databases or services that use a function to calculate the return value for input values. For such services, the computing resources required (such as CPU, GPU, or memory, etc.) are basically linearly related to the number of input requests, and have little correlation with the content of the data to be processed.
[0049] For example, a service for data query can respond to a QPS of M when it has a fixed amount of resources N, and N and M have a linear relationship, M=k×N. The service can perform load monitoring to determine whether the load of its data processing reaches the set threshold, and scale resources when the threshold is reached. When the expected QPS required for the request actually processed by the service is M1, and M1>M, the service can determine that the load exceeds the set threshold during the load monitoring process, and then expand resources. The service can determine that the amount of resources required to achieve the expected QPS is N1=M1 / k. The service has a resource gap of N1-N. Accordingly, a certain amount of resources can be added based on the resource amount N according to the set resource expansion coefficient to ensure that the resource gap is filled, so as to achieve dynamic expansion of resources in combination with expected QPS and load monitoring.
[0050] Figure 1It is a simple flow chart for adjusting computing resources provided by related technologies. Figure 1 As shown, services can be based on the actual request they need to process (such as Figure 1 The expected QPS can be determined based on the actual amount of data in the service, and a target QPS that matches the relevant requirements of the service can be obtained based on the expected QPS, and then resources can be dynamically scaled based on the target QPS. The process of dynamically scaling resources can specifically be that the service adjusts resources multiple times according to a fixed resource scaling factor, and continuously monitors the load to determine whether to continue adjusting resources. When the service detects that the current load does not meet the set threshold, it continues to adjust resources according to the resource scaling factor until it detects that the load meets the set threshold, then the scaling is completed. During the dynamic scaling process, the actual QPS of the service may differ from the target QPS. After the dynamic scaling is completed, the actual QPS may be the same as the target QPS.
[0051] However, for scenarios where service performance and QPS do not have a strong linear relationship, such as scenarios where service performance is related to the amount of data to be processed by requests, this resource adjustment method is not applicable. For example, the amount of requests received by the service in the first time period and the second time period are M1 and M2 respectively, M2=2×M1, but the amount of data to be processed for each request in the first time period is twice the amount of data to be processed for each request in the second time period. In this way, the computing resources required by the service for the requests in the two time periods are the same, and it is inappropriate to expand the computing resources in the second time period according to the above scaling method. For example, OCR services and NLP services combined with multiple detection or recognition modules, bert model services based on transform structures and generative pre-trained transformer (GPT) model services, and services that process images or texts with different text densities and different text lengths are not suitable for using the above resource scaling method.
[0052] For services that are not suitable for the above resource scaling method, a related technology provides a coarse-grained relationship between QPS and computing power for the service through stress testing. However, the stress testing results are generally used with some auxiliary means to improve the data processing efficiency of the service and save resource utilization. It is still impossible to accurately evaluate the required amount of resources and the actual data processing capabilities of the service, and it is still impossible to ensure stable processing of different data, and the data processing effect is still not ideal. For the problem of different document pages in the document processing scenario, this method will further magnify the problem of differences in image text density and text length, making it impossible to accurately set the resource scaling factor, resulting in frequent scaling of resources or slow resource scaling of the service, affecting the data processing effect.
[0053] This specification provides a computing resource adjustment method, which can reasonably scale resources for data processing services related to service performance and the amount of data to be processed, thereby improving data processing effects. This computing resource adjustment method can be applied to a cloud computing platform, and the computing resources adjusted accordingly are cloud computing resources of the cloud computing platform. Based on this, this specification also provides a cloud computing resource adjustment method. This specification also relates to a resource adjustment device, a cloud computing resource adjustment device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0054] Figure 2 1 is a flow chart of a resource adjustment method provided in an embodiment of the present specification. The resource adjustment method can be applied to a resource adjustment device. The resource adjustment device is taken as a server as an example. Optionally, the resource adjustment device can also be a resource adjustable terminal device used by a user. Figure 2 As shown, the resource adjustment method specifically includes the following steps.
[0055] Step 202: For the task data, using the correlation between the data volume and the request response time, determine the expected response time for calling the data processing service to process the task data.
[0056] The resource adjustment device can execute some set tasks, such as executing data processing tasks. The resource adjustment device can have multiple data processing services, and the execution of the task to be executed can be supported by one or more data processing services. The resource adjustment device can call at least one data processing service related to the task to be executed to perform corresponding data processing, so as to determine the execution result of the task to be executed based on the processing results of each data processing service.
[0057] The resource adjustment device may also obtain the task data of the task to be performed, so as to perform the task to be performed according to the task data. Optionally, the resource adjustment device may obtain the task to be performed and the task data at the same time, or there may be a sequence in obtaining the task to be performed and the task data. For example, the task data and the task to be performed may be sent by the user device, or the user device may only send an identifier of the task data (such as a storage location), and the resource adjustment device may obtain the task data based on the identifier.
[0058] If the target application is installed on the user device, the resource adjustment device is the background server of the target application. The user can trigger the user device to start the target application and input a task execution instruction for the task data to the target application. The user device can use the target application to send the task data and information about the task to be executed to the resource adjustment device. Optionally, the user device can also only send the task data, and the resource adjustment device can execute the corresponding task by default for different types of task data.
[0059] In the embodiments of the present specification, after the resource adjustment device obtains the task data and before processing the task data, it can execute the resource adjustment method to adjust the computing resources of the data processing service required for data processing to an appropriate level, thereby ensuring high data processing efficiency, reducing idle computing resources, ensuring that the processing effect on the data fluctuates less, and enhancing the stability of the data processing effect.
[0060] The resource adjustment device may first execute step 202 to determine the data processing service that needs to be called for the task data, and determine the expected response time (RT, response time) for the data processing service to process the task data. The resource adjustment device may need to call multiple data processing services for the task data. The embodiment of this specification only takes one of the data processing services as an example, and the same resource adjustment method is executed for the other data processing services. There is a certain correlation between the request response time of the data processing service and the amount of data corresponding to the request, such as the response time is positively correlated with the amount of data processed, and the request response time refers to the time taken to process the request. For example, the correlation relationship has been generated, and the resource adjustment device can directly obtain the correlation relationship to determine the expected response time for the data processing service to process the task data based on the correlation relationship and the amount of task data.
[0061] Since the expected response time needs to be determined based on the data volume, the resource adjustment device may first determine the data volume of the task data. In some embodiments, different methods may be used to determine the data volume for different types of data, and the data volume determination method for each data type may be set in advance. For example, before step 202, the resource adjustment device may identify the target data type included in the task data, and then determine the data volume of the task data according to the data volume determination method corresponding to the target data type.
[0062] The target data type may refer to a data type for which a data volume determination method has been predetermined. The resource adjustment device may first identify, with respect to the task data, whether each data in the task data belongs to the target data type. For data belonging to the target data type, the data volume of the data is determined according to a set data volume determination method. Optionally, if there is data that does not belong to the target data type, the data volume may be determined according to a certain set default determination method, or it may be determined that the part of the data cannot be processed, and the data volume of the part of the data is not included in the data volume of the task data, and the part of the data may not be processed in the subsequent processing process.
[0063] For example, one target data type may be an image, and the pixel density, width, and height of the image may be quantified into data volume according to a certain conversion relationship. One target data type may be text, and the length of the text (such as the number of characters) may be quantified into data volume according to a certain conversion relationship. Another target data type may be a table, which may contain text and images, and the data volume of the table may be determined by combining the method for determining the data volume of the image and the method for determining the data volume of the text.
[0064] In some embodiments, the above association relationship is generated by the resource adjustment device itself, such as based on the historical task data processed by the data processing service and the corresponding response time. Accordingly, before step 202, the resource adjustment device can generate an association relationship between the data volume and the request response time based on the historical task data processed by the data processing service and the response time of the historical task data.
[0065] The resource adjustment device can count the amount of historical task data processed and the corresponding response time during the operation of the data processing service. The method for determining the amount of historical task data is the same as the method for determining the amount of actual task data to be processed. After counting a certain amount of data and the corresponding response time, a correlation relationship between the amount of data and the request response time can be generated based on the statistical information.
[0066] For example, the construction of the association relationship can be realized by using a heuristic algorithm or a linear regression function. In the case of using a heuristic algorithm, the resource adjustment device needs to adjust the association relationship based on the latest information at regular intervals, such as determining the association relationship required for the day based on the statistical information of the previous day (that is, the data volume and the corresponding request response time), so as to predict the expected response time for processing the task data on the day based on the association relationship. In the case of using a linear regression function, the resource adjustment device can determine a fixed association relationship based on statistical information within a fixed time period (such as the previous year), so as to determine the expected response time based on the association relationship thereafter.
[0067] In the embodiments of this specification, the above-mentioned association relationship is determined based on the historical task data based on the heuristic algorithm or the linear regression function, and there is no need to calculate separately for different data, and the request response time corresponding to different task data (such as pictures with different pixel densities or texts of different lengths) can be comprehensively determined. The request response time can characterize the service performance of the data processing service for the corresponding task data, which is equivalent to realizing the performance evaluation of the data processing service based on the obtained association relationship.
[0068] In some optional methods, after determining the request response time corresponding to the data volume of the task data based on the above-mentioned association relationship, it is possible to make certain adjustments based on the request response time based on the attributes of the data processing service to obtain the expected response time. For example, the response time supported by the data processing service must meet certain conditions, assuming that the response time should be an integer multiple of 0.1 seconds. The request response time (such as the auxiliary response time) directly determined based on the above-mentioned association relationship may not meet the condition, then the resource adjustment device may determine the value that meets the condition that is closest to the auxiliary response time as the expected response time. Optionally, the expected response time must also be less than the auxiliary response time. If the auxiliary response time determined based on the above-mentioned association relationship is 0.12 seconds, the resource adjustment device may determine the expected response time to be 0.1 seconds.
[0069] Step 204: Based on the existing computing resources of the data processing service, determine the target response time for the data processing service to process the task data based on the existing computing resources.
[0070] When the data processing method remains unchanged, the amount of data that can be processed by the data processing service using a unit amount of computing resources per unit time should be fixed, for example, the amount of data and the amount of computing resources can have a certain proportional relationship.
[0071] The resource adjustment device can obtain the existing computing resources of the data processing service, such as the existing computing resources can refer to all computing resources allocated to the data processing service for data processing, and the data processing service can call all its computing resources when performing data processing. The resource adjustment device can determine the amount of data that the data processing service can process based on the existing computing resources in a unit time based on the proportional relationship, such as the unit data amount. Based on the unit data amount and the data amount of the task data, such as dividing the data amount of the task data by the unit data amount, the number of unit times required for the data processing service to process the task data based on the existing computing resources can be determined, and then the total processing time for the task data can be determined, that is, the target response time.
[0072] Step 206: Based on the target response time, the expected response time and the existing computing resources, determine the target computing resources required for the data processing service to process the task data according to the expected response time.
[0073] For the same amount of data, there is a fixed relationship between the ratio of the response time of two processings of the data processing service and the ratio of the computing resources used for the two processings. The response time is negatively correlated with the amount of computing resources, and the ratio of the response time of two processings can be equal to the inverse of the ratio of the computing resources used for the two processings. If the target response time required for the data processing service to process the task data based on the existing computing resources N is T, and the expected response time for processing the task data based on the target computing resources N1 is T1, then N / N1=T1 / T, so N1=N×T / T1. Based on this relationship, the target computing resources required for the data processing service to process the task data based on the expected response time can be determined.
[0074] In the embodiments of this specification, it is equivalent to multiplying the existing computing resources by the expansion coefficient T / T1 to expand and contract the computing resources. The expansion coefficient will change based on the different data volumes of the task data, which is equivalent to expanding and contracting the computing resources based on a dynamic expansion coefficient, which can improve the flexibility and adaptability of the expansion and contraction of the computing resources. In the case where the target response time corresponding to the task data is large, the actual load of the data processing service will become higher. In this case, the expansion coefficient will be higher, making the expansion and contraction of the computing resources more aggressive. In the case where the target response time is short or steadily decreasing, the actual load of the data processing service is low. In this case, the expansion coefficient can be reduced, making the expansion and contraction of the computing resources more conservative.
[0075] The above determination method does not take into account the computing resources required for other actions other than the data processing action. Some necessary auxiliary actions need to be performed during the data processing of the data processing service, and accordingly there will be some fixed time consumption. In the process of determining the target computing resources in the embodiment of this specification, the fixed time consumption can be considered to more accurately determine the target computing resources. Accordingly, step 206 may include the following steps:
[0076] Step s2: determine the response time offset caused by the data processing service performing auxiliary actions related to data processing during the data processing process.
[0077] The resource adjustment device can determine the auxiliary actions that must be performed in the data processing process, such as network communication actions, data transmission actions, etc., based on the historical data processing process of the data processing service, and determine the time consumption of each auxiliary action in the fixed-duration data processing process. The resource adjustment device can determine the total time consumption of each auxiliary action in the target response time as the response time offset.
[0078] Step s4: Based on the target response time and the response time offset, determine the actual response time of the data processing service to perform the data processing action.
[0079] For example, the resource adjustment device may subtract the response time offset from the target response time to obtain the actual response time of the data processing service performing the data processing action on the task data.
[0080] Step s6: Based on the actual response time, the expected response time and the existing computing resources, determine the target computing resources required for the data processing service to process the task data according to the expected response time.
[0081] For a fixed amount of data, a more accurate relationship between response time and computing resources should be that the response time of the data processing service to perform a data processing action is in a certain linear relationship with the computing resources required for the action. Therefore, the target computing resources can be determined based on the actual response time determined in step s4 instead of the target response time described in step 206. Please refer to the above introduction for the method of determining the target computing resources. If the time offset is T0, the target computing resource amount N1=N×(T-T0) / T1.
[0082] In an optional implementation, the resource adjustment device can determine the auxiliary computing resources required for the auxiliary action, and based on the auxiliary computing resources and the existing computing resources, determine the actual computing resources corresponding to the data analysis action in the existing computing resources. Based on the actual response time, the expected response time and the actual computing resources, determine the target computing resources required for the data processing service to process the task data according to the expected response time. If the auxiliary computing resource is N0, then the target computing resource amount N1=N0+(N-N0)×(T-T0) / T1.
[0083] Step 208: Adjust the existing computing resources based on the target computing resources.
[0084] After determining the target computing resources required by the data processing service to process the task data, the resource adjustment device can determine whether the existing computing resources are equal to the target computing resources. If the existing computing resources are not equal to the target computing resources, the existing computing resources can be adjusted to be equal to the target computing resources.
[0085] Optionally, when the existing computing resources are less than the target computing resources, adjustments can be made, and when they are more than the target computing resources, no adjustments can be made, so as to ensure computing resource redundancy, improve data processing efficiency, and reduce resource adjustment frequency. When the existing computing resources are less than the target computing resources, the resource adjustment device can also determine whether the difference between the target computing resources and the existing computing resources is greater than a set threshold, and adjust the existing computing resources if it is greater than the threshold, so that the difference is less than or equal to the set threshold. In this way, the difference between the actual computing resources and the required computing resources is ensured to be small, the response time fluctuation of different data processing processes is ensured to be small, and the stability of the data processing effect is ensured.
[0086] In some embodiments, the resource adjustment device can adjust the existing computing resources based on the target computing resources, and adjust the computing resources of the data processing service to be greater than the target computing resources. This can ensure that the expected response time is obtained for the task data, and can also ensure computing resource redundancy, thereby improving data processing efficiency and reducing the frequency of resource adjustment.
[0087] In some optional ways, the resource adjustment device may also directly determine the target computing resource amount required for the data processing service to process the task data according to the expected response time based on the expected response time and the data amount of the task data, and then directly adjust the computing resources based on the target computing resource amount. In this way, the above step 204 may not be performed. For example, the resource amount of the existing computing resources may be adjusted to the target computing resource amount, or may be adjusted to a resource amount that is greater than the target computing resource amount.
[0088] In a fixed time, there is a positive linear relationship between the computing resources of the data processing service and the amount of data that can be processed. In the case of a fixed amount of data, there is a negative linear relationship between the response time of the data processing service for the processed data and the computing resources. Based on this, we can get the amount of computing resources required by the data processing service to process any amount of data according to any response time, and accordingly, we can get the target amount of computing resources required to process the task data according to the expected response time.
[0089] In some embodiments, the amount of computing resources of the data processing service is reflected by the actual number of resources, which may refer to the number of physical machines, the number of virtual machines, the number of container services, or the number of container deployment environments. The number of resources must be an integer. Accordingly, step 206 may include: determining the target number of computing resources required for the data processing service to process the task data according to the expected response time based on the target response time, the expected response time, and the number of resources of the existing computing resources. Accordingly, in step 208, the existing computing resources are adjusted based on the target computing resources, including: based on the target number, increasing or decreasing computing resources on the basis of the existing computing resources, and adjusting the existing computing resources. For example, N and N1 both refer to the number of machines, taking N1=N×(T-T0) / T1 as an example, in this embodiment, N1=roundup(N×(T-T0) / T1), and roundup refers to rounding up. The target number of computing resources is the N1. The resource adjustment device may increase or decrease the number of machines corresponding to the data processing service based on the target number, such as adjusting the number of machines to the target number, or adjusting it to more than the target number.
[0090] In the embodiments of the present specification, the resource adjustment device actively scales up or down computing resources for data processing services based on the task data to be processed, thereby ensuring a stable response of the overall data processing process and improving the data processing effect.
[0091] In some embodiments, after adjusting the existing computing resources based on the target computing resources in step 208, the resource adjustment device may also monitor the request response time of the data processing service; when the monitored request response time exceeds the target time range, the computing resources of the data processing service are adjusted.
[0092] A target time range that the response time must meet can be pre-set for the data processing service. Optionally, the target time range can be updated periodically. The resource adjustment device can continuously monitor the actual request response time of the data processing service, and determine whether the request response time exceeds the target time range. In the case of exceeding the target time range, it is determined that the current request response time does not meet the requirements, and the computing resources of the data processing service need to be adjusted accordingly to restore the request response time to the target time range. In this way, on the basis of actively scaling the computing resources of the data processing service based on the task data, further safeguards can be added to ensure the stability of the response time of the data processing service.
[0093] In the embodiments of this specification, based on the monitoring of the request response time, the frequency of active scaling of the computing resources of the data processing service can be relatively low. The active scaling based on the monitoring has little impact on the operation of the data processing service.
[0094] In some embodiments, during the execution of the above-mentioned resource adjustment method, the resource adjustment device may also control the data processing service and monitor the load of the data processing service; when the load of the data processing service exceeds the target load range, the computing resources of the data processing service are adjusted.
[0095] For data processing services, a target load range that the load of the data processing service must meet can be pre-set. For example, the target load range can be expressed by the occupancy rate of computing resources. The resource adjustment device can continuously monitor the current load situation of the data processing service and determine whether it exceeds the target load range. In the case of exceeding the target load range, it is determined that the current amount of computing resources does not meet the requirements, and the computing resources of the data processing service need to be adjusted accordingly to restore the load to the target load range. In this way, on the basis of actively expanding and contracting the computing resources of the data processing service based on the task data, safeguards can be further added to adjust the computing resources to ensure a stable response time for the data processing service.
[0096] The resource adjustment method provided in the embodiment of this specification can be executed by the target service in the resource adjustment device, and the target service can be an upstream service of the data processing service. In the process of implementing data processing by the target service, the downstream data processing service can be called to use the data processing service to perform some subdivided data processing on the task data to be processed. The resource adjustment method provided in the embodiment of this specification can be executed by the target service, or it can also be executed by the data processing service.
[0097] Figure 3 This is a simplified flowchart of resource adjustment provided in an embodiment of this specification, which shows the resource adjustment process executed by the target service. Figure 4 This is another simplified flowchart of resource adjustment provided in an embodiment of the present specification, which shows the resource adjustment process executed by the data processing service. Figure 3 The process before "dynamic scaling" is performed by the target service, and the actions of "dynamic scaling" and "load monitoring" can be performed by the data processing service. Figure 3 As shown, the target service can determine the expected auxiliary response time required for the data processing service based on the amount of task data to be processed (that is, the actual amount of data in the figure), that is, Figure 3 The target service can obtain the expected response time based on the auxiliary RT based on the attributes of the data processing service, that is, Figure 3 Based on the expected response time, the data processing service can dynamically scale computing resources to obtain the actual RT, and the data processing service can also monitor its load. The target service can also monitor the response time. Figure 4 All actions in the , including determination of target RT, "dynamic scaling", "load monitoring" and "RT monitoring", can be performed by the data processing service.
[0098] In some embodiments, the resource adjustment method provided in the embodiments of this specification can be used in a document parsing scenario. The method can be applied to a document parsing service in a resource adjustment device, and the document parsing service is the aforementioned target service. Optionally, the document parsing service can correspond to an application with a document parsing function installed in a user device. Accordingly, the aforementioned task data can be a document to be parsed, and the above step 202 includes: for the document to be parsed, using the correlation between the data volume and the request response time, determining the expected response time of calling a data processing service to process the document to be parsed, wherein the data processing service includes an optical character recognition OCR service or a natural language processing NLP service.
[0099] Figure 5 This is a schematic diagram of a processing process for a PDF document provided in an embodiment of this specification. For documents in other formats, you can refer to Figure 5The process is as shown. Figure 5 As shown, the OCR algorithm service can be used to process data for each page in the document, and different types of data can be processed differently using the OCR algorithm service. For example, images can be detected or recognized, text can be recognized, and tables can be detected. After that, the information of each page obtained after processing the PDF document using the OCR algorithm service can be aggregated and then input into the NLP algorithm service for corresponding processing. For example, the NLP algorithm service can merge across pages, determine the hierarchical tree, process the semantic layout, and obtain the key-value (KV) information of tables or paragraphs based on the input information.
[0100] The resource adjustment method provided in the embodiments of this specification is targeted at a data processing service that may have uncertainty about the resources required for processing a single piece of data, and the correlation between QPS and resource quantity cannot be obtained through traditional stress testing methods. In addition, for a data processing service, there can be one and only one target service for associated calls. In this way, it can be ensured that the target service can obtain the correlation between the data volume and the request response time through linear or nonlinear regression based on the information in its historical call process to the data processing service, and then determine the required resource quantity based on the correlation relationship, which can ensure accurate prediction of the required resource quantity.
[0101] Taking the simplification of services that need to be called by the IDP service as an example, the IDP service can call the OCR algorithm service and the NLP algorithm service. Among them, for the processing of image data, the density of the image text affects the number of calculations required by the detection or recognition module (such as the OCR algorithm service), resulting in the response time of a single request being affected by the actual image content; for text processing services (such as the NLP algorithm service), the text length affects the actual response time for processes such as paragraph merging and hierarchical tree relationship calculation. The OCR algorithm service and the NLP algorithm service are both integrated in the IDP in an independent manner, and there is a one-to-one calling relationship between them and the IDP service. Therefore, the OCR algorithm service and the NLP algorithm service are both data processing services, and the IDP service can be a target service.
[0102] The embodiments of this specification only take the case of processing documents, where the corresponding data processing service is an algorithm service called by a document parsing service as an example. The target service can also call other corresponding services for data processing on other task data. For example, the task data can also be video data, and the corresponding data processing service is a video processing service.
[0103] Optionally, in the embodiments of this specification, the processing capacity of the data processing service may be evaluated based on the correlation between the data volume and the request response time, and the data processing service may be optimized based on the evaluation results.
[0104] In the embodiments of this specification, the linear correlation between the amount of resources and the request response time can be used to strengthen the reference amount based on the dynamic expansion process. The resource adjustment device uses the target service to actively expand and shrink, and can pre-estimate the amount of resources required for the algorithm service relied on in the IDP document processing process to ensure the data processing stability of the algorithm service. In addition to adjusting resources for data processing services where QPS is non-linearly related to service performance, the resource adjustment method can also be compatible with data processing services where QPS is linearly related to service performance.
[0105] In the embodiments of this specification, for data processing services, on the basis of dynamic scaling of computing resources based on load monitoring, the request response time can be evaluated at the target service that calls the data processing service, and the response time can be used as the response standard of the entire service. Based on this, a suitable active scaling adjustment model can be established, so that in the system where the data processing service with nonlinear response characteristics is located, the expected data processing time can be determined, and the expected active scaling of computing resources can be performed, so that the scaling of computing resources of the service is more flexible.
[0106] In summary, in the resource adjustment method provided by the embodiment of this specification, for task data, based on its data volume, the expected response time required for calling the data processing service for processing is determined, and based on the existing computing resources corresponding to the data analysis service, the target response time for processing based on the existing computing resources is determined; based on the expected response time, the target response time and the existing computing resources, the target computing resources required for processing the task data with the expected response time are predicted, and then the computing resources of the data processing service are adjusted. Since there is a certain linear correlation between the request response time of the service and the amount of data processed, there will be a linear correlation with the required computing resources accordingly, so the required target computing resources can be determined more accurately according to the request response time, and then reasonable resource adjustment can be performed to ensure that the data processing efficiency is kept stable for different data, and to avoid the waste of computing resources. In addition, actively adjusting the computing resources before processing the task data can keep the response time of the data processing relatively stable, ensure that the response stability of the data processing is high, and the data processing effect is better.
[0107] Figure 6 is a flow chart of another resource adjustment method provided in an embodiment of this specification. Figure 6Taking the resource adjustment method applied to the document parsing scenario as an example, the task data may be the document to be parsed. Figure 6 As shown, the resource adjustment method includes:
[0108] Step 602: Obtain a target task for the document to be parsed, wherein the target task includes a processing task for at least one data type among images, texts, and tables.
[0109] In the embodiments of the present specification, the document to be parsed may include multiple types of data, and the resource adjustment device may be instructed to process a specific type of data in the document to be parsed. For example, the specific type of data may be any one or more of a picture, text, and table in the document. The target task may be specified by a user device that is communicatively connected to the resource adjustment device, such as when the user sends the document to be parsed to the resource adjustment device using the user device, the information of the target task is also sent.
[0110] Optionally, the resource adjustment device may process all data in the document to be parsed. In this case, the target task may not be sent to the resource adjustment device. After obtaining the document to be parsed, the resource adjustment device may process all data therein by default.
[0111] Step 604: Based on the target task, identify data of the at least one data type in the document to be parsed.
[0112] After acquiring the target task, the resource adjustment device can identify the data of the at least one data type in all the data of the document to be parsed based on the at least one data type indicated by the target task. Subsequently, only the identified data of this type can be processed. For example, if the data type indicated by the target task only includes pictures, the resource adjustment device can call the OCR algorithm service to perform only picture recognition for the document to be parsed.
[0113] Step 606: for the document to be parsed, using the correlation between the data volume and the request response time, determine the expected response time for calling the data processing service to process the data of the at least one data type in the document to be parsed.
[0114] Step 608: Based on the existing computing resources of the data processing service, determine the target response time for the data processing service to process the data of the at least one data type based on the existing computing resources.
[0115] Step 610: Based on the target response time, the expected response time and the existing computing resources, determine the target computing resources required for the data processing service to process the data of the at least one data type according to the expected response time.
[0116] Step 612: Adjust the existing computing resources based on the target computing resources.
[0117] Figure 6 For the specific implementation of the resource adjustment method shown, please refer to the above Figures 2 to 5 The relevant introduction in the resource adjustment method shown is not repeated here.
[0118] The resource adjustment method provided in the embodiments of this specification can be applied to a cloud computing platform, and the execution process in this scenario is introduced below. Figure 7 1 is a flow chart of a cloud computing resource adjustment method provided in an embodiment of this specification, and the method is applied to a cloud computing platform. Figure 7 As shown, the cloud computing resource adjustment method may include the following steps:
[0119] Step 702: for the task data uploaded to the cloud computing platform, the expected response time of invoking the data processing service to process the task data is determined by using the correlation between the data volume and the request response time.
[0120] The task data acquired by the cloud computing platform can be uploaded by the user device connected to the cloud computing platform. For example, the user device can call the interface of the cloud computing platform to upload the task data that needs to be processed by the cloud computing platform. The cloud computing platform can call the corresponding data processing service for different task data to process.
[0121] Step 704: Based on the existing cloud computing resources of the data processing service, determine the target response time for the data processing service to process the task data based on the existing cloud computing resources, wherein the cloud computing resources include a container service or a container deployment environment.
[0122] The data processing service in the cloud computing platform can be allocated certain cloud computing resources, which may include server resources. Server resources may include container services or container deployment environments, such as ACK on the cloud, and the container deployment environment may be a self-built k8s cluster. Both ACK on the cloud and the k8s cluster may have an application programming interface (API) that can control resource expansion and contraction, and the service orchestration tool (such as k8s) may be used to call the API to expand and contract cloud computing resources.
[0123] Step 706: Based on the target response time, the expected response time and the existing cloud computing resources, determine the target cloud computing resources required for the data processing service to process the task data according to the expected response time.
[0124] Step 708: Based on the target cloud computing resources, the service orchestration tool is used to call the resource management application program interface to adjust the existing cloud computing resources.
[0125] Figure 7 The specific implementation of the cloud computing resource adjustment method shown in FIG. Figures 2 to 5 The relevant introduction in the resource adjustment method shown is not repeated here.
[0126] With Figure 2 Corresponding to the resource adjustment method embodiment, this specification also provides a resource adjustment device embodiment. Figure 8 Schematic diagram of a resource adjustment device provided in an embodiment of this specification. Figure 8 As shown, the resource adjustment device includes:
[0127] The first determination module 802 is used to determine the expected response time of invoking the data processing service to process the task data by using the correlation relationship between the data volume and the request response time for the task data;
[0128] A second determination module 804 is used to determine, based on the existing computing resources of the data processing service, a target response time for the data processing service to process the task data based on the existing computing resources;
[0129] The third determination module 806 is used to determine the target computing resources required for the data processing service to process the task data according to the expected response time based on the target response time, the expected response time and the existing computing resources;
[0130] The first adjustment module 808 is used to adjust the existing computing resources based on the target computing resources.
[0131] Optionally, the third determining module 806 is used to:
[0132] Determine the response time offset caused by the data processing service performing auxiliary actions related to data processing during the data processing process;
[0133] Determine the actual response time of the data processing service to perform the data processing action based on the target response time and the response time offset;
[0134] Based on the actual response time, expected response time and existing computing resources, determine the target computing resources required for the data processing service to process the task data according to the expected response time.
[0135] Optionally, the third determining module 806 is used to:
[0136] Based on the target response time, expected response time and the number of existing computing resources, determine the target number of computing resources required for the data processing service to process the task data according to the expected response time;
[0137] Adjust existing computing resources based on target computing resources, including:
[0138] Based on the target number, increase or decrease computing resources on the basis of existing computing resources, and adjust the existing computing resources.
[0139] Optionally, the first adjustment module 808 is used to:
[0140] The existing computing resources are adjusted based on the target computing resources, and the computing resources of the data processing service are adjusted to be greater than the target computing resources.
[0141] Optionally, the resource adjustment device provided in the embodiment of this specification further includes:
[0142] an identification module, for identifying a target data type included in the task data before determining an expected response time for invoking a data processing service to process the task data by using a correlation between the data volume and the request response time for the task data;
[0143] The fourth determination module is used to determine the data volume of the task data according to the data volume determination method corresponding to the target data type.
[0144] Optionally, the resource adjustment device provided in the embodiment of this specification further includes:
[0145] The relationship generation module is used to generate a correlation relationship between data volume and request response time based on historical task data processed by the data processing service and the response time of the historical task data before determining the expected response time for calling the data processing service to process the task data by utilizing the correlation relationship between data volume and request response time.
[0146] Optionally, the resource adjustment device provided in the embodiment of this specification further includes:
[0147] A first monitoring module, configured to monitor the request response time of the data processing service after adjusting the existing computing resources based on the target computing resources;
[0148] The second adjustment module is used to adjust the computing resources of the data processing service when the monitored request response time exceeds the target time range.
[0149] Optionally, the resource adjustment device provided in the embodiment of this specification further includes:
[0150] A second monitoring module is used to control the data processing service and monitor the load of the data processing service;
[0151] The third adjustment module is used to adjust the computing resources of the data processing service when the load of the data processing service exceeds the target load range.
[0152] Optionally, the resource adjustment device provided in the embodiment of this specification is applied to a document parsing service, and the first determination module 802 is used to:
[0153] For the document to be parsed, the correlation between the data volume and the request response time is used to determine the expected response time of calling the data processing service to process the document to be parsed, wherein the data processing service includes an optical character recognition service or a natural language processing service.
[0154] In summary, in the resource adjustment device provided by the embodiment of this specification, the first determination module determines the expected response time required for calling the data processing service for processing based on the data volume of the task data, and the second determination module determines the target response time required for processing based on the existing computing resources corresponding to the data analysis service; the third determination module predicts the target computing resources required for processing the task data with the expected response time based on the expected response time, the target response time and the existing computing resources, and then the first adjustment module adjusts the computing resources of the data processing service. Since the request response time of the service has a certain linear correlation with the amount of data processed, it will also have a linear correlation with the required computing resources accordingly. Therefore, according to the request response time, the required target computing resources can be determined more accurately, and then reasonable resource adjustment can be performed to ensure that the data processing efficiency is kept stable for different data, and to avoid the waste of computing resources. In addition, actively adjusting the computing resources before processing the task data can keep the response time of the data processing relatively stable, ensure that the response stability of the data processing is high, and the data processing effect is better.
[0155] With Figure 6 Corresponding to the resource adjustment method embodiment, this specification also provides another resource adjustment device embodiment. Fig. 9 FIG. 1 is a schematic diagram of the structure of another resource adjustment device provided in an embodiment of this specification. Fig. 9 As shown, the resource adjustment device includes:
[0156] An acquisition module 902 is used to acquire a target task for the document to be parsed, wherein the target task includes a processing task for at least one data type among images, texts and tables;
[0157] An identification module 904, configured to identify data of the at least one data type in the document to be parsed based on the target task;
[0158] A first determination module 906 is used to determine, for the document to be parsed, an expected response time for invoking a data processing service to process data of at least one data type in the document to be parsed, using a correlation between data volume and request response time;
[0159] A second determination module 908 is used to determine, based on the existing computing resources of the data processing service, a target response time for the data processing service to process the data of the at least one data type based on the existing computing resources;
[0160] The third determination module 910 is used to determine the target computing resources required for the data processing service to process the data of the at least one data type according to the expected response time based on the target response time, the expected response time and the existing computing resources;
[0161] The adjustment module 912 is used to adjust the existing computing resources based on the target computing resources.
[0162] With Figure 7 Corresponding to the resource adjustment method embodiment, this specification also provides a cloud computing resource adjustment device embodiment. Fig.10 1 is a schematic diagram of a cloud computing resource adjustment device provided in an embodiment of the present specification, and the device is applied to a cloud computing platform. Fig.10 As shown, the cloud computing resource adjustment device includes:
[0163] The first determination module 1002 is used to determine the expected response time of invoking the data processing service to process the task data uploaded to the cloud computing platform by using the correlation between the data volume and the request response time;
[0164] A second determination module 1004 is used to determine a target response time for the data processing service to process the task data based on the existing cloud computing resources of the data processing service, wherein the cloud computing resources include a container service or a container deployment environment;
[0165] The third determination module 1006 is used to determine the target cloud computing resources required for the data processing service to process the task data according to the expected response time based on the target response time, the expected response time and the existing cloud computing resources;
[0166] The adjustment module 1008 is used to adjust the existing cloud computing resources based on the target cloud computing resources by using the service orchestration tool to call the resource management application program interface.
[0167] The above is a schematic scheme of the resource adjustment device of this embodiment. It should be noted that the technical scheme of the resource adjustment device and the technical scheme of the corresponding resource adjustment method above belong to the same concept, and the details not described in detail in the technical scheme of the resource adjustment device can be referred to the description of the technical scheme of the resource adjustment method above.
[0168] Fig.1111 is a block diagram of a computing device provided in an embodiment of the present specification. The components of the computing device 1100 include but are not limited to a memory 1110 and a processor 1120. The processor 1120 is connected to the memory 1110 via a bus 1130, and the database 1150 is used to store data.
[0169] The computing device 1100 also includes an access device 1140 that enables the computing device 1100 to communicate via one or more networks 1160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0170] In one embodiment of the present specification, the above components of the computing device 1100 and Fig.11 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.11 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0171] The computing device 1100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1100 may also be a mobile or stationary server.
[0172] The processor 1120 is used to execute a computer program / instruction, and the computer program / instruction implements the above-mentioned resource adjustment method when executed by the processor.
[0173] As for the computing device embodiment, since it is basically similar to the resource adjustment method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the resource adjustment method embodiment.
[0174] One embodiment of the present specification also provides a computer-readable storage medium, which stores a computer program / instruction, and the steps of the above-mentioned resource adjustment method are implemented when the computer instruction is executed by the processor. The computer program / instruction includes a computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electric carrier signals and telecommunication signals.
[0175] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned resource adjustment method when the computer program / instruction is executed in a processor.
[0176] As for the computer-readable storage medium embodiment and the computer program product embodiment, since they are basically similar to the resource adjustment method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the resource adjustment method embodiment.
[0177] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0178] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0179] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0180] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A resource adjustment method, comprising: For the task data, using the correlation between the data volume and the request response time, determine the expected response time of calling the data processing service to process the task data; Based on the existing computing resources of the data processing service, determining a target response time for the data processing service to process the task data based on the existing computing resources; Determine the response time offset caused by the data processing service performing auxiliary actions related to data processing during the data processing process; Determining an actual response time of the data processing service performing the data processing action based on a difference between the target response time and the response time offset; Based on the ratio of the actual response time to the expected response time and the existing computing resources, determining the target computing resources required for the data processing service to process the task data according to the expected response time; The existing computing resources are adjusted based on the target computing resources.
2. The method according to claim 1, wherein determining, based on the ratio of the actual response time to the expected response time and the existing computing resources, the target computing resources required for the data processing service to process the task data according to the expected response time comprises: Determine, based on the ratio of the actual response time to the expected response time and the number of existing computing resources, a target number of computing resources required for the data processing service to process the task data according to the expected response time; The adjusting the existing computing resources based on the target computing resources includes: Based on the target quantity, computing resources are increased or decreased on the basis of the existing computing resources, and the existing computing resources are adjusted.
3. The method according to claim 1, wherein adjusting the existing computing resources based on the target computing resources comprises: The existing computing resources are adjusted based on the target computing resources, and the computing resources of the data processing service are adjusted to be greater than the target computing resources.
4. The method according to any one of claims 1 to 3, before determining the expected response time of invoking a data processing service to process the task data by using the correlation between the data volume and the request response time for the task data, further comprising: Identify the target data type contained in the task data; The data volume of the task data is determined according to the data volume determination method corresponding to the target data type.
5. The method according to any one of claims 1 to 3, before determining the expected response time of invoking a data processing service to process the task data by using the correlation between the data volume and the request response time for the task data, further comprising: Based on the historical task data processed by the data processing service and the response time of the historical task data, a correlation relationship between the data volume and the request response time is generated.
6. The method according to any one of claims 1 to 3, after adjusting the existing computing resources based on the target computing resources, further comprising: Monitoring the request response time of the data processing service; When the monitored request response duration exceeds the target duration range, the computing resources of the data processing service are adjusted.
7. The method according to any one of claims 1 to 3, further comprising: controlling the data processing service and monitoring the load of the data processing service; When the load of the data processing service exceeds a target load range, computing resources of the data processing service are adjusted.
8. The method according to any one of claims 1 to 3, applied to a document parsing service, wherein for task data, the expected response time of invoking a data processing service to process the task data is determined by utilizing the correlation between the data volume and the request response time, comprising: For the document to be parsed, the expected response time of calling a data processing service to process the document to be parsed is determined by utilizing the correlation between the data volume and the request response time, wherein the data processing service includes an optical character recognition service or a natural language processing service.
9. A resource adjustment method, comprising: Obtaining a target task for the document to be parsed, wherein the target task includes a processing task for at least one data type among images, texts, and tables; Based on the target task, identifying data of at least one data type in the document to be parsed; For the document to be parsed, using the correlation between the data volume and the request response time, determine the expected response time of invoking the data processing service to process the data of the at least one data type in the document to be parsed; Based on the existing computing resources of the data processing service, determining a target response time for the data processing service to process the data of the at least one data type based on the existing computing resources; Determine the response time offset caused by the data processing service performing auxiliary actions related to data processing during the data processing process; Determining an actual response time of the data processing service performing the data processing action based on a difference between the target response time and the response time offset; Determining, based on the ratio of the actual response time to the expected response time and the existing computing resources, target computing resources required for the data processing service to process the data of the at least one data type according to the expected response time; The existing computing resources are adjusted based on the target computing resources.
10. A cloud computing resource adjustment method, applied to a cloud computing platform, comprising: For the task data uploaded to the cloud computing platform, using the correlation between the data volume and the request response time, determine the expected response time of invoking the data processing service to process the task data; Based on the existing cloud computing resources of the data processing service, determining a target response time for the data processing service to process the task data based on the existing cloud computing resources, wherein the cloud computing resources include a container service or a container deployment environment; Determine the response time offset caused by the data processing service performing auxiliary actions related to data processing during the data processing process; Determining an actual response time of the data processing service performing the data processing action based on a difference between the target response time and the response time offset; Determining, based on the ratio of the actual response time to the expected response time and the existing cloud computing resources, target cloud computing resources required for the data processing service to process the task data according to the expected response time; Based on the target cloud computing resources, a resource management application program interface is called by using a service orchestration tool to adjust the existing cloud computing resources.
11. A computing device comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 10 are implemented.
12. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10.
13. A computer program product, comprising a computer program / instructions, which implement the steps of the method according to any one of claims 1 to 10 when the computer program / instructions are executed in a processor.
