CN113448655B - C standard dynamic library calling method and device - Google Patents

C standard dynamic library calling method and device Download PDF

Info

Publication number
CN113448655B
CN113448655B CN202110778724.9A CN202110778724A CN113448655B CN 113448655 B CN113448655 B CN 113448655B CN 202110778724 A CN202110778724 A CN 202110778724A CN 113448655 B CN113448655 B CN 113448655B
Authority
CN
China
Prior art keywords
standard dynamic
request message
dynamic library
library
calling
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.)
Active
Application number
CN202110778724.9A
Other languages
Chinese (zh)
Other versions
CN113448655A (en
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.)
Agree Technology Co ltd
Original Assignee
Agree Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agree Technology Co ltd filed Critical Agree Technology Co ltd
Priority to CN202110778724.9A priority Critical patent/CN113448655B/en
Publication of CN113448655A publication Critical patent/CN113448655A/en
Application granted granted Critical
Publication of CN113448655B publication Critical patent/CN113448655B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (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 invention provides a calling method and a device of a C standard dynamic library, wherein the calling method comprises the following steps: receiving a request message, wherein the request message comprises a socket request message or an http request message; acquiring a function address in a C standard dynamic library according to the function name in the request message, and organizing request data in the request message into a C standard dynamic library parameter structure; and calling the C standard dynamic library function according to the function address and the C standard dynamic library parameter structure. The invention can provide any C standard dynamic library for any language call.

Description

C standard dynamic library calling method and device
Technical Field
The invention relates to the technical field of software development, in particular to a method and a device for calling a C standard dynamic library.
Background
The C standard refers to interfaces produced by C language code export or defined by the extra "C" __ declspec (dllexport) in C + + code. This declaration is not positive, but for example, the way in which such dynamic library derivation functions are actually declared is many, and the main emphasis is on a series of labels without the C + + standard. Since c + + needs to support reloading, much information is needed to help match the interface.
When the C standard interface facing the network message is designed, a dynamic link library is used, and the method is not suitable for all functional modules. Modern software develops a plurality of functional modules which can be provided in a plurality of forms, such as jar packages of java applications, a plurality of services carried by nodes in electronics, and the like, and the stripping is not needed, so that the condition of many-to-many does not exist. The dynamic link library is more suitable for some comparative bottom layers which are realized by bottom layer languages such as C/C + + and the like, such as device driving, multimedia processing, or secondary packaging of some older functional modules and the like.
In the aspect of calling the dynamic link library in cross-language, traditions such as jni, jna, ocx, activeX, com component, npapi, ppapi and the like are common ways of loading c/c + + in cross-language. The jni, jna and the like are loaded in the same process as the calling module, share the memory, and need to call the language to create unsafe memory in the environment of the calling language and deliver the memory to the dynamic link library for use. The development process is complex, the problem is difficult to be solved after the problem is solved, the requirement on developers is high, the developers need to deeply understand the memory in the dynamic link library on the basis of using the language, and the implementation difficulty is high.
Ocx or ActiveX requires the developer to use a series of technical standards under the corresponding frame to deal with the memory problem, but the memory problem is easy to cause in the target process. Meanwhile, the development is very complex, and the method depends on the Windows system environment and is sensitive to the difference of the Windows system.
COM component means also include OCX or ActiveX. The COM component can be used as a service for providing windows call for dynamic link libraries developed by facing different languages, and also provides a scheme of the COM component outside the process and the like. In order to enable different languages to provide services, the COM component has a very complex development process, a very complex calling process and a very high difficulty in application development. The whole system depends on the windows environment and is sensitive to differences of the windows environment, and although the standard is available in the linux environment, the standard lacks uniform functional support and is not widely used. The ActiveX can also be used for the web, but the memory processing process is complex, the development cost is high, and the mode of an out-of-process COM component is difficult to use, so the memory problem is very easy to cause.
Npapi and ppapi are modules provided by some browsers for front-end calling local resources, but the functions are severely limited, and the dynamic link library needs to run in a sandbox, and basically only can use pure logic functions.
In rpc communication, the current rpc framework is server-oriented, which solves the problem of service development and maintenance, and makes it easier for applications to use the services on the server, the service form is mainly based on the service module developed by the corresponding rpc framework, which has strong requirements for language and operating environment, and the framework is firstly followed by the service module.
Therefore, how to provide a C-standard dynamic library calling method to provide an arbitrary C-standard dynamic library (i.e., dynamic link library) to an arbitrary language call in an arbitrary operating system environment becomes a technical problem to be solved urgently.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for calling a C-standard dynamic library, so as to provide an arbitrary C-standard dynamic library for arbitrary language calling in an arbitrary operating system environment.
In one aspect, a method for calling a C-standard dynamic library, the method comprising:
receiving a request message, wherein the request message comprises a socket request message or an http request message;
acquiring a function address in a C standard dynamic library according to the function name in the request message, and organizing request data in the request message into a C standard dynamic library parameter structure;
and calling the C standard dynamic library function according to the function address and the C standard dynamic library parameter structure.
Further, after the calling the C standard dynamic library function according to the function address and the C standard dynamic library parameter structure, the method includes:
judging whether the request message comprises a control mark indicating that a C standard dynamic library is to be released;
and releasing the C standard dynamic library when the request message comprises a control mark indicating that the C standard dynamic library is to be released.
Further, before obtaining the function address in the C-standard dynamic library according to the function name in the request message, the method further includes:
analyzing the request message;
and determining the proxy service and the C standard dynamic library corresponding to the service identification information according to the service identification information in the request message obtained by analysis.
Further, after the function of the C-standard dynamic library is called according to the function address and the parameter structure of the C-standard dynamic library, the method further includes:
converting the parameter type in the request message, creating an incoming parameter and an outgoing parameter memory, organizing a structural body, and adapting the time for creating and releasing the parameter when the function is called.
Further, the calling the C-standard dynamic library function according to the function address and the C-standard dynamic library parameter structure includes:
and calling a plurality of C standard dynamic libraries according to the function address and the C standard dynamic library parameter structure, wherein each C standard dynamic library is in a separate process.
In another aspect, the present invention provides a calling device for a C-standard dynamic library, including:
the communication module is used for receiving a request message, wherein the request message comprises a socket request message or an http request message;
the library loading module is used for acquiring a function address in the C standard dynamic library according to the function name in the request message and organizing the request data in the request message into a C standard dynamic library parameter structure; and calling the C standard dynamic library function according to the function address and the C standard dynamic library parameter structure.
Further, the library loading module is further configured to: judging whether the request message comprises a control mark indicating that a C standard dynamic library is to be released; and when the request message comprises a control mark indicating that the C standard dynamic library is to be released, releasing the C standard dynamic library after calling the C standard dynamic library function.
Further, the calling device further comprises: the configuration analysis module is respectively connected with the communication module and the library loading module and is used for analyzing the request message; and determining the proxy service and the C standard dynamic library corresponding to the service identification information according to the service identification information in the request message obtained by analysis.
Further, the calling device further comprises: and the organization memory module is connected with the library loading module and is used for converting the parameter types in the request message, creating a memory for transmitting the parameters and transmitting the parameters, organizing a structural body and adapting the time for creating and releasing the parameters when the function is called.
Further, the calling device further comprises: and the scheduling module is used for correspondingly connecting the library loading module and the organization memory module one by one, and the number of the library loading module and the organization memory module is the same as that of the C standard dynamic libraries.
The calling method and the calling device of the C standard dynamic library acquire the function address in the C standard dynamic library according to the function name in the request message, and organize the request data in the request message into a C standard dynamic library parameter structure; the method comprises the steps of calling a C standard dynamic library function according to a function address and a C standard dynamic library parameter structure, using a general dynamic link library as a service, issuing the service to an application for use, wherein the general dynamic link library is a dynamic link library, packaging the dynamic link library into the service, arranging an interface into a document, and delivering the document to the application. The invention optimizes the existing dynamic library use scheme rather than expanding the coverage of the dynamic library function.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a C-standard dynamic library invocation method according to an exemplary first embodiment of the present invention.
Fig. 2 is a flowchart of a C-standard dynamic library invocation method according to an exemplary second embodiment of the present invention.
Fig. 3 is a block diagram showing a configuration of a calling apparatus of a C-standard dynamic library according to an exemplary third embodiment of the present invention.
Fig. 4 is a block diagram illustrating a calling apparatus of a C-standard dynamic library according to an exemplary fourth embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
It should be noted that, in the case of no conflict, the features in the following embodiments and examples may be combined with each other; moreover, based on the embodiments in the present disclosure, all other embodiments obtained by a person of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
Fig. 1 is a flowchart of a C-standard dynamic library calling method according to an exemplary first embodiment of the present invention, and as shown in fig. 1, a calling method according to the present invention includes:
step 101: and receiving a request message, wherein the request message comprises a socket request message or an http request message.
Step 102: and acquiring a function address in the C standard dynamic library according to the function name in the request message, and organizing the request data in the request message into a parameter structure of the C standard dynamic library.
Step 103: and calling the C standard dynamic library function according to the function address and the C standard dynamic library parameter structure.
In this embodiment, a function address in a C-standard dynamic library is obtained according to a function name in the request message, and request data in the request message is organized into a parameter structure of the C-standard dynamic library; the function of the C standard dynamic library is called according to the function address and the parameter structure of the C standard dynamic library, a general dynamic link library is used as a service and is issued to an application for use, the dynamic link library is firstly packaged into the service, then an interface is arranged into a document and is handed to the application, the interface in the calling document is equal to the original service function when the application calls, the arbitrary dynamic link library is provided for calling in any language, meanwhile, the method is not dependent on Windows, the universality is better, and the development is easier.
Fig. 2 is a flowchart of a C-standard dynamic library invocation method according to an exemplary second embodiment of the present invention. Fig. 2 is a preferred embodiment of the process shown in fig. 1. As shown in fig. 2, the calling method includes:
1) the application App can support ssl through socket or http communication, and sends a message, such as json or xml, to the proxy service program. The App requests a socket or http request from the proxy service, which may include a module name or code, a function name, a parameter field and a value, and may further include a control flag indicating whether to release the dynamic library after the call is completed.
2) The agent service program (i.e. the agent program in fig. 2) locally queries according to the message information to find the dynamic link library module to be called, obtains the function address in the dynamic link library through the function name recorded in the message, organizes the request data into a dynamic link library parameter structure, and calls the dynamic link library function.
Specifically, the process of calling the dynamic link library by the proxy service includes loading the dynamic library into a memory, acquiring a function address according to a function name, organizing a parameter memory, calling a dynamic link library interface, releasing the dynamic link library, or judging whether to release according to a control mark. The interior of the dynamic library may have a saved state, so the timing of releasing the dynamic library may affect the process of the business process, and should be directly controlled by the application logic.
2) The call windows uses loadlibrary, GetProcAddress, freelibrary calls, and linux uses dlopen, dlsym, dlclose calls, commonly referred to as dynamic loading.
In this embodiment, a function address in a C-standard dynamic library is obtained according to a function name in the request message, and request data in the request message is organized into a parameter structure of the C-standard dynamic library; the function of the C standard dynamic library is called according to the function address and the parameter structure of the C standard dynamic library, a general dynamic link library is used as a service and is issued to an application for use, the dynamic link library is firstly packaged into the service, then an interface is arranged into a document and is handed to the application, the interface in the calling document is equal to the original service function when the application calls, the arbitrary dynamic link library is provided for calling in any language, meanwhile, the method is not dependent on Windows, the universality is better, and the development is easier. The local modules are directly accessed into a lightweight service structure to be called by modern application programs, by means of the fact that some functions, such as module drivers of the client and the like, cannot be put into the server to run, and the client computer environment cannot bear a heavy framework of the server.
Fig. 3 is a block diagram showing a configuration of a calling apparatus of a C-standard dynamic library according to an exemplary third embodiment of the present invention. The embodiments shown in fig. 1 and fig. 2 can be applied to this embodiment, and specifically, as shown in fig. 3, the calling device includes:
the communication module 301 is configured to receive a request message, where the request message includes a socket request message or an http request message; specifically, the communication module 301 receives the request message and parses the message field. The purpose of using the communication module 301 is to isolate the memory at the process level. Meanwhile, the communication module brings the advantage of resource servitization, so that the use process of local resources and the use process of service resources of the server are unified.
The library loading module 303 is configured to obtain a function address in the C-standard dynamic library according to the function name in the request message, and organize request data in the request message into a C-standard dynamic library parameter structure; and calling the C standard dynamic library function according to the function address and the C standard dynamic library parameter structure. The library loading module 303 loads the dynamic link library, which is essentially a package of the dynamic link library, the internal interface of the reflective dynamic link library. The impact of the functional logic on the encapsulation process can be excluded.
Preferably, the library loading module 303 is further configured to: judging whether the request message comprises a control mark indicating that a C standard dynamic library is to be released; and when the request message comprises a control mark indicating that the C standard dynamic library is to be released, releasing the C standard dynamic library after calling the C standard dynamic library function.
Preferably, the invoking device further comprises: a configuration analysis module 302, where the configuration analysis module 302 is connected to the communication module and the library loading module, respectively, and is configured to analyze the request packet; and determining the proxy service and the C standard dynamic library corresponding to the service identification information according to the service identification information in the request message obtained by analysis.
Because the service does not care about the actual dynamic link library file path sometimes, but replaces it by the service name, the configuration parsing module 302 obtains the actual service path pointed by the service name through the configuration file, and meanwhile, since the organization memory module 304 may be independent and needs to be modified and compiled for different dynamic link libraries, it also contains the relevant information of the organization memory module 304.
Preferably, the invoking device further comprises: an organization memory module 304, where the organization memory module 304 is connected to the library loading module 303, and is configured to convert the parameter type in the request message, create a memory for incoming parameters and outgoing parameters, organize a structure, and adapt the time for creating and releasing parameters when a function is called.
The organization memory module 304 is to process type conversion of various parameters, memory creation for parameter generation, structure organization, adaptation for calling convention, packaging for content generation and the like. There may be multiple memory adapter modules, and there may be one common dynamic link library. In the organization memory module 304, for example, the type conversion part of the parameter, the common parameter structure may be of an original type or a uniform character string, and there are many schemes. The common layer parameters may be obtained through a string array, such as list < string >, char, or may be obtained through a map string, such as jsonmap string, map < string, string >, or may have other manners. When a character string type is needed, the character string type can be directly transmitted, when a numerical value type such as int \ short is needed, the numerical value type is converted through an itoa mode and the like, when binary data such as pictures and the like are needed, the character string can be a character string obtained by base64 coding or memory hexadecimal conversion, the character string can be transmitted after decoding, namely, the content in a non-ascii range is represented through ascii symbols, the transmission is convenient, and the method is not limited to base64 and hex. The common layer parameters may also be map < string, object >, etc., as long as there are corresponding various types of transformation specifications. The nature of the structure type is also a unified organization of a series of values and pointers, which can be transmitted as well without any effect.
The code is very simple, the flow is unified, the access reference memory is mainly organized, the return value structure is organized, some very simple descriptions and specifications can be made, and the key point is that functional details are not needed to be concerned in writing, all memory structures with the highest application quality can be provided, so that the key advantage brought by the design of the whole scheme is realized, and great convenience is brought to later expansion.
The calling convention can be understood that when a function is called, a parameter transmitted to the function is placed in a memory created by a system, and sometimes the function returns, but the parameter is also used by a thread started in the function and cannot be released, so that the gc process of various languages is influenced. So the old solution cdecl is that the caller knows what the function used by himself, so the caller wants to know when to create and release, but after cross-language, the mechanism of gc causes the caller to often not know when to release, so the initiative is given to the inside of the function through stdcall.
Therefore, when the dynamic link library is used in many languages, the gc process is an important factor causing memory leakage or null pointer crash. The memory problem can be solved only by process isolation and not by the memory and the application of the dynamic link library in one process.
Fig. 4 is a block diagram illustrating a structure of a C-standard dynamic library calling apparatus according to an exemplary fourth embodiment of the present invention. Fig. 4 is a preferred embodiment of the device shown in fig. 3. The difference between the embodiment shown in fig. 3 and fig. 4 is that the calling device further comprises: and the dispatching module is used for correspondingly connecting the library loading module and the organization memory module one by one, and the quantity of the library loading module and the organization memory module is the same as that of the C standard dynamic library.
In this embodiment, when one proxy service calls a plurality of service dynamic link libraries, the library loading module recommends an independent process, each dynamic link library is in a separate process, so that the influence between processes is avoided, and the conflict of dependent modules can be isolated. If the method is a multi-process mode with one process for each module, the starting, closing and interaction processes among the management processes are scheduled, a plurality of schemes are provided, and a general calling scheme or an interprocess communication framework can be directly used. The communication uses network communication, is convenient for various applications and uses, reduces the limitation, can utilize the related security technology of the network communication to ensure the security, and can isolate the memory due to different processes to avoid abnormity.
The caller does not need to load resources into the memory of the caller, but realizes calling by communicating with the proxy service, thus preventing damage to the application itself, and emphasizing two processes of the application and the proxy service.
The service only needs to configure the module name and the path mapping, and does not need to separately specify the service name, and the service name is the function name for dynamically calling the dynamic link library, so that compared with the common rpc, the method has the advantages that a module derived by the service does not need to be developed, a calling party does not need to make additional modification, all calling logics are unchanged, and the method is suitable for migrating old cross-language calling, such as the migration of jni and jna.
The memory module is organized without concerning the interface function, only concerning the format of the interface declaration, and only developing according to the specific rule, the code quality can be ensured, the service logic is completely isolated from the interface technology, and the encapsulation personnel only encapsulates.
The technical threshold of the packaging process is low, and the interface, the doing and the waiting need not be concerned, and only the calling convention, a plurality of parameters, the parameter type, the memory space of the output parameter and the like need to be concerned. On the contrary, application developers do not care about memories, only about interface functions, when waiting, and what parameter values are.
The positions of the organized memory modules are flexible, a calling party encapsulates the organized memory modules according to different drivers to obtain different organized memory modules, but if a uniform interface is released, a driver provider can directly provide versions of the universal interface, namely only one upper-layer organized memory module is provided, the corresponding organized memory modules of each dynamic link library are located in the dynamic link library, the development process is simpler, and the requirements of developers of the dynamic link libraries are high. The memory organization process can be independently stripped, and the memory can be automatically packaged after being stripped.
The main functions of the invention can be developed by C language, the memory is controllable, the efficiency is high and the compatibility is good. The method can ensure the correct size and structure of the memory of the dynamic library parameters and the accurate time of creating and releasing the memory. The efficiency of program operation is high, and the difference between the performance and the direct loading is small. The whole scheme is completely cross-platform, and can be used for common Windows and linux, an Android system, a part of single-chip microcomputers and the like.
The service of the invention also utilizes GetProcAddress or dlsym which dynamically loads the dynamic link library, the two interfaces can be analogized to the interfaces in the reflective dynamic link library essentially, the interfaces and functions of the general service are specially designed and packaged, the process is very complicated for application developers, and the interfaces and the functions are directly exposed to the application through the interfaces of the reflective dynamic link library, so that the application developers can pay attention to the interface flow and do not pay attention to the interface memory and language.
Compared with the scheme of creating the memory loading dynamic link library in the process of a plurality of languages, the method and the device ensure that the dynamic link library can obtain a correct memory structure by isolating from the application process, ensure that the memory of a calling party is not damaged, avoid the gc process, ensure the memory safety of the calling party, and avoid the problems of resource conflict or abnormal blocking deadlock and the like.
The logic part of the calling process is not greatly different from the original scheme, the old scheme can be reused to the greatest extent, and the method is suitable for reducing the workload during stock engineering migration.
The caller can realize remote calling by linking and calling through the network, which is equivalent to giving jni a function similar to rpc. In theory, there may be a corresponding java implementation, such as "remote reflection call jni", but their encapsulation process is more complicated, requires java developers to understand c's memory deeply, is not practical and difficult to popularize, and its compatibility also depends on jvm.
The remote call can also be used for part of the single chip microcomputer, although part of the single chip microcomputer possibly has no operating system and is sequentially executed, at this time, the code realized by pure C can deploy the service to the target machine, the service modules are packaged together in a static mode, and theoretically, the service modules can also be provided for general application call through a network module of the single chip microcomputer. The single chip microcomputer is developed mainly by C language at present, and related technologies are deeply understood, so that the difficulty of urgent cross-language calling is avoided, the design and the scheme of the single chip microcomputer are relatively few, specific implementation is not achieved, and the single chip microcomputer is theoretically feasible.
The independent process of each module can ensure that the dynamic library is correctly released, thereby avoiding memory leakage and influencing application, and ensuring correct cleaning of the memory by closing the process when the process is used up. A proxy service calls a plurality of service dynamic link libraries, the library loading module is in a separate process, and each dynamic link library is in a separate process.
The mode of independent process of each dynamic link library can avoid the conflict of dependence, like the dependence dynamic link libraries with different versions, can avoid the conflict of global variables, global locks and the like in the memory. When the abnormity occurs, the services are not influenced mutually, and the application of calling the services is not influenced.
It should be noted that there are many communication modes, which are not necessarily socket or http, and according to actual needs, some local inter-process communication modes such as system messages, pipelines, and the like may also be used. The communication messages may have a variety of json, xml, or custom data structures. The message may contain information that may include many additional control messages. When each module has one process, the scheduling modules, if any, can be called in many ways, mainly to ensure the completeness and isolation of the call.
If the interfaces of the dynamic link library are uniform, the memory module can be organized without being modified every time.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are also within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A calling method of a C standard dynamic library is characterized in that the calling method comprises the following steps:
receiving a request message, wherein the request message comprises a socket request message or an http request message;
acquiring a function address in a C standard dynamic library according to the function name in the request message, and organizing request data in the request message into a C standard dynamic library parameter structure;
calling a C standard dynamic library function according to the function address and the C standard dynamic library parameter structure;
after the C standard dynamic library function is called according to the function address and the C standard dynamic library parameter structure, the method comprises the following steps:
judging whether the request message comprises a control mark indicating that a C standard dynamic library is to be released;
when the request message comprises a control mark indicating that the C standard dynamic library is to be released, releasing the C standard dynamic library;
before the function address in the C-standard dynamic library is obtained according to the function name in the request message, the method further includes:
analyzing the request message;
and determining the proxy service and the C standard dynamic library corresponding to the service identification information according to the service identification information in the request message obtained by analysis.
2. The calling method of claim 1, wherein after calling the C-standard dynamic library function according to the function address and the C-standard dynamic library parameter structure, further comprising:
converting the parameter type in the request message, creating an incoming parameter and an outgoing parameter memory, organizing a structural body, and adapting the time for creating and releasing the parameter when the function is called.
3. The calling method according to claim 2, wherein the calling a C-standard dynamic library function according to the function address and a C-standard dynamic library parameter structure comprises:
and calling a plurality of C standard dynamic libraries according to the function address and the C standard dynamic library parameter structure, wherein each C standard dynamic library is in a separate process.
4. A calling device for a C-standard dynamic library, the calling device comprising:
the communication module is used for receiving a request message, wherein the request message comprises a socket request message or an http request message;
the library loading module is used for acquiring a function address in the C standard dynamic library according to the function name in the request message and organizing the request data in the request message into a C standard dynamic library parameter structure; and calling the C standard dynamic library function according to the function address and the C standard dynamic library parameter structure.
5. The calling apparatus of claim 4, wherein the library loading module is further configured to: judging whether the request message comprises a control mark indicating that a C standard dynamic library is to be released; and when the request message comprises a control mark indicating that the C standard dynamic library is to be released, releasing the C standard dynamic library after calling the C standard dynamic library function.
6. The calling device according to claim 5, further comprising: the configuration analysis module is respectively connected with the communication module and the library loading module and is used for analyzing the request message; and determining the proxy service and the C standard dynamic library corresponding to the service identification information according to the service identification information in the request message obtained by analysis.
7. The calling device according to claim 6, further comprising: and the organization memory module is connected with the library loading module and is used for converting the parameter types in the request message, creating a memory for transmitting the parameters and transmitting the parameters, organizing a structural body and adapting the time for creating and releasing the parameters when the function is called.
8. The calling device according to claim 7, further comprising: and the dispatching module is used for correspondingly connecting the library loading module and the organization memory module one by one, and the quantity of the library loading module and the organization memory module is the same as that of the C standard dynamic library.
CN202110778724.9A 2021-07-09 2021-07-09 C standard dynamic library calling method and device Active CN113448655B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110778724.9A CN113448655B (en) 2021-07-09 2021-07-09 C standard dynamic library calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110778724.9A CN113448655B (en) 2021-07-09 2021-07-09 C standard dynamic library calling method and device

Publications (2)

Publication Number Publication Date
CN113448655A CN113448655A (en) 2021-09-28
CN113448655B true CN113448655B (en) 2022-06-17

Family

ID=77815660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110778724.9A Active CN113448655B (en) 2021-07-09 2021-07-09 C standard dynamic library calling method and device

Country Status (1)

Country Link
CN (1) CN113448655B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113867719A (en) * 2021-09-29 2021-12-31 上海同星智能科技有限公司 Third-party library function disassembling and calling method and system for software platform
CN114416219B (en) * 2021-12-31 2023-05-23 北京五八信息技术有限公司 System function calling method, device, electronic equipment and readable medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020024424A1 (en) * 2018-08-03 2020-02-06 平安科技(深圳)有限公司 Dynamic library information acquisition method and apparatus for application program
CN111274155A (en) * 2020-02-25 2020-06-12 腾讯科技(深圳)有限公司 Memory operation recording method, device, equipment and storage medium of dynamic library
CN112667287A (en) * 2020-12-28 2021-04-16 深圳前海微众银行股份有限公司 Method, device and equipment for creating rule file and computer readable storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20080039080A (en) * 2006-10-31 2008-05-07 에스케이 텔레콤주식회사 Terminal having an interfacing function of the heterogeneity language compile library, api calling method and compile function generating method
CN100464305C (en) * 2007-03-13 2009-02-25 华为技术有限公司 Method and apparatus for calling dynamic library and dynamic library server
CN102810070A (en) * 2012-07-16 2012-12-05 福建富士通信息软件有限公司 High-performance professional ability packaging process engine and process control method thereof
CN103051728B (en) * 2013-01-10 2015-07-08 太仓市同维电子有限公司 Remote-procedure calling method
CN108038796B (en) * 2017-12-11 2021-02-26 厦门亿力吉奥信息科技有限公司 C + + based GIS service operation method and storage medium
CN109445968A (en) * 2018-11-09 2019-03-08 金瓜子科技发展(北京)有限公司 Service request processing method, device, equipment and the storage medium of different agreement
CN113064658B (en) * 2019-12-31 2023-09-08 北京华为数字技术有限公司 Copying method, copying device, copying equipment and computer readable storage medium for configuration data
CN112379940B (en) * 2020-11-11 2023-04-25 歌尔科技有限公司 Executable file processing method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020024424A1 (en) * 2018-08-03 2020-02-06 平安科技(深圳)有限公司 Dynamic library information acquisition method and apparatus for application program
CN111274155A (en) * 2020-02-25 2020-06-12 腾讯科技(深圳)有限公司 Memory operation recording method, device, equipment and storage medium of dynamic library
CN112667287A (en) * 2020-12-28 2021-04-16 深圳前海微众银行股份有限公司 Method, device and equipment for creating rule file and computer readable storage medium

Also Published As

Publication number Publication date
CN113448655A (en) 2021-09-28

Similar Documents

Publication Publication Date Title
US6622175B1 (en) System and method for communications in a distributed processing environment
US6272559B1 (en) Deferred reconstruction of objects and remote loading for event notification in a distributed system
US6757899B2 (en) Dynamic CORBA gateway for CORBA and non-CORBA clients and services
US6393497B1 (en) Downloadable smart proxies for performing processing associated with a remote procedure call in a distributed system
CN111176626B (en) Cross-programming-language code calling method and device, medium and equipment
CN113448655B (en) C standard dynamic library calling method and device
US20080215613A1 (en) Method and System For Transferring Objects Between Programming Platforms Computer Program Product Thereof
US20030009539A1 (en) Distributed object middleware connection method
CN110058864B (en) Micro-service deployment method and device
CN108881111B (en) Method and device for realizing multi-tenant system
US8701129B2 (en) Web API server program, web API publication method
CN112596931B (en) Cross-process communication method and device, electronic equipment and storage medium
CN111651169B (en) Block chain intelligent contract operation method and system based on web container
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
US7003782B2 (en) Optimized COBRA software method invocation
US10402307B2 (en) System and method for providing runtime tracing for a web-based client accessing a transactional middleware platform using an extension interface
CN111324395B (en) Calling method, device and computer readable storage medium
CN113179269A (en) Internet of things-based protocol data analysis method, system, medium, and program product
CN111338717A (en) Interface calling method, application program upgrading method, server and client
CN113064737B (en) Method for enabling components of software communication architecture to run in parallel on multi-core processor
CN113835904A (en) Remote procedure call control method, device, equipment and storage medium
CN111447279B (en) Server and interface analysis service package generation method
CN109669793B (en) Object calling method in middleware process
CN113312031A (en) Naming service interface of software communication system structure
CN112905273A (en) Service calling method and device

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