CN116346963A - Network communication method, device, medium, and program product - Google Patents

Network communication method, device, medium, and program product Download PDF

Info

Publication number
CN116346963A
CN116346963A CN202310202166.0A CN202310202166A CN116346963A CN 116346963 A CN116346963 A CN 116346963A CN 202310202166 A CN202310202166 A CN 202310202166A CN 116346963 A CN116346963 A CN 116346963A
Authority
CN
China
Prior art keywords
target application
application program
protocol stack
interface
function
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
CN202310202166.0A
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.)
Southeast University
Network Communication and Security Zijinshan Laboratory
Original Assignee
Southeast University
Network Communication and Security Zijinshan Laboratory
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 Southeast University, Network Communication and Security Zijinshan Laboratory filed Critical Southeast University
Priority to CN202310202166.0A priority Critical patent/CN116346963A/en
Publication of CN116346963A publication Critical patent/CN116346963A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/28Timers or timing mechanisms used in protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present application relates to a network communication method, device, medium and program product, and relates to the field of network communication. The method comprises the following steps: firstly, responding to a compiling instruction of a target application program, obtaining a functional interface of the target application program, then fusing and compiling the target application program and the functional interface, obtaining a functional interface instance meeting a preset compiling language, and finally accessing a protocol stack through the functional interface instance to perform network communication of the target application program and the protocol stack. The preset compiling language is compatible with protocol stacks of various operating systems. The method can support the target application program to realize effective network communication.

Description

Network communication method, device, medium, and program product
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a network communication method, device, medium, and program product.
Background
An Application (APP) implements network communications by communicating with a protocol stack. Such as a user state protocol stack, a core state protocol stack, etc.
In the related art, in the communication interaction process between the APP and the protocol stack, an interface opened by the protocol stack for an APP user is called according to the communication requirement of the APP in a link library file in the protocol stack, and a communication channel between the APP and the protocol stack is established, so that network communication among a plurality of APPs is realized.
However, when the APP interacts with the protocol stack, the protocol stack cannot provide an effective operating system interface, resulting in a failure to spread the network communications of the APP.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a network communication method, apparatus, device, medium, and program product that spreads network communication of application programs by providing an efficient operating system interface.
In a first aspect, the present application provides a network communication method, the method comprising:
responding to a compiling instruction of a target application program, and acquiring a functional interface of the target application program;
fusing and compiling the target application program and the functional interface to obtain a functional interface instance meeting a preset compiling language; presetting a protocol stack of which the compiling language is compatible with various operating systems;
the protocol stack is accessed through the functional interface instance to conduct network communications of the target application with the protocol stack.
In one embodiment, the compiling instruction carries a functional interface identifier of the target application program; responding to the compiling instruction of the target application program, acquiring the functional interface of the target application program, comprising:
calling the function interface of the target application program from the function interface library according to the function interface identification of the target application program; the function interface library comprises function interfaces of various application programs and interface identifiers corresponding to the function interfaces of the application programs.
In one embodiment, fusing and compiling a target application program and a functional interface to obtain a functional interface instance meeting a preset compiling language includes:
fusing and compiling the target application program and the functional interface to generate a program fusion instance meeting the preset compiling language;
and acquiring a functional interface instance meeting a preset compiling language according to the program fusion instance.
In one embodiment, according to a program fusion instance, obtaining a functional interface instance satisfying a preset compiling language includes:
reading the program fusion instance to obtain a link relation between the target application program and a functional interface of the target application program;
and acquiring a functional interface instance meeting the preset compiling language according to the link relation.
In one embodiment, obtaining a function interface instance satisfying a preset compiling language according to a link relation includes:
acquiring a function library corresponding to a function interface of a target application program according to the link relation;
and generating a function interface instance meeting the preset compiling language by executing the function library.
In one embodiment, after accessing the protocol stack through the functional interface instance, the network communication method further comprises:
Determining a communication channel of the target application program in response to a starting instruction of the target application program; the communication channel is used for connecting the target application program and the protocol stack;
network communication of the target application program and the protocol stack is performed through a communication channel.
In one embodiment, network communication of a target application with a protocol stack via a communication channel includes:
acquiring a data message of a target application program;
and transmitting the data message of the target application program to a protocol stack through a communication channel.
In one embodiment, the network communication method further comprises:
responding to a receiving and transmitting instruction of a target application program, and acquiring a mapping relation between the target application program and a memory address; the memory address is used for storing the data message of the target application program;
and according to the mapping relation, completing delivery of the data message of the target application program through the communication channel.
In one embodiment, after accessing the protocol stack through the functional interface instance, the network communication method further comprises:
starting a timer in response to a target application program running instruction;
detecting the running state of a target application program according to a trigger instruction of a timer;
and if the target application program is not in the running state, closing the timer.
In a second aspect, the present application also provides a network communication device, the device comprising:
the acquisition module is used for responding to the compiling instruction of the target application program and acquiring the functional interface of the target application program;
the compiling module is used for fusing and compiling the target application program and the functional interface to obtain a functional interface instance meeting the preset compiling language; presetting a protocol stack of which the compiling language is compatible with various operating systems;
and the calling module is used for accessing the protocol stack through the functional interface instance so as to carry out network communication between the target application program and the protocol stack.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the steps of the method in any of the embodiments of the first aspect described above when the computer program is executed.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method in any of the embodiments of the first aspect described above.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprising a computer program which, when executed by a processor, implements the steps of the method in any of the embodiments of the first aspect described above.
According to the network communication method, the device, the medium and the program product, firstly, the compiling instruction of the target application program is responded, the functional interface of the target application program is obtained, then the target application program and the functional interface are fused and compiled, the functional interface instance meeting the preset compiling language is obtained, and finally, the protocol stack is accessed through the functional interface instance so as to carry out network communication of the target application program and the protocol stack. The preset compiling language is compatible with protocol stacks of various operating systems. In the method, the functional interface of the target application program is obtained in response to the compiling instruction of the target application program, so that the obtained functional interface of the target application program can meet the communication requirement of the target application program. Further, after the function interface of the target application program is obtained, the function interface instance is obtained by fusing the target application program and the function interface and compiling, which is equivalent to the process of carrying out network communication, not only considering the diversity of compiling languages of the application program, but also considering the effectiveness of the function interface of the target application program, so that the obtained function interface instance can support each system call to access a protocol stack, thereby supporting communication among a plurality of target application programs.
Drawings
FIG. 1 is a block diagram of a computer device of a network communication method in one embodiment;
FIG. 2 is a schematic diagram of a network communication scheme in one embodiment;
FIG. 3 is a flow diagram of a method of network communication in one embodiment;
FIG. 4 is a flow chart of the functional interface instance acquisition steps in one embodiment;
FIG. 5 is a flowchart of a functional interface instance acquisition step according to another embodiment;
FIG. 6 is a flowchart of a functional interface instance acquisition step according to another embodiment;
FIG. 7 is a schematic diagram of a network communication architecture in one embodiment;
FIG. 8 is a communication diagram of an application interacting with a protocol stack in one embodiment;
FIG. 9 is a flow chart of a method of network communication according to another embodiment;
FIG. 10 is a flow chart of a method of network communication according to another embodiment;
FIG. 11 is a communication diagram illustrating the interaction of an application program with a protocol stack in another embodiment;
FIG. 12 is a flow chart of a method of network communication according to another embodiment;
FIG. 13 is a flow chart of a method of network communication according to another embodiment;
FIG. 14 is a flow diagram of an application keep-alive mechanism in one embodiment;
fig. 15 is a block diagram of a network communication device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The network communication method provided by the embodiment of the application can be applied to computer equipment. The computer device may be a server, the internal structure of which may be as shown in FIG. 1. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing network communication data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a network communication method.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an operating system, application software (APP) operates on system resources through a system interface provided by a Kernel (Kernel). There may be different application program interfaces (Application Programming Interface, API) for different systems (Windows, linux, mac etc.), such as Windows system for Windows API, mac system or Linux system for POSIX API.
As data transceiving of an operating system tends to be user-oriented, more and more products realize calling of an API interface through a user-oriented protocol stack. The user state protocol stack can shield the difference of different operation system interfaces, and the data receiving and transmitting efficiency of the user state protocol stack is higher than the kernel receiving and transmitting efficiency.
Meanwhile, along with the diversification of application deployment, the Wasm technology gradually becomes the main stream of APP deployment due to the characteristics of usability and portability. However, the Wasm technology requires a Web browser to invoke a system interface, which reduces the efficiency of APP operating resources in the event of increasing network communication demands. Therefore, the operation of Wasm outside the Web browser becomes an urgent problem to be solved, and the solution to this problem needs to take portability and security problems into consideration. Wherein portability is the ability of the same Wasm file to support calls of different systems. The security refers to control of the access authority of the user, that is, in the process of system call, a third party is not allowed to directly access the system resource, and then a sandbox environment needs to be constructed to isolate the Wasm instance generated based on the Wasm technology from the system resource.
However, the Wasm technology is developed in the WASI (WebAssembly System Interface, network program set system interface), and the currently evolving WASI standard implements the interface function of part of the operating system. The WASI is used as an abstract interface layer, and the implementation is called by the Wasm binary system before the system call, i.e. the Wasm is written without depending on a browser or JavaScript, and at the moment, the WASI cannot be operated by the current tool chain which only supports embedding into Web, but needs to be realized by the runtime which supports the WASI.
Existing WASI-based implementations as shown in fig. 2, the WASI is designed as a set of modular standard interfaces, with the most basic core module being the WASI core (wati-core) module. The WASI-core contains WASI abstract function interfaces for related system calls such as files, networks, etc. In addition to the wasi-core, other subsets such as "sensors", "keys", "processes", "multimedia", "smart contracts", "three-dimensional graphics" are organized in the form of individual sub-modules. With the fopen function example, for C/C++, a WASI system root directory (WASI-sysroot) is created, which implements libc (C language function library) from WASI-core. Next, the source code is compiled into the wasm binary using the wasi-sdk tool set, and finally a system call is made through the_wasi_path_open function. It will be appreciated that in the Rust system programming language architecture, rust will directly use the wasi-core as its standard library, directly introducing the_wasi_path_open function to implement. The function for system call finally generated when the_wasi_path_open function is generated, the abstract system call function generated according to the WASI standard, the fopen function as a file operation function, and the fopen function is divided into a WASI-core subset. By way of example, WASI run time provides portability by implementing subsets such as a WASI-core, while these run time engines provide a sandboxed environment, hosts can choose, program by program, which WASI-core functions can be imported, and only the imported functions support system calls, thereby ensuring security of network communications. The current running process can not fully support WASI, so that the current WASI interface is an interface modification interface based on an operating system interface, and is temporarily not supported for the customized interface of the application and the user mode protocol stack.
To sum up, the current WASI standard can only implement the interface function of a part of the operating system, and the imperfect interface causes that many operating system interfaces of the protocol stack cannot be effectively supported. For APP, only the class operating system interface can be called, the custom interface can not be directly called, and network communication can not be performed.
Based on the method, the function interface library is developed based on the WASI standard, and the APP and the function interface library are fused and compiled, so that the APP realizes an external communication function through a user mode protocol stack.
In one embodiment, as shown in fig. 3, there is provided a network communication method, including:
s301, responding to a compiling instruction of a target application program, and acquiring a functional interface of the target application program.
The application software is a set of various programming languages which can be used by users and application programs compiled by the various programming languages, and can meet the application requirements of different fields and different problems of the users. In user mode, an application refers to a computer program, such as word, photoshop, that is a single program for performing one or more specific tasks. In an operating system, applications require system resources to be operated through a system interface provided by a protocol stack, which is a specific software implementation of a computer network protocol suite. Obviously, when the application program interacts with the protocol stack, not only the compatibility of the application program and the operating system needs to be considered, but also the functional interface of the target application program needs to meet the actual requirement of the user and can communicate with the protocol stack.
Under the condition that the programming language of the target application program is not compatible with the operating system, the target application program needs to be compiled to generate a compiling instruction of the target application program. In response to a compiling instruction of a target application program, functional interfaces meeting the service requirements of the target application program, such as scn_service_init interface, scn_pub interface, scn_init interface, scn_recv interface and the like, need to be obtained, so that the service requirements of initializing a communication channel between a wasm app and a protocol stack, creating app identifiers, establishing the communication channel between apps and the like are respectively realized. And encapsulating the function interfaces of the target application program to form a group of function interfaces, wherein one target application program corresponds to one group of function interfaces. It should be noted that the number of the target application programs may be one or more, and different target application programs may correspond to different groups of function interfaces, or may be the same group of function interfaces.
S302, fusing and compiling a target application program and a functional interface to obtain a functional interface instance meeting a preset compiling language; the preset compiling language is compatible with protocol stacks of various operating systems.
Where the protocol stack, also called protocol stack, is a specific software implementation of a computer network protocol suite, one protocol in the protocol suite is typically designed for one purpose only, with the application processing the uppermost protocol.
After the target application program and the corresponding functional interface are obtained, the target application program and the functional interface are fused, then the fused target application program and functional interface are compiled at the same time according to the protocol standard of the protocol stack, and the compiling result is read to obtain the functional interface instance. Because the compiling mode is carried out according to the protocol standard of the protocol stack, the compiling language of the compiled functional interface instance is compatible with the protocol stacks of various operating systems.
Taking the wasm technique as an example, wasm is a binary instruction format based on a stack virtual machine, the wasm technique allows application code to be written using a plurality of compiling languages and can be run in a sandbox environment. The method and the device integrate and compile the target application program and the function interface into the wasm binary, acquire the wasm instance, and acquire the function interface instance of the wasm binary compiling language by reading the wasm instance. The wasm binary compiling language can be compatible with protocol stacks of various operating systems, and the functional interface instance can be compatible with various operating systems.
S303, accessing the protocol stack through the functional interface instance to perform network communication between the target application program and the protocol stack.
Wherein the protocol stack is a specific software implementation of the computer network protocol suite. The protocol stack in the application can be a user state protocol stack or a core state protocol stack.
It should be appreciated that the functional interface instance is generated based on a pre-set compiled language that is capable of satisfying the protocol stack corresponding to each operating system. The function interface is a customized interface customized based on own requirements, which means that the function interface instance can normally communicate with the protocol stack while realizing the service requirements of the user.
In the embodiment of the application, firstly, a compiling instruction of a target application program is responded, a functional interface of the target application program is obtained, then the target application program and the functional interface are fused and compiled, a functional interface instance meeting a preset compiling language is obtained, and finally, a protocol stack is accessed through the functional interface instance so as to carry out network communication of the target application program and the protocol stack. The preset compiling language is compatible with protocol stacks of various operating systems. In the method, the functional interface of the target application program is obtained in response to the compiling instruction of the target application program, so that the obtained functional interface of the target application program can meet the communication requirement of the target application program. Further, after the function interface of the target application program is obtained, the function interface instance is obtained by fusing the target application program and the function interface and compiling, which is equivalent to the process of carrying out network communication, not only considering the diversity of compiling languages of the application program, but also considering the effectiveness of the function interface of the target application program, so that the obtained function interface instance can support each system call to access a protocol stack, thereby supporting communication among a plurality of target application programs.
The service functions implemented by different application programs are different, so that the function interfaces for acquiring the application programs are not the same in response to the compiling instructions of the application programs. Based on this, the following describes the acquisition step of the function interface of the target application program by one embodiment.
In one embodiment, the compiling instruction carries a function interface identifier of the target application program; responding to the compiling instruction of the target application program, acquiring the functional interface of the target application program, comprising:
calling the function interface of the target application program from the function interface library according to the function interface identification of the target application program; the function interface library comprises function interfaces of various application programs and interface identifiers corresponding to the function interfaces of the application programs.
The function interface library comprises function interfaces of various application programs, and each function interface is correspondingly provided with an interface identifier so as to distinguish the application programs to which the function interfaces belong. In addition, the compiling instruction of the target application program also carries the function interface identification of the target application program. The interface identifier may be in the form of roman numerals, application names, symbols, and the like, and the embodiment of the application does not limit the form of the interface identifier.
And responding to the compiling instruction of the target application program, acquiring the functional interface identification of the target application program carried by the compiling instruction, and acquiring the functional interface of the target application program in a functional interface library according to the corresponding relation between the interface identification corresponding to the functional interface and the functional interface.
In the embodiment of the application program, the function interfaces of the application programs are packaged in the function interface library, and the function interfaces of the application programs are distinguished by setting the interface identifiers, so that compiling instructions of target application programs can be responded quickly, corresponding function interfaces can be acquired accurately, personalized requirements for the application programs are met, and communication of the application programs is realized.
In the network communication process, the acquired function interface needs to be imported into the target application program, and a series of operations such as related functions are executed to generate a function interface instance capable of communicating with the protocol stack, so as to realize the communication function of the target application program. In the process of fusing and compiling the target application program and the functional interface, the target application program and the functional interface can be compiled and then fused respectively, or can be fused first and then compiled. Based on this, a functional interface example is described below by way of one embodiment.
In one embodiment, as shown in fig. 4, the fusion compiling of the target application program and the functional interface to obtain the functional interface instance meeting the preset compiling language includes:
S401, fusing and compiling the target application program and the functional interface to generate a program fusion instance meeting the preset compiling language.
And fusing the functional interface into the target application program to obtain a fused application program, compiling the fused application program according to a preset compiling target to ensure that a compiling result can meet a preset compiling language, and taking the compiled result as a program fusion example.
S402, acquiring a functional interface instance meeting a preset compiling language according to the program fusion instance.
The program fusion instance is obtained by fusion and compilation of the target application program and the functional interface, and then the program fusion instance also comprises the compiled target application program and the compiled functional interface. And acquiring the function interface instance through the corresponding relation between the target application program and the function interface in the program fusion instance. Obviously, the program fusion instance meets the preset compiling language, and then the function interface instance also meets the preset compiling language.
Alternatively, the embodiment of the application may act on the APP through a function interface layer (lib_wrapper) to obtain a function interface instance. Firstly, a protocol stack customized lib library interface is packaged to generate a scn-lib wrapper, then the scn-lib wrapper is added to an APP side, the scn-lib wrapper and the APP are compiled simultaneously to generate a binary wasm module (program fusion instance), and finally, a functional interface instance meeting a preset compiling language is obtained according to the program fusion instance.
In the embodiment of the application, the target application program and the function interface are fused, so that the function interface is always effective in the target application program, and then the function interface instance is also effective in the program fusion instance generated after fusion compiling.
The foregoing embodiment S402 illustrates the basis of the acquisition of the function interface instance, and the manner of acquiring the function interface instance is described below by way of one embodiment.
In one embodiment, as shown in fig. 5, according to a program fusion example, obtaining a functional interface example that meets a preset compiling language includes:
s501, reading the program fusion instance to obtain a link relation between the target application program and the functional interface of the target application program.
The program fusion instance is obtained based on fusion compiling of the target application program and the functional interface, and in the process of fusion compiling, the association relation between the target application program and the functional interface of the target application program is also written into the program fusion instance. Therefore, the link relation between the target application program and the functional interface of the target application program can be quickly obtained by performing read-write operation on the shared memory of the program fusion instance.
S502, acquiring a function interface instance meeting a preset compiling language according to the link relation.
In the program fusion instance, the program fusion instance is divided into a target application instance and a functional interface instance according to the link relation between the target application and the functional interface of the target application.
Alternatively, the embodiment of the application may be implemented by a packaging layer (rust_wrapper) written in Rust language. Firstly, in an application fusion example, an interface which needs to be exposed to an APP user is declared as an FFI interface, and the interface is packaged, so that a potentially unsafe C method in the FFI interface can be linked with the APP through packaging, and the memory of a wasm module corresponding to the APP can be read, so that the protocol stack lib library has no use difference between a wasm memory and a host memory, and the communication process is smoother.
In the embodiment of the application, the functional interface instance of the program fusion instance is obtained according to the link relation between the target application program and the functional interface of the target application program, so that the logic is clear, the implementation is easy, and the communication interaction between the APP and the protocol stack is facilitated.
The method for acquiring the function interface examples through the link relation has diversity, the target function interface can be acquired through the link relation, then the target function interface is compiled to acquire the function interface examples, or the function interface examples meeting the preset requirements are directly called through the link relation, and the like. Based on this, the manner of acquiring the function interface instance will be described below by way of one embodiment.
In one embodiment, as shown in fig. 6, according to the link relation, obtaining a function interface instance satisfying a preset compiling language includes:
s601, acquiring a function library corresponding to the function interface of the target application program according to the link relation.
The function library is a function set capable of executing interface functions, different function libraries correspond to different target application programs and correspond to interface identifiers of function interfaces of the target application programs, the function interfaces of the target application programs are obtained according to the link relation, and the function library corresponding to the function interfaces of the target application programs is called in the function library according to the interface identifiers of the function interfaces of the target application programs.
Taking the configuration of the APP based on the wasm technology as an example, the function library is a file written in C++ language, the protocol stack lib library is a dynamic library, an interface which needs to be exposed to the APP of a user is declared as an FFI interface, and the APP and the protocol stack lib library interface are linked together when the wasm is instantiated.
S602, generating a function interface instance meeting a preset compiling language by executing a function library.
Through executing the function library corresponding to the function interface of the target application program, the generated function interface instance meets the preset compiling language, can be interacted with the protocol stack to communicate, and can also ensure that the target application program can realize the service requirement corresponding to the function interface.
Alternatively, embodiments of the present application may be implemented by embedding a function library layer (lib-impl layer) in the rust_wrapper. The lib-impl may be a so-file written in c-language, comprising specific functions of a plurality of protocol stack lib libraries for implementing the actual functions of the protocol stack lib libraries. When the lib-impl layer is integrated in the wasm operation, concurrent access of a plurality of APP can be supported, and data of the APP can be managed.
In the embodiment of the application, the function library is obtained according to the link relation, so that the problem of interface redundancy caused by great workload of an interface of an operating system can be avoided, and further, the function interface instance is obtained by executing the function library, so that the communication requirement of a target application program can be met.
In one embodiment, a framework corresponding to a network communication method is provided, as shown in fig. 7, by constructing a sandbox environment, an APP is packaged by three layers from top to bottom, and the three layers are sequentially executed, so that mapping and sending of data are completed, and an external communication function of the APP is realized. The names and functions of the three layers are described as follows:
the first layer, app+ function interface layer (lib_wrapper layer), the protocol stack lib library uses APP handle to distinguish between connected different user APPs. In order to keep the APP interface consistent with other morphological deployment schemes, the APP perceives no handle, so that an encapsulation library scn-lib wrapper of a protocol stack lib library is added on the APP side. The Scn-lib wrapper provides a protocol stack customized lib library interface for the APP to call and compile with the APP into a Wasm binary. The embodiment of the application realizes a protocol stack lib library customizing interface which is tens of interfaces such as scn_service_init interface, scn_pub interface, scn_init interface, scn_recv interface and the like, and respectively realizes the functions of initializing a communication channel between a wasm APP and a protocol stack, creating an APP identifier, establishing a communication channel between APPs, receiving a message sent by an opposite terminal APP and the like.
The second layer, the encapsulation layer (rust_wrapper layer), the protocol stack lib library declares the interface that it wants to expose as the FFI interface and adds a Rust wrapper encapsulation over the FFI interface. The encapsulation layer has two functions, namely, on one hand, the unsafe C method is encapsulated and then provided for the Wasm operation to link with the APP, and on the other hand, the operations such as reading and writing of the Wasm shared memory are completed, and the protocol stack lib library does not sense the use difference of the Wasm shared memory and the host memory.
And the third layer, a function library layer (lib-impl layer), is used for completing the actual functions of the protocol stack lib library. The function library is integrated in the Wasm runtime as a so file written in the c language and is provided as an import function to the APP. When the lib-impl library is integrated in the Wasm operation, concurrent access of a plurality of APP needs to be supported, and data (such as shared memory, pointers and the like) of the plurality of APP needs to be managed. When the APP call protocol stack lib library is initialized, the lib-impl library allocates a unique handle to the APP and points to the relevant data structure body of the APP. When the following APP access protocol stack lib library interface performs operations such as identification release, an APP handle needs to be provided so that the lib-impl library can find an APP related data structure body.
In summary, the embodiment of the application compiles the application into the Wasm module containing a plurality of protocol stack lib library import functions through the APP through the compiler, the Wasm runtime is loaded and instantiated into a Wasm instance and runs in a thread, the protocol stack lib library is developed by using the Rust language when the Wasm is running in the current cloud deployment, the Rust language supports FFI call, the protocol stack lib can be compiled into a dynamic library, an interface needing to be exposed to the user APP is declared as an FFI interface, and the APP and the protocol stack lib library interface are linked together when the Wasm is instantiated when the Wasm is running.
According to the embodiment of the application, based on a WASI-based communication model, a bootstrapping (import) mechanism and a lib customizing interface of the wasm-run are fused, a customizing interface independent of the WASI is designed, and the function of network communication of the wasm form APP is realized.
On the basis of the network communication method provided by any of the foregoing embodiments, the communication of the target application program through the protocol stack can be realized. In one embodiment, a communication schematic of deploying an application in wasm, with multiple target applications interacting with a protocol stack is shown in fig. 8. As can be seen from fig. 8, in the same manner as the APP operates in a process, a plurality of application programs establish a communication channel through the lib_wrapper layer protocol stack lib library, the protocol stack lib library is connected to the protocol stack, n+1 application programs are shown in fig. 8, n+1 protocol stack lib library management structures are corresponding to the protocol stack lib library, and n+1 protocol stack management structures are corresponding to the protocol stack. And each application program points to a corresponding protocol stack lib library management structure in the protocol stack lib library through a handle, each protocol stack lib library management structure is correspondingly connected with the protocol stack management structure in the protocol stack, and each protocol stack lib library management structure and each protocol stack management structure synchronize data through an intermediate file. For example, the application program 1 points to the protocol stack lib library management structure 1 through the handle 1, the protocol stack lib library management structure 1 is connected with the protocol stack management structure 1 through a communication channel where the connection 1 is located, and the protocol stack lib library management structure 1 and the protocol stack management structure 1 realize data synchronization through the file 1. It will be appreciated that when an application program accesses the protocol stack lib library for initialization, the protocol stack lib library will assign a unique APP handle to the APP to establish a communication channel between the protocol stack lib library and the application program, that is, the handles of each application program are generated at the time of application program initialization, and the handles of each application program are different. Then, when the APP performs subsequent operations (messaging, etc.), the APP handle also finds its corresponding communication channel.
Further, the communication principles of the application program, the protocol stack lib library and the protocol stack are further described: the Wasm runtime comprises an application program and a protocol stack lib library, the application program Wasm module runs in a thread in the Wasm runtime, and a socket and a shared memory file of the application program Wasm module are established by the protocol stack lib library in the Wasm runtime to communicate with the protocol stack. In fig. 8, the protocol stack lib library has n+1 connections to the protocol stack, corresponding to n+1 sockets, and corresponding to n+1 shared memory files. The socket is an abstract description of endpoints for performing bidirectional communication between application processes on different hosts in a network, and one socket is one end of process communication on the network and is used for providing a mechanism for an application layer process to exchange data by using a network protocol. Each shared memory file is used for synchronizing the synchronization data between each APP and the protocol stack. Through different socket connections between the APP and the protocol stack, the protocol stack lib library and the protocol stack can manage and distinguish the shared memory of different APP.
In the following, by means of an embodiment, a communication manner between a plurality of target applications and a protocol stack is described in the context of a plurality of target applications.
In one embodiment, as shown in fig. 9, after accessing the protocol stack through the functional interface instance, the network communication method further includes:
s901, determining a communication channel of a target application program in response to a starting instruction of the target application program; the communication channel is used for connecting the target application program and the protocol stack.
Responding to a starting instruction of a target application program, wherein the starting instruction carries a handle identifier of the target application program, establishing a mapping relation among the handle identifier, a socket and a shared memory according to the handle identifier of the target application program, and establishing a communication channel according to the mapping relation for connecting the target application program and a protocol stack.
It should be noted that, a handle is included between the target application program and the functional interface instance, the handle is used for distinguishing different target application programs, a socket and a shared memory are corresponding between the functional interface instance and the protocol stack, the socket is used for indicating the communication endpoint, and the shared memory is used for storing the communication content. Thus, a communication channel exists between a target application and the corresponding protocol stack.
It should be noted that one protocol stack may correspond to a plurality of target applications, and then different communication channels are corresponding to different target applications, and each communication channel is distinguished based on the handles of the target application.
And S902, carrying out network communication between the target application program and the protocol stack through a communication channel.
The request instruction of the target application program is transmitted to the protocol stack through the communication channel, and after receiving the response information corresponding to the request instruction, the protocol stack transmits the response information of the protocol stack to the target application program through the communication channel, so that the network communication between the target application program and the protocol stack is realized.
According to the embodiment of the application, network communication is realized by establishing the communication channels of the target application program and the protocol stack, a plurality of target application programs are supported to communicate with the protocol stack concurrently, and each communication channel can accurately distinguish data of each target application program based on the handle of each target application program, so that data transmission is performed, and network communication is realized.
After the communication channel between the target application and the protocol stack is established, the data between the target application and the protocol stack can be transmitted. Based on this, the network communication of the target application and the protocol stack is described below by way of one embodiment.
In one embodiment, as shown in fig. 10, network communication of a target application program with a protocol stack is performed through a communication channel, including:
s1001, acquiring a data message of a target application program.
The data message of the target application program refers to a series of data messages related to the target application program, such as a starting instruction of the target application program, request data (scn_init request) of the target application program, data messages of the target application program, and response result information received by a protocol stack based on the request data of the target application program.
Dividing the data message of the target application program based on the generation attribute of the data message to obtain a request data message and a response data message. Obviously, the request data message is generated based on the target application program, and then the request data message is replied through the remote response application program or the control service (such as a controller), and a response data message is generated, and the response data message is stored in the shared content corresponding to the protocol stack and the target application program.
S1002, transmitting the data message between the target application program and the protocol stack through a communication channel, and carrying out network communication between the target application program and the protocol stack.
Transmitting the request data message of the target application program to a protocol stack through a communication channel, and transmitting the response data message to the target application program through the communication channel after the protocol stack receives the response data message.
The flow diagram of communication between the APP and the protocol stack is described on the basis of the network communication architecture shown in fig. 7, and as shown in fig. 11, the method includes the following steps:
1. and initializing APP. And after the APP is started, an initialization interface is called, a socket and a shared memory are initialized between a protocol stack lib library and a protocol stack in the operation process, an APP handle (for example, handle=1) is allocated for the APP, and a mapping relation is established among the handle, the socket and the shared memory.
2. A scn_init request is sent. And a protocol stack lib library in the operation finds out a corresponding socket and a shared memory through the handle, writes in an init message and notifies the protocol stack. The protocol stack is responsible for sending init requests and writing response results. And after the protocol stack lib library senses, writing the init response result into the corresponding handle. And (3) the APP polls the init result, and after the protocol stack lib library is written, the APP searches the result. Transmitting the request data message of the target application program to the shared memory through the communication channel, receiving the response data message of the target application program by the protocol stack according to the request data message in the shared memory, and calling the recv interface by the target application program through polling to read the response data message.
3. And writing the application program data message into the shared memory. The protocol stack receives the data message sent to the APP, writes the data message into a shared memory between the APP and the protocol stack, and notifies the protocol stack lib library through the socket. And the protocol stack lib library takes the data message out of the shared memory and writes the data message into a message queue corresponding to the APP handle.
4. And inquiring and reading the data message. And the APP polls and calls the recv interface, and after the protocol stack lib library writes a new data message, the APP can read the new data message.
According to the embodiment of the application, the data transmission between the target application program and the protocol stack is realized through the communication channel, which is equivalent to the situation that a plurality of target application programs are communicated with the corresponding protocol stacks in parallel in the network communication process, and the data transmission confusion is caused by the fact that the plurality of communication channels, the data transmission reliability is improved by fixing the communication channels between different target application programs and the corresponding protocol stacks.
The foregoing embodiments describe the communication channel and the data message information transmitted by the communication channel in the network communication process. Based on this, the following describes further the delivery process of the data message of the target application program by an embodiment.
In one embodiment, as shown in fig. 12, the network communication method further includes:
s1201, responding to a receiving and transmitting instruction of a target application program, and acquiring a mapping relation between the target application program and a memory address; the memory address is used for storing the data message of the target application program.
And responding to the receiving and transmitting instruction of the target application program, designating a communication channel for the data message of the target application program based on the handle of the target application program, simultaneously distributing a shared memory for the data message of the target application program, and establishing a mapping relation between the shared memory address and the handle of the target application program.
S1202, according to the mapping relation, delivery of the data message of the target application program is completed through the communication channel.
Still based on the network communication architecture shown in fig. 7, the messaging function between the APP and the protocol stack will be described with reference to the communication flow diagram shown in fig. 11, including two aspects of packet sending and message distribution:
(1) And (3) hair pack: and in response to the wasm APP initialization instruction, calling a scn_service_init interface, distributing a section of shared memory by the lib-impl, returning the section of shared memory to a lib-wrapper module of the APP, distributing a handle and the shared memory for the APP by the lib-wrapper, establishing an association relation between the handle and the shared memory, and enabling the APP not to perceive the handle and the shared memory. When the APP calls scn_send to send packets, the lib-wrapper module designates the APP handle to send packets. Thus, the lib-impl module in the operation can complete the writing and sending of the data according to the mapping relation between the handle and the shared memory
(2) Message distribution: when the lib-impl in the wasm operation receives the data message, the message needs to be sent and received, and the decision of which wasm deployed APP is used for delivering data is determined. Because the APP wasm module has established the mapping relation between the shared memory and the APP handle when the scn_service_init interface is provided, after receiving the message sent by the protocol stack, the APP wasm module finds the corresponding handle according to the shared memory of the received message and writes the corresponding handle into the message queue pointed by the handle to complete distribution. When APP calls scn_recv interface, lib-wrapper specifies handle to poll and receive packet. And the lib-impl finds the message according to the handle and writes the message into the wasm shared memory which is transmitted by the APP, so as to finish the delivery of the data message.
In the embodiment of the application, the delivery of the data message of the target application is realized through the mapping relation between the target application and the memory address, so that the condition of disordered data transmission when a plurality of applications communicate in parallel is avoided, and the reliability of data transmission is improved.
When an application program communicates through a protocol stack, it is generally hoped that an APP can keep active when running in the background, and even the APP is kept active all the time through a system bug, a manner that the APP can be kept active is called a keep-alive mechanism of the APP.
In the conventional technology, the APP keep-alive mechanism is to maintain the keep-alive of the APP and the socket by sending a heartbeat message through the socket based on the protocol stack and the APP keep-alive, however, in the application, the protocol stack lib library is integrated in the wasm running process, and cannot sense whether the APP is still running, so the protocol stack cannot perform heartbeat detection, and based on this, the following describes the manner of performing the APP keep-alive mechanism in the network communication method by an embodiment.
In one embodiment, as shown in fig. 13, after accessing the protocol stack through the functional interface instance, the network communication method further includes:
s1301, in response to the target application running instruction, starts a timer.
And fusing the timer function interface into the target application program, responding to the running instruction of the target application program, automatically executing the timer function interface, and starting a timer corresponding to the timer function interface. The timer refers to a counting method to detect whether the APP runs or not when the normal execution of the APP thread is ended or when the run-time panic (panic) occurs.
S1302, detecting the running state of the target application program according to the triggering instruction of the timer.
The reference counting method acts on a timer, and the running state of the target application program is detected by triggering the timer. Taking a wasm deployment target program application as an example, a method for converting a Rust method into a callback function executable by a c language is supported by a Rust FFI in a Rust language, a detection method provided by the wasm operation is used as a callback to register to a protocol stack lib library, and the protocol stack lib library detects through the registered callback function when a timer is triggered.
And S1303, if the target application program is not in the running state, closing the timer.
And if the target application program is in the running state, continuously detecting the running state of the APP according to the trigger instruction of the timer. If the target application program is not in the running state, the running state of the target application program is not needed to be detected through the timer, namely the timer is closed.
As shown in fig. 14, the keep-alive mechanism flow of the APP includes the following steps:
s1401, the target application runs. And triggering the target application program to run instructions.
S1402, starting a timer. And responding to the running instruction of the target application program, and starting a timer corresponding to the timer function interface.
S1403, timer triggers. And detecting the running state of the target application program through triggering a timer.
S1404, determining whether the APP is in an operating state.
S1405, sending keep-alive messages. If the target application program is in the running state, a keep-alive message is generated, and a message is sent to the timer, and the timer is triggered again.
S1406, closing the timer. If the target application is not in the running state, stopping the timer.
According to the embodiment of the application, the running state of the target application program, the reference technology and the callback mechanism are detected through the triggering instruction of the timer, and the keep-alive function of the protocol stack in which the APP and the user state exist in the process or container mode is completed. In addition, the timer responsible for executing the keep-alive mechanism is customized to be a functional interface supported by a protocol stack, so that the flexibility of the target application program is improved.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiments of the present application also provide a network communication device for implementing the above-mentioned network communication method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the network communication device provided below may refer to the limitation of the network communication method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 15, there is provided a network communication device 1500 comprising: acquisition module 1520, compilation module 1540, and invocation module 1560, wherein:
an obtaining module 1520, configured to obtain a functional interface of the target application program in response to a compiling instruction of the target application program;
the compiling module 1540 is used for fusing and compiling the target application program and the functional interface to obtain a functional interface instance meeting a preset compiling language; presetting a protocol stack of which the compiling language is compatible with various operating systems;
call module 1560 is configured to access the protocol stack through the functional interface instance to perform network communication between the target application and the protocol stack.
In one embodiment, the obtaining module 1520 is further configured to call the function interface of the target application program from the function interface library according to the function interface identifier of the target application program; the function interface library comprises function interfaces of various application programs and interface identifiers corresponding to the function interfaces of the application programs.
In one embodiment, the compiling module 1540 includes: program fusion unit and first acquisition unit, wherein:
the program fusion unit is used for fusing and compiling the target application program and the functional interface to generate a program fusion instance meeting the preset compiling language;
the first acquisition unit is used for acquiring the function interface instance meeting the preset compiling language according to the program fusion instance.
In one embodiment, a first acquisition unit includes: an example read subunit and a first acquire subunit, wherein:
an instance reading subunit, configured to read the program fusion instance to obtain a link relationship between the target application program and the functional interface of the target application program;
the first obtaining subunit is configured to obtain, according to the link relationship, a function interface instance that satisfies a preset compiling language.
In one embodiment, the first obtaining subunit is further configured to obtain, according to the link relationship, a function library corresponding to a function interface of the target application program; and generating a function interface instance meeting the preset compiling language by executing the function library.
In one embodiment, network communication device 1500 further comprises: a determination module and a communication module, wherein:
The determining module is used for responding to the starting instruction of the target application program and determining the communication channel of the target application program; the communication channel is used for connecting the target application program and the protocol stack;
and the communication module is used for carrying out network communication between the target application program and the protocol stack through a communication channel.
In one embodiment, the communication module is configured to obtain a message and transmit the message, where:
the message acquisition unit is used for acquiring the data message of the target application program;
and the message transmission unit is used for transmitting the data message of the target application program to the protocol stack through the communication channel.
In one embodiment, network communication device 1500 further comprises: a mapping module and a delivery module, wherein:
the mapping module is used for responding to the receiving and transmitting instruction of the target application program and acquiring the mapping relation between the target application program and the memory address; the memory address is used for storing the data message of the target application program;
and the delivery module is used for completing the delivery of the data message of the target application program through the communication channel.
In one embodiment, network communication device 1500 further comprises: opening module, detection module and sending module, wherein:
The starting module is used for responding to the running instruction of the target application program and starting a timer;
the detection module is used for detecting the running state of the target application program according to the triggering instruction of the timer;
and the closing module is used for closing the timer if the target application program is not in the running state.
The various modules in the network communication device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, including a memory and a processor, where the memory stores a computer program, and the processor implements the technical solution of the network communication method provided in any one of the foregoing embodiments when executing the computer program.
The computer device provided in the foregoing embodiments has similar implementation principles and technical effects to those of the foregoing method embodiments, and will not be described herein in detail.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the technical solution of the network communication method provided in any of the above embodiments.
The foregoing embodiment provides a computer readable storage medium, which has similar principles and technical effects to those of the foregoing method embodiment, and will not be described herein.
In one embodiment, a computer program product is provided, including a computer program, which when executed by a processor implements the technical solution of the network communication method provided in any of the foregoing embodiments.
The foregoing embodiment provides a computer program product, which has similar principles and technical effects to those of the foregoing method embodiment, and will not be described herein.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (12)

1. A method of network communication, the method comprising:
responding to a compiling instruction of a target application program, and acquiring a functional interface of the target application program;
fusing and compiling the target application program and the functional interface to obtain a functional interface instance meeting a preset compiling language; the preset compiling language is compatible with protocol stacks of various operating systems;
Accessing a protocol stack through the functional interface instance to perform network communication between the target application program and the protocol stack.
2. The method according to claim 1, wherein the compiling instruction carries a functional interface identifier of the target application program; the responding to the compiling instruction of the target application program obtains the functional interface of the target application program, and the method comprises the following steps:
calling the function interface of the target application program from a function interface library according to the function interface identification of the target application program; the function interface library comprises function interfaces of various application programs and interface identifiers corresponding to the function interfaces of the application programs.
3. The method according to claim 1 or 2, wherein the fusing and compiling the target application program and the functional interface to obtain a functional interface instance satisfying a preset compiling language includes:
fusing and compiling the target application program and the functional interface to generate a program fusion instance meeting the preset compiling language;
and acquiring a function interface instance meeting the preset compiling language according to the program fusion instance.
4. A method according to claim 3, wherein said obtaining, from the program fusion instance, a function interface instance satisfying the preset compiling language, comprises:
Reading the program fusion instance to obtain a link relation between the target application program and a functional interface of the target application program;
and acquiring a function interface instance meeting the preset compiling language according to the link relation.
5. The method according to claim 4, wherein the obtaining, according to the link relation, a function interface instance satisfying the preset compiling language includes:
acquiring a function library corresponding to the function interface of the target application program according to the link relation;
and generating a function interface instance meeting the preset compiling language by executing the function library.
6. The method according to claim 1 or 2, characterized in that after said accessing a protocol stack via said functional interface instance, the method further comprises:
determining a communication channel of the target application program in response to a starting instruction of the target application program; the communication channel is used for connecting the target application program and the protocol stack;
and carrying out network communication between the target application program and the protocol stack through the communication channel.
7. The method of claim 6, wherein said communicating the target application with the network of the protocol stack via the communication channel comprises:
Acquiring a data message of the target application program;
and transmitting the data message of the target application program to the protocol stack through the communication channel.
8. The method of claim 6, wherein the method further comprises:
responding to a receiving and transmitting instruction of the target application program, and acquiring a mapping relation between the target application program and a memory address; the memory address is used for storing the data message of the target application program;
and according to the mapping relation, completing delivery of the data message of the target application program through the communication channel.
9. The method according to claim 1 or 2, characterized in that after said accessing a protocol stack via said functional interface instance, the method further comprises:
starting a timer in response to a target application program running instruction;
detecting the running state of the target application program according to the triggering instruction of the timer;
and if the target application program is not in the running state, closing the timer.
10. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 9 when the computer program is executed.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 9.
12. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 9.
CN202310202166.0A 2023-03-06 2023-03-06 Network communication method, device, medium, and program product Pending CN116346963A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310202166.0A CN116346963A (en) 2023-03-06 2023-03-06 Network communication method, device, medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310202166.0A CN116346963A (en) 2023-03-06 2023-03-06 Network communication method, device, medium, and program product

Publications (1)

Publication Number Publication Date
CN116346963A true CN116346963A (en) 2023-06-27

Family

ID=86892240

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310202166.0A Pending CN116346963A (en) 2023-03-06 2023-03-06 Network communication method, device, medium, and program product

Country Status (1)

Country Link
CN (1) CN116346963A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806852A (en) * 2024-03-01 2024-04-02 傲拓科技股份有限公司 Interface calling method, device, storage medium and processor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806852A (en) * 2024-03-01 2024-04-02 傲拓科技股份有限公司 Interface calling method, device, storage medium and processor
CN117806852B (en) * 2024-03-01 2024-05-14 傲拓科技股份有限公司 Interface calling method, device, storage medium and processor

Similar Documents

Publication Publication Date Title
KR102234427B1 (en) Code execution on demand in localized device coordinators
US10776091B1 (en) Logging endpoint in an on-demand code execution system
US11836516B2 (en) Reducing execution times in an on-demand network code execution system using saved machine states
KR102209276B1 (en) Messaging protocol communication management
RU2429526C2 (en) Statistically verified isolated processes permitting inter-process exchange
US6111894A (en) Hardware interface between a switch adapter and a communications subsystem in a data processing system
US8010973B2 (en) Class loader for managing a network
CN109032806A (en) The service scheduling method and device of container
CN114586011B (en) Inserting an owner-specified data processing pipeline into an input/output path of an object storage service
CN112202615B (en) Multi-CNI cooperative work system and method
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
US9069592B2 (en) Generic transport layer mechanism for firmware communication
CN113672576A (en) File sharing method and terminal equipment
CN112698921A (en) Logic code operation method and device, computer equipment and storage medium
CN112230857B (en) Hybrid cloud system, hybrid cloud disk application method and data storage method
CN114281263B (en) Storage resource processing method, system and equipment of container cluster management system
CN116346963A (en) Network communication method, device, medium, and program product
CN113810230A (en) Method, device and system for carrying out network configuration on containers in container cluster
US11271895B1 (en) Implementing advanced networking capabilities using helm charts
CN108804100B (en) Method and device for creating interface element, storage medium and mobile terminal
CN115086166B (en) Computing system, container network configuration method, and storage medium
CN108829529A (en) Virutal machine memory sharing method, device, computer equipment and storage medium
CN116028163A (en) Method, device and storage medium for scheduling dynamic link library of container group
EP3458956B1 (en) Peer-to-peer distributed computing system for heterogeneous device types
CN111324395B (en) Calling method, device and computer readable storage 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