Dynamic library detection method and device and related equipment

Automatically detect symbolic link exceptions of dynamic library by analyzing and solving symbol dependency graphs, solving the problem of high failure risk caused by missing symbolic links in the operating system, realizing automatic repair of dynamic library, and improving system stability.

CN119292653APending Publication Date: 2025-01-10CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411426644.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

During the operating system operation and maintenance process, incompatibility between different versions of software and dynamic libraries leads to the missing symbolic links, resulting in unavailability or crash of operating system programs. The existing technology relies on manual processing and takes a long time, and has a high risk of failure.

Method used

By analyzing the dynamic library symbol links in the operating system, it is converted into a Boolean expression, and solving the Boolean expressions is solved to automatically detect symbol link exceptions, generate detection results, realize automated repairs, and reduce the influence of human factors.

Benefits of technology

It realizes comprehensive detection and repair of the operating system dynamic library, reduces the risk of operation and maintenance failures, and improves system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292653A_ABST
    Figure CN119292653A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic library detection method and device and related equipment, and relates to the technical field of operating systems, the method comprises the following steps: analyzing a plurality of symbolic links included in a to-be-detected target dynamic library in an operating system to obtain a symbolic dependency graph, the symbolic dependency graph being used for representing a dependency relationship among the plurality of symbolic links; converting the symbol dependency graph into a Boolean expression; the Boolean expression is solved, a solving result is obtained, and the solving result is used for indicating whether each symbol link in the multiple symbol links is abnormal or not; and generating a detection result according to the solving result, wherein the detection result is used for indicating whether the target dynamic library comprises an abnormal symbolic link or not. According to the method and the device, a manual processing mode is replaced by an automatic processing mode, comprehensive detection on the dynamic library can be conveniently and rapidly realized, a user can conveniently, timely and accurately repair the missing symbolic link in the operating system, and thus the fault risk of the operating system during operation and maintenance is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of operating systems, and in particular to a dynamic library detection method, device and related equipment. Background Art

[0002] In modern software development, dynamic link libraries (DLLs) are widely used to improve code reusability and software modularity.

[0003] However, in the process of operating system operation and maintenance, it is found that there are incompatibilities between different versions of software and dynamic libraries, which will cause the loss of symbolic links that the operating system's related programs rely on, thereby causing the operating system's related programs to be unavailable or even crash.

[0004] Currently, manual operations are mostly used to handle the above-mentioned missing symbolic link problem. Due to human factors, this method of handling the missing symbolic link problem usually takes a long time, and it is difficult to discover all missing symbolic link problems, which greatly increases the risk of failure during operation and maintenance of the operating system.

[0005] In other words, the operating system provided by the related technology has a greater risk of failure. Summary of the invention

[0006] The purpose of the present disclosure is to provide a dynamic library detection method, device and related equipment, which are used to solve the technical problem that the operating system provided by the related technology has a high risk of failure.

[0007] In a first aspect, an embodiment of the present disclosure provides a dynamic library detection method, the method comprising:

[0008] Parsing a plurality of symbolic links included in a target dynamic library to be detected in the operating system to obtain a symbolic dependency graph, wherein the symbolic dependency graph is used to represent dependency relationships between the plurality of symbolic links;

[0009] Converting the symbolic dependency graph into a Boolean expression;

[0010] Solving the Boolean expression to obtain a solution result, wherein the solution result is used to indicate whether each symbolic link among the plurality of symbolic links is abnormal;

[0011] A detection result is generated according to the solution result, and the detection result is used to indicate whether the target dynamic library includes an abnormal symbolic link.

[0012] In a second aspect, an embodiment of the present disclosure provides a dynamic library detection device, the device comprising:

[0013] A parsing module, used for parsing a plurality of symbolic links included in a target dynamic library to be detected in the operating system to obtain a symbolic dependency graph, wherein the symbolic dependency graph is used for representing dependency relationships between the plurality of symbolic links;

[0014] A conversion module, used for converting the symbolic dependency graph into a Boolean expression;

[0015] A solution module, used for solving the Boolean expression to obtain a solution result, wherein the solution result is used to indicate whether each symbolic link in the plurality of symbolic links has an abnormality;

[0016] A result generating module is used to generate a detection result according to the solution result, wherein the detection result is used to indicate whether the target dynamic library includes an abnormal symbolic link.

[0017] In a third aspect, the present disclosure provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect.

[0018] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0019] In a fifth aspect, the present disclosure provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0020] In the present disclosure, a symbol dependency graph is formed by parsing multiple symbolic links of a dynamic library, and the symbol dependency graph is converted into a Boolean expression, so as to convert the complex dependency relationship between multiple symbolic links in the dynamic library into an expression that can be processed by a computer. By solving the aforementioned Boolean expression, it can be determined whether each of the multiple symbolic links in the dynamic library is abnormal, and the manual processing method is replaced by the automated processing method, thereby avoiding the influence of human factors, conveniently realizing comprehensive detection of dynamic libraries in the operating system, and facilitating users to repair missing symbolic links in the operating system in a timely and accurate manner, thereby reducing the risk of failure during operation and maintenance of the operating system. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of a flow chart of a dynamic library detection method provided in an embodiment of the present application;

[0022] Figure 2 is a schematic diagram of a symbol dependency graph provided in an embodiment of the present application;

[0023] Figure 3is a schematic diagram of a Boolean expression provided in an embodiment of the present application;

[0024] Figure 4 It is a schematic diagram of a process for solving a Boolean expression provided by an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of a result of solving a Boolean expression provided by an embodiment of the present application;

[0026] Figure 6 It is a structural schematic diagram of a dynamic library detection device provided in an embodiment of the present application;

[0027] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0029] The present disclosure provides a dynamic library detection method, such as Figure 1 As shown, the method includes:

[0030] Step 101: parse multiple symbolic links included in a target dynamic library to be detected in an operating system to obtain a symbolic dependency graph.

[0031] Among them, the operating system (OS) can be understood as system software that manages computer hardware and software resources, provides services for computer programs, and serves as a bridge between users and computer hardware; its functions include but are not limited to: process management, memory management, file system management, device management, security and permission management.

[0032] Dynamic Link Libraries (DLLs), also known as shared libraries, are library files loaded at runtime, allowing multiple programs to share the same code.

[0033] The operating system includes multiple dynamic libraries, and the target dynamic library to be detected can be any one of the multiple dynamic libraries included in the operating system, for example: a dynamic library newly loaded or newly added in the operating system, or a dynamic library preset in the initial installation phase of the operating system. Each dynamic library records multiple symbolic links.

[0034] Symbol Binding refers to the access path of functions and variables in dynamic libraries (also called shared libraries). It ensures that the symbols in the dynamic library can be correctly parsed and bound at runtime through the symbol table and linker mechanism, so that the application can call and access these functions and variables. Missing symbol links will cause the application to be unable to correctly call or access the functions in the dynamic library, thus causing link errors or runtime errors.

[0035] The symbolic dependency graph is used to represent the dependency relationship between multiple symbolic links included in the target dynamic library. The symbolic dependency graph includes multiple nodes, and the nodes are connected by edges, wherein the nodes refer to symbolic links and the edges refer to the dependencies between the symbolic links.

[0036] Step 102: Convert the symbolic dependency graph into a Boolean expression.

[0037] Among them, Boolean expression can be understood as a mathematical expression composed of Boolean variables and Boolean operators (such as and, or, not, etc.).

[0038] Step 103: Solve the Boolean expression to obtain a solution result.

[0039] The solution result is used to indicate whether each symbolic link in the plurality of symbolic links has an abnormality.

[0040] Specifically, if the dependency of a symbolic link is normal, then there is no abnormality in the symbolic link, that is, the symbolic link can correctly jump to the corresponding file or directory. Conversely, if the dependency of a symbolic link is abnormal (that is, there is an interruption or missing in the dependency), then there is an abnormality in the symbolic link, that is, the symbolic link cannot jump to the corresponding file or directory, and an error will be prompted instead.

[0041] Exemplarily, the operations of step 102 and step 103 may be completed using a Boolean satisfiability solver (SAT Solver) tool.

[0042] Step 104: Generate a detection result according to the solution result, wherein the detection result is used to indicate whether the target dynamic library includes an abnormal symbolic link.

[0043] The present application forms a symbol dependency graph by parsing multiple symbolic links of a dynamic library, and converts the symbol dependency graph into a Boolean expression, so as to convert the complex dependency relationship between multiple symbolic links in the dynamic library into an expression that can be processed by a computer. By solving the aforementioned Boolean expression, it is possible to determine whether each of the multiple symbolic links in the dynamic library is abnormal, and the manual processing method is replaced by the automated processing method, thereby avoiding the influence of human factors, conveniently realizing comprehensive detection of dynamic libraries in the operating system, and facilitating users to repair missing symbolic links in the operating system in a timely and accurate manner, thereby reducing the risk of failure during operation and maintenance of the operating system.

[0044] Based on the above settings, the symbolic links of dynamic libraries in the operating system can be managed to prevent and solve the problem of missing symbolic links in dynamic libraries, ensure that all necessary symbolic links exist in the operating system when the software is running, thereby improving the stability and reliability of the operating system.

[0045] In one embodiment, the solution result is further used to indicate: when there is an abnormality in the dependency relationship between the multiple symbolic links, the symbolic link corresponding to the abnormal dependency relationship and the abnormal reason of the abnormal dependency relationship;

[0046] The detection result is also used to indicate: when the target dynamic library includes an abnormal symbolic link, the abnormal symbolic link and the corresponding abnormal repair solution.

[0047] In this embodiment, in addition to detecting whether there is an abnormality in the symbolic link by solving the Boolean expression, the abnormal cause of the abnormal symbolic link is further detected, and then a corresponding abnormal repair plan is generated based on the abnormal cause to guide the user to quickly complete the repair of the abnormal symbolic link.

[0048] For example, you can Figures 2 to 5 As shown, Figure 2 A symbolic dependency graph is shown in Figure 2 It is shown in the figure that the startup of executable A (Executable A) depends on symbol 1 (symbol1), symbol 1 (symbol1) depends on dynamic library X (library address libX.so), and the startup of dynamic library X depends on symbol 3 (symbol3), and the version of symbol 3 (symbol3) is required to be greater than or equal to 2.0, symbol 3 (symbol3) depends on dynamic library Y (library address libY.so), and the version of symbol 3 (symbol3) started in dynamic library Y is 1.0. In addition, dynamic library Y can also start symbol 2 (symbol2).

[0049] in accordance with Figure 2 The Boolean expression obtained by converting the symbolic dependency graph shown is as follows Figure 3As shown, symbol 1 (S1) depends on symbol link 1 (S1_L), symbol 2 (S2) depends on symbol link 2 (S2_L), symbol link 1 (S1_L) depends on symbol link 3 (S3_L) and the version that symbol link 3 (S3_L) depends on is 1.0.

[0050] Use SAT Solver to Figure 3 The process of solving the Boolean expression shown is as follows Figure 4 As shown, start SATSolver first, then Figure 3 The CNF expression shown is added to the SAT Solver and solved based on the DPLL (Davis-Putnam-Logemann-Loveland) algorithm to determine whether there are unsatisfiable logical relationships (i.e., dependencies) in the Boolean expression. If so, the conflict and unresolved symbols are recorded.

[0051] based on Figure 4 The output solution can obtain conflicts and unresolved symbols and generate corresponding repair suggestions, such as updating or reinstalling specific dynamic libraries, such as Figure 5 As shown, for Figure 2 From the symbol dependency graph shown, it can be found that symbol 3 has a missing dependency problem, that is, dynamic library X requires the version of symbol 3 to be greater than or equal to 2.0, while the version of symbol 3 provided by dynamic library Y is only 1.0, which causes a conflict. The recommended solution is to check the specific version of symbol 3 provided by dynamic library Y, or to find other dynamic libraries to provide symbol 3.

[0052] In one embodiment, when the target dynamic library is a dynamic library used to update a first dynamic library in the operating system, and the detection result indicates that the target dynamic library includes an abnormal symbolic link, the method further includes:

[0053] Backing up the first dynamic library to obtain a backup dynamic library;

[0054] In the operating system, updating the first dynamic library to the target dynamic library;

[0055] The abnormal repair scheme includes: rolling back the abnormal symbolic link in the target dynamic library based on the backup dynamic library.

[0056] In this embodiment, before updating the first dynamic library based on the newly recorded target dynamic library, the symbolic link of the newly recorded target dynamic library is detected, and when an abnormal symbolic link is detected, the first dynamic library is backed up, and the first dynamic library is updated to the target dynamic library only after the backup is completed. While supporting the user's update operation on the first dynamic library, by backing up the first dynamic library in advance, after the user encounters a program failure due to the abnormal symbolic link in the target dynamic library, the abnormal symbolic link in the target dynamic library can be rolled back in time based on the backup dynamic library.

[0057] Among them, rolling back the abnormal symbolic link in the target dynamic library based on the backup dynamic library can be understood as: updating the abnormal symbolic link in the target dynamic library to the corresponding normal symbolic link in the backup dynamic library, and the correspondence between different symbolic links can be understood as different symbolic links have the same symbolic identifier, for example: the symbolic link S1 existing in dynamic library No. 1 and the symbolic link S1 existing in dynamic library No. 2, both of which have the same symbolic identifier S1.

[0058] In one embodiment, before parsing a plurality of symbolic links included in the target dynamic library to be detected in the operating system to obtain a symbolic dependency graph, the method further includes:

[0059] After the operating system is installed, each dynamic library in the operating system is scanned and registered to form a symbolic link information set, wherein the symbolic link information set includes: a plurality of symbolic link information, each symbolic link information includes a symbolic identifier, a dynamic library to which the symbolic link indicated by the symbolic identifier belongs, and a software package corresponding to the dynamic library to which the symbolic link indicated by the symbolic identifier belongs;

[0060] The abnormal repair scheme further includes: in the case where the backup dynamic library corresponding to the target dynamic library is missing, rolling back the abnormal symbolic link in the target dynamic library based on the symbolic link information set.

[0061] Specifically, the plurality of symbolic link information includes symbolic link information carrying a preset identifier, and the preset identifier is used to indicate that the symbolic link indicated by the symbolic identifier included in the corresponding symbolic link information is the latest symbolic link with a normal dependency relationship;

[0062] The step of rolling back data of abnormal symbolic links in the target dynamic library based on the symbolic link information set includes:

[0063] Determining target link information in the symbolic link information set according to the symbolic identifier of the abnormal symbolic link in the target dynamic library, wherein the target link information includes the symbolic identifier of the abnormal symbolic link, and the target link information carries the preset identifier;

[0064] Reinstall the dynamic library indicated by the target link information.

[0065] In this embodiment, after the operating system is installed, each dynamic library in the operating system is scanned to achieve full detection of symbolic links in the operating system, and a symbolic link information set that can be used to reinstall the dynamic library and / or software package corresponding to the symbolic link is formed, so that when a symbolic link abnormality is detected and the backup is missing, the user is supported to reinstall the dynamic library or software package based on the symbolic link information set, and then roll back the abnormal symbolic link based on the reinstalled dynamic library or software package.

[0066] Exemplarily, the preset identifier may be a “release” identifier.

[0067] The marking process of the preset identifier may be:

[0068] Get multiple symbolic link information corresponding to a symbolic identifier;

[0069] Perform dependency detection on the multiple symbolic links indicated by the multiple symbolic link information respectively, and determine at least one available symbolic link information, wherein the available symbolic link information is the symbolic link information of the indicated symbolic link being normal;

[0070] In at least one available symbolic link information, the available symbolic link information with the latest information generation time is marked based on the preset identifier.

[0071] Based on the setting of preset identifiers, users can easily retrieve data in the symbolic link information set, and then quickly determine the symbolic link information indicating the latest symbolic link with normal dependencies, so that users can repair abnormal symbolic links with minimal cost when backup is missing.

[0072] In one embodiment, after scanning each dynamic library in the operating system and registering to form a symbolic link information set, the method further includes:

[0073] Based on a preset periodic interval, periodically scan each dynamic library in the operating system, and update the symbolic link information set based on the scanning result;

[0074] The target dynamic library is a dynamic library in the operating system in a scanning cycle indicated by the preset period interval.

[0075] In this embodiment, each dynamic library in the operating system is periodically scanned, and the aforementioned symbolic link information set is updated according to the scanning results to ensure the timeliness and comprehensiveness of the symbolic link information set, thereby improving the management effect of multiple dynamic libraries in the operating system.

[0076] For ease of understanding, the following examples are provided:

[0077] First, after the operating system is installed, all binaries and dynamic libraries of the operating system are scanned, and relevant information (which can be understood as the aforementioned symbolic link information) is registered in the database, and a "release" label is added (which can be understood as the aforementioned preset identifier), wherein the related equipment includes but is not limited to: symbolic links, the dynamic libraries to which the symbolic links belong, whether the dynamic libraries to which the symbolic links belong are available, the software packages to which the symbolic links belong, whether the symbolic links are available, and other data.

[0078] After the above operations are completed, when the dynamic library is installed or updated in the operating system, the new dynamic library is scanned, and the corresponding information is registered in the aforementioned database according to the scanning results. If the scanning results show that the symbolic link in the new dynamic library is available, the "release" label is added, and the "release" label of the corresponding symbolic link information in the database is removed; if the scanning results show that the symbolic link in the new dynamic library is unavailable, only the corresponding information is entered into the database without any other processing.

[0079] Among them, when the user installs or modifies the dynamic library / binary file by manual operation, installation of source code package or manipulation based on the package manager, it is necessary to detect whether the newly added dynamic library and the existing symbolic links in the database match based on the aforementioned process (referring to extracting the dependency relationship between the symbolic links in the newly added dynamic library as a symbolic dependency graph, and converting the symbolic dependency graph into a Boolean expression, and determining whether there are abnormal symbolic links in the newly added dynamic library by solving the Boolean expression. If a mismatch is detected (referring to the existence of abnormal symbolic links in the newly added dynamic library), the user is alerted and the dynamic library to be modified by the newly added dynamic library (which can be understood as the aforementioned first dynamic library) is backed up.

[0080] Periodically scan the symbolic links of all dynamic libraries in the operating system and detect whether the symbolic links are abnormal. If abnormalities are detected, an alarm is issued to the user.

[0081] In the application, when a missing symbolic link is detected, if there is an available backup dynamic library, the user is supported to roll back the symbolic link from the backup dynamic library; if there is no unavailable backup dynamic library, based on the corresponding symbolic link information carrying the release tag, the dynamic library or software package to which the latest available symbolic link belongs indicated by the symbolic link information is reinstalled, completing the rollback of the symbolic link at the lowest cost.

[0082] For example, the function for scanning the symbolic links in the dynamic library can be as follows:

[0083] SymbolParsing(file_path):

[0084] Open ELF file at 'file_path'

[0085] Read'.dynsym'section

[0086] Initialize'imported_symbols'as empty list

[0087] Initialize'exported_symbols'as empty list

[0088] For each symbol in '.dynsym':

[0089] If symbol is global and undefined:

[0090] Add symbol to'imported_symbols'

[0091] If symbol is global and defined:

[0092] Add symbol to'exported_symbols'

[0093] Return'imported_symbols','exported_symbols'

[0094] Among them, file_path refers to the file path of the dynamic library, imported_symbols is used to store symbolic links in the import direction, and exported_symbols is used to store symbolic links in the export direction.

[0095] A function that converts symbolic links into a symbolic dependency graph can be as follows:

[0096] BuildDependencyGraph(executables):

[0097] Initialize graph'G'as directed graph

[0098] For each executable in'executables':

[0099] Extract'imported_symbols'and'exported_symbols'

[0100] Find 'dependencies' using ldd or other methods

[0101] For each imported symbol'imp'in'imported_symbols':

[0102] Add node'imp' to graph'G'

[0103] For each dependency'dep'in'dependencies':

[0104] Extract'dep_imported','dep_exported'

[0105] For each exported symbol'exp'in'dep_exported':

[0106] Add node 'exp' to graph 'G'

[0107] Add edge from'imp'to'exp'in graph'G'

[0108] Return graph 'G'

[0109] Among them, executables refers to the symbolic link information of all executable files and dynamic libraries in the operating system, and G refers to the symbolic dependency graph.

[0110] The function that analyzes the symbol dependency graph to detect missing symbol links and symbol link version mismatch issues is as follows:

[0111] SATResolver(graph):

[0112]

[0113] Here, graph refers to the symbolic dependency graph, and the function output is the unmet dependencies and conflict list in the symbolic dependency graph. If there are no unmet dependencies and conflict lists, "No solution found" is output.

[0114] The function that forms the detection result based on the analysis result of the symbolic dependency graph can be as follows:

[0115]

[0116] Among them, sat_output refers to the analysis results of the symbol dependency graph, and issues refers to the problem list of missing symbolic links and symbolic links with mismatched versions.

[0117] A function that forms a change suggestion based on a list of issues with missing symlinks and symlinks with mismatched versions could look like this:

[0118]

[0119] Print"Missing or mismatched symbol:",issue

[0120] Print"Suggested fix:Check for library updates or reinstallation."

[0121] Else:

[0122] Print"No symbol issues detected."

[0123] In this example, the above settings can effectively solve the problems caused by the missing symbolic links of dynamic libraries during software operation, and improve the stability and reliability of the operating system. This solution has the characteristics of high degree of automation, high management efficiency, and user-friendliness, and is suitable for various software development and operation environments.

[0124] For example: the solution described in this application can be applied to cloud service scenarios. After the user subscribes to the relevant services provided by the cloud operating system, the symbolic link management of the dynamic library in the cloud operating system can be implemented based on the above settings, so as to ensure the stability and maintainability of the operating system while flexibly replacing and adjusting the operating system based on its own actual needs.

[0125] See also Figure 6 , Figure 6 A dynamic library detection device provided by an embodiment of the present disclosure is as follows: Figure 6 As shown, the dynamic library detection device 600 includes:

[0126] A parsing module 601 is used to parse multiple symbolic links included in a target dynamic library to be detected in an operating system to obtain a symbolic dependency graph, wherein the symbolic dependency graph is used to represent dependency relationships between the multiple symbolic links;

[0127] A conversion module 602, used to convert the symbolic dependency graph into a Boolean expression;

[0128] A solution module 603, used for solving the Boolean expression to obtain a solution result, wherein the solution result is used to indicate whether each symbolic link in the plurality of symbolic links has an abnormality;

[0129] The result generation module 604 is used to generate a detection result according to the solution result, and the detection result is used to indicate whether the target dynamic library includes an abnormal symbolic link.

[0130] In one embodiment, the solution result is further used to indicate: when there is an abnormality in the dependency relationship between the multiple symbolic links, the symbolic link corresponding to the abnormal dependency relationship and the abnormal reason of the abnormal dependency relationship;

[0131] The detection result is also used to indicate: when the target dynamic library includes an abnormal symbolic link, the abnormal symbolic link and the corresponding abnormal repair solution.

[0132] In one embodiment, when the target dynamic library is a dynamic library used to update a first dynamic library in the operating system, and the detection result indicates that the target dynamic library includes an abnormal symbolic link, the device 600 further includes:

[0133] A backup module, used for backing up the first dynamic library to obtain a backup dynamic library;

[0134] An updating module, used for updating the first dynamic library to the target dynamic library in the operating system;

[0135] The abnormal repair scheme includes: rolling back the abnormal symbolic link in the target dynamic library based on the backup dynamic library.

[0136] In one embodiment, the apparatus 600 further includes:

[0137] An initial scanning module is used to scan each dynamic library in the operating system after the operating system is installed, and register to form a symbolic link information set, wherein the symbolic link information set includes: a plurality of symbolic link information, each of which includes a symbolic identifier, a dynamic library to which the symbolic link indicated by the symbolic identifier belongs, and a software package corresponding to the dynamic library to which the symbolic link indicated by the symbolic identifier belongs;

[0138] The abnormal repair scheme further includes: in the case where the backup dynamic library corresponding to the target dynamic library is missing, rolling back the abnormal symbolic link in the target dynamic library based on the symbolic link information set.

[0139] In one embodiment, the plurality of symbolic link information includes symbolic link information carrying a preset identifier, and the preset identifier is used to indicate that the symbolic link indicated by the symbolic identifier included in the corresponding symbolic link information is the latest symbolic link with a normal dependency relationship;

[0140] The step of rolling back data of abnormal symbolic links in the target dynamic library based on the symbolic link information set includes:

[0141] Determining target link information in the symbolic link information set according to the symbolic identifier of the abnormal symbolic link in the target dynamic library, wherein the target link information includes the symbolic identifier of the abnormal symbolic link, and the target link information carries the preset identifier;

[0142] Reinstall the dynamic library indicated by the target link information.

[0143] In one embodiment, the apparatus 600 further includes:

[0144] A periodic scanning module, used for periodically scanning each dynamic library in the operating system based on a preset periodic interval, and updating the symbolic link information set based on the scanning result;

[0145] The target dynamic library is a dynamic library in the operating system in a scanning cycle indicated by the preset period interval.

[0146] The dynamic library detection device 600 provided in the embodiment of the present disclosure can implement each process in the above-mentioned dynamic library detection method embodiment, and will not be described again here to avoid repetition.

[0147] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0148] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0149] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0150] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0151] The computing unit 701 can be various general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units for running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a dynamic library detection method. For example, in some embodiments, the dynamic library detection method can be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 700 via ROM 702 and / or a communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the dynamic library detection method described above can be executed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the dynamic library detection method in any other appropriate manner (eg, by means of firmware).

[0152] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0153] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0154] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0155] As used herein, the term "machine-readable medium" refers to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0156] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0157] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0158] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0159] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0160] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0161] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A dynamic library detection method, characterized in that: The method comprises: Parsing a plurality of symbolic links included in a target dynamic library to be detected in the operating system to obtain a symbolic dependency graph, wherein the symbolic dependency graph is used to represent dependency relationships between the plurality of symbolic links; Converting the symbolic dependency graph into a Boolean expression; Solving the Boolean expression to obtain a solution result, wherein the solution result is used to indicate whether each symbolic link among the plurality of symbolic links is abnormal; A detection result is generated according to the solution result, and the detection result is used to indicate whether the target dynamic library includes an abnormal symbolic link.

2. The dynamic library detection method according to claim 1, characterized in that: The solution result is also used to indicate: when there is an abnormality in the dependency relationship between the multiple symbolic links, the symbolic link corresponding to the abnormal dependency relationship and the abnormal reason of the abnormal dependency relationship; The detection result is also used to indicate: when the target dynamic library includes an abnormal symbolic link, the abnormal symbolic link and the corresponding abnormal repair solution.

3. The dynamic library detection method according to claim 2, characterized in that: In a case where the target dynamic library is a dynamic library used to update a first dynamic library in the operating system, and the detection result indicates that the target dynamic library includes an abnormal symbolic link, the method further includes: Backing up the first dynamic library to obtain a backup dynamic library; In the operating system, updating the first dynamic library to the target dynamic library; The abnormal repair scheme includes: rolling back the abnormal symbolic link in the target dynamic library based on the backup dynamic library.

4. The dynamic library detection method according to claim 2, characterized in that: Before parsing the multiple symbolic links included in the target dynamic library to be detected in the operating system to obtain the symbolic dependency graph, the method further includes: After the operating system is installed, each dynamic library in the operating system is scanned and registered to form a symbolic link information set, wherein the symbolic link information set includes: a plurality of symbolic link information, each symbolic link information includes a symbolic identifier, a dynamic library to which the symbolic link indicated by the symbolic identifier belongs, and a software package corresponding to the dynamic library to which the symbolic link indicated by the symbolic identifier belongs; The abnormal repair scheme further includes: in the case where the backup dynamic library corresponding to the target dynamic library is missing, rolling back the abnormal symbolic link in the target dynamic library based on the symbolic link information set.

5. The dynamic library detection method according to claim 4, characterized in that: The multiple symbolic link information includes symbolic link information carrying a preset identifier, where the preset identifier is used to indicate that the symbolic link indicated by the symbolic identifier included in the corresponding symbolic link information is the latest symbolic link with a normal dependency relationship; The step of rolling back data of abnormal symbolic links in the target dynamic library based on the symbolic link information set includes: Determining target link information in the symbolic link information set according to the symbolic identifier of the abnormal symbolic link in the target dynamic library, wherein the target link information includes the symbolic identifier of the abnormal symbolic link, and the target link information carries the preset identifier; Reinstall the dynamic library indicated by the target link information.

6. The method according to claim 4, characterized in that After scanning each dynamic library in the operating system and registering to form a symbolic link information set, the method further includes: Based on a preset periodic interval, periodically scan each dynamic library in the operating system, and update the symbolic link information set based on the scanning result; The target dynamic library is a dynamic library in the operating system in a scanning cycle indicated by the preset period interval.

7. A dynamic library detection device, characterized in that: The device comprises: A parsing module, used for parsing a plurality of symbolic links included in a target dynamic library to be detected in the operating system to obtain a symbolic dependency graph, wherein the symbolic dependency graph is used for representing dependency relationships between the plurality of symbolic links; A conversion module, used for converting the symbolic dependency graph into a Boolean expression; A solution module, used for solving the Boolean expression to obtain a solution result, wherein the solution result is used to indicate whether each symbolic link among the plurality of symbolic links has an abnormality; A result generating module is used to generate a detection result according to the solution result, wherein the detection result is used to indicate whether the target dynamic library includes an abnormal symbolic link.

8. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 6 when executed by the processor.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 6.