CN114327481A - Code processing method, device, equipment and storage medium - Google Patents

Code processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114327481A
CN114327481A CN202111649782.8A CN202111649782A CN114327481A CN 114327481 A CN114327481 A CN 114327481A CN 202111649782 A CN202111649782 A CN 202111649782A CN 114327481 A CN114327481 A CN 114327481A
Authority
CN
China
Prior art keywords
code
editable
dynamic link
link library
application program
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111649782.8A
Other languages
Chinese (zh)
Inventor
樊冰新
陈逢锦
郑旗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111649782.8A priority Critical patent/CN114327481A/en
Publication of CN114327481A publication Critical patent/CN114327481A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

The disclosure provides a code processing method, a code processing device, code processing equipment and a storage medium, and relates to the technical fields of cloud service, edge computing, artificial intelligence, block chaining and the like. The specific implementation scheme is as follows: acquiring a first code of an application program during running; converting the first code into an editable code; compiling the editable codes into a dynamic link library; and in response to receiving a call request for the application program after the dynamic link library is loaded, calling a function in the dynamic link library and executing the function. The implementation mode can pre-compile the code into the dynamic link library, thereby accelerating the running efficiency of the code.

Description

Code processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the technical fields of cloud services, edge computing, artificial intelligence, and blockchains, and in particular, to a code processing method, apparatus, device, and storage medium.
Background
WebAssembly is derived from high-performance scenes such as graphic processing, video rendering, encryption and decryption and the like in Web, and is widely applied to the fields of cloud native application, edge computing, artificial intelligence, block chains and the like.
The WebAssembly virtual machine provides runtime support for the WebAssembly module. As the runtime support of the WebAssembly, the WebAssembly virtual machine isolates an operating system and an execution module, manages the runtime memory of the WebAssembly, and translates the WebAssembly instruction into a local instruction and executes the local instruction. However, the existing code execution method consumes longer time and has lower efficiency.
Disclosure of Invention
The disclosure provides a code processing method, apparatus, device and storage medium.
According to a first aspect, there is provided a code processing method comprising: acquiring a first code of an application program during running; converting the first code into an editable code; compiling the editable codes into a dynamic link library; and in response to receiving a call request for the application program after the dynamic link library is loaded, calling a function in the dynamic link library and executing the function.
According to a second aspect, there is provided a code processing apparatus comprising: an acquisition unit configured to acquire a first code of an application program at runtime; a conversion unit configured to convert the first code into an editable code; a pre-compiling unit configured to compile the editable code into a dynamically linked library; a calling unit configured to call and execute a function in the dynamically linked library in response to receiving a call request for the application program after the dynamically linked library is loaded.
According to a third aspect, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
According to a fourth aspect, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method as described in the first aspect.
According to a fifth aspect, a computer program product comprising a computer program which, when executed by a processor, implements the method as described in the first aspect.
The technology according to the present disclosure can pre-compile the code into a dynamic link library, thereby accelerating the execution efficiency of the code.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a code processing method according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a code processing method according to the present disclosure;
FIG. 4 is a flow diagram of another embodiment of a code processing method according to the present disclosure;
FIG. 5 is a schematic block diagram of one embodiment of a code processing apparatus according to the present disclosure;
fig. 6 is a block diagram of an electronic device for implementing a code processing method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 shows an exemplary system architecture to which embodiments of the code processing method or code processing apparatus of the present disclosure may be applied.
As shown in fig. 1, the system architecture may include a virtual machine and its execution engine. The Virtual Machine may be various Virtual machines such as a Java Virtual Machine (JVM), an Etherhouse Virtual Machine (EVM). The execution engine may be the part Of the virtual machine responsible for code execution, such as an AOT (Ahead-Of-Time) execution engine, a JIT (Just-In-Time) execution engine, an interpreter, etc.
The virtual machine is a concept relative to a 'physical machine', both machines have code execution capacity, and the difference is that an execution engine of the physical machine is directly established on the processor, cache, instruction set and operating system level, and the execution engine of the virtual machine is realized by software, so that the structural system of the instruction set and the execution engine can be customized without being limited by physical conditions, and the instruction set format which is not directly supported by hardware can be executed.
It should be noted that the code processing method provided by the embodiment of the present disclosure is generally executed by a virtual machine. Accordingly, the code processing apparatus is generally provided in a virtual machine.
It should be understood that the number of virtual machines and execution engines in FIG. 1 is merely illustrative. There may be any number of virtual machines and execution engines, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a code processing method according to the present disclosure is shown. The code processing method of the embodiment comprises the following steps:
in step 201, a first code of an application program during running is obtained.
In this embodiment, an execution subject of the code processing method may first obtain a first code of an application program when the application program is running. The application program may be any program installed on the virtual machine. A program running on a hardware or platform requires an intermediate layer for converting the programming language into a machine language understandable by the machine. Here, the machine language may be referred to as a first code. The first code can be converted from the source code of the application program through a language tool chain. In some specific applications, the application program may be an execution engine, Webassembly, which is a method for using non-JavaScript code and making it run in a browser. These codes may be C, C + + or Rust, etc. They are compiled into a browser and run at a speed close to native on the CPU. These codes are in the form of binary files, which can be used directly in JavaScript as modules. Thus, the first code may be binary code or text. The first code may exist in the form of a wasm file or a wait file, both of which are readable forms of WebAssembly.
Step 202, converting the first code into an editable code.
After obtaining the first code, the execution subject may convert the first code into editable code using a code conversion tool. Here, the editable code may be C language code, IR (Intermediate Representation) of LLVM (LLVM is a framework system of a framework compiler, written in C + +), abstract syntax tree, or the like. The transcoding tool may be a WABT (The WebAssembly Binary Toolkit), which is a set of tools for WebAssembly containing a series of tools, such as a wat2wasm tool (converting from WebAssembly text format to WebAssembly Binary format), a wasm2wat tool (converting from Binary format back to text format (also referred to as. wat) as opposed to wat2 wasm), a wasm2C tool (converting from Binary format to C language format), a wasm2js tool (converting from Binary format to JSON language format), and a wasm-objdump (displaying information about a wasm Binary file).
At step 203, the editable code is compiled into a dynamically linked library.
The execution body may compile the editable code into a Dynamic Link Library (DLL) in various existing ways, which is not described herein again. The dynamically linked library may include a plurality of symbols, each symbol corresponding to a function in the editable code. The dynamic link library may be a dll file.
And step 204, in response to receiving a call request for the application program after the dynamic link library is loaded, calling a function in the dynamic link library and executing the function.
After the execution main body obtains the dynamic link library, the dynamic link library can be loaded when the execution main body loads the application program, and the loading efficiency is improved. After the dynamic link library is loaded, a call request for the application program can be received, and the execution subject can call and execute a function in the dynamic link library in order to deal with the call request. This can improve the compiling efficiency of the code.
With continued reference to FIG. 3, a schematic diagram of one application scenario of a code processing method according to the present disclosure is shown. In the application scenario of fig. 3, the virtual machine may convert the first code of the execution engine during running into the C code, compile the C code into a dynamic link library, load the dynamic link library when loading the application program, and call a function in the dynamic link library when calling the application program. Therefore, the compiling process and the running process of the application program are separated, so that technicians can spend more energy in the compiling process to obtain a better compiling result and improve the performance of the application program in running.
The code processing method provided by the above embodiment of the present disclosure can pre-compile the code into the dynamic link library, thereby accelerating the compiling efficiency of the code.
With continued reference to FIG. 4, a flow 400 of another embodiment of a code processing method according to the present disclosure is shown. As shown in fig. 4, the method of the present embodiment may include the following steps:
step 401, a first code of an application program during running is obtained.
Step 402, converting the first code into an editable code.
At step 403, the editable code is compiled into a dynamically linked library.
In response to receiving a call request for the application program after the dynamic link library is loaded, a function in the dynamic link library is called and executed, step 404.
Step 405, the second code is injected into the editable code to obtain the third code.
The execution agent, upon obtaining the editable code, may inject the second code into the editable code. Here, the second code may be code for realizing various functions, for example, a resource audit function, an instruction tracing function, and the like may be realized. The execution subject may inject the second code at a suitable position of the editable code according to an actual application scenario, and use the injected code as a third code. It will be appreciated that the form of the second code is the same as the form of the editable code. That is, if the editable code is C language code, the second code is also C language code.
In some alternative implementations of this embodiment, the execution agent may inject the second code by the following steps not shown in fig. 4: determining an injection form of the second code according to the type of the editable code; and injecting the second code into the editable code according to the injection form to obtain the third code.
The execution agent may determine the injection form of the second code according to the type of the editable code. For example, if the editable code is C code, the injected form of the second code may be C code. If the type of editable code is LLVM IR, the injection form of the second code may be instructions of LLVM IR. If the type of the editable code is an abstract syntax tree, the injection form of the second code may be a node of the abstract syntax tree. The execution agent may inject the second code into the editable code via the injection form described above, resulting in the third code. For example, if the type of editable code is an abstract syntax tree, the execution body may inject the second code by modifying nodes of the abstract syntax tree.
Step 406, the third code is executed.
The execution subject may execute the third code obtained after the code injection to obtain an execution result. The operation result may be a text message, a numerical value, or the like.
In some optional implementations of this embodiment, the execution subject may implement the running of the third code by the following steps not shown in fig. 4: the third code is subjected to persistence; executing the code after the persistence.
In this embodiment, the execution subject may also persist the code obtained in the injection process. Here, the persistence may be to efficiently store the code or to convert the code obtained during the injection process into another form of code. In this way, the code obtained during the injection process can be effectively preserved. The execution agent may then execute the code after the persistence.
In some optional implementations of the present embodiment, the execution body may perform persistence by: and the third code is encoded and stored.
In this implementation, the execution agent may directly encode the third code and store the third code for use in a subsequent tool chain. Here, the serialization may refer to the serialization of the third code using various existing algorithms. It will be appreciated that subsequent tool chains, when used, may be deserialized first.
In some optional implementations of the present embodiment, the execution body may perform persistence by: the third code is compiled into machine code.
In this implementation, the execution agent may compile the third code into machine code. In this way, subsequent execution of third code at AOT runtime may be facilitated.
In some optional implementations of the present embodiment, the execution body may perform persistence by: the third code is converted into the same format as the first code.
In this implementation, the execution body may convert the third code into the same format as the first code. In particular, the execution agent may perform the above-described conversion using an existing transcoding tool. After conversion, the JIT runtime and interpreter facilitate execution on the third code.
Step 407, cache the dynamic link library, the editable code, the third code and the operation result of the third code.
In the whole pre-compiling process of the application program, the execution main body can cache codes and results obtained in the process, and the overall performance is improved. For example, the execution agent may cache editable code, inject code for different functions for subsequent use in different application scenarios, and generate other results. Alternatively, the execution agent may cache the dynamically linked library for reloading at the next boot. The third code may also be cached for subsequent conversion into machine-dependent code, or for different results to be generated by adjusting the compilation strategy according to different conditions or requirements. The execution body may also cache the execution result of the third code.
And step 408, in response to the detection of the starting request, generating and updating the dynamic link library according to the operation result and loading the dynamic link library.
And the execution main body can also generate an updated dynamic link library for loading according to the running result of the third code when the execution main body is started next time, so that the updating of the dynamic link library is realized.
In some specific applications, the execution agent may manage the memory pages by using a memory management technology based on MMAP (a method for mapping a file or other objects to an address space of a process, and implementing a one-to-one mapping relationship between a file disk address and a virtual address in a virtual address space of the process), which is particularly important for the execution engine weballocation. Because Webassignment requires that the size of a memory page must be an integral multiple of 64K, and the memory page belongs to a large block of memory, each memory page can be initialized to 0 by adopting an MMAP memory management technology, and the isolation among different modules is ensured.
The code processing method provided by the above embodiment of the present disclosure can implement pre-compiling of an application program, improve the overall performance of a system by using a code caching technology, and support dynamic code injection to provide different functions, thereby improving the processing efficiency of the system.
In the blockchain application field, a user initiates a transaction through a node in a blockchain by using an external account in a blockchain network, and the transaction can be a common transfer transaction and can also be used for creating an intelligent contract or calling the intelligent contract. For example, a user issues an intelligent contract, the user writes the intelligent contract in a high-level language, and the intelligent contract needs to be compiled into Webassembly bytecode by a compiler to generate a contract module (which may also be referred to as a Webassembly module). The user may then publish the contract in the form of a transaction into the blockchain network. In the process of executing the intelligent contract by other nodes in the blockchain network, the WebAssembly module needs to be loaded first. In this embodiment, the Webassembly module is pre-compiled into the dynamic link library, and the code caching technology is used to improve the overall performance of the system, so that the execution efficiency of the intelligent contract can be improved.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a code processing apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the code processing apparatus 500 of the present embodiment includes: an acquisition unit 501, a conversion unit 502, a pre-compilation unit 503, and a calling unit 504.
An obtaining unit 501 is configured to obtain a first code of an application program when the application program is running.
A conversion unit 502 configured to convert the first code into an editable code.
A pre-compiling unit 503 configured to compile the editable code into a dynamically linked library.
And a calling unit 504 configured to call and execute a function in the dynamic link library in response to receiving a call request for the application program after the dynamic link library is loaded.
In some optional implementations of this embodiment, the apparatus 500 may further include: an injection unit and an operation unit.
And the injection unit is configured to inject the second code into the editable code to obtain the third code.
An execution unit configured to execute the third code.
In some optional implementations of this embodiment, the apparatus 500 may further include: a cache unit configured to cache the dynamically linked library, the editable code, and the third code.
In some optional implementations of this embodiment, the cache unit is further configured to: and caching the running result of the third code. And the generating unit is configured to respond to the detection of the starting request, generate and update the dynamic link library according to the operation result and load the dynamic link library.
In some optional implementations of this embodiment, the injection unit is further configured to: determining an injection form of the second code according to the type of the editable code; and injecting the second code into the editable code according to the injection form to obtain the third code.
In some optional implementations of this embodiment, the execution unit is further configured to: the third code is subjected to persistence; and executing the code after the persistence.
It should be understood that the units recited in the code processing apparatus 500 correspond to the respective steps in the method described in fig. 2, respectively. Thus, the operations and features described above with respect to the code processing method are equally applicable to the apparatus 500 and the units included therein, and are not described in detail here.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to an embodiment of the present disclosure.
Fig. 6 shows a block diagram of an electronic device 600 that performs a code processing method according to an embodiment of the disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the electronic device 600 includes a processor 601 that may perform various suitable actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)602 or a computer program loaded from a memory 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 can also be stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An I/O interface (input/output interface) 605 is also connected to the bus 604.
Various components in the electronic device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a memory 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Processor 601 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of processor 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 601 performs the various methods and processes described above, such as code processing methods. For example, in some embodiments, the code processing method may be implemented as a computer software program tangibly embodied in a machine-readable storage medium, such as memory 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the processor 601, one or more steps of the code processing method described above may be performed. Alternatively, in other embodiments, the processor 601 may be configured to perform the code processing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. The program code described above may be packaged as a computer program product. These program code or computer program products may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor 601, causes the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable storage medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable storage medium may be a machine-readable signal storage medium or a machine-readable storage medium. A machine-readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions of the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.

Claims (15)

1. A code processing method, comprising:
acquiring a first code of an application program during running;
converting the first code into an editable code;
compiling the editable code into a dynamic link library;
and in response to receiving a call request for the application program after the dynamic link library is loaded, calling a function in the dynamic link library and executing the function.
2. The method of claim 1, wherein the method further comprises:
injecting a second code into the editable code to obtain a third code;
and executing the third code.
3. The method of claim 2, wherein the method further comprises:
caching the dynamically linked library, the editable code and the third code.
4. The method of claim 2, wherein the method further comprises:
caching the running result of the third code;
and responding to the detection of the starting request, generating and updating a dynamic link library according to the running result, and loading.
5. The method of claim 2, wherein said injecting the second code into the editable code results in a third code comprising:
determining an injection form of the second code according to the type of the editable code;
and injecting the second code into the editable code according to the injection form to obtain a third code.
6. The method of claim 2, wherein the executing the third code comprises:
persisting the third code;
and executing the code after the persistence.
7. A code processing apparatus comprising:
an acquisition unit configured to acquire a first code of an application program at runtime;
a conversion unit configured to convert the first code into an editable code;
a pre-compiling unit configured to compile the editable code into a dynamically linked library;
a calling unit configured to call and execute a function in the dynamically linked library in response to receiving a call request for the application program after the dynamically linked library is loaded.
8. The apparatus of claim 7, wherein the apparatus further comprises:
an injection unit configured to inject a second code into the editable code, resulting in a third code;
an execution unit configured to execute the third code.
9. The apparatus of claim 8, wherein the apparatus further comprises:
a caching unit configured to cache the dynamically linked library, the editable code, and the third code.
10. The apparatus of claim 8, wherein the cache unit is further configured to:
caching the running result of the third code; and
and the generating unit is configured to respond to the detection of the starting request, generate and update the dynamic link library according to the operation result and load the dynamic link library.
11. The apparatus of claim 8, wherein the injection unit is further configured to:
determining an injection form of the second code according to the type of the editable code;
and injecting the second code into the editable code according to the injection form to obtain a third code.
12. The apparatus of claim 8, wherein the execution unit is further configured to:
persisting the third code;
and executing the code after the persistence.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-6.
CN202111649782.8A 2021-12-30 2021-12-30 Code processing method, device, equipment and storage medium Pending CN114327481A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111649782.8A CN114327481A (en) 2021-12-30 2021-12-30 Code processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111649782.8A CN114327481A (en) 2021-12-30 2021-12-30 Code processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114327481A true CN114327481A (en) 2022-04-12

Family

ID=81019965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111649782.8A Pending CN114327481A (en) 2021-12-30 2021-12-30 Code processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114327481A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816401A (en) * 2022-04-13 2022-07-29 上海弘玑信息技术有限公司 Interface element positioning method, electronic equipment and storage medium
CN116860358A (en) * 2023-08-30 2023-10-10 北京趋动智能科技有限公司 Method, system, device and medium for executing injection code

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816401A (en) * 2022-04-13 2022-07-29 上海弘玑信息技术有限公司 Interface element positioning method, electronic equipment and storage medium
CN114816401B (en) * 2022-04-13 2022-12-23 上海弘玑信息技术有限公司 Interface element positioning method, electronic equipment and storage medium
CN116860358A (en) * 2023-08-30 2023-10-10 北京趋动智能科技有限公司 Method, system, device and medium for executing injection code
CN116860358B (en) * 2023-08-30 2024-01-02 北京趋动智能科技有限公司 Method, system, device and medium for executing injection code

Similar Documents

Publication Publication Date Title
US8627281B2 (en) Method, computer program and computer system for converting source code written in dynamically typed language into target code written in statically typed language and executing target code
CN111881401B (en) WebAssemble-based browser deep learning method and system
CN113010181B (en) Deployment method and device of operators in deep learning framework and electronic equipment
US11720344B2 (en) Code hot-update method and device, storage medium, processor, and terminal
CN111625224A (en) Code generation method, device, equipment and storage medium
CN114327481A (en) Code processing method, device, equipment and storage medium
US8336035B2 (en) Customizable dynamic language expression interpreter
CN110389786B (en) Kernel management method, electronic device and computer-readable storage medium
CN109542455B (en) Contract execution method, contract reduction method, device, and storage medium
CN112114818B (en) JAVA compiling method and device for expression
CN114879948A (en) WebAssembly-based intelligent contract processing method, device, equipment and storage medium
US11029924B2 (en) Program optimization by converting code portions to directly reference internal data representations
US9207956B2 (en) Class loading device for a java runtime environment, cluster system and method of executing a function
US9886251B2 (en) Optimized compiling of a template function
CN112506602B (en) Page generation method and device, electronic equipment and computer readable medium
US10459703B2 (en) Systems and methods for task parallelization
CN111563253B (en) Intelligent contract operation method, device, equipment and storage medium
US20190377589A1 (en) Efficient data decoding using runtime specialization
US11429358B2 (en) Representing asynchronous state machine in intermediate code
CN113760274B (en) Front-end assembly logic injection method and device
CN115061678A (en) Code compiling method and client based on browser proxy service
CN112650502A (en) Batch processing task processing method and device, computer equipment and storage medium
CN114327496A (en) Code injection method, device, equipment and storage medium
CN114327772A (en) Code injection method, device, equipment and storage medium
US20160196114A1 (en) Apparatus and method for realizing runtime system for programming language

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination