WO2016197853A1 - 一种基于复杂度的业务处理方法和装置 - Google Patents
一种基于复杂度的业务处理方法和装置 Download PDFInfo
- Publication number
- WO2016197853A1 WO2016197853A1 PCT/CN2016/084443 CN2016084443W WO2016197853A1 WO 2016197853 A1 WO2016197853 A1 WO 2016197853A1 CN 2016084443 W CN2016084443 W CN 2016084443W WO 2016197853 A1 WO2016197853 A1 WO 2016197853A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- complexity
- kernel
- task program
- execution
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
Definitions
- the present application relates to the field of computer processing technologies, and in particular, to a complexity-based service processing method and a complexity-based service processing apparatus.
- the computing tasks on various cloud computing platforms have a tendency to blow out.
- the computing tasks are measured by complexity.
- complexity is typically calculated by matching keywords in the SQL (Structured Query Language) syntax. Specifically, based on setting an initial complexity, when a keyword is matched, the corresponding complexity weight is multiplied.
- SQL Structured Query Language
- the above-mentioned complexity calculation method can only measure the complexity of the task of applying the SQL statement, and has low practicability, and cannot calculate a large number of non-application SQL such as Map/Reduce, MPI (Message Passing Interface), graph, etc. in the cluster.
- the complexity of the task of the statement; and, the weight of the complexity is calculated based on the empirical value, and the calculation accuracy is low. Further, the efficiency of business processing based on complexity is made low.
- embodiments of the present application have been made in order to provide an overcoming of the above problems or at least partially A complexity-based business processing method and a corresponding complexity-based business processing apparatus that solve the above problems.
- a complexity-based business processing method including:
- determining one or more pieces of kernel information corresponding to one or more kernels executing the task program are:
- One or more pieces of kernel information corresponding to one or more cores executing the task program are read from the log information.
- the step of calculating one or more running times of the one or more kernel information one-to-one correspondence comprises:
- a difference between the one or more start times and the one or more end times is calculated to obtain one or more runtimes.
- the complexity is measured by the computational power that a core can run at full load for a standard time.
- the step of calculating the complexity according to the one or more kernel information and one-to-one correspondence one or more runtimes comprises:
- Calculating one or more reference metering information by calculating a product of the one or more kernel information and one-to-one corresponding one or more running times after the standard time;
- the sum of the one or more reference metering information is calculated to obtain complexity.
- the step of calculating the sum of the one or more reference metering information to obtain complexity includes:
- the sum of the values of one or more reference metering information after the unified processing is calculated to obtain complexity.
- the step of performing service processing according to the complexity includes:
- the execution cost is calculated using the complexity and the one or more weights.
- the step of calculating the execution cost by using the complexity and the one or more weights comprises:
- the sum of the one or more reference metering information after the configuration weight is calculated to obtain an execution cost.
- the step of performing service processing according to the complexity includes:
- the task program is optimized according to the complexity.
- the embodiment of the present application further discloses a complexity-based service processing apparatus, including:
- a kernel information determining module configured to determine one or more kernel information corresponding to one or more kernels executing the task program when the task program is completed;
- a runtime calculation module configured to calculate one or more running times of the one or more kernel information one-to-one correspondence
- a complexity calculation module configured to calculate a complexity according to the one or more kernel information and one or more running times
- a service processing module is configured to perform service processing according to the complexity.
- the kernel information determining module comprises:
- a kernel information extraction submodule configured to extract kernel information corresponding to one or more kernels executing the task program before the execution of the task program
- the first log information invokes a submodule for invoking log information of the record execution information
- a kernel information reading submodule configured to read, from the log information, one or more kernel information corresponding to one or more kernels executing the task program.
- the runtime calculation module comprises:
- the second log information invokes a submodule for invoking log information of the record execution information
- a time reading submodule configured to read, from the log information, one or more start times and one or more end times of the task program that are one-to-one corresponding to the one or more kernels;
- the time difference calculation sub-module is configured to calculate a difference between the one or more start times and the one or more end times to obtain one or more running times.
- the complexity is measured by the computational power that a core can run at full load for a standard time.
- the complexity calculation module comprises:
- a reference metering information calculation sub-module configured to calculate a product of the one or more kernel information and one-to-one corresponding one or more running times after the standard time, to obtain one or more reference metering information
- the reference metering information and calculation sub-module is configured to calculate a sum of the one or more reference metering information to obtain complexity.
- the reference metering information and calculation submodule comprises:
- a unified processing submodule configured to uniformly process kernel information in the one or more reference metering information
- An arithmetic calculation sub-module for calculating a sum of values of one or more reference metering information after unified processing to obtain complexity.
- the service processing module includes:
- a weight acquisition submodule configured to acquire one or more weights corresponding to the one or more kernel information
- An execution cost calculation sub-module is configured to calculate an execution cost using the complexity and the one or more weights.
- the execution cost calculation sub-module comprises:
- a first weight configuration submodule configured to configure the weight on the sum of the one or more reference metering information to obtain an execution cost
- a second weight configuration submodule configured to configure one or more weights corresponding to the one or more reference metering information
- the weight and calculation sub-module is configured to calculate a sum of the one or more reference metering information after the configuration weight is obtained, and obtain an execution cost.
- the service processing module includes:
- the optimization submodule is configured to optimize the task program according to the complexity.
- the embodiment of the present application calculates the complexity of running time of each kernel of the task program, and is applicable to task programs of multiple compiled formats, which greatly improves the practicability, and at the same time, the complexity can truly reflect the logic complexity of the task program and avoid The experience estimation greatly improves the accuracy, which greatly improves the efficiency of business processing.
- FIG. 1 is a flow chart of steps of an embodiment of a complexity-based service processing method of the present application
- FIG. 2 is a structural block diagram of an embodiment of a complexity-based service processing apparatus of the present application.
- FIG. 1 a flow chart of steps of an embodiment of a complexity-based service processing method of the present application is shown, which may specifically include the following steps:
- Step 101 When the execution of the task program is completed, determining one or more pieces of kernel information corresponding to one or more kernels of the task program.
- the embodiment of the present application may be applied to a single computer, such as a personal computer, a mobile device, or the like, and may also be applied to a computer cluster, such as a distributed system, and the like.
- the distributed system can be divided into the following parts:
- Distributed System Underlying Services Provides services for coordination services, remote procedure calls, security management, and resource management that are required in a distributed environment. These underlying services support the upper distributed file system, task scheduling and other modules.
- Distributed File System Provides a massive, reliable, and scalable data storage service that aggregates the storage capabilities of each node in the cluster and automatically shields hardware and software failures to provide users with uninterrupted data access services. Incremental expansion and automatic data balancing, providing user space file access API (Application Program Interface), support random read and write and additional write operations.
- API Application Program Interface
- Task scheduling Provide scheduling services for tasks in the cluster system, support online service (Online Service) that emphasizes response speed, and Batch Processing Job that emphasizes processing data throughput; automatically detect faults and hotspots in the system, pass errors Retry, for long tail operation concurrent backup jobs, etc., to ensure stable operation Reliably completed.
- Online Service Online Service
- Batch Processing Job that emphasizes processing data throughput
- Cluster monitoring and deployment Monitor the status of the cluster and the running status and performance indicators of the upper-layer application services, and generate alarms and records for abnormal events. Provide deployment and configuration management for the entire distributed system and upper-layer applications for operation and maintenance personnel. Online expansion of cluster expansion, capacity reduction and application services.
- a central processing unit In each computer, a central processing unit (CPU) is generally configured.
- the central processing unit is a large-scale integrated circuit, which is the computing core and control core of a computer, and can be used to interpret computer instructions and Process data in a computer program.
- a single computer such as a personal computer, mobile device, etc.
- a central processing unit In most cases, a single computer, such as a personal computer, mobile device, etc., is typically configured with a central processing unit. However, in some large servers, such as blade servers, a single computer can integrate two or more central processors.
- each central processor can be configured, or multiple cores (ie, two or more cores) can be configured, and the kernel information can be a kernel capable of representing a central processing unit.
- Information for example, the kernel model, the letter core that identifies the kernel, that is, the kernel and the kernel information are in one-to-one correspondence.
- the program is generally a sequence of instructions, and the execution of the program may refer to executing the instructions one by one in the sequence of instructions. If the program is loaded into the main memory (referred to as main memory), the task of the slave access instruction and the execution instruction can be completed by the central processing unit.
- main memory main memory
- the task program is relative to the execution of a core (Core) assigned to a processor in a single computer or cluster of computers, and is essentially a program.
- Core core
- step 101 may include the following sub-steps:
- Sub-step S11 extracting kernel information corresponding to one or more kernels executing the task program one by one before execution of the task program;
- the kernel execution of the processor may be randomly allocated according to the amount of data, and the kernel information of the kernel of the processor is recorded.
- the data volume of a task program is 300M. If the core of each processor can execute 50M data volume, the kernel of six processors can be allocated to execute the task program.
- the kernel of the processor that allocates the task program may be the core of the processor of the same computer or the core of the processor of a different computer.
- Sub-step S12 calling log information of the record execution information
- Sub-step S13 reading one or more pieces of kernel information corresponding to one or more kernels executing the task program from the log information.
- the kernel of the processor can execute some of the assigned task programs. If the task program is completed, the system can record the execution information (that is, information related to the execution of the task program).
- the execution information that is, information related to the execution of the task program.
- JSON JavaScript Object Notation, a data exchange format
- the log records how many instances of the task program are started. Generally, an instance corresponds to a central processor core.
- Step 102 Calculate one or more running times of the one or more kernel information one-to-one correspondence
- kernel information can be used to identify the kernel.
- Run time which can be the time taken by the central processor's kernel to execute some of the assigned task programs.
- the core of each processor may have its own running time, that is, the kernel information has a one-to-one correspondence with the running time.
- step 102 may include the following sub-steps:
- Sub-step S21 calling log information of the record execution information
- Sub-step S22 reading one or more start times and one or more end times of the task program that are one-to-one corresponding to the one or more kernels from the log information;
- Sub-step S23 calculating a difference between the one or more start times and the one or more end times to obtain one or more running times.
- the system can record the execution information into a JSON format log, which records how many instances of the task program are started, and the start time and end time of each instance. .
- each instance can report itself to the master (control node) in the computer cluster when starting to execute some of the assigned part of the task program and ending execution of the assigned part of the task program.
- the start time and end time the master (control node) can record the start time and end time into the log, calculate the difference between the start time and the end time, then the instance run time, that is, the running time of the kernel can be obtained.
- Step 103 Calculate complexity according to the one or more kernel information and one or more corresponding running times;
- kernel information can be used as a unit of measure for complexity.
- Complexity can refer to the complexity of the task program.
- the complexity of the task program is higher, the resources (such as time and processor resources) required to run the task program are larger, and the cost is higher.
- the complexity of the program the smaller the resources (such as time, processor resources) needed to run the task program, and the lower the cost.
- the complexity can be calculated based on the kernel of the CPU.
- step 103 may include the following sub-steps:
- Sub-step S31 calculating one or more kernel information and one-to-one corresponding product of one or more running times after the standard time, to obtain one or more reference metering information;
- the kernel cannot run other programs, and the kernel can be considered to be running at full load.
- the task program generally has a large amount of calculation.
- the day (D) is used as the standard time. Since the second (s) is usually used as the time unit in the computer, the standard time conversion of the running time is required.
- the product of the kernel information and the running time may be first calculated, and then the running time is converted into a standard time to convert the product into reference calculation information;
- a task program is assigned to the A core and the B core.
- Sub-step S32 calculating the sum of the one or more reference metering information to obtain complexity.
- the computer cluster is generally configured as a whole (such as the same hardware model, the performance difference between different computers is small, the use time and environment are the same, the loss difference between different computers is small), the kernel calculation of each computer The difference between capabilities is small and within acceptable limits.
- the computing power of each computer is the same, that is, one or more
- the kernel information in the reference metering information is uniformly processed, and since the standard time is also the same, the sum of the values of one or more reference metering information after the unified processing can be calculated to obtain the complexity.
- a task program is assigned to the A core and the B core, the A core runs 14400 seconds (s), the B core runs 7200 seconds (s), and the day (D) is used as the standard time, if referenced in the measurement information
- the kernel information in the reference metering information may be considered to be different, and the logical sum of the reference metering information may be used as the complexity.
- a task program is assigned to the A core and the B core, the A core runs 14400 seconds (s), the B core runs 7200 seconds (s), and the day (D) is used as the standard time, if referenced in the measurement information
- the kernel information in each reference metering information may be configured according to the computing power, and then the computing power of the computing power may be calculated.
- the logically identical reference programs can be independently run in each core in advance, and the computing power weights are configured according to the running time. The shorter the running time, the higher the weight, the longer the running time, and the lower the weight.
- the A kernel and the B kernel run the reference program independently, if the A core runs for 2 hours and the B core runs for 1 hour, the A core has half the computing power and the B core has a weight of 1.
- the A kernel has a weight of 0.5.
- Step 104 Perform service processing according to the complexity.
- business processing in the field of communication, business processing can be a transmission process of communication data; in the news media industry, business processing can be a release process of news data; in the field of program testing, business processing can be a process of testing optimization of a program; In the field of e-commerce, business processing can be a process of calculating the execution cost.
- step 104 may include the following sub-steps:
- Sub-step S41 acquiring one or more weights corresponding to the one or more kernel information one-to-one;
- Sub-step S42 the execution cost is calculated using the complexity and the one or more weights.
- a newly configured computer performs better and costs more, and the cost of applying the computer's kernel to execute the task program is higher.
- weights can be configured for complexity, which comprehensively reflects the execution cost when executing the task program, and can be used to measure the cost of executing the same task program between different cores.
- a website can provide the computing power of a computer cluster to other users, and the weight can be characterized as pricing, such as the price required to rent the computer cluster to perform program tasks, and can be priced at 1 CU. Pricing can be divided in other ways.
- the sub-step S42 may include the following sub-steps:
- Sub-step S421 configuring the weights on the sum of the one or more reference metering information to obtain an execution cost.
- the weight can also be considered to be the same, and the execution cost can be uniformly calculated.
- the sub-step S42 may include the following sub-steps:
- Sub-step S422 configuring one or more weights corresponding to the one or more reference metering information
- the corresponding weights may be configured for each reference measurement information in the complexity, and the execution cost is calculated.
- step 104 may include the following sub-steps:
- Sub-step S43 the task program is optimized according to the complexity.
- the task program can be optimized according to the complexity.
- the complexity is higher than a certain threshold, which indicates that the task program logic is more complex, does not meet the standard, and needs to continue to optimize.
- adjusting a certain underlying parameter to a task program can bring huge optimization to the system, greatly improve the computing performance, and the running time will be greatly reduced, and the calculation will be The complexity will also decrease. It is considered that the current optimization process is up to standard, and there is no need to continue the optimization process, which avoids the waste of resources caused by the failure of optimization and greatly improves the efficiency of optimization.
- FIG. 2 a structural block diagram of an embodiment of a complexity-based service processing apparatus of the present application is shown, which may specifically include the following modules:
- the kernel information determining module 201 is configured to determine one or more kernel information corresponding to one or more kernels executing the task program one by one when the task program execution is completed;
- the runtime calculation module 202 is configured to calculate one or more running times of the one or more kernel information one-to-one correspondence;
- the complexity calculation module 203 is configured to calculate a complexity according to the one or more kernel information and one or more running times of the one-to-one correspondence;
- the service processing module 204 is configured to perform service processing according to the complexity.
- the kernel information determining module 201 may include the following submodules:
- a kernel information extraction submodule configured to extract kernel information corresponding to one or more kernels executing the task program before the execution of the task program
- the first log information invokes a submodule for invoking log information of the record execution information
- a kernel information reading submodule configured to read, from the log information, one or more kernel information corresponding to one or more kernels executing the task program.
- the runtime calculation module 202 can include the following sub-modules:
- the second log information invokes a submodule for invoking log information of the record execution information
- a time reading submodule configured to read, from the log information, one or more start times and one or more end times of the task program that are one-to-one corresponding to the one or more kernels;
- the time difference calculation sub-module is configured to calculate a difference between the one or more start times and the one or more end times to obtain one or more running times.
- the complexity can be measured by the computational power that a core can run at full load for a standard time.
- the complexity calculation module 203 may include the following sub-modules:
- a reference metering information calculation sub-module configured to calculate a product of the one or more kernel information and one-to-one corresponding one or more running times after the standard time, to obtain one or more reference metering information
- the reference metering information and calculation sub-module is configured to calculate a sum of the one or more reference metering information to obtain complexity.
- the reference metering information and calculation sub-module may include the following sub-modules:
- a unified processing submodule configured to uniformly process kernel information in the one or more reference metering information
- An arithmetic calculation sub-module for calculating a sum of values of one or more reference metering information after unified processing to obtain complexity.
- the service processing module 204 may include the following sub-modules:
- a weight acquisition submodule configured to acquire one or more weights corresponding to the one or more kernel information
- An execution cost calculation sub-module is configured to calculate an execution cost using the complexity and the one or more weights.
- the execution cost calculation sub-module may include the following sub-modules:
- a first weight configuration submodule configured to configure the weight on the sum of the one or more reference metering information to obtain an execution cost
- a second weight configuration submodule configured to configure one or more weights corresponding to the one or more reference metering information
- the weight and calculation sub-module is configured to calculate a sum of the one or more reference metering information after the configuration weight is obtained, and obtain an execution cost.
- the service processing module 204 may include the following sub-modules:
- the optimization submodule is configured to optimize the task program according to the complexity.
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media includes both permanent and non-persistent, removable and non-removable media.
- Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
- computer readable media does not include non-persistent computer readable media, such as modulated data signals and carrier waves.
- Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
- These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
- Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
一种基于复杂度的业务处理方法和装置,该方法包括:当任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息(101);计算所述一个或多个内核信息一一对应的一个或多个运行时间(102);根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度(103);根据所述复杂度进行业务处理(104)。通过执行任务程序的各内核的运行时间计算复杂度,适用于多种编译格式的任务程序,大大提高了实用性,同时,复杂度可以真实反映该任务程序的逻辑复杂程度,避免了经验估算,大大提高了准确率,进而大大提高了业务处理的效率。
Description
本申请要求2015年6月9日递交的申请号为201510314346.3、发明名称为“一种基于复杂度的业务处理方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机处理技术领域,特别是涉及一种基于复杂度的业务处理方法和一种基于复杂度的业务处理装置。
随着大数据技术的发展,各个云计算平台上的计算任务出现了井喷的趋势,通常,会以复杂度对计算任务进行衡量。
目前,复杂度一般是通过匹配SQL(Structured Query Language,结构化查询语言)语法的关键字计算的。具体而言,在设置一个初始复杂度的基础上,当匹配到一个关键字,则乘以相应的复杂度权值。
例如,假设所有SQL语句初始复杂度为1,若SQL语句中匹配到一个关键字join,复杂度乘以1.1的权值,若SQL语句匹配到一个关键字order by时,复杂度乘以1.2的权值。
但是,上述复杂度的计算方法只能计量应用SQL语句的任务的复杂度,实用性低,无法计算集群中大量的Map/Reduce、MPI(Message Passing Interface,消息传递接口)、graph等非应用SQL语句的任务的复杂度;并且,复杂度的权值是根据经验值来推算的,计算准确率低。进而,使得在基于复杂度进行的业务处理的效率低。
以优化为例,某些任务,调整某个底层参数,如控制启动的实例数不超过某一个值,就可以给系统带来巨大的优化,大大提高计算性能。但是,这个任务的计算逻辑和复杂度没有任何的变化,基于上述复杂度的计算方式,由于关键字并未发生变化,可能复杂度在优化前和优化后基本是相同的,可能会认为当前优化处理是失败的,需要重新进行优化,导致资源浪费、优化处理效率低。
发明内容
鉴于上述问题,提出了本申请实施例以便提供一种克服上述问题或者至少部分地解
决上述问题的一种基于复杂度的业务处理方法和相应的一种基于复杂度的业务处理装置。
为了解决上述问题,本申请公开了一种基于复杂度的业务处理方法,包括:
当任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息;
计算所述一个或多个内核信息一一对应的一个或多个运行时间;
根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度;
根据所述复杂度进行业务处理。
优选地,所述当任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息包括:
提取在任务程序执行前,分配执行所述任务程序的一个或多个内核一一对应的内核信息;
或者,
调用记录执行信息的日志信息;
从所述日志信息中读取执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息。
优选地,所述计算所述一个或多个内核信息一一对应的一个或多个运行时间的步骤包括:
调用记录执行信息的日志信息;
从所述日志信息中读取所述一个或多个内核一一对应的执行所述任务程序的一个或多个开始时间和一个或多个结束时间;
计算所述一个或多个开始时间和所述一个或多个结束时间之差,获得一个或多个运行时间。
优选地,所述复杂度以一个内核满负载运行一个标准时间所能提供的计算能力进行计量。
优选地,所述根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度的步骤包括:
计算所述一个或多个内核信息与一一对应的、换算为标准时间之后的一个或多个运行时间的乘积,获得一个或多个参考计量信息;
计算所述一个或多个参考计量信息之和,获得复杂度。
优选地,所述计算所述一个或多个参考计量信息之和,获得复杂度的步骤包括:
将所述一个或多个参考计量信息中的内核信息进行统一处理;
计算统一处理之后的一个或多个参考计量信息的数值之和,获得复杂度。
优选地,所述根据所述复杂度进行业务处理的步骤包括:
获取所述一个或多个内核信息一一对应的一个或多个权重;
采用所述复杂度和所述一个或多个权重计算执行成本。
优选地,所述采用所述复杂度和所述一个或多个权重计算执行成本的步骤包括:
对所述一个或多个参考计量信息之和配置所述权重,获得执行成本;
或者,
对所述一个或多个参考计量信息配置一一对应的一个或多个权重;
计算配置权重后的所述一个或多个参考计量信息的和,获得执行成本。
优选地,所述根据所述复杂度进行业务处理的步骤包括:
按照所述复杂度对所述任务程序进行优化处理。
本申请实施例还公开了一种基于复杂度的业务处理装置,包括:
内核信息确定模块,用于任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息;
运行时间计算模块,用于计算所述一个或多个内核信息一一对应的一个或多个运行时间;
复杂度计算模块,用于根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度;
业务处理模块,用于根据所述复杂度进行业务处理。
优选地,所述内核信息确定模块包括:
内核信息提取子模块,用于提取在任务程序执行前,分配执行所述任务程序的一个或多个内核一一对应的内核信息;
或者,
第一日志信息调用子模块,用于调用记录执行信息的日志信息;
内核信息读取子模块,用于从所述日志信息中读取执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息。
优选地,所述运行时间计算模块包括:
第二日志信息调用子模块,用于调用记录执行信息的日志信息;
时间读取子模块,用于从所述日志信息中读取所述一个或多个内核一一对应的执行所述任务程序的一个或多个开始时间和一个或多个结束时间;
时间差计算子模块,用于计算所述一个或多个开始时间和所述一个或多个结束时间之差,获得一个或多个运行时间。
优选地,所述复杂度以一个内核满负载运行一个标准时间所能提供的计算能力进行计量。
优选地,所述复杂度计算模块包括:
参考计量信息计算子模块,用于计算所述一个或多个内核信息与一一对应的、换算为标准时间之后的一个或多个运行时间的乘积,获得一个或多个参考计量信息;
参考计量信息和计算子模块,用于计算所述一个或多个参考计量信息之和,获得复杂度。
优选地,所述参考计量信息和计算子模块包括:
统一处理子模块,用于将所述一个或多个参考计量信息中的内核信息进行统一处理;
算术计算子模块,用于计算统一处理之后的一个或多个参考计量信息的数值之和,获得复杂度。
优选地,所述业务处理模块包括:
权重获取子模块,用于获取所述一个或多个内核信息一一对应的一个或多个权重;
执行成本计算子模块,用于采用所述复杂度和所述一个或多个权重计算执行成本。
优选地,所述执行成本计算子模块包括:
第一权重配置子模块,用于对所述一个或多个参考计量信息之和配置所述权重,获得执行成本;
或者,
第二权重配置子模块,用于对所述一个或多个参考计量信息配置一一对应的一个或多个权重;
权重和计算子模块,用于计算配置权重后的所述一个或多个参考计量信息的和,获得执行成本。
优选地,所述业务处理模块包括:
优化子模块,用于按照所述复杂度对所述任务程序进行优化处理。
本申请实施例包括以下优点:
本申请实施例通过执行任务程序的各内核的运行时间计算复杂度,适用于多种编译格式的任务程序,大大提高了实用性,同时,复杂度可以真实反映该任务程序的逻辑复杂程度,避免了经验估算,大大提高了准确率,进而大大提高了业务处理的效率。
图1是本申请的一种基于复杂度的业务处理方法实施例的步骤流程图;
图2是本申请的一种基于复杂度的业务处理装置实施例的结构框图。
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
参照图1,示出了本申请的一种基于复杂度的业务处理方法实施例的步骤流程图,具体可以包括如下步骤:
步骤101,当任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息;
需要说明的是,本申请实施例可以应用在单台计算机,如个人电脑、移动设备等等,也可以应用在计算机集群中,如分布式系统等等,本申请实施例对此不加以限制。
以某个分布式系统为例,该分布式系统可以分为以下几部分:
分布式系统底层服务:提供分布式环境下所需要的协调服务、远程过程调用、安全管理和资源管理的服务。这些底层服务为上层的分布式文件系统、任务调度等模块提供支持。
分布式文件系统:提供一个海量的、可靠的、可扩展的数据存储服务,将集群中各个节点的存储能力聚集起来,并能够自动屏蔽软硬件故障,为用户提供不间断的数据访问服务;支持增量扩容和数据的自动平衡,提供用户空间文件访问API(Application Program Interface,应用程序编程接口),支持随机读写和追加写的操作。
任务调度:为集群系统中的任务提供调度服务,同时支持强调响应速度的在线服务(Online Service)和强调处理数据吞吐量的离线任务(Batch Processing Job);自动检测系统中故障和热点,通过错误重试、针对长尾作业并发备份作业等方式,保证作业稳定
可靠地完成。
集群监控和部署:对集群的状态和上层应用服务的运行状态和性能指标进行监控,对异常事件产生警报和记录;为运维人员提供整个分布式系统以及上层应用的部署和配置管理,支持在线集群扩容、缩容和应用服务的在线升级。
在每台计算机中,一般都配置有中央处理器(Central Processing Unit,CPU),中央处理器是一块大规模的集成电路,是一台计算机的运算核心和控制核心,可以用于解释计算机指令以及处理计算机程序中的数据。
大多数情况下,单台计算机,如个人电脑、移动设备等,一般是配置一个中央处理器。但是,在某些大型服务器中,如刀片服务器等,单台计算机可以集成两个或两个以上的中央处理器。
此外,在每个中央处理器中,可以配置一个内核(Core),也可以配置多个内核(即两个或两个以上的内核),而内核信息可以是能够代表一中央处理器的内核的信息,例如,内核型号、标识内核的字母core,即内核与内核信息是一一对应的。
在程序的正常运行、测试等过程中,一般由中央处理器的内核执行。
具体而言,程序一般是由指令构成的序列,执行程序可以指按指令序列逐条执行指令。若把程序装入主存储器(简称主存)中,就可以由中央处理器完成从主存取指令和执行指令的任务。
而任务程序是相对于分配到单台计算机或计算机集群中某个处理器的内核(Core)执行而言的,其本质也是程序。
在本申请的一种优选实施例中,步骤101可以包括如下子步骤:
子步骤S11,提取在任务程序执行前,分配执行所述任务程序的一个或多个内核一一对应的内核信息;
在本申请实施例中,任务程序在执行前,可以根据其数据量随机分配处理器的内核执行,并记录该处理器的内核的内核信息。
例如,某个任务程序的数据量为300M,若每个处理器的内核可以执行50M的数据量,则可以分配六个处理器的内核执行该任务程序。
需要说明的是,分配执行任务程序的处理器的内核,可以为同一台计算机的处理器的内核,也可以为不同计算机的处理器的内核。
或者,
子步骤S12,调用记录执行信息的日志信息;
子步骤S13,从所述日志信息中读取执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息。
执行任务程序的处理器的内核分配完成后,该处理器的内核可以执行所分配的某部分任务程序,若任务程序运行完成,则系统可以将执行信息(即执行任务程序相关的信息)记录到一个JSON(JavaScript Object Notation,一种数据交换格式)格式的日志中,在该日志中记载了该任务程序启动了多少个instance(实例),一般一个instance就对应了一个中央处理器的内核。
步骤102,计算所述一个或多个内核信息一一对应的一个或多个运行时间;
在步骤101和步骤102中,内核信息可以用于标识内核。
运行时间,可以为中央处理器的内核在执行所分配的某部分任务程序所消耗的时间。
在本申请实施例中,每个处理器的内核(以内核信息表征)可以具有自己的运行时间,即内核信息与运行时间是一一对应的。
在本申请的一种优选实施例中,步骤102可以包括如下子步骤:
子步骤S21,调用记录执行信息的日志信息;
子步骤S22,从所述日志信息中读取所述一个或多个内核一一对应的执行所述任务程序的一个或多个开始时间和一个或多个结束时间;
子步骤S23,计算所述一个或多个开始时间和所述一个或多个结束时间之差,获得一个或多个运行时间。
若任务程序运行完成,则系统可以将执行信息记录到一个JSON格式的日志中,在该日志中记载了该任务程序启动了多少个instance(实例),以及,每一个instance的开始时间和结束时间。
进一步而言,在计算机集群中,每一个instance在开始执行所分配的某部分任务程序的时候和结束执行所分配的某部分任务程序的时候,可以向计算机集群中的master(控制节点)汇报自己的开始时间和结束时间,则master(控制节点)可以把开始时间和结束时间记录到日志里中,计算开始时间和结束时间之差,则可以获得该instance运行时间,即内核的运行时间。
步骤103,根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度;
在步骤103中,内核信息可以作为复杂度的计量单位。
复杂度,可以指任务程序的复杂程度。
通常,在运行环境相同的情况下,若任务程序的复杂度越高,则运行该任务程序所需要消耗的资源(如时间、处理器资源)就越大,成本就越高,反之,若任务程序的复杂度越低,则运行该任务程序所需要消耗的资源(如时间、处理器资源)就越小,成本就越低。
目前,通过关键字匹配计算SQL语句的复杂度的方式不够直观,计算机面向外部用户的时候,更多的把计算和CPU挂钩,而不是数据量。
因此,在本申请实施例中可以基于CPU的内核计算复杂度。
进一步而言,该复杂度(CU)可以以一个内核满负载运行一个标准时间所能提供的计算能力进行计量,即1CU=1core*标准时间。
标准时间是一个逻辑时间,实际可以为任意的时间,如一天、一小时等等。以一天(D)作为标准时间的示例,1CU=1core*D。
在本申请的一种优选实施例中,步骤103可以包括如下子步骤:
子步骤S31,计算所述一个或多个内核信息与一一对应的、换算为标准时间之后的一个或多个运行时间的乘积,获得一个或多个参考计量信息;
在实际应用中,若任务对象是独占内核进行执行的,则该内核无法运行其他程序,可以认为该内核是满负载运行的。
任务程序一般计算量较大,通常以天(D)作为标准时间,由于在计算机中一般以秒(s)作为时间单位,因此,需要对运行时间进行标准时间的换算。
在本申请实施例中,可以先计算内核信息与运行时间的乘积,再将运行时间换算成标准时间,以将乘积换算成参考计算信息;
也可以先将运行时间换算成标准时间,再计算内核信息与换算为标准时间之后的运行时间的乘积,获得参考计算信息。
例如,某个任务程序分配给A内核和B内核执行,其中,A内核运行了14400秒(s),B内核运行了7200秒(s),以天(D)作为标准时间,则参考计量信息分别为core(A)*14400s=core(A)*(1/6)D、core(B)*7200s=core(B)*(1/12)D。
子步骤S32,计算所述一个或多个参考计量信息之和,获得复杂度。
在实际应用中,由于计算机集群一般为整体配置(如硬件型号相同,不同计算机之间的性能差异较小,使用时间、环境相同,不同计算机之间的损耗差异较小),各计算机的内核计算能力之间的差异比较小,在可以接受的差异范围内。
为了减少计算量,可以认为各计算机的内核计算能力是相同的,即可以将一个或多
个参考计量信息中的内核信息进行统一处理,而由于标准时间也是相同的,则可以计算统一处理之后的一个或多个参考计量信息的数值之和,获得复杂度。
例如,某个任务程序分配给A内核和B内核执行,A内核运行了14400秒(s),B内核运行了7200秒(s),以天(D)作为标准时间,若参考计量信息中的内核信息相同,以core表示,则A内核的参考计量信息为core*(1/6)D、B内核的参考计量信息为core*(1/12)D,则复杂度=core*(1/6)D+core*(1/12)D=0.25core*D=0.25CU,其表示的意思为该任务程序的复杂度为在该计算机集群的内核中执行时需要消耗0.25CU。
对于单台计算机、计算机集群非整体配置(如硬件型号不同,导致不同计算机之间的性能差异较大,使用时间、环境不同,导致不同计算机之间的损耗差异较大)等情况下,各计算机的内核计算能力之间的差异比较大。
为了提高复杂度的精确度,可以认为参考计量信息中的内核信息是不相同的,及可以以该参考计量信息的逻辑之和作为复杂度。
例如,某个任务程序分配给A内核和B内核执行,A内核运行了14400秒(s),B内核运行了7200秒(s),以天(D)作为标准时间,若参考计量信息中的内核信息不同,则A内核的参考计量信息为core(A)*(1/6)D=1/6CU(A)、B内核的参考计量信息为core(B)*(1/12)D=1/12CU(B),则复杂度=1/6CU(A)+1/12CU(B),其表示的意思为该任务程序的复杂度为在A内核中执行时需要消耗1/6CU,同时,在B内核执行时需要消耗1/12CU。
进一步而言,为了在各计算机的内核计算能力之间的差异比较大的情况下减少计算量,可以将各参考计量信息中的内核信息按照计算能力配置计算能力权重,再计算配置计算能力权重之后的参考计量信息的数值之加,作为复杂度。
在一个实施例中,可以预先在各内核中独立运行逻辑相同的参考程序,按照运行时间配置计算能力权重,运行时间越短,权重越高,运行时间越长,权重越低。
例如,在A内核和B内核分别独立运行参考程序,若A内核运行了2小时,B内核运行了1小时,则A内核的运算能力为B内核的一半,以B内核的权重为1,则A内核的权重为0.5。
则配置权重后的复杂度=1/6CU(A)+1/12CU(B)=0.5*1/6CU(A)+1/12CU(A)=1/6CU(B),其表示的意思为该任务程序的复杂度为在B内核执行时需要消耗1/6CU。
步骤104,根据所述复杂度进行业务处理。
在不同的领域中,可以具有不同的业务,该业务为体现该领域特性的事件。
例如,在通信领域中,业务处理可以为通信数据的传输过程;在新闻媒体行业中,业务处理可以为新闻数据的发布过程;在程序测试领域中,业务处理可以为程序的测试优化过程;在电子商务领域中,业务处理可以为执行成本的计算过程。
需要说明的是,在不同的领域中,虽然业务处理承载领域特性而有所不同,但其本质是对数据(例如,字符、文本数据、图像数据、音频数据、视频数据等等)的处理过程。
在本申请的一种优选实施例中,步骤104可以包括如下子步骤:
子步骤S41,获取所述一个或多个内核信息一一对应的一个或多个权重;
子步骤S42,采用所述复杂度和所述一个或多个权重计算执行成本。
在实际应用中,不同的计算机除了内核的计算能力可能存在差异之外,还可能存在其他方面的差异。
例如,某新配置的计算机性能较好,成本较高,应用该计算机的内核执行任务程序时成本也较高。
在本发明实施例中,可以对复杂度配置权重,综合体现执行任务程序时的执行成本,可以用于衡量不同内核之间执行相同的任务程序的成本情况。
需要说明的是,本领域技术人员可以根据实际需求对内核(内核信息表征,为标识内核的作用)配置相应的权重。
例如,在电子商务领域中,网站可以提供计算机集群的计算能力给其他用户,则该该权重可以表征为定价,如租用该计算机集群执行程序任务时所需的价格,可以以1CU划分定价,也可以以其他方式划分定价。
在本申请实施例的一种优选示例中,子步骤S42可以包括如下子步骤:
子步骤S421,对所述一个或多个参考计量信息之和配置所述权重,获得执行成本。
在认为各计算机的内核计算能力相同等情况下,则该权重也可以认为是相同的,可以统一计算执行成本。
例如,某个任务程序分配给A内核和B内核执行,复杂度为0.25CU,若A内核的权重和B内核的权重均为4,则执行成本=0.25*4=1。
在本申请实施例的另一种优选示例中,子步骤S42可以包括如下子步骤:
子步骤S422,对所述一个或多个参考计量信息配置一一对应的一个或多个权重;
子步骤S423,计算配置权重后的所述一个或多个参考计量信息的和,获得执行成本。
计算配置权重后的所述一个或多个标准计量信息的和,获得执行成本。
在认为各计算机的内核计算能力存在差异等情况下,可以对复杂度中各参考计量信息配置相应的权重,计算执行成本。
例如,某个任务程序分配给A内核和B内核执行,复杂度为1/6CU(A)+1/12CU(B),若A内核的权重为3、B内核的权重均为4,则执行成本=(1/6)*3+(1/12)*4=0.83。
在本申请的另一种优选实施例中,步骤104可以包括如下子步骤:
子步骤S43,按照所述复杂度对所述任务程序进行优化处理。
在本申请实施例中,可以按照复杂度的情况对任务程序进行优化。
一般而言,复杂度较高,超过了一定的阈值,则可以表明该任务程序逻辑较为复杂,并未达标,需要继续进行优化。
例如,对某个任务程序调整了某个底层参数,如控制启动的实例数不超过某一个值,就可以给系统带来巨大的优化,大大提高计算性能,运行时间也会大大减少,计算出的复杂度也会随之下降,认为当前优化处理是达标的,无需再继续进行优化处理,避免了判断优化失败时导致的资源浪费,大大提高了优化处理效率。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图2,示出了本申请的一种基于复杂度的业务处理装置实施例的结构框图,具体可以包括如下模块:
内核信息确定模块201,用于任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息;
运行时间计算模块202,用于计算所述一个或多个内核信息一一对应的一个或多个运行时间;
复杂度计算模块203,用于根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度;
业务处理模块204,用于根据所述复杂度进行业务处理。
在本申请的一种优选实施例中,所述内核信息确定模块201可以包括如下子模块:
内核信息提取子模块,用于提取在任务程序执行前,分配执行所述任务程序的一个或多个内核一一对应的内核信息;
或者,
第一日志信息调用子模块,用于调用记录执行信息的日志信息;
内核信息读取子模块,用于从所述日志信息中读取执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息。
在本申请的一种优选实施例中,所述运行时间计算模块202可以包括如下子模块:
第二日志信息调用子模块,用于调用记录执行信息的日志信息;
时间读取子模块,用于从所述日志信息中读取所述一个或多个内核一一对应的执行所述任务程序的一个或多个开始时间和一个或多个结束时间;
时间差计算子模块,用于计算所述一个或多个开始时间和所述一个或多个结束时间之差,获得一个或多个运行时间。
在具体实现中,所述复杂度可以以一个内核满负载运行一个标准时间所能提供的计算能力进行计量。
在本申请的一种优选实施例中,所述复杂度计算模块203可以包括如下子模块:
参考计量信息计算子模块,用于计算所述一个或多个内核信息与一一对应的、换算为标准时间之后的一个或多个运行时间的乘积,获得一个或多个参考计量信息;
参考计量信息和计算子模块,用于计算所述一个或多个参考计量信息之和,获得复杂度。
在本申请的一种优选实施例中,所述参考计量信息和计算子模块可以包括如下子模块:
统一处理子模块,用于将所述一个或多个参考计量信息中的内核信息进行统一处理;
算术计算子模块,用于计算统一处理之后的一个或多个参考计量信息的数值之和,获得复杂度。
在本申请的一种优选实施例中,所述业务处理模块204可以包括如下子模块:
权重获取子模块,用于获取所述一个或多个内核信息一一对应的一个或多个权重;
执行成本计算子模块,用于采用所述复杂度和所述一个或多个权重计算执行成本。
在本申请的一种优选实施例中,所述执行成本计算子模块可以包括如下子模块:
第一权重配置子模块,用于对所述一个或多个参考计量信息之和配置所述权重,获得执行成本;
或者,
第二权重配置子模块,用于对所述一个或多个参考计量信息配置一一对应的一个或多个权重;
权重和计算子模块,用于计算配置权重后的所述一个或多个参考计量信息的和,获得执行成本。
在本申请的一种优选实施例中,所述业务处理模块204可以包括如下子模块:
优化子模块,用于按照所述复杂度对所述任务程序进行优化处理。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
在一个典型的配置中,所述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(transitory media),如调制的数据信号和载波。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种基于复杂度的业务处理方法和一种基于复杂度的业务处理装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领
域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
Claims (18)
- 一种基于复杂度的业务处理方法,其特征在于,包括:当任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息;计算所述一个或多个内核信息一一对应的一个或多个运行时间;根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度;根据所述复杂度进行业务处理。
- 根据权利要求1所述的方法,其特征在于,所述当任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息包括:提取在任务程序执行前,分配执行所述任务程序的一个或多个内核一一对应的内核信息;或者,调用记录执行信息的日志信息;从所述日志信息中读取执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息。
- 根据权利要求2所述的方法,其特征在于,所述计算所述一个或多个内核信息一一对应的一个或多个运行时间的步骤包括:调用记录执行信息的日志信息;从所述日志信息中读取所述一个或多个内核一一对应的执行所述任务程序的一个或多个开始时间和一个或多个结束时间;计算所述一个或多个开始时间和所述一个或多个结束时间之差,获得一个或多个运行时间。
- 根据权利要求1或2或3所述的方法,其特征在于,所述复杂度以一个内核满负载运行一个标准时间所能提供的计算能力进行计量。
- 根据权利要求4所述的方法,其特征在于,所述根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度的步骤包括:计算所述一个或多个内核信息与一一对应的、换算为标准时间之后的一个或多个运行时间的乘积,获得一个或多个参考计量信息;计算所述一个或多个参考计量信息之和,获得复杂度。
- 根据权利要求5所述的方法,其特征在于,所述计算所述一个或多个参考计量信息之和,获得复杂度的步骤包括:将所述一个或多个参考计量信息中的内核信息进行统一处理;计算统一处理之后的一个或多个参考计量信息的数值之和,获得复杂度。
- 根据权利要求1或2或3或5或6所述的方法,其特征在于,所述根据所述复杂度进行业务处理的步骤包括:获取所述一个或多个内核信息一一对应的一个或多个权重;采用所述复杂度和所述一个或多个权重计算执行成本。
- 根据权利要求7所述的方法,其特征在于,所述采用所述复杂度和所述一个或多个权重计算执行成本的步骤包括:对所述一个或多个参考计量信息之和配置所述权重,获得执行成本;或者,对所述一个或多个参考计量信息配置一一对应的一个或多个权重;计算配置权重后的所述一个或多个参考计量信息的和,获得执行成本。
- 根据权利要求1或2或3或5或6所述的方法,其特征在于,所述根据所述复杂度进行业务处理的步骤包括:按照所述复杂度对所述任务程序进行优化处理。
- 一种基于复杂度的业务处理装置,其特征在于,包括:内核信息确定模块,用于任务程序执行完成时,确定执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息;运行时间计算模块,用于计算所述一个或多个内核信息一一对应的一个或多个运行时间;复杂度计算模块,用于根据所述一个或多个内核信息及一一对应的一个或多个运行时间计算复杂度;业务处理模块,用于根据所述复杂度进行业务处理。
- 根据权利要求10所述的装置,其特征在于,所述内核信息确定模块包括:内核信息提取子模块,用于提取在任务程序执行前,分配执行所述任务程序的一个或多个内核一一对应的内核信息;或者,第一日志信息调用子模块,用于调用记录执行信息的日志信息;内核信息读取子模块,用于从所述日志信息中读取执行所述任务程序的一个或多个内核一一对应的一个或多个内核信息。
- 根据权利要求11所述的装置,其特征在于,所述运行时间计算模块包括:第二日志信息调用子模块,用于调用记录执行信息的日志信息;时间读取子模块,用于从所述日志信息中读取所述一个或多个内核一一对应的执行所述任务程序的一个或多个开始时间和一个或多个结束时间;时间差计算子模块,用于计算所述一个或多个开始时间和所述一个或多个结束时间之差,获得一个或多个运行时间。
- 根据权利要求10或11或12所述的装置,其特征在于,所述复杂度以一个内核满负载运行一个标准时间所能提供的计算能力进行计量。
- 根据权利要求13所述的装置,其特征在于,所述复杂度计算模块包括:参考计量信息计算子模块,用于计算所述一个或多个内核信息与一一对应的、换算为标准时间之后的一个或多个运行时间的乘积,获得一个或多个参考计量信息;参考计量信息和计算子模块,用于计算所述一个或多个参考计量信息之和,获得复杂度。
- 根据权利要求14所述的装置,其特征在于,所述参考计量信息和计算子模块包括:统一处理子模块,用于将所述一个或多个参考计量信息中的内核信息进行统一处理;算术计算子模块,用于计算统一处理之后的一个或多个参考计量信息的数值之和,获得复杂度。
- 根据权利要求10或11或12或14或15所述的装置,其特征在于,所述业务处理模块包括:权重获取子模块,用于获取所述一个或多个内核信息一一对应的一个或多个权重;执行成本计算子模块,用于采用所述复杂度和所述一个或多个权重计算执行成本。
- 根据权利要求16所述的装置,其特征在于,所述执行成本计算子模块包括:第一权重配置子模块,用于对所述一个或多个参考计量信息之和配置所述权重,获得执行成本;或者,第二权重配置子模块,用于对所述一个或多个参考计量信息配置一一对应的一个或多个权重;权重和计算子模块,用于计算配置权重后的所述一个或多个参考计量信息的和,获得执行成本。
- 根据权利要求10或11或12或14或15所述的装置,其特征在于,所述业务处理模块包括:优化子模块,用于按照所述复杂度对所述任务程序进行优化处理。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510314346.3 | 2015-06-09 | ||
CN201510314346.3A CN106293890B (zh) | 2015-06-09 | 2015-06-09 | 一种基于复杂度的业务处理方法和装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016197853A1 true WO2016197853A1 (zh) | 2016-12-15 |
Family
ID=57502991
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/084443 WO2016197853A1 (zh) | 2015-06-09 | 2016-06-02 | 一种基于复杂度的业务处理方法和装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106293890B (zh) |
WO (1) | WO2016197853A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113110931A (zh) * | 2020-01-10 | 2021-07-13 | 北京小米松果电子有限公司 | 内核运算优化方法、装置及系统 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110675236A (zh) * | 2019-08-27 | 2020-01-10 | 阿里巴巴集团控股有限公司 | 基于分布式的税费计算方法以及装置 |
CN111786801B (zh) * | 2019-11-26 | 2023-08-04 | 北京京东尚科信息技术有限公司 | 一种基于数据流量进行计费的方法和装置 |
CN113467959A (zh) * | 2021-09-06 | 2021-10-01 | 西安芯瞳半导体技术有限公司 | 应用于gpu的确定任务复杂度的方法、装置及介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102221988A (zh) * | 2011-05-23 | 2011-10-19 | 北京工商大学 | 一种快速的指令级处理器能耗估算方法 |
CN103109276A (zh) * | 2010-09-07 | 2013-05-15 | 现代自动车株式会社 | 系统测试方法 |
CN103338228A (zh) * | 2013-05-30 | 2013-10-02 | 江苏大学 | 基于双加权最小连接算法的云计算负载均衡调度算法 |
CN103399800A (zh) * | 2013-08-07 | 2013-11-20 | 山东大学 | 基于Linux并行计算平台的动态负载均衡方法 |
CN103473134A (zh) * | 2013-09-23 | 2013-12-25 | 哈尔滨工程大学 | 一种异构多核处理器的依赖任务调度方法 |
KR20140086577A (ko) * | 2012-12-28 | 2014-07-08 | 경상대학교산학협력단 | 변동하는 계산량을 갖는 복수개의 주기적 실시간 작업을 위한 멀티 코어 프로세서의 누수 전력 소모를 고려한 확률적 최소 전력 스케줄링 방법 |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012027907A1 (en) * | 2010-09-03 | 2012-03-08 | Siemens Aktiengesellschaft | Method for parallelizing automatic control programs and compiler |
KR101341562B1 (ko) * | 2011-12-15 | 2013-12-16 | 경상대학교산학협력단 | 변동하는 계산량을 갖는 실시간 작업을 위한 단일 코어 프로세서의 에너지 효율적 스케줄링 방법 |
CN103164321A (zh) * | 2013-03-20 | 2013-06-19 | 华为技术有限公司 | 中央处理器占用率测量方法及装置 |
CN103729246B (zh) * | 2013-12-31 | 2017-05-03 | 浪潮(北京)电子信息产业有限公司 | 一种任务调度方法和装置 |
-
2015
- 2015-06-09 CN CN201510314346.3A patent/CN106293890B/zh active Active
-
2016
- 2016-06-02 WO PCT/CN2016/084443 patent/WO2016197853A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103109276A (zh) * | 2010-09-07 | 2013-05-15 | 现代自动车株式会社 | 系统测试方法 |
CN102221988A (zh) * | 2011-05-23 | 2011-10-19 | 北京工商大学 | 一种快速的指令级处理器能耗估算方法 |
KR20140086577A (ko) * | 2012-12-28 | 2014-07-08 | 경상대학교산학협력단 | 변동하는 계산량을 갖는 복수개의 주기적 실시간 작업을 위한 멀티 코어 프로세서의 누수 전력 소모를 고려한 확률적 최소 전력 스케줄링 방법 |
CN103338228A (zh) * | 2013-05-30 | 2013-10-02 | 江苏大学 | 基于双加权最小连接算法的云计算负载均衡调度算法 |
CN103399800A (zh) * | 2013-08-07 | 2013-11-20 | 山东大学 | 基于Linux并行计算平台的动态负载均衡方法 |
CN103473134A (zh) * | 2013-09-23 | 2013-12-25 | 哈尔滨工程大学 | 一种异构多核处理器的依赖任务调度方法 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113110931A (zh) * | 2020-01-10 | 2021-07-13 | 北京小米松果电子有限公司 | 内核运算优化方法、装置及系统 |
CN113110931B (zh) * | 2020-01-10 | 2024-06-04 | 北京小米松果电子有限公司 | 内核运算优化方法、装置及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN106293890B (zh) | 2019-11-05 |
CN106293890A (zh) | 2017-01-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11683221B1 (en) | Automatic generation of template for provisioning services in a hosted computing environment | |
US11487760B2 (en) | Query plan management associated with a shared pool of configurable computing resources | |
US20210314273A1 (en) | Enabling multi-tenant virtual servers in a cloud system | |
Zheng et al. | Service-generated big data and big data-as-a-service: an overview | |
CN106202235B (zh) | 一种数据处理方法及装置 | |
US9256222B2 (en) | Sensor virtualization through cloud storage and retrieval mechanisms | |
US9336288B2 (en) | Workflow controller compatibility | |
US8898291B2 (en) | Dynamically expanding computing resources in a networked computing environment | |
US9413818B2 (en) | Deploying applications in a networked computing environment | |
US9612946B2 (en) | Using linked data to determine package quality | |
US9996888B2 (en) | Obtaining software asset insight by analyzing collected metrics using analytic services | |
US10275326B1 (en) | Distributed computing system failure detection | |
WO2016197853A1 (zh) | 一种基于复杂度的业务处理方法和装置 | |
CN107491371B (zh) | 一种监控部署的方法以及装置 | |
CN114490268A (zh) | 全链路监控方法、装置、设备、存储介质和程序产品 | |
US10862984B2 (en) | Methods and apparatus to monitor usage of virtual computing environments | |
US10951540B1 (en) | Capture and execution of provider network tasks | |
CN106911784B (zh) | 一种执行异步事件的方法和装置 | |
US11627193B2 (en) | Method and system for tracking application activity data from remote devices and generating a corrective action data structure for the remote devices | |
US11416318B1 (en) | Application programming interface for integration flow design | |
CN116049246A (zh) | 资源数据查询方法、装置、电子设备及存储介质 | |
US10311019B1 (en) | Distributed architecture model and management | |
CN108089899B (zh) | 查询报表的实现方法及装置 | |
CN112486501B (zh) | 一种Spark应用部署管理方法及相关设备 | |
US20240054066A1 (en) | Portable binary files for client side execution of federated application programming interfaces |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16806751 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16806751 Country of ref document: EP Kind code of ref document: A1 |