CN111176626A - Cross-programming-language code calling method and device, medium and equipment - Google Patents
Cross-programming-language code calling method and device, medium and equipment Download PDFInfo
- Publication number
- CN111176626A CN111176626A CN201910718878.1A CN201910718878A CN111176626A CN 111176626 A CN111176626 A CN 111176626A CN 201910718878 A CN201910718878 A CN 201910718878A CN 111176626 A CN111176626 A CN 111176626A
- Authority
- CN
- China
- Prior art keywords
- code
- calling
- thread
- programming language
- request
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
- G06F9/449—Object-oriented method invocation or resolution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
The present disclosure provides a cross-programming-language code calling method and apparatus, an electronic device, and a storage medium; relates to the technical field of computers. The method comprises the following steps: starting a monitoring thread, and acquiring identification information corresponding to a code calling request when the code calling request corresponding to the target code is monitored; determining a target interface corresponding to the code calling request through the identification information so as to generate a return value corresponding to the code calling request according to the target interface; returning the return value to the calling thread corresponding to the code calling request according to the monitoring thread so as to enable the calling thread to end the code calling request; the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language. According to the method and the device, the high-level programming language can call codes in the basic programming language in an interprocess communication mode, meanwhile, the learning cost is reduced, the development period is shortened, and the use experience of a user is improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a cross-programming-language code calling method, a cross-programming-language code calling apparatus, an electronic device, and a computer-readable storage medium.
Background
At present, many open source libraries are compiled through a C Language (The C Programming Language is a general Programming Language facing a process and abstraction, and is widely applied to bottom layer development), and The C Language is a very "universal" computer Language, and can basically support The C Language from The top to a supercomputer and from The bottom to an embedded system. C + +, which is a superset thereof, is applied to a second extent to C language. In addition, a plurality of high-level languages exist, and the efficiency is obviously improved when the C/C + + code is called to compile programs.
However, when a high-level programming language in the prior art calls a code or an open source library compiled by C/C + +, a caller needs to learn a scheme for calling C/C + + in a corresponding language, and due to the great difference between different computer languages, the scheme for calling C/C + + is complex. On one hand, the learning cost of a user is improved, and the program debugging period is prolonged; on the other hand, when bugs appear, repair is difficult, the stability of the program is reduced, and the user experience is poor.
Therefore, it is very necessary to provide a cross-programming-language code calling method with low learning cost, short debugging period and simple operation.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a cross-programming-language code calling method, a cross-programming-language code calling apparatus, an electronic device, and a computer-readable storage medium, which overcome the problems of high learning cost, long program debugging period, and poor program stability of a calling programmer when program codes are called across programming languages due to limitations and disadvantages of the related art to some extent.
According to a first aspect of the present disclosure, there is provided a cross-programming-language code calling method, comprising: starting a monitoring thread, and acquiring identification information corresponding to a code calling request when the monitoring thread monitors the code calling request corresponding to a target code; determining a target interface corresponding to the code calling request through the identification information, and generating a return value corresponding to the code calling request according to the target interface; returning the return value to the calling thread corresponding to the code calling request according to the monitoring thread so that the calling thread finishes the code calling request; the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In an exemplary embodiment of the present disclosure, determining, by the identification information, a target interface corresponding to the code invocation request includes: and packaging the interfaces corresponding to the plurality of codes according to a preset packaging mode so as to determine a target interface corresponding to the code calling request in the plurality of packaged interfaces through the identification information.
In an exemplary embodiment of the present disclosure, the interfaces corresponding to the plurality of codes are encapsulated in a binary fixed data structure; or the interfaces corresponding to the plurality of codes are packaged through a text protocol capable of serializing the target data into binary data.
According to a second aspect of the present disclosure, there is provided a cross-programming-language code calling method, comprising: responding to an instruction for calling the target code, creating a calling thread and generating a code calling request corresponding to the target code; sending the code calling request to a corresponding monitoring thread through the calling thread so that a target interface in the monitoring thread generates a return value corresponding to the code calling request; receiving the return value returned by the monitoring thread, and finishing the code calling request of the target code; the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In an exemplary embodiment of the present disclosure, sending, by the calling thread, the code call request to a corresponding listening thread so that a target interface in the listening thread generates a return value corresponding to the code call request further includes: and encapsulating the interface name and the parameter value in the code calling request through a key-value pair mode, so that the monitoring thread calls the target interface according to the interface name and the parameter value to generate a return value corresponding to the code calling request.
In an exemplary embodiment of the present disclosure, the invoking the target interface according to the interface name and the parameter value to generate a return value corresponding to the code invocation request includes: and calling a callback function corresponding to the target interface according to the parameter value so as to generate a return value corresponding to the code calling request through the callback function.
According to a third aspect of the present disclosure, there is provided a cross-programming-language code calling method, comprising: acquiring a code calling request for a target code in a first programming language in a calling thread started by a second programming language; sending the code calling request to a corresponding monitoring thread started by the first programming language according to address information in the code calling request; based on the monitoring thread, sending the code calling request to a target interface corresponding to the first programming language so that the target interface generates a corresponding return value; returning the return value to the calling thread to cause the second programming language to complete the code call to the target code in the first programming language.
According to a fourth aspect of the present disclosure, there is provided a code calling apparatus across programming languages, comprising: the device comprises an identification information acquisition unit, a monitoring unit and a processing unit, wherein the identification information acquisition unit is used for starting a monitoring thread and acquiring identification information corresponding to a code calling request when the code calling request of a target code is monitored; a return value generating unit, configured to determine, through the identification information, a target interface corresponding to the code calling request, so as to generate a return value corresponding to the code calling request according to the target interface; a code call ending unit, configured to return the return value to the call thread corresponding to the code call request according to the monitoring thread, so that the call thread ends the code call request; the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In an exemplary embodiment of the present disclosure, the cross-programming-language code invoking device further includes an interface packaging unit configured to:
and packaging the interfaces corresponding to the plurality of codes according to a preset packaging mode so as to determine a target interface corresponding to the code calling request in the plurality of packaged interfaces through the identification information.
In an exemplary embodiment of the present disclosure, the interface packaging unit is further configured to:
packaging the interfaces corresponding to the codes in a binary fixed data structure mode; or
And packaging the interfaces corresponding to the plurality of codes through a text protocol capable of serializing the target data into binary data.
According to a fifth aspect of the present disclosure, there is provided a code calling apparatus across programming languages, comprising: the request generation unit is used for responding to the requirement of calling the target code, creating a calling thread and generating a code calling request corresponding to the target code; a request sending unit, configured to send the code call request to a corresponding monitoring thread through the call thread, so that a target interface in the monitoring thread generates a return value corresponding to the code call request; a return value receiving unit, configured to receive the return value returned by the monitoring thread, and end the code call request for the target code; the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In an exemplary embodiment of the present disclosure, the request transmitting unit is configured to:
and encapsulating the interface name and the parameter value in the code calling request through a key-value pair mode, so that the monitoring thread calls the target interface according to the interface name and the parameter value to generate a return value corresponding to the code calling request.
In an exemplary embodiment of the present disclosure, the request transmitting unit is further configured to:
and calling a callback function corresponding to the target interface according to the parameter value so as to generate a return value corresponding to the code calling request through the callback function.
According to a sixth aspect of the present disclosure, there is provided a code calling apparatus across programming languages, comprising: the second programming language request unit is used for acquiring a code calling request for a target code in the first programming language in a calling thread started by the second programming language; a code calling request sending unit, configured to send the code calling request to a corresponding monitoring thread started by the first programming language according to address information in the code calling request; the first programming language feedback unit is used for sending the code calling request to a target interface corresponding to the first programming language based on the monitoring thread so as to enable the target interface to generate a corresponding return value; and the code call completion unit is used for returning the return value to the call thread so that the second programming language completes the code call of the target code in the first programming language.
According to a seventh aspect of the present disclosure, there is provided an electronic apparatus comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any one of the above via execution of the executable instructions.
According to an eighth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of the above.
Exemplary embodiments of the present disclosure may have some or all of the following benefits:
in the cross-programming-language code calling method provided by an example embodiment of the present disclosure, a monitoring thread is started through a first programming language, and when the monitoring thread monitors a code calling request corresponding to a second programming language calling target code, the code calling request is allocated to a corresponding target interface, so that the target interface generates a return value corresponding to the code calling request; and returning a return value to the calling thread started by the second programming language corresponding to the code calling request according to the monitoring thread so that the second programming language completes the calling of the target code. On one hand, each programming language can develop a corresponding interprocess communication mode by itself without the help of other programming languages, and the second programming language completes the calling of the target code of the first programming language through interprocess communication, so that the learning cost of a user is reduced, the period of developing a program by the second programming language is shortened, and the working efficiency is improved; on the other hand, code calling is carried out in an interprocess communication mode, so that the method is simple to operate, and abnormal points can be quickly positioned when the program has errors, the debugging efficiency is improved, and the use experience of a user is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 illustrates a schematic diagram of an exemplary system architecture to which a cross-programming language code invocation method and apparatus of embodiments of the present disclosure may be applied;
FIG. 2 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device used to implement embodiments of the present disclosure;
FIG. 3 schematically illustrates a diagram of an existing computer language call to C/C + + code, in accordance with an embodiment of the present disclosure;
FIG. 4 schematically shows a flow diagram of a method of code invocation across programming languages in one embodiment in accordance with the present disclosure;
FIG. 5 schematically illustrates a flow diagram of a method for code invocation across programming languages in another embodiment in accordance with the present disclosure;
FIG. 6 schematically illustrates a flow diagram of a method for code invocation across programming languages in yet another embodiment in accordance with the present disclosure;
FIG. 7 schematically illustrates a scenario diagram of a code invocation method across programming languages in an embodiment in accordance with the present disclosure;
FIG. 8 schematically illustrates a schematic block diagram of a code invocation device across programming languages, according to one embodiment of the present disclosure;
FIG. 9 schematically illustrates a schematic block diagram of a code invocation device across programming languages, according to another embodiment of the present disclosure;
FIG. 10 schematically illustrates a schematic block diagram of a cross-programming language code invocation apparatus according to yet another embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
FIG. 1 is a schematic diagram illustrating a system architecture of an exemplary application environment to which a cross-programming-language code invocation method and apparatus of an embodiment of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The cross-programming-language code calling method provided by the embodiment of the present disclosure is generally executed by the terminals 101, 102, and 103 having the operating system installed therein, and accordingly, a cross-programming-language code calling device is generally disposed in the terminals 101, 102, and 103. However, it is easily understood by those skilled in the art that the cross-programming-language code calling method provided in the embodiment of the present disclosure may also be executed by the server 105, and accordingly, a cross-programming-language code calling device may also be disposed in the server 105, which is not particularly limited in the exemplary embodiment.
FIG. 2 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present disclosure.
It should be noted that the computer system 200 of the electronic device shown in fig. 2 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments of the present disclosure.
As shown in fig. 2, the computer system 200 includes a Central Processing Unit (CPU)201 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)202 or a program loaded from a storage section 208 into a Random Access Memory (RAM) 203. In the RAM 203, various programs and data necessary for system operation are also stored. The CPU201, ROM 202, and RAM 203 are connected to each other via a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
The following components are connected to the I/O interface 205: an input portion 206 including a keyboard, a mouse, and the like; an output section 207 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 208 including a hard disk and the like; and a communication section 209 including a network interface card such as a LAN card, a modem, or the like. The communication section 209 performs communication processing via a network such as the internet. A drive 210 is also connected to the I/O interface 205 as needed. A removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 210 as necessary, so that a computer program read out therefrom is mounted into the storage section 208 as necessary.
In particular, the processes described below with reference to the flowcharts may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 209 and/or installed from the removable medium 211. The computer program, when executed by a Central Processing Unit (CPU)201, performs various functions defined in the methods and apparatus of the present application.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having 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. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the embodiments below. For example, the electronic device may implement the steps shown in fig. 4 to 6, and the like.
The technical solution of the embodiment of the present disclosure is explained in detail below:
there are many methods for calling C/C + + codes in the existing computer languages, and the following description mainly refers to three high-level languages of Swift, Java and Python. FIG. 3 schematically illustrates a diagram of an existing computer language calling C/C + + code, according to one embodiment of the present disclosure.
Referring to FIG. 3, the Swift language 301 is a programming language written in macOS, iOS, tvOS, watchOSApp. During design, the Swift uses some characteristics of Objective-C (ObjC or OC, which is an object-oriented programming language for expanding C language) for reference, and in practical application, the Swift can directly call the classes of Objective-C and Objective-C + +. However, Swift cannot directly call C/C + + codes during design, and Objective-C/C + + can directly call C/C + + codes or static/dynamic library files thereof, so that Swift calling of C/C + + codes is realized by writing an Objective-C/C + + middle layer.
The Java language 303 is a widely used cross-platform computer programming language, and is applied to scenes such as server programming and Android development. Java cannot directly call C/C + + codes during design, but Java provides a Java Native Interface (JNI) framework, so that programs in a Java virtual machine can call local library files. For C/C + +, the code needs to be compiled (UNIX and UNIX-like systems are taken as examples, the same below) into a dynamic link library file (. so suffix file, the same below), then Java and the bondline code of the library file are designed according to a given format based on JNI, and finally the bondline code is called by the Java program, thereby realizing the calling of the C/C + + program code.
The Python language 305 is a widely used interpreted computer language, often used in rapid prototyping or algorithmic analysis, machine learning development. Python has several techniques available for calling C language programs, one of the more common being Ctypes. The Ctypes technology is similar to Java calling, and the code needs to be compiled into a dynamic link library file first, then a Ctypes syntax is given, and the adhesive layer codes of Python and library files are designed according to a given format. Finally, the Java program calls the bonding layer code, thereby realizing the calling of the most C/C + + program.
As can be seen from the above-listed methods for invoking C/C + + in various computer languages, if some programs or packages are developed using C/C + +, developers in other languages need to additionally learn about tools for invoking C/C + + when they are provided to the developers in other languages. Continuing with FIG. 3, it can be seen that the coupling layer between different languages and C/C + + programs, for example, Swift language 301 needs to call the code of C/C + + program through third party tool Obj-C302, Java language 303 needs to call the code of C/C + + program through third party tool JNI 304, and Python language 305 needs to call the code of C/C + + program through third party tool Ctype 306.
The C/C + + code is called by using the scheme, on one hand, a new tool needs to be learned, the design style and idea of the C/C + + language are different from those of other languages, and when the calling tool is learned, the C/C + + language also needs to be learned at the same time, which is close to learning the grammar of the new language, so that the time cost of the schemes is high; on the other hand, memory management of the C/C + + language and the like are greatly different from other high-level languages, memory pools of different languages are mixed together when calling, developers of two parties also do not know details of the programming language of the other party, once a program bug problem occurs, the developers of two programming languages are often required to debug together, a program b bug which is difficult to locate is easy to occur in the development process, particularly, whether the problem occurs in the calling party language or the called party language cannot be located, the period of program development is prolonged, and the difficulty of program development is improved; on the other hand, developers of all programming languages pay attention to learning and application of the programming languages, and technical risk points needing attention during long-term and stable running of the programs can be well controlled. However, when multiple language code hybrids are combined together, the uncertainty is increased, and in addition to the debugging risk, the program is easy to have risk points in long-term operation, the risk is low to memory leakage and high to program collapse, the stability of the program is reduced, and the user experience is poor.
Based on one or more of the problems set forth above, the present example embodiment provides a code calling method across programming languages. The cross-programming-language code calling method may be applied to one or more of the terminal devices 101, 102, and 103, and may also be applied to the server 105, which is not particularly limited in this exemplary embodiment. Taking the terminal to execute the method as an example, referring to fig. 4, the method for calling codes in the cross-programming language may include the following steps S410 to S430:
step S410, starting a monitoring thread, and acquiring identification information corresponding to a code call request when the monitoring thread monitors the code call request corresponding to a target code.
Step S420, determining a target interface corresponding to the code calling request through the identification information, so as to generate a return value corresponding to the code calling request according to the target interface.
Step S430, according to the monitoring thread, returning the return value to the calling thread corresponding to the code calling request so that the calling thread ends the code calling request; the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In the cross-programming-language code calling method provided by the exemplary embodiment, on one hand, each programming language can develop a corresponding inter-process communication mode by itself, and the second programming language completes calling of the target code of the first programming language through inter-process communication without help of other programming languages, so that the learning cost of a user is reduced, the period of developing a program by the second programming language is shortened, and the working efficiency is improved; on the other hand, code calling is carried out in an interprocess communication mode, so that the method is simple to operate, and abnormal points can be quickly positioned when the program has errors, the debugging efficiency is improved, and the use experience of a user is improved.
The above steps of the present exemplary embodiment will be described in more detail below.
In step S410, a monitoring thread is started, and when the monitoring thread monitors a code call request corresponding to a target code, identification information corresponding to the code call request is obtained.
In an example embodiment of the present disclosure, the listening thread may refer to a thread that implements inter-process communication (IPC) initiated by code in a first programming language (which may be a callee, for example, C/C + + language), and is capable of listening for a message (request instruction) of calling code sent by a second programming language (which may be a caller, for example, Swift language, Java language, Python language, etc.). The inter-process communication may include mechanisms such as Socket, pipe, message queue, and shared memory, which are not limited in this example embodiment. The first programming language may refer to a most basic programming language in the machine language, for example, the first programming language may be a C language or a C + + language, which is not particularly limited in this example embodiment. The second programming language may be an interpreted programming language, for example, the second programming language may be a Python language or a Java language, and of course, the second programming language may also be a Swift language, which is not limited in this example embodiment. The object code may refer to a code in the first programming language that needs to be called by the second programming language, for example, the object code may refer to a function code edited by the C/C + + language, or may refer to a library file in the C/C + + language, and of course, the object code may also refer to another code edited by the first programming language (which may also be considered as another programming language other than the second programming language), which is not particularly limited in this example embodiment. The code call request may refer to a message (request instruction) generated in a created call thread when the second programming language needs to call the target code in the first programming language, and the second programming language can call the target code in the first programming language in an interprocess communication manner by using the code call request. The identification information may refer to information labeled through the second programming language in the code call request, for example, the identification information may be a pointer included in the code call request, or may also be a function name included in the code call request, and of course, the identification information may also be a function parameter value included in the code call request, which is not particularly limited in this example embodiment.
In step S420, a target interface corresponding to the code invoking request is determined through the identification information, so as to generate a return value corresponding to the code invoking request according to the target interface.
In an example embodiment of the present disclosure, the target Interface may refer to an external Interface (API) or a function, which is encapsulated by a preset inter-process communication mode after the first Programming language completes Interface development, and the external target Interface may enable the second Programming language to call the target code in the first Programming language. The return value may refer to an execution result generated by the second programming language calling the target interface through the code call request and corresponding to the target code. And similarly, returning the return value to the calling thread corresponding to the second programming language in an interprocess communication mode through the listening thread.
Specifically, the terminal encapsulates the interfaces corresponding to the plurality of codes according to a preset encapsulation mode through the first programming language, so as to determine a target interface corresponding to the code calling request in the encapsulated plurality of interfaces through the identification information. The preset encapsulation manner may refer to a content organization manner for encapsulating a plurality of corresponding interfaces in the first programming language, for example, the preset encapsulation manner may be an encapsulation manner adopting a binary fixed data structure (specifically, may refer to sending and receiving binary data with a fixed size, and a specific meaning is formulated for each offset of the binary data, which is suitable for application scenarios where interface data is relatively simple, and is fast in data packing and parsing speed), or may be a text protocol for serializing data into binary data (specifically, may refer to protocols Json, Bson, XML, Google Protobuf, and the like, and by using this manner, the generated data has strong extensibility, and has an object-oriented concept, which facilitates packing and calling of data), and of course, the preset encapsulation manner may also be a text protocol for deserializing binary data into visual data, this exemplary embodiment is not particularly limited thereto. The encapsulation processing may refer to converting an interface in the first programming language into contents of inter-process communication in a preset encapsulation manner, so that the second programming language can call the object code in the first programming language in the inter-process communication manner.
Further, the terminal encapsulates the interfaces corresponding to the plurality of codes in a binary fixed data structure mode according to the first programming language; or the interfaces corresponding to the multiple codes are encapsulated through a text protocol capable of serializing the target data into binary data, which is only schematically illustrated here, and this example embodiment may also encapsulate the multiple interfaces in the first programming language through other preset encapsulation manners, which is not limited in this example embodiment. The target data may refer to visualization data (as opposed to binary data) generated by an interpreted programming language.
In step S430, returning the return value to the calling thread corresponding to the code calling request according to the monitoring thread so that the calling thread ends the code calling request; the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In an example embodiment of the present disclosure, the calling thread may refer to a thread that is started by the second programming language when the second programming language needs to call the target code in the first programming language, so that the second programming language can call the target code in the first programming language by means of inter-process communication. And the target interface calls the related function according to the content in the code calling request to generate a return value, and packages the return value according to a preset packaging mode so as to return the return value to the calling thread corresponding to the second programming language through the monitoring thread. When the monitoring thread returns the return value generated by the target interface to the calling thread, the calling thread considers that the result of the code calling is received, so that the code calling request is ended, and the calling of the target code in the first programming language by the second programming language is completed.
The example embodiments also provide a cross-programming language code invocation method. The cross-programming-language code calling method may be applied to one or more of the terminal devices 101, 102, and 103, and may also be applied to the server 105, which is not particularly limited in this exemplary embodiment. Taking the terminal to execute the method as an example, referring to fig. 5, the method for calling codes in the cross-programming language may include the following steps S510 to S530:
in step S510, in response to an instruction for calling the object code, a calling thread is created and a code calling request corresponding to the object code is generated.
In an example embodiment of the present disclosure, the instruction to call the object code may refer to an instruction compiled by a developer through a second programming language to call the object code. The calling thread may be a thread started by the second programming language, a code calling request corresponding to the target code is generated in the calling thread, and the code calling request is sent to the monitoring thread corresponding to the first programming language in an inter-process communication manner, so as to realize calling of the target code in the first programming language by the second programming language.
In step S520, the code call request is sent to the corresponding listening thread through the calling thread, so that the target interface in the listening thread generates a return value corresponding to the code call request.
In an example embodiment of the present disclosure, a terminal sends a code call request to a monitoring thread corresponding to a first programming language in an inter-process communication manner through a call thread started by a second programming language, and the monitoring thread parses and acquires identification information in the code call request when receiving the code call request, and determines a target interface corresponding to a target code in the first programming language according to the identification information, so that the target interface generates a corresponding return value according to a code call instruction.
Specifically, the terminal encapsulates the interface name and the parameter value in the code calling request through a key value pair mode according to a second programming language, so that the monitoring thread calls the target interface to generate a return value corresponding to the code calling request according to the interface name and the parameter value. The key-value pair mode may refer to a mode of encapsulating data with a corresponding relationship of key values, for example, for a person's information, "sex" is "male" and "name" is "third", the "sex" and the "name" are "key", the "male" and "third" are "values (values)" corresponding to the "key", and the "sex" and the corresponding value "male" are referred to as a "key-value pair". The interface name may refer to a name of a function to be called in the code call request, and the parameter value may refer to a value in a key value pair in the code call request, such as '″ sound-callback': the "true" in the true "is a parameter value, which represents a state of starting the callback function, and of course, this is only an illustrative example, and this example embodiment is not limited to this specifically according to different actual situations.
Furthermore, the terminal calls a callback function corresponding to the target interface according to the parameter value through a second programming language, so that a return value corresponding to the code calling request is generated through the callback function. Callback Functions (Callback Functions) may refer to Functions called by function pointers. In this example embodiment, a callback function corresponding to the target interface is called through a parameter value in the code call request, for example, a "sound-callback" in the code call instruction: and the "true" in the true "is a parameter value, which represents that the callback behavior of the function is started, and the target generates a return value according to the callback function. The existing programming languages generally start from ordinary function call when calling C/C + +. However, for the callback function interface of C/C + +, the learning cost is very high due to the inconsistent processing modes of the programming languages. Secondly, since the callback behavior is initiated by C/C + + (first programming language), the active is not in the caller (second programming language) hand. The scheduling of memory resources is not under the control of the caller. This scheme is either not implemented or is easily trapped in traps for memory transactions, such as wild pointers (memory), invalid pointers (which directly cause a process crash), etc. In the embodiment of the present invention, the call of the callback function is completed by judging whether the parameter value starts the callback behavior, so that the learning cost of a program developer is further reduced, the problem of process crash caused by an invalid pointer is reduced, the development speed of the program is increased, the robustness of the program code is improved, and the use experience of a caller programmer is further improved.
In step S530, receiving the return value returned by the listening thread, and ending the code call request for the target code; the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In an example embodiment of the present disclosure, the listening thread acquires a return value generated by the target interface, encapsulates the return value in an inter-process communication mode, and returns the return value to the calling thread in an inter-process communication mode, and the calling thread corresponding to the second programming language considers that the calling process for the target code is completed after receiving the return value, thereby ending the code calling request for the target code.
The illustrative embodiments further provide a cross-programming language code invocation method. The cross-programming-language code calling method may be applied to one or more of the terminal devices 101, 102, and 103, and may also be applied to the server 105, which is not particularly limited in this exemplary embodiment. Taking the terminal to execute the method as an example, referring to fig. 6, the method for calling codes in the cross-programming language may include the following steps S610 to S640:
in step S610, a code call request for the target code in the first programming language in the call thread started by the second programming language is obtained.
In an example embodiment of the disclosure, the terminal calls the second programming language to create and start a calling thread when determining that the second programming language requires a call to the object code of the first programming language. And packaging the interface name and the parameter value corresponding to the target code to be called according to the calling thread to generate a code calling request, and sending the code calling request through the calling thread. The terminal acquires the code calling request and analyzes the address information contained in the code calling request.
In step S620, the code calling request is sent to the corresponding monitoring thread started by the first programming language according to the address information in the code calling request.
In an example embodiment of the present disclosure, the terminal obtains address information in the code call request, where the address information may refer to an address of a listening thread corresponding to a target code requested to be called, for example, the address information may be a memory pointer included in the code call request, or may also be a function name included in the code call request, and of course, the address information may also refer to other identification information indicating a target code address, which is not particularly limited in this example embodiment. And the terminal sends a code calling request to a monitoring thread started by the first programming language according to the address information.
In step S630, based on the listening thread, the code call request is sent to the target interface corresponding to the first programming language, so that the target interface generates a corresponding return value.
In an example embodiment of the present disclosure, the terminal sends the code call request to a corresponding target interface according to the identification information in the code call request based on the listening thread started by the first programming language, and the target interface calls a corresponding callback function according to a parameter value and an interface name in the code call request to generate a return value.
In step S640, the return value is returned to the calling thread to make the second programming language complete the code call to the target code in the first programming language.
In an example embodiment of the present disclosure, the terminal encapsulates the return value generated by the target interface by the calling thread and returns the return value to the calling thread. And the calling thread considers that the second programming language completes the calling of the target code in the first programming language when receiving the return value, and the end code calling request completes the code calling process of the second programming language for the target code in the first programming language.
For example, a code calling method across programming languages in the present exemplary embodiment is described below by taking Json package C/C + + as an example.
The interactive means side: before calling the code in C/C + +, the corresponding interface needs to be encapsulated by C/C + +, for example, the encapsulation of the interface can be realized by the following code structure:
a callback function)
The second function "reg _ callback" registers a callback function, which the C/C + + program will call after certain conditions are met.
The interaction means adopts Json for packaging, specifically, a key-value pair mode is adopted for packaging values, a variable name is used as a key (key), for example, a call to a function "test _ structure _ func", and a call data stream is packaged through the following code structure:
the return data is then encapsulated by the following code structure:
{ "return": numerical data) }
And for callback function registration, it is somewhat different. When the parameter is transferred, since a general callback function data type does not exist, only "whether a callback behavior exists" needs to be transferred for the callback function, which can be implemented by, for example, the following code structure:
{
"function:""reg_callback";
"parameters" { "some _ callback" } (true when callback is enabled, false otherwise)
}
When C/C + + actually calls callback, the wrapping of parameters is similar to the ordinary function wrapping described above.
The called side: a thread may be started listening for incoming data (socket for example). The data is organized in the above Json format. The thread parses the value of the "function" key in the Json data, determines which interface API should be passed to, and then calls the parameters in the "parameters" as the parameters of the interface API. If the API has the return value, after the execution is finished, the return value is returned to the calling side in a similar mode.
The calling side: if the data flow is initiated by the calling party (no callback), the calling of the C/C + + interface can be completed by directly adopting a mode of sending and receiving data by a socket during calling. If two-way data flow, such as a callback, is involved, a thread may also be started, listening for callback data, and processing.
It should be noted that the program codes mentioned in the exemplary embodiment are only schematic illustrations, and should not cause any particular limitation to the exemplary embodiment.
FIG. 7 schematically illustrates a scenario diagram of a code invocation method across programming languages in an embodiment in accordance with the present disclosure.
Referring to fig. 7, a specific scenario structure of the cross-programming-language code calling method in the present exemplary embodiment may include a caller 701 (which may refer to the second programming language in the present exemplary embodiment), an interaction means 702 (which may refer to inter-process communication), and a callee 703 (which may refer to the first programming language in the present exemplary embodiment).
Specifically, before the C/C + + language 710 in the callee 703 is called, after the developer completes interface development normally, the developer encapsulates the developed interface in an inter-process communication (IPC) mode by using the C/C + + language, that is, the C/C + + type interface is converted into an interface C/C + + IPC711 for inter-process communication. When the caller needs to call the C/C + + language in the callee 703, the caller checks the information of the inter-process communication interface externally encapsulated by the callee, and then develops a corresponding inter-process communication interface according to the inter-process communication interfaces. For example, the Swift language 704 develops a corresponding interprocess communication interface Swift IPC 705 according to C/C + + IPC 711; the Java language 706 develops a corresponding interprocess communication interface Java IPC707 according to C/C + + IPC 711; the Python language 708 develops a corresponding interprocess communication interface Python IPC 709 according to C/C + + IPC 711. When the Swift language, the Java language and the Python language of a calling party need to call codes in the C/C + + language, the C/C + + language codes are communicated with the C/C + + IPC in an interprocess communication mode through Swift IPC, Java IPC and Python IPC respectively, and calling of the C/C + + language codes is completed. Compared with the code calling method shown in fig. 3, the method in fig. 7 completes code calling across programming languages in a general interprocess communication mode, so that the learning cost of a user is reduced, the period of developing a program by using a second programming language is shortened, the working efficiency is improved, the operation is simple, abnormal points can be quickly positioned when the program has errors, the debugging efficiency is improved, and the use experience of the user is improved.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Further, in the present example embodiment, a code invoking apparatus across programming languages is provided. The code calling device of the cross-programming language can be applied to a server or terminal equipment. Referring to fig. 8, the cross-programming-language code calling apparatus 800 may include an identification information acquiring unit 810, a return value generating unit 820, and a code call ending unit 830. Wherein:
the identification information obtaining unit 810 is configured to start a monitoring thread, and obtain identification information corresponding to a code call request when the monitoring thread monitors the code call request of a target code;
the return value generating unit 820 is configured to determine, through the identification information, a target interface corresponding to the code call request, so as to generate a return value corresponding to the code call request according to the target interface;
the code call ending unit 830 is configured to return the return value to the call thread corresponding to the code call request according to the listening thread, so that the call thread ends the code call request;
the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In an exemplary embodiment of the present disclosure, the cross-programming-language code invoking device 800 further includes an interface packaging unit configured to:
and packaging the interfaces corresponding to the plurality of codes according to a preset packaging mode so as to determine a target interface corresponding to the code calling request in the plurality of packaged interfaces through the identification information.
In an exemplary embodiment of the present disclosure, the interface packaging unit is further configured to:
packaging the interfaces corresponding to the codes in a binary fixed data structure mode; or
And packaging the interfaces corresponding to the plurality of codes through a text protocol capable of serializing the target data into binary data.
In the example embodiment, a cross-programming-language code calling device is also provided. The code calling device of the cross-programming language can be applied to a server or terminal equipment. Referring to fig. 9, the cross-programming-language code invocation apparatus 900 may include a request generation unit 910, a request transmission unit 920, and a return value reception unit 930. Wherein:
the request generating unit 910 is configured to, in response to an instruction for calling a target code, create a calling thread and generate a code calling request corresponding to the target code;
the request sending unit 920 is configured to send the code call request to a corresponding monitoring thread through the calling thread, so that a target interface in the monitoring thread generates a return value corresponding to the code call request;
the return value receiving unit 930 is configured to receive the return value returned by the listening thread, and end the code call request for the target code;
the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
In an exemplary embodiment of the present disclosure, the request transmitting unit 920 is configured to:
and encapsulating the interface name and the parameter value in the code calling request through a key-value pair mode, so that the monitoring thread calls the target interface according to the interface name and the parameter value to generate a return value corresponding to the code calling request.
In an exemplary embodiment of the present disclosure, the request sending unit 920 is further configured to:
and calling a callback function corresponding to the target interface according to the parameter value so as to generate a return value corresponding to the code calling request through the callback function.
In the example embodiment, a code calling device crossing programming languages is further provided. The code calling device of the cross-programming language can be applied to a server or terminal equipment. Referring to fig. 10, the cross-programming-language code invocation apparatus 1000 may include a second programming language request unit 1010, a code invocation request transmission unit 1020, a first programming language feedback unit 1030, and a code invocation completion unit 1040. Wherein:
the second programming language request unit 1010 is configured to obtain a code call request for a target code in the first programming language in a call thread initiated by the second programming language;
the code calling request sending unit 1020 is configured to send the code calling request to a corresponding monitoring thread started by the first programming language according to address information in the code calling request;
the first programming language feedback unit 1030 is configured to send the code call request to a target interface corresponding to the first programming language based on the monitoring thread, so that the target interface generates a corresponding return value;
the code call completion unit 1040 is used to return the return value to the calling thread to make the second programming language complete the code call to the target code in the first programming language.
The specific details of each module or unit in the cross-programming-language code calling device are already described in detail in the corresponding cross-programming-language code calling method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (10)
1. A code invocation method across programming languages, comprising:
starting a monitoring thread, and acquiring identification information corresponding to a code calling request when the monitoring thread monitors the code calling request corresponding to a target code;
determining a target interface corresponding to the code calling request through the identification information, and generating a return value corresponding to the code calling request according to the target interface;
returning the return value to the calling thread corresponding to the code calling request according to the monitoring thread so that the calling thread finishes the code calling request;
the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
2. The cross-programming-language code calling method according to claim 1, wherein determining a target interface corresponding to the code calling request through the identification information comprises:
and packaging the interfaces corresponding to the plurality of codes according to a preset packaging mode so as to determine a target interface corresponding to the code calling request in the plurality of packaged interfaces through the identification information.
3. The cross-programming-language code calling method according to claim 2, wherein encapsulating the interfaces corresponding to the plurality of codes according to a preset encapsulation method includes:
packaging the interfaces corresponding to the codes in a binary fixed data structure mode; or
And packaging the interfaces corresponding to the plurality of codes through a text protocol capable of serializing the target data into binary data.
4. A code invocation method across programming languages, comprising:
responding to an instruction for calling the target code, creating a calling thread and generating a code calling request corresponding to the target code;
sending the code calling request to a corresponding monitoring thread through the calling thread so that a target interface in the monitoring thread generates a return value corresponding to the code calling request;
receiving the return value returned by the monitoring thread, and finishing the code calling request of the target code;
the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
5. The cross-programming-language code calling method according to claim 4, wherein sending the code call request to a corresponding listening thread through the calling thread to cause a target interface in the listening thread to generate a return value corresponding to the code call request further comprises:
and encapsulating the interface name and the parameter value in the code calling request through a key-value pair mode, so that the monitoring thread calls the target interface according to the interface name and the parameter value to generate a return value corresponding to the code calling request.
6. The method for code calling across programming languages according to claim 5, wherein the calling the target interface according to the interface name and the parameter value to generate the return value corresponding to the code calling request comprises:
and calling a callback function corresponding to the target interface according to the parameter value so as to generate a return value corresponding to the code calling request through the callback function.
7. A code invocation method across programming languages, comprising:
acquiring a code calling request for a target code in a first programming language in a calling thread started by a second programming language;
sending the code calling request to a corresponding monitoring thread started by the first programming language according to address information in the code calling request;
based on the monitoring thread, sending the code calling request to a target interface corresponding to the first programming language so that the target interface generates a corresponding return value;
returning the return value to the calling thread to cause the second programming language to complete the code call to the target code in the first programming language.
8. A code invocation apparatus across programming languages, comprising:
the device comprises an identification information acquisition unit, a code calling unit and a code calling unit, wherein the identification information acquisition unit is used for starting a monitoring thread and acquiring identification information corresponding to a code calling request when the monitoring thread monitors the code calling request of a target code;
a return value generating unit, configured to determine, through the identification information, a target interface corresponding to the code calling request, so as to generate a return value corresponding to the code calling request according to the target interface;
a code call ending unit, configured to return the return value to the call thread corresponding to the code call request according to the monitoring thread, so that the call thread ends the code call request;
the monitoring thread is started through a first programming language, and the calling thread is started through a second programming language.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-7 via execution of the executable instructions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910718878.1A CN111176626B (en) | 2019-08-05 | 2019-08-05 | Cross-programming-language code calling method and device, medium and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910718878.1A CN111176626B (en) | 2019-08-05 | 2019-08-05 | Cross-programming-language code calling method and device, medium and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111176626A true CN111176626A (en) | 2020-05-19 |
CN111176626B CN111176626B (en) | 2022-04-19 |
Family
ID=70648693
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910718878.1A Active CN111176626B (en) | 2019-08-05 | 2019-08-05 | Cross-programming-language code calling method and device, medium and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111176626B (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112000393A (en) * | 2020-08-25 | 2020-11-27 | 上海连尚网络科技有限公司 | Method and device for running small program |
CN112925527A (en) * | 2021-02-07 | 2021-06-08 | 北京三快在线科技有限公司 | Calling method, calling device, storage medium and electronic equipment |
CN113010181A (en) * | 2021-03-24 | 2021-06-22 | 北京百度网讯科技有限公司 | Deployment method and device of operators in deep learning framework and electronic equipment |
CN113485688A (en) * | 2021-07-01 | 2021-10-08 | 广州博冠信息科技有限公司 | Code completion method and device, storage medium and electronic equipment |
CN113656009A (en) * | 2021-08-26 | 2021-11-16 | 五八同城信息技术有限公司 | Macro processing method and device, electronic equipment and storage medium |
CN113687879A (en) * | 2021-07-22 | 2021-11-23 | 成都鲁易科技有限公司 | Interaction method and device for cross-platform framework and platform interaction library |
CN114047922A (en) * | 2021-11-16 | 2022-02-15 | 北京字节跳动网络技术有限公司 | Code conversion method, apparatus, medium, and device for pre-compiler |
CN115080006A (en) * | 2021-03-15 | 2022-09-20 | 武汉斗鱼网络科技有限公司 | Data calling method and related equipment |
WO2022194090A1 (en) * | 2021-03-19 | 2022-09-22 | 华为技术有限公司 | Multi-language hybrid debugging method and apparatus |
CN116048845A (en) * | 2023-02-07 | 2023-05-02 | 之江实验室 | Data processing method and device, storage medium and electronic equipment |
CN116991600A (en) * | 2023-06-15 | 2023-11-03 | 上海一谈网络科技有限公司 | Method, device, equipment and storage medium for processing graphic call instruction |
WO2024088053A1 (en) * | 2022-10-25 | 2024-05-02 | 华为技术有限公司 | Code debugging method, electronic device, and computer readable storage medium |
CN116048845B (en) * | 2023-02-07 | 2024-07-26 | 之江实验室 | Data processing method and device, storage medium and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110138059A1 (en) * | 2009-12-03 | 2011-06-09 | Microsoft Corporation | Communication channel between web application and process outside browser |
CN103399735A (en) * | 2013-07-12 | 2013-11-20 | 浙江吉利汽车研究院有限公司杭州分公司 | Method for developing intermediate layer of remote function call interface |
CN106462407A (en) * | 2014-05-16 | 2017-02-22 | 微软技术许可有限责任公司 | Code service for language-independent dispatch |
CN108255615A (en) * | 2017-11-30 | 2018-07-06 | 平安科技(深圳)有限公司 | Across language call method, server and storage medium |
CN109933443A (en) * | 2019-03-07 | 2019-06-25 | 腾讯科技(深圳)有限公司 | Inter-process communication methods, device, computer equipment and readable storage medium storing program for executing |
-
2019
- 2019-08-05 CN CN201910718878.1A patent/CN111176626B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110138059A1 (en) * | 2009-12-03 | 2011-06-09 | Microsoft Corporation | Communication channel between web application and process outside browser |
CN103399735A (en) * | 2013-07-12 | 2013-11-20 | 浙江吉利汽车研究院有限公司杭州分公司 | Method for developing intermediate layer of remote function call interface |
CN106462407A (en) * | 2014-05-16 | 2017-02-22 | 微软技术许可有限责任公司 | Code service for language-independent dispatch |
CN108255615A (en) * | 2017-11-30 | 2018-07-06 | 平安科技(深圳)有限公司 | Across language call method, server and storage medium |
CN109933443A (en) * | 2019-03-07 | 2019-06-25 | 腾讯科技(深圳)有限公司 | Inter-process communication methods, device, computer equipment and readable storage medium storing program for executing |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112000393A (en) * | 2020-08-25 | 2020-11-27 | 上海连尚网络科技有限公司 | Method and device for running small program |
CN112925527A (en) * | 2021-02-07 | 2021-06-08 | 北京三快在线科技有限公司 | Calling method, calling device, storage medium and electronic equipment |
CN112925527B (en) * | 2021-02-07 | 2022-03-08 | 北京三快在线科技有限公司 | Calling method, calling device, storage medium and electronic equipment |
CN115080006A (en) * | 2021-03-15 | 2022-09-20 | 武汉斗鱼网络科技有限公司 | Data calling method and related equipment |
WO2022194090A1 (en) * | 2021-03-19 | 2022-09-22 | 华为技术有限公司 | Multi-language hybrid debugging method and apparatus |
US11531529B2 (en) | 2021-03-24 | 2022-12-20 | Beijing Baidu Netcom Science Technology Co., Ltd. | Method and electronic device for deploying operator in deep learning framework |
CN113010181A (en) * | 2021-03-24 | 2021-06-22 | 北京百度网讯科技有限公司 | Deployment method and device of operators in deep learning framework and electronic equipment |
CN113485688A (en) * | 2021-07-01 | 2021-10-08 | 广州博冠信息科技有限公司 | Code completion method and device, storage medium and electronic equipment |
CN113485688B (en) * | 2021-07-01 | 2022-08-05 | 广州博冠信息科技有限公司 | Code completion method and device, storage medium and electronic equipment |
CN113687879A (en) * | 2021-07-22 | 2021-11-23 | 成都鲁易科技有限公司 | Interaction method and device for cross-platform framework and platform interaction library |
CN113687879B (en) * | 2021-07-22 | 2023-05-05 | 成都鲁易科技有限公司 | Interaction method and device for cross-platform framework and platform interaction library |
CN113656009A (en) * | 2021-08-26 | 2021-11-16 | 五八同城信息技术有限公司 | Macro processing method and device, electronic equipment and storage medium |
CN113656009B (en) * | 2021-08-26 | 2024-02-02 | 五八同城信息技术有限公司 | Macro processing method, macro processing device, electronic equipment and storage medium |
CN114047922A (en) * | 2021-11-16 | 2022-02-15 | 北京字节跳动网络技术有限公司 | Code conversion method, apparatus, medium, and device for pre-compiler |
WO2024088053A1 (en) * | 2022-10-25 | 2024-05-02 | 华为技术有限公司 | Code debugging method, electronic device, and computer readable storage medium |
CN116048845A (en) * | 2023-02-07 | 2023-05-02 | 之江实验室 | Data processing method and device, storage medium and electronic equipment |
CN116048845B (en) * | 2023-02-07 | 2024-07-26 | 之江实验室 | Data processing method and device, storage medium and electronic equipment |
CN116991600A (en) * | 2023-06-15 | 2023-11-03 | 上海一谈网络科技有限公司 | Method, device, equipment and storage medium for processing graphic call instruction |
CN116991600B (en) * | 2023-06-15 | 2024-05-10 | 上海一谈网络科技有限公司 | Method, device, equipment and storage medium for processing graphic call instruction |
Also Published As
Publication number | Publication date |
---|---|
CN111176626B (en) | 2022-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111176626B (en) | Cross-programming-language code calling method and device, medium and equipment | |
CN108345531B (en) | Test method, device and system | |
CN109002362B (en) | Service method, device and system and electronic equipment | |
CN107678778B (en) | Hybrid-based compatible method, adapter, operation device and system | |
CN111338623B (en) | Method, device, medium and electronic equipment for developing user interface | |
GB2589658A (en) | Method and apparatus for running an applet | |
CN111740948B (en) | Data packet issuing method, dynamic updating method, device, equipment and medium | |
CN105872083A (en) | Method and system supporting server access by different types of clients as well as server | |
US20080209405A1 (en) | Distributed debugging for a visual programming language | |
CN110489323B (en) | Visual RPC API debugging method, device, medium and equipment | |
CN104821954A (en) | Cross-platform remote procedure call method | |
US9602329B1 (en) | Dynamic remote procedure call | |
CN111026439B (en) | Application program compatibility method, device, equipment and computer storage medium | |
CN111857658A (en) | Method, device, medium and electronic equipment for rendering dynamic component | |
CN111506368B (en) | Method, device, equipment and storage medium for converting asynchronous call into synchronous call | |
CN112631590A (en) | Component library generation method and device, electronic equipment and computer readable medium | |
CN109062714A (en) | The method, apparatus and electronic equipment of long-range control Android device | |
CN109725887B (en) | Data interaction method and device based on message research and development framework and terminal equipment | |
CN103150161B (en) | Based on task encapsulation method and the device of MapReduce computation module | |
CN112015384A (en) | Interface mapping method and device | |
CN109343970B (en) | Application program-based operation method and device, electronic equipment and computer medium | |
CN112612460A (en) | Interface packaging and calling method, electronic device and storage medium | |
US20130139185A1 (en) | Intercepting and tracing interface routine transactions | |
CN106775916B (en) | Method and device for reducing application installation packages and electronic equipment | |
WO2023083071A1 (en) | View interaction method and apparatus, electronic device, and computer readable medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |