WO2024037168A1 - 建立模型的方法、装置以及设备 - Google Patents

建立模型的方法、装置以及设备 Download PDF

Info

Publication number
WO2024037168A1
WO2024037168A1 PCT/CN2023/100721 CN2023100721W WO2024037168A1 WO 2024037168 A1 WO2024037168 A1 WO 2024037168A1 CN 2023100721 W CN2023100721 W CN 2023100721W WO 2024037168 A1 WO2024037168 A1 WO 2024037168A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
model
application program
data
roi
Prior art date
Application number
PCT/CN2023/100721
Other languages
English (en)
French (fr)
Inventor
刘昊程
朱琦
崔宝龙
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024037168A1 publication Critical patent/WO2024037168A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/53Decompilation; Disassembly
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Definitions

  • the present application relates to the field of information technology, and more specifically, to methods, devices and equipment for building models.
  • this information can include the performance of the application in processing data.
  • knowing the data processing performance of an application used to implement supercomputing can make it easier for users to predict the time required for the application to process data.
  • This application provides a method, device and equipment for building a model. This method does not require the source code of an application program when generating a target model. Therefore, it is also applicable to some scenarios where the source code of the application program cannot be obtained.
  • the first aspect provides a method for building a model, including: first obtaining a binary file corresponding to an application, and then generating a target model based on the obtained binary file, and the output result of the generated target model indicates the first step of the application. a message.
  • the output result of the target model indicates the first information of the application program.
  • This method does not require the source code of the application when building the model, so it is also suitable for some scenarios where the source code of the application cannot be obtained. That is, this method is more applicable.
  • generating a target model according to the binary file includes: obtaining the region of interest ROI in the application program according to the binary file; Describe the ROI and generate the target model.
  • obtaining the region of interest ROI in the application program according to the binary file includes: converting the binary file into a third A programming language, the first programming language is a language that can be used for program static analysis; perform program static analysis on the first programming language to obtain the ROI in the application program.
  • the binary file is converted into a language that can be used for program static analysis, that is, the first programming language, and the ROI in the application is obtained by performing program static analysis on the first programming language, and then according to the application
  • the ROI in the program generates the target model.
  • the method of building a model provided by this application does not need to actually run the application program in the presence of input. Therefore, the method of building a model provided by this application is decoupled from the input of the application program, and has stronger dynamic scalability.
  • the ROI includes at least one of the following: a basic block for calculation in the application program, a block for input/output I/O Basic blocks, basic blocks used to access memory, basic blocks used for data operations.
  • the application program's processing of data requires the participation of at least two processing nodes, and the ROI includes a communication interface between nodes participating in data processing.
  • the first programming language includes an intermediate representation IR language.
  • the first information includes at least one of the data processing performance of the application program and the function of the application program.
  • the user can predict the data processing performance of the application program before using the application program to process data.
  • the output result of the target model indicate the function of the application program, for example, indicating at least one of the data flow and data dependency relationship corresponding to the basic block used for data operation in the application program, so that according to the basic block used for data operation in the application program, Data corresponding to the basic block of the operation At least one of the flow and data dependencies optimizes the application's algorithm.
  • this application provides a device for building a model, including: a processing module, used to obtain the binary file corresponding to the application program; the processing module is also used to generate a target model according to the binary file, the The output result of the target model indicates the first information of the application program.
  • the output result of the target model indicates the first information of the application program.
  • This device does not need to rely on the source code of the application program when establishing the model, so it is also suitable for some scenarios where the source code of the application program cannot be obtained, that is, the device has greater applicability.
  • the processing module is specifically configured to: obtain the region of interest ROI in the application program according to the binary file; generate a target according to the ROI Model.
  • the processing module is specifically used to: convert the binary file into a first programming language, and the first programming language is capable of being A language used for program static analysis; performing program static analysis on the first programming language to obtain the ROI in the application program.
  • the binary file is converted into a language that can be used for program static analysis, that is, the first programming language, and the ROI in the application is obtained by performing program static analysis on the first programming language, and then according to the application
  • the ROI in the program generates the target model.
  • the device for establishing the model provided by this application There is no need to actually run the application program when establishing the target model. Therefore, the device for establishing the model provided by this application has higher modeling efficiency.
  • the device for building a model provided by this application does not need to actually run the application program in the presence of input. Therefore, the device for building a model provided by this application is decoupled from the input of the application program when building the model, and has stronger dynamic scalability. .
  • the ROI includes at least one of the following: a basic block for calculation in the application program, a block for input/output I/O Basic blocks, basic blocks used to access memory, basic blocks used for data operations.
  • the application program's processing of data requires the participation of at least two processing nodes, and the ROI includes a communication interface between nodes participating in data processing.
  • the first programming language includes an intermediate representation IR language.
  • the first information includes at least one of the data processing performance of the application program and the function of the application program.
  • the user can predict the data processing performance of the application program before using the application program to process data.
  • the output result of the target model indicate the function of the application program, for example, indicating at least one of the data flow and data dependency relationship corresponding to the basic block used for data operation in the application program, so that according to the basic block used for data operation in the application program, At least one of the data flow and data dependency corresponding to the basic block of the operation optimizes the algorithm of the application.
  • a device for building a model which device includes a memory and a processor.
  • the memory is used to store instructions; the processor executes the instructions stored in the memory, so that the device performs the model building method in the first aspect or any possible implementation of the first aspect.
  • a computer-readable storage medium In a fourth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When the instructions are run on a computer, they cause the computer to execute the above-mentioned first aspect or any possible implementation of the first aspect. method of building models.
  • a fifth aspect provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the method for building a model in the first aspect or any possible implementation of the first aspect.
  • Figure 1 is a schematic flow chart of a method for establishing a model provided by this application
  • FIG. 2 is a schematic diagram of the execution logic between basic blocks in an application provided by this application;
  • Figure 3 is a schematic diagram of the data flow corresponding to the basic blocks used for data operations in an example application provided by this application;
  • Figure 4 is a schematic diagram of data dependencies corresponding to basic blocks used for data operations in an example application provided by this application;
  • Figure 5 is a schematic block diagram of a device for establishing a model provided by this application.
  • Figure 6 is a schematic block diagram of a model-building device provided by this application.
  • Program static analysis mainly refers to the analysis technology that uses technical means to scan the program code or binary without running the source code to verify whether the code meets certain index requirements.
  • IR is a data structure used internally by compilers/virtual machines/program static analysis tools to represent application source code. It is designed to support a series of processing processes (such as optimization, conversion, etc.). IR can be in several main forms Exists: in-memory data structures, special tuple-based or stack-based code.
  • Figure 1 shows a schematic flow chart of establishing a model.
  • Step 101 Obtain the binary file corresponding to the application program.
  • the binary file corresponding to the application program may be provided by the user.
  • the user compiles the source code corresponding to the application program, obtains the binary file corresponding to the application program, and provides the binary file corresponding to the application program to the party that builds the model.
  • Step 102 Generate a target model according to the binary file, where the output result of the target model indicates the first information of the application program.
  • the output result of the target model indicates the first information of the application program.
  • This method does not require the source code of the application when building the model, so it is also suitable for some scenarios where the source code of the application cannot be obtained. That is, this method is more applicable.
  • the region of interest (ROI) in the application can be obtained based on the binary file corresponding to the application, and then , based on the ROI, generate the target model.
  • the binary file of the application program when obtaining the ROI, can be converted into the first programming language. After that, the program static analysis is performed on the first programming language to obtain the ROI. Application ROI.
  • the first programming language may include IR language.
  • the ROI of the application may include at least one of the following: basic blocks used for calculation in the application, basic blocks used for input/output (I/O), Basic blocks for accessing memory and basic blocks for data operations.
  • a basic block can be understood as: a sequence of statements executed sequentially in an application program.
  • a basic block used for calculation in an application program can be understood as: a sequence of statements executed sequentially in an application program for calculation, for input/output.
  • the basic blocks can be understood as: the sequence of statements used in the application for input/output to be executed sequentially, and the basic blocks used to access memory to be understood as: the sequence of statements used to access memory in the application to be executed sequentially, used for data
  • a basic block of operations can be understood as: a sequence of statements executed sequentially in an application for data operations.
  • the ROI of the application can include at least one of the following: basic blocks used for calculation in the application, input used / Basic blocks for output, basic blocks for accessing memory, basic blocks for data operations, and communication interfaces between nodes involved in data processing.
  • the above-mentioned at least two processing nodes can be at least two servers that can communicate with each other, or they can be at least two processors deployed in the same server, or they can run the same server. at least two processes in .
  • the first information may include at least one of the data processing performance of the application program or the functions of the application program.
  • the application is used to analyze protein data.
  • the output results of the target model can indicate the performance of the application in analyzing protein data.
  • the output results of the target model can complete the analysis of protein data for the application.
  • the time required; alternatively, the output result of the target model can indicate the function of the application program.
  • the output result of the target model can indicate at least one of the data flows or data dependencies corresponding to the basic blocks used for data operations in the application program. A sort of.
  • the basic blocks related to the performance of the application in processing data can be obtained from the IR language, for example, the basic blocks for calculation, the basic blocks for input/output can be obtained from the IR language , basic blocks used to access memory (hereinafter referred to as "memory access”), etc.
  • the communication interface between the nodes participating in data processing can also be obtained from the IR language.
  • the target model can be established based on the obtained basic blocks.
  • the performance characteristics can be determined based on the obtained basic blocks, and the target model can be established based on the performance characteristics.
  • the following takes basic blocks including basic blocks for calculation and basic blocks for memory access as an example to introduce the method of determining performance characteristics based on basic blocks and establishing a target model based on performance characteristics.
  • the basic blocks used for memory access in the application include basic block 1, basic block 2, basic block 3, and basic block 4, and the basic blocks used for calculation in the application include basic block 5 and basic block 6, where, basic block 1 loaded data 1 from memory, basic block 2 loaded data 2 from memory, basic block 3 loaded data 3 from memory, basic block 5 performed a multiplication operation on data 1 and data 2, and basic block 6 performed a multiplication operation on basic block 6.
  • the result in 5 performs an addition operation with data 3
  • basic block 4 performs a storage operation on the result in basic block 6.
  • the result in basic block 6 is recorded as data 4.
  • Figure 2 shows the execution logic between the above basic blocks.
  • ld in Figure 2 represents the load operation
  • mul represents the multiplication operation
  • add represents the addition operation
  • st represents the storage operation.
  • the performance characteristics can be determined.
  • the performance characteristics can include calculation characteristics and memory access characteristics.
  • compute represents performance characteristics
  • uops is used to determine the micro-operation corresponding to the data operation.
  • uops(mul) is used to determine the micro-operation corresponding to the multiplication operation
  • uops(add) is used to determine the micro-operation corresponding to the addition operation.
  • accesses represents memory access characteristics, and size is used to determine the size of the data being operated. For example, size (data 1), size (data 2), size (data 3), and size (data 4) are used to determine data 1 respectively. , the number of bytes of data 2, data 3, and data 4.
  • the target model can be determined based on the computing characteristics and memory access characteristics. After that, if you want to get the performance of the application in processing data, you can input the data into a target model, and the output of the target model indicates the performance of the application in processing data.
  • basic blocks related to the functions of the application can be obtained from the IR language.
  • basic blocks for data operations can be obtained from the IR language.
  • basic blocks related to the functionality of the application can be colored in the IR language.
  • basic blocks for data operations can be colored in the IR language so that when building a model later, Identify the colored basic blocks as ROIs in your application.
  • a target model can be established based on the above basic blocks.
  • the functional characteristics of the application can be determined based on the obtained above basic blocks, and the target model can be established based on the functional characteristics.
  • the functional characteristics of the application program determined based on the basic blocks for data operations may include at least one of a data flow or a data dependency relationship corresponding to the basic blocks for data operations in the application program.
  • the following takes the functional characteristics including the data flow corresponding to the basic blocks used for data operations in the application as an example to introduce the method of building a model based on the functional characteristics.
  • variable a is created and assigned a value in basic block 7, and in basic block 7, variable a is created and assigned a value.
  • Variable c is created and assigned a value in block 8
  • variable b is created and assigned a value in basic block 9
  • variables a and b created in basic block 7 and basic block 9 are used in basic block 10, and a New variable u, and assign u to the value of a+b.
  • Basic block 11 uses the variable c and basic block created in basic block 2.
  • U in 10 assigns variable a in basic block 7 to c+u.
  • the data flow corresponding to the basic block is determined.
  • the data flow corresponding to the basic block 7 to the basic block 11 is shown in Figure 3, and then based on the data flow, the target model is established.
  • the target model After obtaining the target model, if you want to obtain the data flow corresponding to the basic blocks used for data operations in an application, you can input the binary file corresponding to the application into the target model, and the output result of the target model indicates that the application The data flow corresponding to the basic blocks used for data operations in the program.
  • the functions of the application according to the target model for example, obtaining the data flow corresponding to the basic block used for data operation in the application, so that the application can be modified based on the data flow corresponding to the basic block used for data operation in the application.
  • the algorithm is optimized.
  • the following takes the functional characteristics including the data dependencies corresponding to the basic blocks used for data operations in the application as an example to introduce the method of building a model based on the functional characteristics.
  • basic blocks related to data operations in the application include basic block 12, basic block 13, basic block 14, and basic block 15.
  • basic block 12 performs an addition operation on data 5 and data 6
  • basic block 13 performs an addition operation on data 7 and data 6.
  • the result of the previous iteration in basic block 14 performs an addition operation.
  • Basic block 15 performs an addition operation on the result in basic block 12 and the result in basic block 13.
  • Basic block 14 performs an addition operation on the result in basic block 15 and a constant. multiply operation.
  • the corresponding data dependency relationship is determined.
  • the data dependency relationship corresponding to the basic block 12 to the basic block 15 is shown in Figure 4, and then based on the data dependency relationship, the target model is established.
  • the purpose of determining the data dependencies corresponding to the basic blocks used for data operations in the application is to determine the longest data dependency path corresponding to the basic blocks, so as to optimize the application algorithm based on the longest data dependency path.
  • the path outlined by the dotted box in Figure 4 is the longest data dependency path among the data dependencies corresponding to basic blocks 12 to 15.
  • the target model After obtaining the target model, if you want to obtain the data dependencies corresponding to the basic blocks used for data operations in an application, you can input the binary file corresponding to the application into the target model, and the output result of the target model indicates that Data dependencies corresponding to the basic blocks used for data manipulation in the application.
  • the method of building a model provided in this application can be called a black box modeling method, that is, a method of modeling directly through the binary file corresponding to the application program without the source code of the application program.
  • FIG. 5 is a schematic structural block diagram of a model-building device 500 provided by an embodiment of the present application.
  • the device 500 for building a model includes: an acquisition module 510 and a processing module 520.
  • the acquisition module 510 is used to: obtain the binary file corresponding to the application program;
  • the processing module 520 is also configured to generate a target model according to the binary file, and the output result of the target model indicates the first information of the application program.
  • model-building device 500 in the embodiment of the present application can be implemented by an application-specific integrated circuit (ASIC), or can be implemented by a programmable logic device (PLD).
  • PLD programmable logic device
  • the above-mentioned PLD It can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL) or any combination thereof.
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL general array logic
  • the device 500 for establishing the model and its respective modules can also be software modules.
  • the processing module 520 is specifically configured to: obtain the region of interest ROI in the application program according to the binary file; and generate a target model according to the ROI.
  • the processing module 520 is specifically configured to: convert the binary file into a first programming language, where the first programming language is a language that can be used for program static analysis; The first programming language performs program static analysis to obtain ROI in the application program.
  • the ROI includes at least one of the following: a basic block used for calculation, a basic block used for input/output I/O, and a basic block used for accessing memory in the application program. , basic blocks for data manipulation.
  • the application's processing of data requires the participation of at least two processing nodes, and the ROI includes communication interfaces between nodes participating in data processing.
  • the first programming language includes an intermediate representation IR language.
  • the first information includes at least one of data processing performance of the application program and functions of the application program.
  • the apparatus 500 for establishing a model may correspond to performing the method described in the embodiment of the present application, and the above and other operations and/or functions of each unit in the apparatus 500 for establishing the model are respectively to implement the steps in FIG. 1
  • the corresponding process of the method will not be repeated here for the sake of brevity.
  • FIG. 6 is a schematic structural block diagram of a model-building device 600 provided by an embodiment of the present application.
  • the device 600 for building a model includes: a processor 610, a memory 620, a communication interface 630, and a bus 640.
  • the processor 610 in the model-building device 600 shown in FIG. 6 may correspond to the processing module 520 in the model-building device 500 in FIG. 5
  • the communication interface 630 in the model-building device 600 may correspond to the model-building device 600 .
  • the processor 610 may be connected to the memory 620.
  • the memory 620 can be used to store the program code and data. Therefore, the memory 620 may be a storage unit internal to the processor 610 , or may be an external storage unit independent of the processor 610 , or may include a storage unit internal to the processor 610 and an external storage unit independent of the processor 610 . part.
  • the model building device 600 may also include a bus 640 .
  • the memory 620 and the communication interface 630 can be connected to the processor 610 through the bus 640.
  • the bus 640 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus 640 can be divided into an address bus, a data bus, a control bus, etc. For ease of presentation, only one line is used in Figure 6, but it does not mean that there is only one bus or one type of bus.
  • the processor 610 may use a central processing unit (CPU).
  • the processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (field programmable gate arrays, FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs field programmable gate arrays
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the processor 610 uses one or more integrated circuits to execute relevant programs to implement the technical solutions provided by the embodiments of this application.
  • the memory 620 may include read-only memory and random access memory and provides instructions and data to the processor 610 .
  • a portion of processor 610 may also include non-volatile random access memory.
  • processor 610 may also store device type information.
  • the processor 610 executes the computer execution instructions in the memory 620 to utilize the hardware resources in the model-building device 600 to perform the operation steps of the above method.
  • the device 600 for establishing a model may correspond to the apparatus 500 for establishing a model in the embodiment of the present application, and may correspond to the corresponding subject in executing the method shown in Figure 1 according to the embodiment of the present application, Moreover, the above and other operations and/or functions of each module in the model-building device 600 are respectively intended to implement the corresponding processes of the method in Figure 1. For the sake of simplicity, they will not be described again here.
  • This application also provides a computer-readable storage medium.
  • the computer-readable storage medium stores computer instructions.
  • the device for establishing the model causes the device to establish the model to execute the method of establishing the model provided by the embodiment of the application. method.
  • This application also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to execute the method for building a model provided by the embodiments of this application.
  • the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination.
  • the above-described embodiments may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the processes or functions described in the embodiments of the present application are generated in whole or in part.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage such as a server, data center, or the like that contains one or more sets of available media.
  • the usable media may be magnetic media (e.g. Such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media.
  • the semiconductor medium may be a solid state drive (SSD).
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to cause a memory (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code. .

Abstract

本申请提供了建立模型的方法、装置以及设备,应用于信息技术领域。通过获取应用程序对应的二进制文件,并根据二进制文件生成目标模型,目标模型的输出结果指示应用程序的第一信息。该方法在建立模型时无需借助于应用程序的源码,因此对于一些无法获得应用程序的源码的场景也适用,即,该方法的适用性更强。

Description

建立模型的方法、装置以及设备
本申请要求于2022年08月18日提交国家知识产权局、申请号为202211002976.3、申请名称为“建立模型的方法、装置以及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息技术领域,并且更具体地,涉及建立模型的方法、装置以及设备。
背景技术
对于一些应用程序,在使用该应用程序前,获知该应用程序的一些相关信息是比较重要的,例如,对于用于实现超级计算的应用程序,该信息可以包括应用程序处理数据的性能,对于用户而言,获知用于实现超级计算的应用程序处理数据的性能可以便于用户对该应用程序处理数据所需的时间有所预判。
已知一种获知应用程序的相关信息的方法:借助于应用程序的源码来获知与应用程序的相关的一些信息。
发明内容
本申请提供了一种建立模型的方法、装置以及设备,该方法在生成目标模型时无需借助于应用程序的源码,因此,对于一些无法获得应用程序的源码的场景也适用。
第一方面,提供了一种建立模型的方法,包括:首先获取应用程序对应的二进制文件,之后根据获取到的二进制文件,生成目标模型,生成的目标模型的输出结果指示所述应用程序的第一信息。
基于上述技术方案,通过获取应用程序对应的二进制文件,并根据二进制文件生成目标模型,目标模型的输出结果指示应用程序的第一信息。该方法在建立模型时无需借助于应用程序的源码,因此对于一些无法获得应用程序的源码的场景也适用,即,该方法的适用性更强。
结合第一方面,在第一方面的某些实现方式中,所述根据所述二进制文件,生成目标模型,包括:根据所述二进制文件,获取所述应用程序中的感兴趣区域ROI;根据所述ROI,生成目标模型。
结合第一方面和上述实现方式,在第一方面的某些实现方式中,所述根据所述二进制文件,获取所述应用程序中的感兴趣区域ROI,包括:将所述二进制文件转换为第一编程语言,所述第一编程语言为能够被用于程序静态分析的语言;对所述第一编程语言进行程序静态分析,获取所述应用程序中的ROI。
基于上述技术方案,通过将二进制文件转换为可以被用于程序静态分析的语言,即第一编程语言,并通过对第一编程语言进行程序静态分析的方式获取应用程序中的ROI,进而根据应用程序中的ROI,生成目标模型,相对于将应用程序在输入存在的情况下真实运行,根据应用程序在运行过程中所执行的指令以及数据生成目标模型的方法,本申请提供的建立模型的方法在建立目标模型时无需真实运行应用程序,因此,本申请提供的建立模型的方法的建模效率更高。
此外,本申请提供的建立模型的方法无需在输入存在的情况下真实运行应用程序,因此,本申请提供的建立模型的方法与应用程序的输入解耦,动态可扩展性更强。
结合第一方面和上述实现方式,在第一方面的某些实现方式中,所述ROI包括以下至少一项:所述应用程序中用于计算的基本块、用于输入/输出I/O的基本块、用于访问内存的基本块、用于数据操作的基本块。
结合第一方面和上述实现方式,在第一方面的某些实现方式中,所述应用程序对数据的处理需要至少两个处理节点参与,所述ROI包括参与数据处理的节点间的通信接口。
结合第一方面和上述实现方式,在第一方面的某些实现方式中,所述第一编程语言包括中间表示IR语言。
结合第一方面和上述实现方式,在第一方面的某些实现方式中,所述第一信息包括所述应用程序的处理数据的性能与所述应用程序的功能中的至少一种。
基于上述方案,通过使目标模型的输出结果指示应用程序的处理数据的性能,从而使得用户在使用应用程序处理数据之前可以对该应用程序的处理数据的性能有所预判。
通过使目标模型的输出结果指示应用程序的功能,例如,指示应用程序中的用于数据操作的基本块对应的数据流与数据依赖关系中的至少一种,以便根据应用程序中的用于数据操作的基本块对应的数据 流与数据依赖关系中的至少一种对应用程序的算法进行优化。
第二方面,本申请提供了一种建立模型的装置,包括:处理模块,用于获取应用程序对应的二进制文件;所述处理模块,还用于根据所述二进制文件,生成目标模型,所述目标模型的输出结果指示所述应用程序的第一信息。
基于上述技术方案,通过获取应用程序对应的二进制文件,并根据二进制文件生成目标模型,目标模型的输出结果指示应用程序的第一信息。该装置在建立模型时无需借助于应用程序的源码,因此对于一些无法获得应用程序的源码的场景也适用,即,该装置的适用性更强。
结合第二方面,在第二方面的某些实现方式中,所述处理模块,具体用于:根据所述二进制文件,获取所述应用程序中的感兴趣区域ROI;根据所述ROI,生成目标模型。
结合第二方面和上述实现方式,在第二方面的某些实现方式中,所述处理模块,具体用于:将所述二进制文件转换为第一编程语言,所述第一编程语言为能够被用于程序静态分析的语言;对所述第一编程语言进行程序静态分析,获取所述应用程序中的ROI。
基于上述技术方案,通过将二进制文件转换为可以被用于程序静态分析的语言,即第一编程语言,并通过对第一编程语言进行程序静态分析的方式获取应用程序中的ROI,进而根据应用程序中的ROI,生成目标模型,相对于将应用程序在输入存在的情况下真实运行,根据应用程序在运行过程中所执行的指令以及数据生成目标模型的装置,本申请提供的建立模型的装置在建立目标模型时无需真实运行应用程序,因此,本申请提供的建立模型的装置的建模效率更高。
此外,本申请提供的建立模型的装置无需在输入存在的情况下真实运行应用程序,因此,本申请提供的建立模型的装置在建立模型时与应用程序的输入解耦,动态可扩展性更强。
结合第二方面和上述实现方式,在第二方面的某些实现方式中,所述ROI包括以下至少一项:所述应用程序中用于计算的基本块、用于输入/输出I/O的基本块、用于访问内存的基本块、用于数据操作的基本块。
结合第二方面和上述实现方式,在第二方面的某些实现方式中,所述应用程序对数据的处理需要至少两个处理节点参与,所述ROI包括参与数据处理的节点间的通信接口。
结合第二方面和上述实现方式,在第二方面的某些实现方式中,所述第一编程语言包括中间表示IR语言。
结合第二方面和上述实现方式,在第二方面的某些实现方式中,所述第一信息包括所述应用程序的处理数据的性能与所述应用程序的功能中的至少一种。
基于上述方案,通过使目标模型的输出结果指示应用程序的处理数据的性能,从而使得用户在使用应用程序处理数据之前可以对该应用程序的处理数据的性能有所预判。
通过使目标模型的输出结果指示应用程序的功能,例如,指示应用程序中的用于数据操作的基本块对应的数据流与数据依赖关系中的至少一种,以便根据应用程序中的用于数据操作的基本块对应的数据流与数据依赖关系中的至少一种对应用程序的算法进行优化。
第三方面,提供一种建立模型的设备,该设备包括存储器与处理器。该存储器用于存储指令;该处理器执行该存储器存储的指令,使得该设备执行第一方面或第一方面的任一可能的实现方式中的建立模型的方法。
第四方面,提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得计算机执行上述第一方面或第一方面的任一可能的实现方式中的建立模型的方法。
第五方面,提供一种包含指令的计算机程序产品,当该指令在计算机上运行时,使得计算机执行第一方面或第一方面的任一可能的实现方式中的建立模型的方法。
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。
附图说明
图1为本申请提供的建立模型的方法的示意性流程图;
图2为本申请提供的一例应用程序中的基本块之间的执行逻辑的示意图;
图3为本申请提供的一例应用程序中的用于数据操作的基本块对应的数据流的示意图;
图4为本申请提供的一例应用程序中的用于数据操作的基本块对应的数据依赖关系的示意图;
图5是本申请提供的建立模型的装置的示意性框图;
图6是本申请提供的建立模型的设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
为了便于理解,首先对本申请中涉及的相关联术语进行简单介绍。
程序静态分析
程序静态分析主要指在不运行源码的方式下,通过技术手段对程序代码或二进制进行扫描,验证代码是否满足一定指标要求的分析技术。
中间表示(intermediate representation,IR)
IR是一种编译器/虚拟机/程序静态分析工具内部用来表示应用程序源码的数据结构,被设计用于支持一系列的处理流程(如优化、转换等),IR可以以几种主要形式存在:内存中的数据结构、特殊的基于元组或者堆栈的代码。
下面结合图1对本申请提供的建立模型的方法100进行介绍,图1示出的是建立模型的示意性流程图。
步骤101,获取应用程序对应的二进制文件。
应用程序对应的二进制文件可以是用户提供的,例如,用户编译应用程序对应的源码,获得应用程序对应的二进制文件,并将应用程序对应的二进制文件提供给建立模型的一方。
步骤102,根据二进制文件,生成目标模型,其中,目标模型的输出结果指示应用程序的第一信息。
基于上述技术方案,通过获取应用程序对应的二进制文件,并根据二进制文件生成目标模型,目标模型的输出结果指示应用程序的第一信息。该方法在建立模型时无需借助于应用程序的源码,因此对于一些无法获得应用程序的源码的场景也适用,即,该方法的适用性更强。
可选地,作为一种实现方式,在根据应用程序对应的二进制文件,生成目标模型时,可以根据应用程序对应的二进制文件,获取应用程序中的感兴趣区域(region of interest,ROI),之后,根据ROI,生成目标模型。
可选地,作为一种实现方式,根据应用程序对应的二进制文件,获取ROI时,可以将应用程序的二进制文件转换为第一编程语言,之后,对第一编程语言进行程序静态分析,从中获取应用程序的ROI。
可选地,作为一种实现方式,第一编程语言可以包括IR语言。
可选地,作为一种实现方式,应用程序的ROI可以包括以下至少一项:应用程序中用于计算的基本块、用于输入/输出(input/output,I/O)的基本块、用于访问内存的基本块、用于数据操作的基本块。
其中,基本块可以理解为:应用程序中顺序执行的语句序列,例如,应用程序中用于计算的基本块可以理解为:应用程序中用于计算的顺序执行的语句序列,用于输入/输出的基本块可以理解为:应用程序中用于输入/输出的顺序执行的语句序列、用于访问内存的基本块可以理解为:应用程序中用于访问内存的顺序执行的语句序列、用于数据操作的基本块可以理解为:应用程序中用于数据操作的顺序执行的语句序列。
可选地,作为一种实现方式,当应用程序对数据的处理需要至少两个处理节点参与时,应用程序的ROI可以包括以下至少一项:应用程序中用于计算的基本块、用于输入/输出的基本块、用于访问内存的基本块、用于数据操作的基本块以及参与数据处理的节点间的通信接口。
在具体实现时,上述至少两个处理节点可以为可以互相通信的至少两个服务端,或者,可以是部署在同一个服务端中的至少两个处理器,或者,可以是运行同一个服务端中的至少两个进程。
可选地,作为一种实现方式,第一信息可以包括应用程序处理数据的性能或应用程序的功能中的至少一种。
例如,应用程序用于做蛋白质数据的分析,在这种情况下,目标模型的输出结果可以指示应用程序分析蛋白质数据的性能,例如,目标模型的输出结果可以为应用程序完成对蛋白质数据的分析所需要的时间;或者,目标模型的输出结果可以指示应用程序的功能,例如,目标模型的输出结果可以指示应用程序中的用于数据操作的基本块对应的数据流或数据依赖关系中的至少一种。
下面以第一编程语言为IR语言为例,对本申请提供的建立模型的方法分情况进行介绍。
情况1,目标模型的输出结果指示应用程序的处理数据的性能。
为了建立上述模型,可以首先获取应用程序中的ROI,例如,可以将应用程序的二进制文件转换为 IR语言,之后,对IR语言进行程序静态分析,从中获取应用程序的ROI。
在获取应用程序的ROI时,例如,可以从IR语言中获取与应用程序处理数据的性能相关的基本块,例如,从IR语言中获取用于计算的基本块、用于输入/输出的基本块、用于访问内存(下文中简称为“访存”)的基本块等。
如果应用程序对数据的处理需要至少两个处理节点参与,则在建立上述模型时,还可以从IR语言中获取参与数据处理的节点间的通信接口。
之后,可以根据获取到的上述基本块,建立目标模型,例如,可以根据获取到的上述基本块,确定性能特征,根据性能特征,建立目标模型。
下面以基本块包括用于计算的基本块与用于访存的基本块为例,对根据基本块,确定性能特征,以及根据性能特征,建立目标模型的方法进行介绍。
假设应用程序中用于访存的基本块包括基本块1、基本块2、基本块3、基本块4,应用程序中用于计算的基本块包括基本块5、基本块6,其中,基本块1从内存中加载了数据1、基本块2从内存中加载了数据2、基本块3从内存中加载了数据3,基本块5对数据1与数据2执行乘操作,基本块6对基本块5中的结果与数据3执行加操作,基本块4对基本块6中的结果执行存储操作,为便于描述,将基本块6中的结果记为数据4。图2示出了上述各个基本块之间的执行逻辑。
其中,图2中的ld代表加载操作,mul代表乘操作,add代表加操作,st代表存储操作。
根据上述用于计算的基本块与用于访存的基本块,可以确定性能特征,在这种情况下,性能特征可以包括计算特征与访存特征。
例如,计算特征可以通过关系式(1)进行计算:
compute=uops(mul)+uops(add)   (1)
其中,compute代表性能特征,uops用于确定数据操作对应的微操作,例如,uops(mul)用于确定乘操作对应的微操作,uops(add)用于确定加操作对应的微操作。
访存特征可以通过关系式(2)进行计算:
accesses=size(数据1)+size(数据2)+size(数据3)+size(数据4)   (2)
其中,accesses代表访存特征,size用于确定被操作的数据的大小,例如,size(数据1)、size(数据2)、size(数据3)、size(数据4)分别用于确定数据1、数据2、数据3、数据4的字节数。
在得到计算特征与访存特征后,可以根据计算特征与访存特征,确定目标模型。之后,如果要得到应用程序的处理数据的性能,则可以将数据输入目标模型,该目标模型的输出结果指示该应用程序的处理数据的性能。
情况2,目标模型输出结果指示应用程序的功能。
为了建立上述模型,可以首先获取应用程序中的ROI,例如,可以将应用程序的二进制文件转换为IR语言,之后,对IR语言进行程序静态分析,从中获取应用程序的ROI。
在获取应用程序的ROI时,作为一种实现方式,可以从IR语言中获取与应用程序的功能相关的基本块,例如,可以从IR语言中获取用于数据操作的基本块。
作为另一种实现方式,可以在IR语言中将与应用程序的功能相关的基本块进行染色,例如,可以在IR语言中将用于数据操作的基本块进行染色,以便在后续建立模型时,将被染色的基本块确定为应用程序中的ROI。
之后,可以根据上述基本块,建立目标模型,例如,可以根据获取到的上述基本块,确定应用程序的功能特征,根据功能特征,建立目标模型。
例如,根据用于数据操作的基本块确定的应用程序的功能特征可以包括应用程序中的用于数据操作的基本块对应的数据流或数据依赖关系中的至少一种。
下面以功能特征包括应用程序中的用于数据操作的基本块对应的数据流为例,对根据功能特征,建立模型的方法进行介绍。
假设应用程序中与数据操作相关的基本块包括基本块7、基本块8、基本块9、基本块10、基本块11,其中,在基本块7中创建了变量a并为其赋值,在基本块8中创建了变量c并为其赋值,在基本块9中创建了变量b并为其赋值,基本块10中使用到了基本块7、基本块9中创建的变量a、b,并且生成一个新的变量u,并将u赋值为a+b的值,基本块11中使用到了基本块2中创建的变量c和基本块 10中的u,将基本块7中的变量a赋值为c+u。
根据基本块7至基本块11,确定基本块对应的数据流,例如,基本块7至基本块11对应的数据流如图3所示,进而根据该数据流,建立目标模型。
在得到目标模型之后,如果要得到某个应用程序中的用于数据操作的基本块对应的数据流,则可以将该应用程序对应的二进制文件输入目标模型,该目标模型的输出结果指示该应用程序中的用于数据操作的基本块对应的数据流。
通过根据目标模型获取应用程序的功能,例如,获取应用程序中的用于数据操作的基本块对应的数据流,以便根据应用程序中的用于数据操作的基本块对应的数据流对应用程序的算法进行优化。
下面以功能特征包括应用程序中的用于数据操作的基本块对应的数据依赖关系为例,对根据功能特征,建立模型的方法进行介绍。
假设应用程序中与数据操作相关的基本块包括基本块12、基本块13、基本块14、基本块15,其中,基本块12对数据5与数据6执行加操作,基本块13对数据7与基本块14中的上一轮迭代的结果执行加操作,基本块15对基本块12中的结果与基本块13中的结果执行加操作,基本块14对基本块15中的结果与一个常量执行乘操作。
根据基本块12至基本块15,确定对应的数据依赖关系,例如,基本块12至基本块15对应的数据依赖关系如图4所示,进而根据该数据依赖关系,建立目标模型。
其中,确定应用程序中的用于数据操作的基本块对应的数据依赖关系的目的是确定基本块对应的最长的数据依赖路径,以便根据最长的数据依赖路径对应用程序的算法进行优化,例如,图4中的虚线框框出的路径为基本块12~基本块15对应的数据依赖关系中的最长的数据依赖路径。
在得到目标模型之后,如果要得到某个应用程序中的用于数据操作的基本块对应的数据依赖关系,则可以将该应用程序对应的二进制文件输入目标模型,该目标模型的输出结果指示该应用程序中的用于数据操作的基本块对应的数据依赖关系。
本申请提供的建立模型的方法可以称为黑盒建模方法,即在没有应用程序的源码的情况下,直接通过应用程序对应的二进制文件进行建模的方法。
需要说明的是,在具体实现时,情况1与情况2中描述的建立模型的方法可以单独实施,或者,也可以组合后实施。
上文结合图1至图4,详细描述了本申请实施例提供的建立模型的方法,下面将结合图5至图6,详细描述本申请的装置实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。
图5是本申请实施例提供的一种建立模型的装置500的示意性结构框图。该建立模型的装置500包括:获取模块510与处理模块520。
获取模块510用于:用于获取应用程序对应的二进制文件;
处理模块520还用于:还用于根据所述二进制文件,生成目标模型,所述目标模型的输出结果指示所述应用程序的第一信息。
应理解的是,本申请实施例的建立模型的装置500可以通过专用集成电路(application-specific integrated circuit,ASIC)实现,或,可以通过可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。当可以通过软件实现图1所示的建立模型的方法时,建立模型的装置500及其各个模块也可以为软件模块。
可选的,在一些实施例中,处理模块520,具体用于:根据所述二进制文件,获取所述应用程序中的感兴趣区域ROI;根据所述ROI,生成目标模型。
可选的,在一些实施例中,处理模块520,具体用于:将所述二进制文件转换为第一编程语言,所述第一编程语言为能够被用于程序静态分析的语言;对所述第一编程语言进行程序静态分析,获取所述应用程序中的ROI。
可选的,在一些实施例中,所述ROI包括以下至少一项:所述应用程序中用于计算的基本块、用于输入/输出I/O的基本块、用于访问内存的基本块、用于数据操作的基本块。
可选的,在一些实施例中,所述应用程序对数据的处理需要至少两个处理节点参与,所述ROI包括参与数据处理的节点间的通信接口。
可选的,在一些实施例中,所述第一编程语言包括中间表示IR语言。
可选的,在一些实施例中,所述第一信息包括所述应用程序的处理数据的性能与所述应用程序的功能中的至少一种。
根据本申请实施例的建立模型的装置500可对应于执行本申请实施例中描述的方法,并且建立模型的装置500中的各个单元的上述和其它操作和/或功能分别为了实现图1中的方法的相应流程,为了简洁,在此不再赘述。
图6是本申请实施例提供的一种建立模型的设备600的示意性结构框图。建立模型的设备600包括:处理器610、存储器620、通信接口630、总线640。
应理解,图6所示的建立模型的设备600中的处理器610可以对应于图5中建立模型的装置500中的处理模块520,建立模型的设备600中的通信接口630可以对应于建立模型的装置500中的获取模块510。
其中,该处理器610可以与存储器620连接。该存储器620可以用于存储该程序代码和数据。因此,该存储器620可以是处理器610内部的存储单元,也可以是与处理器610独立的外部存储单元,还可以是包括处理器610内部的存储单元和与处理器610独立的外部存储单元的部件。
可选的,建立模型的设备600还可以包括总线640。其中,存储器620、通信接口630可以通过总线640与处理器610连接。总线640可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。所述总线640可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。
应理解,在本申请实施例中,该处理器610可以采用中央处理单元(central processing unit,CPU)。该处理器还可以是其它通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。或者该处理器610采用一个或多个集成电路,用于执行相关程序,以实现本申请实施例所提供的技术方案。
该存储器620可以包括只读存储器和随机存取存储器,并向处理器610提供指令和数据。处理器610的一部分还可以包括非易失性随机存取存储器。例如,处理器610还可以存储设备类型的信息。
在所述建立模型的设备600运行时,所述处理器610执行所述存储器620中的计算机执行指令以利用所述建立模型的设备600中的硬件资源执行上述方法的操作步骤。
应理解,根据本申请实施例的建立模型的设备600可对应于本申请实施例中的建立模型的装置500,并可以对应于执行根据本申请实施例的图1所示方法中的相应主体,并且建立模型的设备600中的各个模块的上述和其它操作和/或功能分别为了实现图1中的方法的相应流程,为了简洁,在此不再赘述。
本申请还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机指令,当计算机指令在建立模型的设备上运行时,使得建立模型的设备执行本申请实施例提供的建立模型的方法。
本申请还提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得计算机执行本申请实施例提供的建立模型的方法。
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储器。所述可用介质可以是磁性介质(例 如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台存储器(可以是个人计算机,服务器,或者网络设备等)执行本申请实施例各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请实施例揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。

Claims (17)

  1. 一种建立模型的方法,其特征在于,包括:
    获取应用程序对应的二进制文件;
    根据所述二进制文件,生成目标模型,所述目标模型的输出结果指示所述应用程序的第一信息。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述二进制文件,生成目标模型,包括:
    根据所述二进制文件,获取所述应用程序中的感兴趣区域ROI;
    根据所述ROI,生成目标模型。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述二进制文件,获取所述应用程序中的感兴趣区域ROI,包括:
    将所述二进制文件转换为第一编程语言,所述第一编程语言为能够被用于程序静态分析的语言;
    对所述第一编程语言进行程序静态分析,获取所述应用程序中的ROI。
  4. 根据权利要求2或3所述的方法,其特征在于,所述ROI包括以下至少一项:所述应用程序中用于计算的基本块、用于输入/输出I/O的基本块、用于访问内存的基本块、用于数据操作的基本块。
  5. 根据权利要求4所述的方法,其特征在于,所述应用程序对数据的处理需要至少两个处理节点参与,所述ROI包括参与数据处理的节点间的通信接口。
  6. 根据权利要求3至5中任一项所述的方法,其特征在于,第一编程语言包括中间表示IR语言。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述第一信息包括所述应用程序的处理数据的性能与所述应用程序的功能中的至少一种。
  8. 一种建立模型的装置,其特征在于,包括:
    处理模块,用于获取应用程序对应的二进制文件;
    所述处理模块,还用于根据所述二进制文件,生成目标模型,所述目标模型的输出结果指示所述应用程序的第一信息。
  9. 根据权利要求8所述的装置,其特征在于,所述处理模块,具体用于:根据所述二进制文件,获取所述应用程序中的感兴趣区域ROI;根据所述ROI,生成目标模型。
  10. 根据权利要求9所述的装置,其特征在于,所述处理模块,具体用于:将所述二进制文件转换为第一编程语言,所述第一编程语言为能够被用于程序静态分析的语言;对所述第一编程语言进行程序静态分析,获取所述应用程序中的ROI。
  11. 根据权利要求9或10所述的装置,其特征在于,所述ROI包括以下至少一项:所述应用程序中用于计算的基本块、用于输入/输出I/O的基本块、用于访问内存的基本块、用于数据操作的基本块。
  12. 根据权利要求11所述的装置,其特征在于,所述应用程序对数据的处理需要至少两个处理节点参与,所述ROI包括参与数据处理的节点间的通信接口。
  13. 根据权利要求10至12中任一项所述的装置,其特征在于,第一编程语言包括中间表示IR语言。
  14. 根据权利要求8至13中任一项所述的装置,其特征在于,所述第一信息包括所述应用程序的处理数据的性能与所述应用程序的功能中的至少一种。
  15. 一种建立模型的设备,其特征在于,所述设备包括处理器与存储器,所述存储器用于存储指令,当所述指令被所述处理器执行时,使得所述建立模型的设备执行如权利要求1至7中任一项所述的建立模型的方法。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在建立模型的设备上运行时,使得所述建立模型的设备执行如权利要求1至7中任一项所述的建立模型的方法。
  17. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1至7中任一项所述的建立模型的方法。
PCT/CN2023/100721 2022-08-18 2023-06-16 建立模型的方法、装置以及设备 WO2024037168A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211002976.3 2022-08-18
CN202211002976.3A CN117632244A (zh) 2022-08-18 2022-08-18 建立模型的方法、装置以及设备

Publications (1)

Publication Number Publication Date
WO2024037168A1 true WO2024037168A1 (zh) 2024-02-22

Family

ID=89940588

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/100721 WO2024037168A1 (zh) 2022-08-18 2023-06-16 建立模型的方法、装置以及设备

Country Status (2)

Country Link
CN (1) CN117632244A (zh)
WO (1) WO2024037168A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183650A (zh) * 2015-09-11 2015-12-23 哈尔滨工业大学 基于llvm的科学计算程序自动性能预测方法
US11036614B1 (en) * 2020-08-12 2021-06-15 Peking University Data control-oriented smart contract static analysis method and system
CN113722218A (zh) * 2021-08-23 2021-11-30 南京审计大学 一种基于编译器中间表示的软件缺陷预测模型构建方法
CN114791808A (zh) * 2022-02-07 2022-07-26 北京清微智能信息技术有限公司 一种数据流图生成方法及装置
CN114911711A (zh) * 2022-06-14 2022-08-16 南方电网科学研究院有限责任公司 一种代码缺陷分析方法、装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183650A (zh) * 2015-09-11 2015-12-23 哈尔滨工业大学 基于llvm的科学计算程序自动性能预测方法
US11036614B1 (en) * 2020-08-12 2021-06-15 Peking University Data control-oriented smart contract static analysis method and system
CN113722218A (zh) * 2021-08-23 2021-11-30 南京审计大学 一种基于编译器中间表示的软件缺陷预测模型构建方法
CN114791808A (zh) * 2022-02-07 2022-07-26 北京清微智能信息技术有限公司 一种数据流图生成方法及装置
CN114911711A (zh) * 2022-06-14 2022-08-16 南方电网科学研究院有限责任公司 一种代码缺陷分析方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN117632244A (zh) 2024-03-01

Similar Documents

Publication Publication Date Title
US11290534B2 (en) System and method for scheduling computer tasks
US11762634B2 (en) Systems and methods for seamlessly integrating multiple products by using a common visual modeler
US11106437B2 (en) Lookup table optimization for programming languages that target synchronous digital circuits
JP2022510121A (ja) 量子コンピューティング・シミュレーションにおける測定のためのゲート融合
US11775269B2 (en) Generating a synchronous digital circuit from a source code construct defining a function call
CN114443559A (zh) 可重构算子单元、处理器、计算方法、装置、设备及介质
CN114116510A (zh) 一种接口参数校验方法及装置
US20160292064A1 (en) Iterative test generation based on data source analysis
US11030362B2 (en) Modeling and cooperative simulation of systems with interdependent discrete and continuous elements
CN110555732B (zh) 一种营销策略推送方法、装置及营销策略运营平台
WO2024037168A1 (zh) 建立模型的方法、装置以及设备
WO2014165464A2 (en) Cryptographic mechanisms to provide information privacy and integrity
US10649973B2 (en) Method for performing in-database distributed advanced predictive analytics modeling via common queries
US20120233332A1 (en) Resource Property Aggregation in a Multi-Provider System
CN114548407A (zh) 层级目标定向因果发现方法、装置及电子设备
US9769025B2 (en) Predicting the performance of a multi-stage communications network under load from multiple communicating servers
US20150089471A1 (en) Input filters and filter-driven input processing
CN114385175A (zh) 一种代码生成方法、装置、电子设备及存储介质
CN117573758A (zh) 基于bi平台的数据流编排方法
CN117435276A (zh) 浏览器页面显示方法、装置、设备、存储介质及程序产品
US8856750B2 (en) Task-based evaluation of user interfaces
CN111966592A (zh) 前端页面测试方法、装置、介质及电子设备
CN116244168A (zh) 一种单元测试生成方法、装置及相关设备
CN117270824A (zh) 一种项目构建方法、装置、设备和介质
CN116032612A (zh) 一种网络攻击靶场的判定方法、装置、设备及介质

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: 23854073

Country of ref document: EP

Kind code of ref document: A1