Method, device and computer program product for generating program code

By obtaining code configuration information, the program code is automatically generated, which solves the inconvenience problem of program code update in deep learning model reasoning, improves the flexibility and diversity of functions, and realizes the automatic generation of program code.

CN114063997BActive Publication Date: 2024-11-29EMC IP HLDG CO LLC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010760123.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-31
Publication Date
2024-11-29
Estimated Expiration
2040-07-31

AI Technical Summary

Technical Problem

The inference program code update process of deep learning models is performed manually, resulting in inconvenience, and the inference program code is usually specific to a specific function or application, limiting the flexibility and diversity of functions.

Method used

By obtaining code configuration information, including the target function and the configuration information of the target device, program code is automatically generated so that the target device can achieve the target function.

Benefits of technology

It significantly reduces the workload of developing program code, improves the diversity and flexibility of functional implementation, and realizes the automated generation of program code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114063997B_ABST
    Figure CN114063997B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to methods, devices, and computer program products for generating program code. A method for generating program code is proposed, comprising: obtaining code configuration information, the code configuration information including code function information indicating a target function and device configuration information of a target device; and generating program code based on the code configuration information, the program code enabling the target device to implement the target function when executed. Through the embodiments of the present disclosure, the diversity and flexibility of function implementation can be improved, and the workload of developing program code can be significantly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure generally relate to the field of computers, and more particularly to methods, devices, and computer program products for generating program codes. Background Art

[0002] With the development of artificial intelligence technology, more and more fields are using deep learning models to achieve more accurate reasoning. However, the training process of deep learning models is often time-consuming and resource-consuming. Therefore, the training of deep learning models is usually performed on devices with powerful computing power, while the use of deep learning models can be performed on other devices as needed. When a deep learning model is updated, for example, due to the emergence of new features and new categories, the program code (sometimes also referred to as reasoning program code) that uses the deep learning model also needs to be updated accordingly. At present, the process of updating the reasoning program code is performed manually, which brings great inconvenience to the use of deep learning models.

[0003] In addition, reasoning program codes are often written according to specific functions or applications. Therefore, specific program codes can only implement specific functions or applications. This limits the flexibility of using deep learning models. Summary of the invention

[0004] Embodiments of the present disclosure provide a method, an apparatus, and a computer program product for generating program code.

[0005] In a first aspect of the present disclosure, a method for generating program code is provided, the method comprising: obtaining code configuration information, the code configuration information comprising code function information indicating a target function and device configuration information of a target device; and generating program code based on the code configuration information, the program code enabling the target device to implement the target function when executed.

[0006] In a second aspect of the present disclosure, a computing device is provided. The device includes: at least one processing unit; at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, cause the device to perform an action, the action including: obtaining code configuration information, the code configuration information including code function information indicating a target function and device configuration information of a target device; and based on the code configuration information, generating program code, the program code, when executed, enables the target device to implement the target function.

[0007] In a third aspect of the present disclosure, a computer program product is provided. The computer program product is tangibly stored in a non-transient computer storage medium and includes machine executable instructions. The machine executable instructions, when executed by a device, cause the device to perform any step of the method described in the first aspect of the present disclosure.

[0008] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.

[0010] Figure 1 A block diagram showing an example code generation system in which embodiments of the present disclosure can be implemented;

[0011] Figure 2 A flowchart showing an example method for generating program code according to an embodiment of the present disclosure is shown;

[0012] Figure 3 A flowchart of a method for generating program code according to an embodiment of the present disclosure is shown;

[0013] Figure 4A A schematic diagram showing an exemplary first code program segment according to an embodiment of the present disclosure is shown;

[0014] Figure 4B A schematic diagram showing an exemplary second code program segment according to an embodiment of the present disclosure; and

[0015] Figure 5 A schematic block diagram of an example device that can be used to implement embodiments of the present disclosure is shown.

[0016] In the various drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0017] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0018] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0019] As mentioned above, with the development of artificial intelligence technology, more and more fields are using deep learning models to achieve more accurate reasoning. For example, in the Internet of Things (IoT) scenario, edge servers can use deep learning models such as those trained in the cloud to make more accurate predictions on various collected data. In the scenario of online reasoning services, the server can use deep learning models to reason on data uploaded by users, such as images, text, and voice, for example, to identify the type of flowers in an image, analyze and diagnose medical reports, etc.

[0020] However, the training process of deep learning models is often time-consuming and resource-consuming. Therefore, the training of deep learning models is usually performed on devices with powerful computing power, while the use of deep learning models can be performed on other devices as needed. When the deep learning model is updated, for example, due to the emergence of new features and new categories, the program code (sometimes also referred to as the reasoning program code) using the deep learning model also needs to be updated accordingly. For example, adjusting the structure and parameters of the neural network, etc. The current process of updating the reasoning program code is performed manually, which brings great inconvenience to the use of deep learning models.

[0021] In addition, reasoning program codes are often written according to specific functions or applications. Therefore, specific program codes can only implement specific functions or applications. This limits the diversity and flexibility of function implementation.

[0022] The embodiments of the present disclosure provide a solution for generating program code to solve one or more of the above problems and other potential problems. The solution obtains code configuration information and generates program code according to the code configuration information. In this way, the generation process of program code can be automated, thereby significantly reducing the workload of developing program code. In addition, the diversity and flexibility of function implementation are also improved.

[0023] Figure 1 1 shows a block diagram of an example code generation system 100 in which embodiments of the present disclosure can be implemented. Figure 1As shown, the code generation system 100 includes a code generation device 110 and target devices 120 - 1 to 120 - 3 (collectively referred to as target devices 120 ). The various methods according to the embodiments of the present disclosure may be implemented at a computing device such as the code generation device 110 .

[0024] like Figure 1 As shown, the code generation device 110 can obtain code configuration information from the target device 120, and generate program codes 130-1 and 130-2 (collectively referred to as program code 130) that can be deployed to the target device 120 according to the code configuration information. The code generation device 110 can be, for example, a computer, a virtual machine, a server, etc. The code generation device 110 can also be a computing device in the cloud. The target device 120 can be a computer, a server, a smart phone, a tablet computer, a smart watch, etc. The code generation device 110 and the target device 120 can be connected through a network, and the network can be the Internet, an intranet, etc. These aspects of the present disclosure are not limited.

[0025] It should be understood that the structure of the code generation system 100 is described only for exemplary purposes, and does not imply any limitation on the scope of the present disclosure. For example, the embodiments of the present disclosure can also be applied to systems different from the code generation system 100. It should be understood that the specific number of the above-mentioned devices is given only for illustrative purposes, and does not imply any limitation on the scope of the present disclosure. For example, the embodiments of the present disclosure can also be applied to more code generation devices, more or fewer target devices. The code generation device can also obtain code configuration information from other devices other than the target device.

[0026] Figure 2 2 is a flowchart of an exemplary method 200 for generating program code according to an embodiment of the present disclosure. For example, the method 200 may be performed as follows: Figure 1 The method 200 is performed by the code generation device 110 shown in the figure. It should be understood that the method 200 can also be performed by other devices, and the scope of the present disclosure is not limited in this respect. It should also be understood that the method 200 can also include additional actions not shown and / or can omit the actions shown, and the scope of the present disclosure is not limited in this respect.

[0027] At 210 , the code generating device 110 acquires code configuration information including code function information indicating a target function and device configuration information of a target device.

[0028] In some embodiments, the target function may be, for example, image recognition, image classification, speech recognition, text recognition, video processing, etc.

[0029] In some embodiments, the code generation device 110 may obtain a deep learning model for implementing the target function, for example, the deep learning model has been trained at a computing facility such as a cloud to implement the target function. For example, in some embodiments, the deep learning model may be CIFAR-10, ResNet-50, etc.

[0030] Additionally or alternatively, in some embodiments, the code generation device 110 may obtain the type of development framework used when training the deep learning model. For example, the development framework may be TensorFlow, MxNET, PyTorch, Keras, etc. Each development framework has a different application programming interface API to be called by the reasoning program code, and a different runtime library for executing the reasoning program code.

[0031] Alternatively or additionally, the code generation device 110 may determine a uniform resource locator (URL) pointing to the deep learning model according to the type of the deep learning model.

[0032] Additionally or alternatively, in some embodiments, the code generation device 110 may obtain input data information related to the data to be input into the program code. For example, the code generation device 110 may obtain information about the type of the input data, for example, the input data may be an image, text, video, or a custom type; the code generation device 110 may also obtain information about the size, location, etc. of the input data. Alternatively or additionally, the code generation device 110 may also obtain the input data itself.

[0033] In an embodiment where the code generation device 110 does not obtain the input data itself, the input data itself can be retained in the target device without being exposed to the code generation device 110. After generating the program code, the code generation device 110 can deploy the generated program code to the target device, and enable the program code to read the input data on the target device. In this way, the security of the input data can be improved. For example, the security of sensitive input data such as medical reports can be improved.

[0034] In some embodiments, the code generation device 110 may obtain the type of the computing platform of the target device. For example, the computing platform type of the target device may be CUDA, GPU, X86_64CPU, ARM, FPGA, ASIC, web browser, etc. Alternatively or additionally, the code generation device 110 may obtain the model of the target device, and then determine the type of the computing platform of the target device according to the model of the target device.

[0035] Additionally, in some embodiments, the code generation device 110 can also determine a programming language suitable for the target device to write program code using a suitable programming language. For example, Python language suitable for running in a CPU, CUDA suitable for running in an NVIDIA GPU, OpenCL suitable for running in an AMD GPU, javascript suitable for running in a js web browser, Verilog suitable for running in an FPGA, etc. Alternatively, in some embodiments, the code generation device 110 can use any programming language to generate program code.

[0036] Alternatively, in some embodiments, the code generation device 110 may only obtain input data information, and then select a deep learning model suitable for the input data and a development framework of the deep learning model from known deep learning models according to the input data information. In such an embodiment, the user does not need to be an expert user who understands deep learning, but only needs to provide input data to achieve the target function. For example, the user may provide the code generation device 110 with an image containing flowers, and then the code generation device 110 may select a deep learning model suitable for identifying flowers and a development framework of the deep learning model according to the image.

[0037] At 220 , the code generation device 110 generates program code according to the code configuration information, and the program code enables the target device to implement the target function when executed.

[0038] In some embodiments, the code generation device 110 may input the acquired code function information and device configuration information into a cross-development framework deep learning compiler, and use the process and API provided by the compiler to generate program code. For example, in some embodiments, the cross-development framework deep learning compiler may be TVM or ONNX, etc. The cross-development framework deep learning compiler has the ability to provide interfaces to different deep learning models and different development frameworks, and has the ability to generate code for devices of different computing platform types.

[0039] In some embodiments, the code generation device 110 can generate a first program code segment and a second program code segment based on the code configuration information, wherein the first program code segment generates an intermediate representation of a deep learning model suitable for implementing a target function on a target device when executed, and the second program code segment implements the target function on the target device by calling the intermediate representation when executed.

[0040] For example, in some embodiments, the code generation device 110 may generate a first program code segment according to the code configuration information. For example, the first program code segment may be written to download a deep learning model when executed, for example, the deep learning model may be downloaded from a uniform resource locator pointing to the deep learning model, and the downloaded deep learning model may be compiled into an intermediate representation of the deep learning model and a deployment runtime library through a development framework, and the intermediate representation may include parameters used by the deep learning model, etc.

[0041] In some embodiments, the code generation device 110 may generate a second program code segment according to the code configuration information. For example, in some embodiments, the second program code segment may be written to read the intermediate representation and deployment runtime library of the deep learning model generated by the first program code segment and the user's input data when executed, so as to execute the target function on the user's input data on the target device.

[0042] It should be understood that the types of deep learning models, development frameworks, computing platforms, etc. are shown only for exemplary purposes, and do not imply any limitation to the present disclosure. For example, the embodiments of the present disclosure may also use other deep learning models, other development frameworks, and be applied to other types of computing platforms.

[0043] In the above exemplary embodiments, by generating program code according to the acquired code function information and the device configuration information of the target device, the generation process of the program code can be automated, thereby significantly reducing the workload of developing the program code. In addition, different target functions can be realized, which improves the diversity and flexibility of function realization.

[0044] Figure 3 1 shows a flow chart of a method 300 for generating program code according to an embodiment of the present disclosure. The method 300 is an embodiment of 220 in the method 200. For example, the method 300 may be performed as follows: Figure 1 The method 300 is performed by the code generation device 110 shown in the figure. It should be understood that the method 300 can also be performed by other devices, and the scope of the present disclosure is not limited in this respect. It should also be understood that the method 300 can also include additional actions not shown and / or can omit the actions shown, and the scope of the present disclosure is not limited in this respect.

[0045] At 310, the code generation device 110 obtains a predefined template code, which is related to the target function. Since there are many fixed parts in the program code for implementing the target function, the code generation device 110 may first obtain the template code for implementing the target function.

[0046] At 320, the code generation device 110 modifies at least a portion of the template code to generate program code specific to the target function and the target device. Figure 4A and Figure 4B To describe Figure 3 .

[0047] Figure 4A A schematic diagram 401 is shown of an example first code program segment according to an embodiment of the present disclosure. Figure 4B A schematic diagram 402 is shown of an example second code program segment according to an embodiment of the present disclosure.

[0048] The code generating device 110 may obtain a predefined template code and then modify at least a portion of the template code. Figure 4A In the embodiment of the first code program segment shown, the variable synset_url in box 410 indicates the resource identifier of the deep learning model, so as to download the specified deep learning model or the deep learning model determined according to the target function according to the resource identifier. The function get_model in box 420 indicates the use of the specified development framework to call the deep learning model, which is the development framework used when training the deep learning model. In this embodiment, the specified development framework is resnet18_v1. The variable target in box 430 indicates the type of computing platform of the target device. The variable shape_dict in box 440 indicates the size of the input image. Figure 4B In the embodiment of the second code program segment shown, the variable img_name in box 450 indicates the name of the input data. The variable dtype in box 460 indicates the type of the input data, which is related to the deep learning model used.

[0049] In the above exemplary embodiments, program codes specific to target functions and target devices are generated by modifying at least a portion of the template code segment, thereby making it possible to automatically generate program codes for implementing different target functions on different target devices.

[0050] Figure 5 Schematic block diagram of an example computing device 500 that can be used to implement embodiments of the present disclosure. Figure 1 The code generation device 110 shown may be implemented by the device 500. Figure 5As shown, the device 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 502 or computer program instructions loaded from a storage unit 508 to a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 1005 is also connected to the bus 504.

[0051] A number of components in the device 500 are connected to the I / O interface 1005, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0052] The various processes and processing described above, such as methods 200 and 300, may be performed by the processing device 501. For example, in some embodiments, the methods 200 and 300 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the CPU 501, one or more actions of the methods 200 and 300 described above may be performed.

[0053] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0054] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer readable storage medium include: portable computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination of the above. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0055] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0056] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0057] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0058] These computer-readable program instructions can be provided to a processing device of a general-purpose computer, a special-purpose computer or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing device of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0059] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0060] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0061] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for generating program code, comprising: Acquire code configuration information, the code configuration information including code function information indicating a target function and device configuration information of a target device; as well as generating program code based on the code configuration information, wherein the program code can enable the target device to implement the target function when executed; Wherein obtaining the code function information comprises obtaining a deep learning model, wherein the deep learning model is configured to realize the target function; The generating of the program code comprises: Generate a first program code segment and a second program code segment, wherein the first program code segment generates an intermediate representation of the deep learning model suitable for implementing the target function on the target device when executed, and the second program code segment implements the target function on the target device by calling the intermediate representation when executed; wherein the deep learning model is obtained at least in part by downloading deep learning model information from a specified resource location; and The intermediate representation of the deep learning model is generated at least in part by compiling the downloaded deep learning model information through a development framework.

2. The method according to claim 1, wherein obtaining the code function information further comprises obtaining at least one of the following: input data information relating to data to be input into the program code; and The type of development framework used to train the deep learning model. 3 . The method according to claim 1 , wherein obtaining the device configuration information comprises obtaining at least one of the following items: a type of a computing platform of the target device and a model of the target device.

4. The method according to claim 1, wherein generating the program code further comprises: Obtaining a predefined template code, wherein the predefined template code is related to the target function; as well as Based on the code configuration information, at least a portion of the predefined template code is modified to generate the program code specific to the target function and the target device.

5. The method according to claim 1, wherein generating the program code further comprises: The code function information and the device configuration information are input into a deep learning compiler across a development framework to generate the program code.

6. The method of claim 1, wherein the designated resource location is identified by a uniform resource locator pointing to the deep learning model.

7. The method according to claim 1, wherein the target function comprises one or more of the following: image recognition, image classification, speech recognition, text recognition and video processing.

8. A computing device comprising: at least one processor; as well as at least one memory storing computer program instructions, the at least one memory and the computer program instructions being configured, together with the at least one processor, to cause the computing device to perform actions comprising: acquiring code configuration information, the code configuration information including code function information indicating a target function and device configuration information of a target device; and generating program code based on the code configuration information, wherein the program code can enable the target device to implement the target function when executed; Wherein obtaining the code function information comprises obtaining a deep learning model, wherein the deep learning model is configured to realize the target function; The generating of the program code comprises: Generate a first program code segment and a second program code segment, wherein the first program code segment generates an intermediate representation of the deep learning model suitable for implementing the target function on the target device when executed, and the second program code segment implements the target function on the target device by calling the intermediate representation when executed; wherein the deep learning model is obtained at least in part by downloading deep learning model information from a specified resource location; and The intermediate representation of the deep learning model is generated at least in part by compiling the downloaded deep learning model information through a development framework.

9. The computing device of claim 8, wherein obtaining the code function information further comprises obtaining at least one of the following: input data information relating to data to be input into the program code; and The type of development framework used to train the deep learning model. 10 . The computing device according to claim 8 , wherein obtaining the device configuration information comprises obtaining at least one of the following items: a type of a computing platform of the target device and a model of the target device.

11. The computing device of claim 8, wherein generating the program code further comprises: Obtaining a predefined template code, wherein the predefined template code is related to the target function; as well as Based on the code configuration information, at least a portion of the predefined template code is modified to generate the program code specific to the target function and the target device.

12. The computing device of claim 8, wherein generating the program code further comprises: The code function information and the device configuration information are input into a deep learning compiler across a development framework to generate the program code.

13. The computing device of claim 8, wherein the designated resource location is identified by a uniform resource locator pointing to the deep learning model.

14. A non-transitory computer-readable storage medium storing machine-executable instructions, wherein when the machine-executable instructions are executed by at least one processor, the at least one processor implements a method for generating program code, the method comprising: Acquire code configuration information, the code configuration information including code function information indicating a target function and device configuration information of a target device; as well as generating program code based on the code configuration information, wherein the program code can enable the target device to implement the target function when executed; Wherein obtaining the code function information comprises obtaining a deep learning model, wherein the deep learning model is configured to realize the target function; The generating of the program code comprises: Generate a first program code segment and a second program code segment, wherein the first program code segment generates an intermediate representation of the deep learning model suitable for implementing the target function on the target device when executed, and the second program code segment implements the target function on the target device by calling the intermediate representation when executed; wherein the deep learning model is obtained at least in part by downloading deep learning model information from a specified resource location; and The intermediate representation of the deep learning model is generated at least in part by compiling the downloaded deep learning model information through a development framework.

15. The non-transitory computer-readable storage medium of claim 14, wherein obtaining the code function information further comprises obtaining at least one of the following: input data information relating to data to be input into the program code; and The type of development framework used to train the deep learning model. 16 . The non-transitory computer-readable storage medium of claim 14 , wherein obtaining the device configuration information comprises obtaining at least one of: a type of a computing platform of the target device and a model of the target device.

17. The non-transitory computer-readable storage medium of claim 14, wherein generating the program code further comprises: Obtaining a predefined template code, wherein the predefined template code is related to the target function; as well as Based on the code configuration information, at least a portion of the predefined template code is modified to generate the program code specific to the target function and the target device.

18. The non-transitory computer-readable storage medium of claim 14, wherein generating the program code further comprises: The code function information and the device configuration information are input into a deep learning compiler across a development framework to generate the program code.

19. The non-transitory computer-readable storage medium of claim 14, wherein the designated resource location is identified by a uniform resource locator pointing to the deep learning model.

20. The non-transitory computer-readable storage medium of claim 14, wherein the target function comprises one or more of: image recognition, image classification, speech recognition, text recognition, and video processing.

Citation Information

Patent Citations

  • Integration of learning models into a software development system

    CN110603520A

  • Developing Programs in a Graphical Specification and Constraint Language

    US20120030646A1