CN114443316B - Object access method and device and electronic equipment - Google Patents

Object access method and device and electronic equipment Download PDF

Info

Publication number
CN114443316B
CN114443316B CN202011218064.0A CN202011218064A CN114443316B CN 114443316 B CN114443316 B CN 114443316B CN 202011218064 A CN202011218064 A CN 202011218064A CN 114443316 B CN114443316 B CN 114443316B
Authority
CN
China
Prior art keywords
function
functions
library
access
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011218064.0A
Other languages
Chinese (zh)
Other versions
CN114443316A (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.)
China Mobile Communications Group Co Ltd
China Mobile IoT Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile IoT 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 China Mobile Communications Group Co Ltd, China Mobile IoT Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011218064.0A priority Critical patent/CN114443316B/en
Publication of CN114443316A publication Critical patent/CN114443316A/en
Application granted granted Critical
Publication of CN114443316B publication Critical patent/CN114443316B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/547Remote procedure calls [RPC]; Web services
    • 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 an object access method, an object access device and electronic equipment, wherein the method comprises the following steps: receiving an access request for a first object, responding to the access request, and determining an objective function corresponding to a request type in a first function set obtained by performing function replacement in a system function library according to the request type of the access request; and calling the target function and executing access to the first object. By the function replacement function of the link program, the function in the object storage function library can be directly called based on the object storage interface in the general operation system function library, without the escape of special software, the data transmission path is shortened, and the data transmission performance is improved.

Description

Object access method and device and electronic equipment
Technical Field
The embodiment of the invention relates to the technical field of storage, in particular to an object access method and device and electronic equipment.
Background
With the development of storage technology, application service providers increasingly use object storage technology in application backend servers to store multimedia files. The background server of the application service provider may implement object storage of the received user data by invoking an application program interface (Application Programming Interface, API) of the object storage technology.
Currently, file storage of user data is typically implemented in a common operating system function library using an API of a file storage technology, and there is no API of an encapsulation object storage technology. When the background server of the application service provider needs to call the API of the object storage technology, the API of the file storage technology needs to be converted into an API implementation of the object storage technology through the user space file system (FILESYSTEMIN USERSPACE, FUSE). The conversion process can lengthen the data transmission path, resulting in a decrease in the transmission performance of user data.
Disclosure of Invention
The embodiment of the invention aims to provide an object access method, an object access device and electronic equipment, which solve the problem that in the prior art, data transmission performance is reduced due to the fact that special software is needed to escape.
In order to achieve the above object, in a first aspect, an embodiment of the present invention provides an object access method, including:
Receiving an access request to a first object;
responding to the access request, and determining an objective function corresponding to the request type in a first function set in a system function library according to the request type of the access request;
Invoking the objective function and executing access to the first object;
The first function set is a function set obtained by performing function replacement through a linking program of an operating system, and functions in the first function set are called based on a calling object storage interface.
In a second aspect, an embodiment of the present invention provides an object access apparatus, including:
The receiving module is used for receiving an access request to the first object;
The determining module is used for responding to the access request and determining an objective function corresponding to the request type in a first function set in a system function library according to the request type of the access request;
the execution module is used for calling the target function and executing access to the first object;
The first function set is a function set obtained by performing function replacement through a linking program of an operating system, and functions in the first function set are called based on a calling object storage interface.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the steps in the object access method provided in the first aspect of the embodiment of the present invention.
One of the above technical solutions has the following advantages or beneficial effects:
the embodiment of the invention provides an object access method, an object access device and electronic equipment, wherein the method comprises the following steps: receiving an access request for a first object, responding to the access request, and determining an objective function corresponding to a request type in a first function set obtained by performing function replacement in a system function library according to the request type of the access request; and calling the target function and executing access to the first object. By the function replacement function of the link program, the function in the object storage function library can be directly called based on the object storage interface in the general operation system function library, without the escape of special software, the data transmission path is shortened, and the data transmission performance is improved.
Drawings
FIG. 1 is a flow chart of an object storage access method in the prior art;
fig. 2 is a flow chart of an object access method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another method for accessing an object according to an embodiment of the present invention;
FIG. 4 is a block diagram of an object access device according to an embodiment of the present invention;
FIG. 5 is a second block diagram of an object access device according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Furthermore, the use of "and/or" in the specification and claims means at least one of the connected objects, e.g., a and/or B, meaning that it includes a single a, a single B, and that there are three cases of a and B.
In embodiments of the invention, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
For ease of understanding, some of the following descriptions are directed to embodiments of the present invention:
s3 (Simple Storage Service): s3 is a set of global Wide area network (Web) storage management service constructed based on a hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP), S3 defines a set of object storage standard interfaces, which can provide object storage service accessed through Internet, and a background server of each application software can store received videos and pictures of users into the S3 object storage service by calling the S3 object storage interfaces.
S3, standard function library: and may also be referred to as an S3 library, hereinafter referred to as an S3 library, the S3 library encapsulates the calling procedures of the S3 object storage interface. Because the method of using S3 is different from the method of using the universal file storage system interface, a program developer of the application software is required to learn the method of using the S3 function library and the S3 object storage interface specifically, and then adaptively develop a server program of the application software.
Glibc: the Libc library published by the GNU/Linux operating system can be understood as a C running library. Glibc is an application program interface in the Linux system, and almost any other runtime will depend on Glibc. Glibc in addition to encapsulating the system services provided by the Linux operating system, may also provide for the implementation of many other necessary functional services.
Glibc library of functions: the Glibc function library encapsulates the calling process of the file storage interface, and can be used by a server program to store files such as video, pictures and the like by using the file storage interface. Since file storage history is long and almost accompanied by the advent of the Linux operating system, most program developers are proficient in using Glibc function libraries to call the file storage interface to implement file storage.
File storage interface: call interface of file storage system.
Object storage interface: the object stores the call interface of the system.
S3FS: the FUSE-based file system interface supports a file system interface for exporting a socket in an object storage in a file form. In a Linux operating system, software represented by S3FS encapsulates an S3 standard function library into a file storage API based on a FUSE technology
In the prior art, in the case that a program developer does not learn the S3 object storage interface, in the Linux operating system, the S3 function library is packaged into a file storage interface based on the FUSE technology by using software typified by S3 FS. In this way, by installing and using the S3FS software, the program developer may still use the Glibc function library to develop a server program, and the server program accesses the file storage interface through the Glibc function library, and the S3FS software converts the call of the file storage interface into the call of the S3 object storage interface, so as to implement object storage access. As shown in fig. 1, the specific implementation steps of the above prior art are as follows:
step 101, compiling the server program.
In a specific implementation, a Compiler (Compiler) compiles source code of a server program into target code executable by a central processing unit (Central Processing Unit, CPU) to generate a plurality of program segments corresponding to the server program.
Step 102, linking Glibc the compiled server program to a function library.
In specific implementation, a link program (Linker) links the compiled program segments with Glibc function libraries to form a complete Load Module. The Loader (Loader) then loads the Loader module into physical memory, after which the server program can run.
Step 103, when the server program runs, the file storage interface is accessed through Glibc function library under the condition that the object storage access request is received.
Step 104, converting the call of the file storage interface into the call of the S3 object storage interface through S3FS software.
And 105, calling a function in the S3 function library based on the S3 object storage interface to realize object storage access.
In the prior art, an escape layer of S3FS software is introduced, the data passes through the escape layer, the data transmission path is increased, and the data transmission performance is also reduced to a certain extent.
Referring to fig. 2, fig. 2 is a schematic diagram of an object access method according to an embodiment of the present invention, where the object access method according to the embodiment of the present invention may be applied to an application server.
As shown in fig. 2, the object access method may include the steps of:
step 201, an access request to a first object is received.
In a specific implementation, the first object may be understood as a first file, and the access request to the first object may be represented as an access request to the first file. The application server can acquire information carried in the access request by receiving the access request of the user to the first object.
Specifically, the access request may carry the following information: the request type of the access request and the request parameters of the access request. The request parameters of the access request match the request type for the first object. Of course, the information carried by the access request is not limited thereto, and is not limited in any way herein.
Step 202, responding to the access request, and determining an objective function corresponding to the request type in a first function set in a system function library according to the request type of the access request; the first function set is a function set obtained by performing function replacement through a linking program of an operating system, and functions in the first function set are called based on a calling object storage interface.
In particular implementation, the application server may obtain a request type of the access request in response to the access request, and may determine, according to the request type of the access request, what access operation is performed on the first object, so as to invoke a corresponding function in an operating system function library to perform access to the first object.
Specifically, the request type of the access request may include any one of the following: creating the first object; deleting the first object; reading data in the first object; writing data into the first object; other request operations for the first object.
In the embodiment of the present invention, the first function set is a function set obtained by performing function replacement through a linker of an operating system, which can be understood that the first function set may be a custom function set, where a series of functions called based on an object storage interface are defined in the custom function set. The function set called based on the file storage system interface in the operating system function library can be replaced by the first function set in the process of linking the server program through the function replacement function of the operating system linking program.
In particular, when the server program runs, after the application server receives the access request of the user to the first object, the function in the operating system function library needs to be called based on the file storage interface of the operating system function library. Based on the above function replacement operation, the function in the first function set may be actually called, that is, the function in the object storage function library may be actually called based on the object storage interface, and the application server may determine the corresponding target function in the first function set according to the request type of the access request.
And 203, calling the target function and executing access to the first object.
In a specific implementation, the application server may execute access to the first object according to implementation logic of the objective function.
It should be noted that steps 201 to 203 are implemented in the runtime of the application server program.
In the embodiment of the invention, an access request for a first object is received, and in response to the access request, an objective function corresponding to a request type is determined from a first function set obtained by performing function replacement in a system function library according to the request type of the access request; and calling the target function and executing access to the first object. By the function replacement function of the link program, the function in the object storage function library can be directly called based on the object storage interface in the general operation system function library, without the escape of special software, the data transmission path is shortened, and the data transmission performance is improved.
Optionally, before the receiving the access request to the first object, the method further includes:
Acquiring the first function set;
recompilation is performed on source codes of application server programs according to the first function set to generate program segments of the application server programs;
And under the condition that program segments of the application server program are linked with an operating system function library, replacing the functions of a second function set in the operating system function library with the functions of the first function set, wherein the functions in the second function set are called based on a file storage interface.
It should be noted that this alternative embodiment is implemented in the compiling and linking period of the application server program.
In specific implementation, the first function set is obtained, which includes any one of the following implementation forms: receiving and acquiring the first function set; generating and acquiring the first function set. Two cases are described below:
And the first kind, receiving and acquiring the first function set. In this case, the first function set is provided to the application server after being custom generated by the operating system development end. The application server receives and acquires the first function set.
And second, generating and acquiring the first function set. In this case, the application server custom generates the first set of functions.
The implementation manner of the custom generation of the first function set is as follows:
Firstly, a function library is customized, a file corresponding to the customized function library is created, then a series of functions are customized, the functions can be called by the object storage interface based on the functions in the object storage function library, and finally, the functions are uniformly written into the file corresponding to the customized function library.
In the embodiment of the invention, after the application server acquires the file corresponding to the first function set through generation or receiving, the source code can be recompiled based on the first function set to generate the program section of the application server program, and then function replacement is realized in the process of connecting the function library of the operating system.
And in specific implementation, determining a function called based on a file storage interface in the function library of the operating system as a second function set. And when the function is replaced, correspondingly replacing the function of the second function set with the function of the first function set. For example, the file write function in the second function set may be correspondingly replaced by an object write function in the first function set, and the object write function in the first function set may call the object write function in the object storage function library based on the object storage interface.
Optionally, the first function set includes a first function, and the second function set includes a second function;
The replacing the second function set in the system function library with the first function set comprises the following steps:
the business logic of the second function is replaced with the business logic of the first function without changing the name and parameters of the second function.
In particular, when the function is replaced, the name and the parameter of the function in the second function set are not changed, and the business logic of the function is replaced by the business logic of the corresponding function in the first function set.
Illustratively, taking the second function as a write (int fd, const void buf, size_t count) of the operating system function library, the business logic of the second function may be expressed as: acquiring a file name of a first file, data in a data Buffer and the size of the data Buffer; and writing the data in the data Buffer into the first file.
When the first function set is customized, the first function may be defined as a write_write (int fd, const void_buf, size_t count) with parameters identical to the write function, and the business logic of the first function may be expressed as: acquiring a file name of a first file, data in a data Buffer and the size of the data Buffer; and calling an object writing function in the object storage function library, and writing the data in the data Buffer into the first file.
And when the function is replaced, replacing the business logic of the second function with the business logic of the first function under the condition that the name and the parameters of the second function are kept unchanged. In this way, in the case of receiving a write request to the first object, in response to the write request, the application server may call the first function based on the name of the write function and execute the replaced business logic.
The first function may be any function in the first function set, and the second function may be any function in the second function set. When the function is replaced, all functions possibly called based on the file storage interface in the function library of the operating system need to be replaced.
In an embodiment of the present invention, the functions in the first function set include, but are not limited to, the following:
1) Replacing a function of the file creation function create () in the operating system function library, the business logic of the function can be represented as: acquiring a file name of a first file; calling an object creation function in an object storage function library based on an object storage interface; and receiving a successful or failed response message returned by the object storage interface.
2) A function that replaces the file write function write () in the operating system function library, the business logic of which can be represented as: acquiring a file name of a first file, data in a data Buffer and the size of the data Buffer; calling an object writing function in an object storage function library based on an object storage interface, and writing data in a data Buffer into a first file; the write data size returned by the object storage interface is received.
3) A function that replaces the file read function read () in the operating system function library, the business logic of which can be represented as: acquiring the file name of a first file and the size of data to be read; calling an object reading function in an object storage function library based on an object storage interface, and writing the read data into a data Buffer; the write data size returned by the object storage interface is received.
4) The function of the file deletion function unlink () in the function library of the replacement operating system, the business logic of which can be expressed as: acquiring a file name of a first file; invoking an object deletion function in an object storage function library based on the object storage interface; and receiving a successful or failed response message returned by the object storage interface.
Optionally, in the case that the operating system is a Linux operating system, the operating system function library is a Glibc function library, and the function of the second function set is a function called based on a file storage interface in the Glibc function library. Of course, in other operating systems, the function of the second function set may also be a function called based on a file storage interface in a function library corresponding to the operating system, which may be specifically determined according to the actual situation, and is not limited in any way.
Optionally, the first function set is an S3 function library. Of course, the first function set may also be a function library that stores standard interface calls based on other objects, and may specifically be determined according to practical situations, which is not limited in any way.
For ease of understanding, an alternative implementation of the embodiments of the present invention is described below:
In this embodiment, the function of the second function set is a function called based on a file storage interface in Glibc function libraries, and the first function set is an S3 function library.
Referring to fig. 3, fig. 3 is a diagram illustrating an object access method according to the present embodiment.
As shown in fig. 3, the object access method may include the steps of:
step 301: compiling a server program according to the first function set.
In specific implementation, an application server firstly acquires a first function set which is compiled in the same way, and recompilation of the adaptability of a server program is carried out according to the first function set.
Step 302: and linking Glibc the compiled server program to a function library and performing function replacement.
In particular implementations, a server executable program is generated using a Linker (Linker) link Glibc to a library of functions. In the process, a function replacement function provided by a link program (Linker) is used to replace a function called based on a file storage interface in a Glibc function library with a custom function, the custom function and the function called based on the file storage interface are the same parameters, and an S3 function library is called based on an S3 object storage interface.
Step 303: when the server program runs, the first function set is accessed by calling Glibc a function library under the condition that an object access request of a user is received.
In particular, when receiving an object access request of a user, the application server may call Glibc a first function set in the function library based on the file storage interface, and because the name of the first function set is the same as the name of the second function set, the application server may access the first function set based on a function corresponding to the file storage interface.
Step 304: and executing the target function in the first function set, and calling the function of the S3 function library based on the S3 object storage interface.
When the business logic of the objective function in the first function set is executed, the function of the S3 function library is called based on the S3 object storage interface to realize object access.
The implementation of the above-described function replacement procedure is illustrated below:
Taking a write function as an example, which is a function used for writing a file in Glibc function library, the write function call command is ssize _t write (int fd, const void, size_t count), then a homoparameter function may be defined in the first function set as follows:
The following is a custom homoparameter function
ssize_t__wrap_write(int fd,const void*buf,size_t count)
{
The file name is obtained, i.e. the object name
The/call S3 object storage interface writes the data in the data buffer into the object storage
}
In this embodiment, the first function set may be named as a libs3wrapper library, the definition of the custom wrapper_write function may be written into the file libs3wrapper. C, and the wrapper_write function is accommodated in the first function set.
When the server program generates an executable file through the linker program, the reference to libs3wrapper may be implemented through commands such as the following:
The// custom function library needs to be compiled first
gcc-c libs3wrapper.c-o libs3wrapper.o
Myrogram of/compiling server program
gcc-c myprogram.c-o myprogram.o
The/(link generates myprogram executable file where the replacement of write function in Glibc function library is performed
The write function in the library of// Glibc functions would be replaced with the __ write_write function in the libs3wrapper
gcc-Wl,-wrap,write-Wl,-wrap=write libs3wrapper.o mygrogram.o-omyprogram
In the above command, the myprogram refers to a server program, and typically when the server program is linked, it directly links Glibc the function library, and then the myprogram can call the write function in Glibc the function library. In this embodiment, replacing the write function in Glibc function library (second function set) with the __ write_write function in libs3wrapper library (first function set) may be performed by the-Wl, -write, write-Wl, -write = write parameter. The write function in the libs3wrapper library may be directly called when the myprogram server program is running.
The foregoing is merely illustrative of the function replacement principle and the complete libs3wrapper library requires redefining all file storage interface functions that may be used and re-implementing the homoparameter functions of these functions using the S3 object storage interface.
Referring to fig. 4, fig. 4 is a schematic diagram of an object access device according to an embodiment of the present invention.
As shown in fig. 4, an object access device 400 provided in an embodiment of the present invention includes:
A receiving module 401, configured to receive an access request to a first object;
a determining module 402, configured to determine, in response to the access request, an objective function corresponding to a request type in a first function set in a system function library according to the request type of the access request;
an execution module 403, configured to call the objective function and execute access to the first object;
The first function set is a function set obtained by performing function replacement through a linking program of an operating system, and functions in the first function set are called based on a calling object storage interface.
Optionally, as shown in fig. 5, the object access device 400 further includes:
an obtaining module 404, configured to obtain the first function set;
a compiling module 405, configured to recompile source code of a server program according to the first function set, to generate a program segment of the server program;
And a replacing module 406, configured to replace, in a case where program segments of the server program link an operating system function library, a function of a second function set in the operating system function library with a function of the first function set, where the function of the second function set is called based on a file storage interface.
Optionally, the first function set includes a first function, and the second function set includes a second function;
the replacement module 406 specifically is configured to:
the business logic of the second function is replaced with the business logic of the first function without changing the name and parameters of the second function.
Optionally, the function of the second function set is a function called based on a file storage interface in Glibc function library.
Optionally, the first function set is an S3 function library.
The object access device 400 provided in the embodiment of the present invention can implement each process implemented in the method embodiment shown in fig. 2 or fig. 3, and can achieve the same beneficial effects, and for avoiding repetition, a detailed description is omitted here.
Referring to fig. 6, fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention.
As shown in fig. 6, the electronic device 600 includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 perform communication with each other through the communication bus 604.
The memory 603 is used for storing a computer program.
The processor 601 is configured to execute a program stored in the memory 603, and implement the following steps:
Receiving an access request to a first object;
responding to the access request, and determining an objective function corresponding to the request type in a first function set in a system function library according to the request type of the access request;
Invoking the objective function and executing access to the first object;
The first function set is a function set obtained by performing function replacement through a linking program of an operating system, and functions in the first function set are called based on a calling object storage interface.
Optionally, before the receiving the access request to the first object, the method further includes:
Acquiring the first function set;
Recompilation is carried out on source codes of the server program according to the first function set, and program segments of the server program are generated;
And under the condition that program segments of the server program are linked with an operating system function library, replacing the functions of a second function set in the operating system function library with the functions of the first function set, wherein the functions in the second function set are called based on a file storage interface.
Optionally, the first function set includes a first function, and the second function set includes a second function;
The replacing the second function set in the system function library with the first function set comprises the following steps:
the business logic of the second function is replaced with the business logic of the first function without changing the name and parameters of the second function.
Optionally, the function of the second function set is a function called based on a file storage interface in Glibc function library.
Optionally, the first function set is an S3 function library.
The communication bus 604 mentioned above for the electronic device 600 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus 604 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 602 is used for communication between the electronic device 600 and other devices described above.
The memory 603 may include random access memory (Random Access Memory, abbreviated as RAM) or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor 601 may be a general-purpose processor, including a central processing unit (Central Processing Unit, abbreviated as CPU), a network processor (Network Processor, abbreviated as NP), and the like; but may also be a digital signal processor (DIGITAL SIGNAL Processing, DSP), application Specific Integrated Circuit (ASIC), field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The embodiment of the invention also provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program realizes the steps of the object access method provided by the embodiment of the invention when being executed by a processor.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (9)

1. An object access method, the method comprising:
Receiving an access request to a first object;
responding to the access request, and determining an objective function corresponding to the request type in a first function set in a system function library according to the request type of the access request;
Invoking the objective function and executing access to the first object;
The first function set is a function set obtained by performing function replacement through a linking program of an operating system, and functions in the first function set are called based on a calling object storage interface;
before said receiving an access request to the first object, the method further comprises:
Acquiring the first function set;
Recompilation is carried out on source codes of the server program according to the first function set, and program segments of the server program are generated;
And under the condition that program segments of the server program are linked with an operating system function library, replacing the functions of a second function set in the operating system function library with the functions of the first function set, wherein the functions in the second function set are called based on a file storage interface.
2. The method of claim 1, wherein the first set of functions comprises a first function and the second set of functions comprises a second function;
The replacing the function of the second function set in the operating system function library with the function of the first function set comprises the following steps:
the business logic of the second function is replaced with the business logic of the first function without changing the name and parameters of the second function.
3. The method of claim 1, wherein the functions of the second set of functions are functions of Glibc function libraries invoked based on a file storage interface.
4. The method of claim 1, wherein the first set of functions is an S3 library of functions.
5. An object access device, the device comprising:
The receiving module is used for receiving an access request to the first object;
The determining module is used for responding to the access request and determining an objective function corresponding to the request type in a first function set in a system function library according to the request type of the access request;
the execution module is used for calling the target function and executing access to the first object;
The first function set is a function set obtained by performing function replacement through a linking program of an operating system, and functions in the first function set are called based on a calling object storage interface;
the acquisition module is used for acquiring the first function set;
The compiling module is used for recompiling the source code of the server program according to the first function set to generate a program segment of the server program;
And the replacing module is used for replacing the function of the second function set in the operating system function library with the function of the first function set under the condition that the program segments of the server program are linked with the operating system function library, and the function in the second function set is called based on a file storage interface.
6. The apparatus of claim 5, wherein the first set of functions comprises a first function and the second set of functions comprises a second function;
The replacement module is specifically used for:
the business logic of the second function is replaced with the business logic of the first function without changing the name and parameters of the second function.
7. The apparatus of claim 5, wherein the functions of the second set of functions are functions of Glibc function libraries invoked based on a file storage interface.
8. The apparatus of claim 5, wherein the first set of functions is an S3 library of functions.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor performs the steps of the method according to any one of claims 1 to 4.
CN202011218064.0A 2020-11-04 2020-11-04 Object access method and device and electronic equipment Active CN114443316B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011218064.0A CN114443316B (en) 2020-11-04 2020-11-04 Object access method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011218064.0A CN114443316B (en) 2020-11-04 2020-11-04 Object access method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN114443316A CN114443316A (en) 2022-05-06
CN114443316B true CN114443316B (en) 2024-06-04

Family

ID=81361613

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011218064.0A Active CN114443316B (en) 2020-11-04 2020-11-04 Object access method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114443316B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101523348A (en) * 2006-10-02 2009-09-02 特兰斯蒂有限公司 Method and apparatus for handling dynamically linked function calls with respect to program code conversion
CN108399223A (en) * 2018-02-12 2018-08-14 北京奇艺世纪科技有限公司 A kind of data capture method, device and electronic equipment
CN111580798A (en) * 2020-03-30 2020-08-25 佛山职业技术学院 Dynamic link library implementation method, system, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10108406B2 (en) * 2016-10-24 2018-10-23 International Business Machines Corporation Linking optimized entry points for local-use-only function pointers
US20180113689A1 (en) * 2016-10-24 2018-04-26 International Business Machines Corporation Local Function Call Site Optimization

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101523348A (en) * 2006-10-02 2009-09-02 特兰斯蒂有限公司 Method and apparatus for handling dynamically linked function calls with respect to program code conversion
CN108399223A (en) * 2018-02-12 2018-08-14 北京奇艺世纪科技有限公司 A kind of data capture method, device and electronic equipment
CN111580798A (en) * 2020-03-30 2020-08-25 佛山职业技术学院 Dynamic link library implementation method, system, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Hardware Root-of-Trust Based Integrity for Shared Library Function Pointers in Embedded Systems;Gabriela Lopez等;《2019 8th Mediterranean Conference on Embedded Computing (MECO)》;20190715;第1-6页 *
Linux下动态注入机制的研究与实现;邹能人;《中国优秀硕士学位论文全文数据库 信息科技辑》;20160315;第I138-5236页 *

Also Published As

Publication number Publication date
CN114443316A (en) 2022-05-06

Similar Documents

Publication Publication Date Title
CN111176626B (en) Cross-programming-language code calling method and device, medium and equipment
US20090024986A1 (en) Runtime code modification
CN111399840B (en) Module development method and device
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
GB2589658A (en) Method and apparatus for running an applet
TW200937188A (en) Contract programming for code error reduction
CN106775781B (en) Method and device for reducing application installation packages and electronic equipment
CN111651169B (en) Block chain intelligent contract operation method and system based on web container
CN111880801A (en) Application program dynamic method and device and electronic equipment
CN110058904B (en) Data transfer method and device and server
CN113157274B (en) Software development method and device based on micro front end, electronic equipment and storage medium
CN111506368A (en) Method, device, equipment and storage medium for transferring asynchronous call to synchronous call
CN106775916B (en) Method and device for reducing application installation packages and electronic equipment
CN114490103A (en) Operating system interface calling method and device and electronic equipment
CN110941443B (en) Method and device for modifying file name in SDK (software development kit) and electronic equipment
CN112764836A (en) Method and device for running fast application and electronic equipment
CN114443316B (en) Object access method and device and electronic equipment
CN116166457A (en) Data processing method and related equipment
CN113778451B (en) File loading method, file loading device, computer system and computer readable storage medium
CN111367512B (en) Method and device for creating Android library module dependency relationship in application development
CN110275710B (en) Java local interface consistency checking method and system, storage medium and terminal
CN113805911A (en) Multi-version program management method, device and system of server side
CN108089852B (en) Method, medium, apparatus and computing device for establishing attribute access
CN110597707A (en) Memory out-of-range fault detection method and terminal equipment
US20040216140A1 (en) Method and system for accessing system operations through an interface layer

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