CN114816482A - Method and device for upgrading block storage service, computer equipment and storage medium - Google Patents
Method and device for upgrading block storage service, computer equipment and storage medium Download PDFInfo
- Publication number
- CN114816482A CN114816482A CN202210470871.4A CN202210470871A CN114816482A CN 114816482 A CN114816482 A CN 114816482A CN 202210470871 A CN202210470871 A CN 202210470871A CN 114816482 A CN114816482 A CN 114816482A
- Authority
- CN
- China
- Prior art keywords
- target
- function
- dynamic library
- address
- library file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a method and a device for upgrading a block storage service, computer equipment and a storage medium. The upgrading method of the block storage service comprises the following steps: and acquiring an entry address of a dynamic library loading function in a target process, wherein the target process is a process to be subjected to block storage service upgrading, and the dynamic library loading function is used for loading a dynamic library file providing the block storage service. And injecting the read target dynamic library file into a target process through the entry address so as to load the target dynamic library file. And upgrading the block storage service by using the target dynamic library file based on the completion of the loading of the target dynamic library file. By the method for upgrading the block storage service, the purpose of upgrading the block storage service on line can be achieved, and the use experience of a user is improved.
Description
Technical Field
The invention relates to the technical field of data storage, in particular to a method and a device for upgrading a block storage service, computer equipment and a storage medium.
Background
A Reliable autonomous Distributed Object storage Block Device (RBD), which is called Block storage for short, is the most widely used and stable storage type in a Distributed file system (ceph), and can be understood as a Block storage type.
The block store is used to provide services for virtualization, databases, etc. services. For example: when providing services for virtualized services, the method can be used for allocating resources for users; may be used to store critical data when servicing a database service. In practical applications, when a service provided by the block storage has a large defect, the service needs to be upgraded to improve the defect.
In the related art, when upgrading the block storage service, a user needs to shut down the device where the block storage is located, and then upgrade the block storage service in an offline processing manner. However, when the upgrading is performed in this way, a huge loss is caused by the shutdown of the device where the block storage is located.
Disclosure of Invention
Therefore, the technical problem to be solved by the present invention is to overcome the defect that upgrading a block storage service by using an offline processing method in the prior art is easy to cause huge loss, thereby providing an upgrading method and apparatus for a block storage service, a computer device, and a storage medium.
According to a first aspect, the present invention provides a method for upgrading a block storage service, the method comprising:
acquiring an entry address of a dynamic library loading function in a target process, wherein the target process is a process to be subjected to block storage service upgrading, and the dynamic library loading function is used for loading a dynamic library file providing a block storage service;
injecting the read target dynamic library file into the target process through the entry address so as to load the target dynamic library file;
and upgrading the block storage service by using the target dynamic library file based on the completion of the loading of the target dynamic library file.
In the method, the target dynamic library file can be injected into the target process for loading under the condition that the entry address of the dynamic library loading function in the target process is determined, so that the target process can utilize the newly injected target dynamic library file to perform online upgrade on the block storage service, and further achieve the purpose of online upgrade, and the method is favorable for improving the use experience of a user.
With reference to the first aspect, in a first embodiment of the first aspect, the injecting the read target dynamic library file into the target process through the entry address includes:
acquiring register information of the target process;
and packaging the target dynamic library file into the register information through the entry address so as to load the target dynamic library file through the dynamic library loading function.
With reference to the first embodiment of the first aspect, in a second embodiment of the first aspect, the obtaining the register information of the target process includes:
calling a process control function to capture the target process;
and if the capture is successful, acquiring the register information of the target process.
With reference to the first aspect, in a third embodiment of the first aspect, the upgrading the block storage service by using the target dynamic library file based on the completion of the loading of the target dynamic library file includes:
comparing the target dynamic library file with a historical dynamic library file in the target process based on the completion of the loading of the target dynamic library file, and determining at least one interface function commonly included by the historical dynamic library file and the target dynamic library file;
acquiring a target function address of the at least one interface function in the target dynamic library file and a historical function address of the at least one interface function in the historical dynamic library file;
replacing the historical function address with the target function address;
and controlling the target process to call the target dynamic library file according to the target function address so as to upgrade the block storage service.
With reference to the third embodiment of the first aspect, in a fourth embodiment of the first aspect, the obtaining an address of a target function of the at least one interface function in the target dynamic library file includes:
obtaining an offset address of the at least one interface function in the target dynamic library file;
and adding the entry address and the offset address to obtain a target function address of the at least one interface function in the target dynamic library file.
With reference to the first aspect, in a fifth embodiment of the first aspect, the obtaining an entry address of a dynamic library loading function in a target process includes:
acquiring the offset of the dynamic library loading function in a function library;
determining a starting address of the function library in the target process through a function library mapping file of the target process, wherein the function library is used for providing the dynamic library loading function;
and adding the starting address and the offset to obtain an entry address of the dynamic library loading function in the target process.
With reference to the fifth embodiment of the first aspect, in a sixth embodiment of the first aspect, the obtaining an offset of the dynamic library loading function in the function library includes:
acquiring an initial address of a function library through a preset function library mapping file;
calling an address acquisition function, and determining a storage address of the dynamic library loading function;
and subtracting the initial address from the storage address to obtain the offset of the dynamic library loading function in the function library.
According to a second aspect, the present invention also provides an apparatus for upgrading a block storage service, the apparatus comprising:
the system comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is used for acquiring an entry address of a dynamic library loading function in a target process, the target process is a process to be subjected to block storage service upgrading, and the dynamic library loading function is used for loading a dynamic library file providing a block storage service;
the transmission unit is used for injecting the read target dynamic library file into the target process through the entry address so as to load the target dynamic library file;
and the upgrading unit is used for upgrading the block storage service by using the target dynamic library file based on the completion of the loading of the target dynamic library file.
With reference to the second aspect, in a first embodiment of the second aspect, the transmission unit includes:
the information acquisition unit is used for acquiring the register information of the target process;
and the transmission subunit is used for packaging the target dynamic library file into the register information through the entry address so as to load the target dynamic library file through the dynamic library loading function.
With reference to the first embodiment of the second aspect, in a second embodiment of the second aspect, the information acquiring unit includes:
the calling unit is used for calling a process control function to capture the target process;
and the information acquisition subunit is used for acquiring the register information of the target process if the capture is successful.
With reference to the second aspect, in a third embodiment of the second aspect, the upgrade unit includes:
the comparison unit is used for comparing the target dynamic library file with a historical dynamic library file in the target process based on the completion of the loading of the target dynamic library file, and determining at least one interface function commonly included by the historical dynamic library file and the target dynamic library file;
an address obtaining unit, configured to obtain a target function address of the at least one interface function in the target dynamic library file, and a historical function address of the at least one interface function in the historical dynamic library file;
a replacement unit for replacing the history function address with the target function address;
and the upgrading subunit is used for controlling the target process to call the target dynamic library file according to the target function address so as to upgrade the block storage service.
With reference to the third embodiment of the second aspect, in a fourth embodiment of the second aspect, the address obtaining unit includes:
a first address obtaining unit, configured to obtain an offset address of the at least one interface function in the target dynamic library file;
and the second address acquisition unit is used for adding the entry address and the offset address to obtain a target function address of the at least one interface function in the target dynamic library file.
With reference to the second aspect, in a fifth embodiment of the second aspect, the obtaining unit includes:
the offset acquisition unit is used for acquiring the offset of the dynamic library loading function in the function library;
a first determining unit, configured to determine, through a function library mapping file of the target process, a starting address of the function library in the target process, where the function library is used to provide the dynamic library loading function;
and the obtaining subunit is configured to add the start address and the offset to obtain an entry address of the dynamic library loading function in the target process.
With reference to the fifth embodiment of the second aspect, in a sixth embodiment of the second aspect, the offset amount acquisition unit includes:
a third address obtaining unit, configured to obtain an initial address of the function library through a preset function library mapping file;
the second determining unit is used for calling an address obtaining function and determining the storage address of the dynamic library loading function;
and the offset obtaining subunit is configured to subtract the storage address from the start address to obtain an offset of the dynamic library loading function in the function library.
According to a third aspect, embodiments of the present invention further provide a computer device, which includes a memory and a processor, where the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the method for upgrading the block storage service in any one of the first aspect and the optional embodiments thereof.
According to a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium storing computer instructions for causing the computer to execute the method for upgrading the block storage service of any one of the first aspect and the optional embodiments thereof.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a proposed method for upgrading a block storage service according to an exemplary embodiment.
Fig. 2 is a flowchart of a proposed method for upgrading a block storage service according to an exemplary embodiment.
FIG. 3 is a process interaction diagram in accordance with an exemplary embodiment.
Fig. 4 is a block diagram of an upgrade apparatus of a block storage service according to an exemplary embodiment.
Fig. 5 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, when upgrading the block storage service, a user needs to shut down the device where the block storage is located, and then upgrade the block storage service in an offline processing manner. However, when the upgrading is performed in this way, a huge loss is caused by the shutdown of the device where the block storage is located.
In order to solve the foregoing problems, an embodiment of the present invention provides an upgrade method for a block storage service, which is used in a computer device, where an execution main body of the upgrade method may be an upgrade apparatus for a block storage service, and the apparatus may be implemented as part or all of a computer device in a software, hardware, or a combination of software and hardware, where the computer device may be a terminal, a client, or a server, and the server may be one server or a server cluster formed by multiple servers, and the terminal in this embodiment of the present invention may be other intelligent hardware devices such as a smart phone, a personal computer, a tablet computer, a wearable device, and an intelligent robot. In the following method embodiments, the execution subject is a computer device as an example.
The computer device in this embodiment is one of node devices in the distributed file system, and can share the memory resource of the distributed file system with other computer devices. In the distributed file system, a block storage service can be provided for each computer device in a distributed block storage manner, so that each computer device can interact with the distributed file system. In one example, the distributed file system runs on a linux platform.
The method for upgrading the block storage service obtains the entry address of a dynamic library loading function in the process of upgrading the block storage service, wherein the dynamic library loading function is a function for loading dynamic library files for providing the block storage service. And then, by adopting an online upgrading mode, injecting a target dynamic library file for upgrading the block storage service into a process to be subjected to the block storage service upgrading for loading so as to upgrade the block storage service by using the target dynamic library file, so that the upgrading can be completed without closing computer equipment where the process to be subjected to the block storage service upgrading is located, the loss caused by upgrading the block storage service is reduced, and the use experience of a user is improved.
For convenience of description, the process to be upgraded for the block storage service is replaced with the target process.
Fig. 1 is a flowchart of a proposed method for upgrading a block storage service according to an exemplary embodiment. As shown in fig. 1, the upgrade method of the block storage service includes the following steps S101 to S103.
In step S101, an entry address of a dynamic library loading function in the target process is acquired.
In an embodiment of the present invention, the dynamic library loading function is used to load a dynamic library file that provides a block storage service. In order to realize online upgrade of the block storage service, an entry address of a dynamic library loading function in the target process is acquired, so that the position of the target process for loading the dynamic library file can be determined, and the subsequent injection of the target dynamic library file for upgrading the block storage service into the target process can be effectively loaded.
In one embodiment, the offset of the dynamic library loading function in the target process in the function library is obtained. The function library is a function library which can be shared in the distributed file system, and can provide a dynamic library loading function. By acquiring the offset, the address offset of the dynamic library loading function in the target process in the function library is facilitated to be determined. And determining the starting address of the function library in the target process through the function library mapping file of the target process, and adding the starting address and the offset to obtain the entry address of the dynamic library loading function in the target process.
In one example, the offset of the dynamic library loading function in the function library is a fixed value in all processes of the distributed file system. Therefore, in order to obtain the offset of the dynamic library loading function in the function library, the offset can be obtained based on the address of the dynamic library loading function in other processes. And acquiring the address of the function library in the function library mapping file through the preset function library mapping file of other processes. And determining the storage address of the dynamic library loading function in the other process by calling the address acquisition function, and subtracting the initial address from the storage address to obtain the offset of the dynamic library loading function in the function library.
In an implementation scenario, the other process may obtain the process identifier of the other process by calling getpid () (a function for obtaining the process identifier), further obtain a preset function library mapping file (maps file) of the other process in the distributed file system, perform parsing through maps file/proc/[ pid ]/maps, and obtain a start field representing the function library according to rows of a start field (r-xp) and a final end field (libc-), that is, obtain a start address of the function library. And calling an address acquisition function (dlsym ()) in other processes to obtain the storage address of the dynamic library loading function (__ libc _ dlopen _ mode) in the other processes, and further subtracting the storage address from the initial address to obtain the offset of the dynamic library loading function in the function library.
In step S102, the read target dynamic library file is injected into the target process through the entry address to load the target dynamic library file.
In an embodiment of the present invention, the target dynamic library file is a dynamic library file for upgrading a block storage service of the target process. And injecting the read target dynamic library file into the target process through the entry address so that the target process can obtain the target dynamic library file to load the target dynamic library file, thereby realizing the upgrading of the block storage service.
In an embodiment, in order to facilitate the target dynamic library file to be injected into the target process through the entry address, the register information of the target process is acquired, and the target dynamic library file is encapsulated into the register information through the entry address to be loaded through the dynamic library loading function, so that the target process obtains the target dynamic library file.
In one example, the target process may be captured by calling a process control function, and then register information of the target process may be obtained if the capture is successful.
In one implementation scenario, the process control function may be a ptrace system function. The ptrace system function is a system function which can provide a function for enabling a parent process to monitor and control other processes and change register information and memory images in a child process. And (3) capturing (attach) the target process by calling a ptrace system function, and further interrupting the running of the target process to acquire the register information of the target process under the condition of determining that the capturing is successful. In an example, the value of each register in the register set of the target process may be determined by looking at a use area structure (user _ regs _ struct) in a header file (/ user/include/sys/user.h) in the distributed file system, so as to obtain register information of the target process. In another example, in order to facilitate the target process to smoothly upgrade the block storage service according to the target dynamic library file, the obtained register information is backed up, so that the interface function to be upgraded is determined according to the backed-up register information, and the accuracy of upgrading the block storage service is further improved.
In step S103, based on the completion of the loading of the target dynamic library file, the block storage service is upgraded using the target dynamic library file.
In the embodiment of the invention, under the condition that the target dynamic library file is completely loaded, the target dynamic library file is utilized to upgrade the block storage service, thereby achieving the purpose of online upgrade.
Through the embodiment, the target dynamic library file can be injected into the target process for loading under the condition that the entry address of the dynamic library loading function in the target process is determined, so that the target process can utilize the newly injected target dynamic library file to perform online upgrade on the block storage service, the purpose of online upgrade is further achieved, and the use experience of a user is facilitated to be improved.
The following embodiment will specifically describe the process of upgrading a block storage service using a target dynamic library file.
FIG. 2 is a flow chart of another proposed method of upgrading a block storage service in accordance with an exemplary embodiment.
In step S201, based on the completion of loading the target dynamic library file, the target dynamic library file is compared with the historical dynamic library file in the target process, and at least one interface function commonly included in the historical dynamic library file and the target dynamic library file is determined.
In the embodiment of the invention, the historical dynamic library file is to be upgraded and provides a dynamic library file of the block storage service for the target process. And when the target process is determined to have loaded the target dynamic library file, comparing the target dynamic library file with the historical dynamic library file in the target process, and determining at least one interface function jointly included by the historical dynamic library file and the target dynamic library file so as to replace the interface function in the target dynamic library file, which is the same as the target dynamic library file, and further realize online upgrade of the block storage service.
In one implementation scenario, the dynamic symbol table (. dynsym) in the dynamic library file is used to hold the dynamic link symbols of the dynamic library. Therefore, the target dynamic file library is compared with the historical dynamic file library, the address of the interface function can be determined through the repositioning (. relax.plt) field in the dynamic library file, and then the target dynamic file library is compared with the historical dynamic file, so that at least one interface function which is commonly included can be determined. The relocation (. rela.plt) field includes a function symbol that the process needs to dynamically resolve through a delayed binding technology in the running process.
In step S202, a target function address of the at least one interface function in the target dynamic library file and a historical function address of the at least one interface function in the historical dynamic library file are obtained.
In the embodiment of the invention, the number of the interface functions which are commonly included in the historical dynamic library file and the target dynamic library file is at least one. In order to replace the same interface function in the target dynamic library file and the historical dynamic library file, the target function address of the part of the interface function in the target dynamic library file and the historical function address in the historical dynamic library file are respectively obtained.
In one example, the interface function is in the target function address in the target dynamic library file, which is an addition sum between the offset address of the interface function within the target dynamic library file and the entry address of the dynamic library load function.
In an implementation scenario, the definition of the structure type (sh _ type) of the dynaym segment is dynamic link information, and the dynaym segment can be located in the target dynamic library file by looking up the sh _ type, so that the structure address (Elf _ Sym) corresponding to the interface function for replacement can be obtained. The offset address of the interface function for replacement in the target dynamic library file can be obtained through the aligned byte number (st _ value) in the structure address.
In another implementation scenario, the address of the replacement function symbol in the Global Offset Table (GOT) is recorded in the relax section in the historical dynamic library file, and we can define the offset address to the interface function to be replaced by the type definition (SHT _ REL).
In step S203, the history function address is replaced with the target function address.
In the embodiment of the invention, the historical function address is replaced by the target function address through the process control function, and then the corresponding interface function can be called by adopting the replaced target function address when the subsequent target process runs.
In one example, in order to obtain the target function address of the part of interface functions in the target dynamic library file and the historical function address of the part of interface functions in the historical dynamic library file, the part of interface functions are represented in a function list mode, and the historical function address of each interface function is replaced by the target function address according to the sequence of the interface functions in the function list.
In step S204, the control target process calls the target dynamic library file according to the target function address, and upgrades the block storage service.
Through the embodiment, at least one interface function which is commonly included by the historical dynamic library file and the target dynamic library file is determined, and the historical function address of each interface function in the historical dynamic library file and the target function address of the target dynamic library file are determined, so that the historical function address of each interface function can be replaced into the target function address in a hot replacement mode, the purpose of upgrading the block storage service can be achieved without terminating the target process, and the use experience of a user is improved.
In an implementation scenario, the other process may be an upgrade process, i.e., a process that assists the target process in upgrading the block storage service. When the upgrading process captures the target process by calling a ptrace system function, register information of the target process is obtained, the register information (% RIP) of the target process points to a dynamic library loading function, a read character string of the name of a target dynamic file is placed in a stack, an entry address of the character string is written into the register information, and a value of a system condition (RTLD _ NOW) for loading the dynamic library is written into a deviation index (% rsi) to serve as a mark (flag) of the dynamic library loading function. While the return address of the dynamic library load function is set to illegal address 0x0 (e.g., pushing 0x0 onto the stack) to suspend control of the target process. When a signal (SIGSEGVGV) generated by the target process and having completed the loading is captured by a data loading tool (such as Loader), then it can be determined that the target process has completed loading the target dynamic library file.
In another implementation scenario, an interactive process for upgrading a block storage service for a target process by an upgrade process may be as shown in FIG. 3. FIG. 3 is a process interaction diagram in accordance with an exemplary embodiment.
In the upgrading process, according to the function library mapping file of the upgrading process and the function library mapping file of the target process, the initial address of the function library in the upgrading process, the storage address of the dynamic library loading function and the initial address of the function library in the target process are respectively obtained. And subtracting the storage address of the dynamic library loading function in the upgrading process from the initial address of the function library in the upgrading process to obtain the offset of the dynamic library loading function in the function library, and further obtaining the entry address of the dynamic library loading function in the target process according to the sum of the offset and the initial address of the function library in the target process.
Calling a ptrace system function to grab the target process, acquiring register information of the target process, interrupting the running state of the target process, and controlling the target process by the upgrading process. And packaging the target dynamic library file into the register information through the entry address so as to load the target dynamic library file into the target process and simultaneously suspend the control of the target process. And controlling the target process to load the target dynamic library file through the ptrace system function. And when the target process finishes loading the target dynamic library file, generating a signal that the loading is finished. When the upgrade process captures the signal, the target process is re-controlled. And determining at least one interface function which is commonly included in the target dynamic library file and the historical dynamic library file, and replacing the historical function address of the part of the interface function in the historical dynamic library file with the target function address. And determining the running state of the target process before interruption according to the backup register information, recovering the running of the target process, and releasing the control on the target process so that the target process can finish the online upgrade on the block storage service in the running process.
Based on the same inventive concept, the invention also provides an upgrading device of the block storage service.
Fig. 4 is a block diagram of an upgrade apparatus of a block storage service according to an exemplary embodiment. As shown in fig. 4, the upgrade apparatus of the block storage service includes an acquisition unit 401, a transmission unit 402, and an upgrade unit 403.
An obtaining unit 401, configured to obtain an entry address of a dynamic library loading function in a target process, where the target process is a process to be updated for a block storage service, and the dynamic library loading function is used to load a dynamic library file providing the block storage service;
a transmission unit 402, configured to inject the read target dynamic library file into a target process through an entry address, so as to load the target dynamic library file;
and an upgrading unit 403, configured to upgrade the block storage service by using the target dynamic library file based on the completion of loading of the target dynamic library file.
In one embodiment, the transmission unit 402 includes: and the information acquisition unit is used for acquiring the register information of the target process. And the transmission subunit is used for packaging the target dynamic library file into the register information through the entry address so as to load the target dynamic library file through a dynamic library loading function.
In another embodiment, the information acquisition unit includes: and the calling unit is used for calling the process control function to capture the target process. And the information acquisition subunit is used for acquiring the register information of the target process if the capture is successful.
In yet another embodiment, the upgrade unit 403 includes: and the comparison unit is used for comparing the target dynamic library file with the historical dynamic library file in the target process based on the completion of the loading of the target dynamic library file and determining at least one interface function commonly included by the historical dynamic library file and the target dynamic library file. And the address acquisition unit is used for acquiring the target function address of at least one interface function in the target dynamic library file and the historical function address of at least one interface function in the historical dynamic library file. And a replacing unit for replacing the history function address with the target function address. And the upgrading subunit is used for controlling the target process to call the target dynamic library file according to the target function address and upgrading the block storage service.
In yet another embodiment, the address acquisition unit includes: and the first address acquisition unit is used for acquiring the offset address of at least one interface function in the target dynamic library file. And the second address acquisition unit is used for adding the entry address and the offset address to obtain a target function address of at least one interface function in the target dynamic library file.
In yet another embodiment, the obtaining unit 401 includes: and the offset acquisition unit is used for acquiring the offset of the dynamic library loading function in the function library. The first determining unit is used for determining the starting address of the function library in the target process through the function library mapping file of the target process, and the function library is used for providing a dynamic library loading function. And the obtaining subunit is used for adding the starting address and the offset to obtain an entry address of the dynamic library loading function in the target process.
In still another embodiment, the offset amount acquisition unit includes: and the third address acquisition unit is used for acquiring the initial address of the function library through a preset function library mapping file. And the second determining unit is used for calling the address acquisition function and determining the storage address of the loading function of the dynamic library. And the offset acquisition subunit is used for subtracting the initial address of the function library from the storage address to obtain the offset of the dynamic library loading function in the function library.
The specific limitations and advantageous effects of the device for upgrading the block storage service may refer to the limitations of the method for upgrading the block storage service, which are not described herein again. The various modules described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 5 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment. As shown in fig. 5, the apparatus includes one or more processors 510 and a storage 520, where the storage 520 includes a persistent memory, a volatile memory, and a hard disk, and one processor 510 is taken as an example in fig. 5. The apparatus may further include: an input device 530 and an output device 540.
The processor 510, the memory 520, the input device 530, and the output device 540 may be connected by a bus or other means, and the bus connection is exemplified in fig. 5.
The memory 520, which is a non-transitory computer-readable storage medium, includes a persistent memory, a volatile memory, and a hard disk, and can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the service management method in the embodiment of the present application. The processor 510 executes various functional applications and data processing of the server by executing non-transitory software programs, instructions and modules stored in the memory 520, namely, implementing any one of the above-described upgrading methods for the block storage service.
The memory 520 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data used as needed or desired, and the like. Further, the memory 520 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 520 may optionally include memory located remotely from processor 510, which may be connected to a data processing device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 530 may receive input numeric or character information and generate key signal inputs related to user settings and function control. The output device 540 may include a display device such as a display screen.
One or more modules are stored in the memory 520, and when executed by the one or more processors 510, perform the methods shown in fig. 1-3.
The product can execute the method provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. Details of the technique not described in detail in the present embodiment may be specifically referred to the related description in the embodiments shown in fig. 1 to fig. 3.
Embodiments of the present invention further provide a non-transitory computer storage medium, where a computer-executable instruction is stored in the computer storage medium, and the computer-executable instruction may execute the authentication method in any of the above method embodiments. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210470871.4A CN114816482A (en) | 2022-04-28 | 2022-04-28 | Method and device for upgrading block storage service, computer equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210470871.4A CN114816482A (en) | 2022-04-28 | 2022-04-28 | Method and device for upgrading block storage service, computer equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN114816482A true CN114816482A (en) | 2022-07-29 |
Family
ID=82510279
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210470871.4A Pending CN114816482A (en) | 2022-04-28 | 2022-04-28 | Method and device for upgrading block storage service, computer equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114816482A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115640037A (en) * | 2022-09-09 | 2023-01-24 | 北京畅游创想软件技术有限公司 | Program updating method and device |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108595218A (en) * | 2018-04-17 | 2018-09-28 | 网宿科技股份有限公司 | Method and device for loading system dynamic library |
| CN108762825A (en) * | 2018-04-20 | 2018-11-06 | 烽火通信科技股份有限公司 | The realization method and system of dynamic base heavy duty |
-
2022
- 2022-04-28 CN CN202210470871.4A patent/CN114816482A/en active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108595218A (en) * | 2018-04-17 | 2018-09-28 | 网宿科技股份有限公司 | Method and device for loading system dynamic library |
| CN108762825A (en) * | 2018-04-20 | 2018-11-06 | 烽火通信科技股份有限公司 | The realization method and system of dynamic base heavy duty |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115640037A (en) * | 2022-09-09 | 2023-01-24 | 北京畅游创想软件技术有限公司 | Program updating method and device |
| CN115640037B (en) * | 2022-09-09 | 2023-08-11 | 北京畅游创想软件技术有限公司 | Program update method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107832100B (en) | APK plug-in loading method and terminal thereof | |
| CN108536745B (en) | Shell-based data table extraction method, terminal, equipment and storage medium | |
| CN111782339A (en) | Container creation method and device, electronic equipment and storage medium | |
| US10075477B2 (en) | Method, system and server for self-healing of electronic apparatus | |
| CN105573864A (en) | Terminal system recovery method and system | |
| WO2020006911A1 (en) | Hybrid app interface calling method and device, and computer-readable storage medium | |
| CN106775754A (en) | The compatible processing method and processing device of application | |
| WO2021121407A1 (en) | Capacity changing method and apparatus for virtual machine | |
| CN111294377B (en) | Dependency network request sending method, terminal device and storage medium | |
| CN110765394A (en) | So file loading method and device, storage medium and terminal equipment | |
| CN111444453B (en) | Page return data processing method and device | |
| CN114816482A (en) | Method and device for upgrading block storage service, computer equipment and storage medium | |
| CN117311764A (en) | Firmware upgrading and restoring method, device, equipment and storage medium | |
| CN112214250A (en) | Method and device for loading application components | |
| CN112632032B (en) | Data migration method and device, storage medium and terminal equipment | |
| CN112379973B (en) | Heavy load method and device | |
| CN113282363A (en) | Method and device for optimizing hybrid APP | |
| US20200133709A1 (en) | System and method for content - application split | |
| WO2017096889A1 (en) | Method and device for upgrading and downgrading system | |
| CN112988265B (en) | Mini-program processing methods, devices, equipment, media, and products | |
| CN114880632B (en) | Method for obtaining obfuscated resources, intelligent terminal and computer-readable storage medium | |
| CN111127601A (en) | An animation switching method, device, electronic device and storage medium | |
| CN112612531A (en) | Application program starting method and device, electronic equipment and storage medium | |
| CN117556395A (en) | System application watermark generation method and device | |
| CN117633382A (en) | Page loading method and device, electronic equipment and computer readable medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information |
Country or region after: China Address after: 215000 Building 9, No.1 guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province Applicant after: Suzhou Yuannao Intelligent Technology Co.,Ltd. Address before: 215000 Building 9, No.1 guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province Applicant before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd. Country or region before: China |
|
| CB02 | Change of applicant information |