CN111984342A - Method and related device for loading dynamic link library - Google Patents

Method and related device for loading dynamic link library Download PDF

Info

Publication number
CN111984342A
CN111984342A CN202010915690.9A CN202010915690A CN111984342A CN 111984342 A CN111984342 A CN 111984342A CN 202010915690 A CN202010915690 A CN 202010915690A CN 111984342 A CN111984342 A CN 111984342A
Authority
CN
China
Prior art keywords
dynamic link
loading
dynamic
link libraries
test tool
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.)
Granted
Application number
CN202010915690.9A
Other languages
Chinese (zh)
Other versions
CN111984342B (en
Inventor
周凯兵
刘璞
黄燕
施展
吴传虎
黄竞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
iFlytek Co Ltd
Original Assignee
iFlytek Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by iFlytek Co Ltd filed Critical iFlytek Co Ltd
Priority to CN202010915690.9A priority Critical patent/CN111984342B/en
Publication of CN111984342A publication Critical patent/CN111984342A/en
Application granted granted Critical
Publication of CN111984342B publication Critical patent/CN111984342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method for loading a dynamic link library and a related device, wherein the method comprises the following steps: when a plurality of dynamic link libraries for delivering items exist in a preset storage path, acquiring a target dynamic loading sequence of the plurality of dynamic link libraries, wherein the target dynamic loading sequence is determined by the dependence of the plurality of dynamic link libraries; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence. Therefore, when a plurality of dynamic link libraries needing to be loaded with delivery items in the test tool are judged, the dependency relationships of the dynamic link libraries are considered, and a target dynamic loading sequence determined by the dependency relationships of the dynamic link libraries is obtained; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence so as to solve the problem that the dynamic link libraries for loading the delivery items by using the preset loading sequence in the test tool are necessary to be broken down.

Description

Method and related device for loading dynamic link library
Technical Field
The present application relates to the field of loading technologies, and in particular, to a method and a related apparatus for loading a dynamic link library.
Background
With the rapid development of technology, many delivery projects of android applications require testing to be implemented using testing tools. The dynamic link libraries for different delivery items are different and are generally obtained by adding or deleting the dynamic link libraries according to the self requirements, but the interfaces of the dynamic link libraries are basically unchanged. When testing different delivery projects by using a testing tool, an android application development tool android studio needs to be installed, engineering source codes of the testing tool are imported, different dynamic link libraries are replaced aiming at the different delivery projects, and the testing is realized by recompiling and packaging.
In order to avoid the problems of time and labor waste and low efficiency existing in the process of replacing different dynamic link libraries for different delivery items and recompiling and packaging, a mode of loading the dynamic link libraries in a test tool can be adopted, and the test of each delivery item by using the test tool is realized. In the prior art, loading the dynamic link library in the test tool generally loads a plurality of dynamic link libraries for delivering items by using a preset loading sequence, that is, static loading of the plurality of dynamic link libraries for delivering items is realized in the test tool.
However, after the delivery item adds, deletes or modifies the dynamic link libraries according to the self-requirement, a certain dependency relationship exists among the dynamic link libraries, and the preset loading sequence is still used in the process of loading the dynamic link libraries of the delivery item, so that the delivery item is extremely easy to crash.
Disclosure of Invention
In view of the above, embodiments of the present application provide a method and a related apparatus for loading dynamic link libraries, so as to solve the problem that a plurality of dynamic link libraries for loading delivery items in a test tool using a preset loading sequence are necessarily crashed.
In a first aspect, an embodiment of the present application provides a method for loading a dynamic link library, where the method includes:
if a plurality of dynamic link libraries for delivering items exist in a preset storage path, acquiring a target dynamic loading sequence of the plurality of dynamic link libraries; the target dynamic loading order is determined by the dependency relationship of the plurality of dynamic link libraries;
and loading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
Optionally, the obtaining a target dynamic loading order of the plurality of dynamic link libraries includes:
loading the plurality of dynamic link libraries in the test tool according to a preset loading sequence;
if the crash happens and the crash reason is that the dependency relationship of the dynamic link libraries does not accord with the preset loading sequence; adjusting the preset loading sequence based on the dependency relationship of the dynamic link libraries to obtain a target dynamic loading sequence of the dynamic link libraries; the crash reason is obtained from analyzing a crash log.
Optionally, if a dynamic loading sequence configuration file exists in a preset storage path, the preset loading sequence is a dynamic loading sequence specified by the dynamic loading sequence configuration file; and if the preset storage path does not have the dynamic loading sequence configuration file, the preset loading sequence is the dynamic loading sequence appointed by the test tool.
Optionally, the loading the plurality of dynamic link libraries in the test tool according to the target dynamic loading order specifically includes:
and reloading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
Optionally, the obtaining a target dynamic loading order of the plurality of dynamic link libraries includes:
obtaining the dependency relationships of the plurality of dynamic link libraries by using a dependency relationship viewing tool;
and obtaining the target dynamic loading sequence of the dynamic link libraries based on the dependency relationship of the dynamic link libraries.
Optionally, the method further includes:
pre-compiling a first version test tool and a second version test tool; the first version test tool comprises a dynamic link library of each platform architecture, and the second version test tool comprises a dynamic link library of a preset platform architecture.
Optionally, the method further includes:
if the platform architecture corresponding to the delivery project is consistent with the platform architectures corresponding to the dynamic link libraries of the delivery project, determining the first version test tool as the test tool;
if the platform architecture corresponding to the delivered project is inconsistent with the platform architectures corresponding to the dynamic link libraries of the delivered project, determining the second version test tool as the test tool; the preset platform architecture is a platform architecture corresponding to a plurality of dynamic link libraries of the delivery item.
In a second aspect, an embodiment of the present application provides an apparatus for loading a dynamically linked library, where the apparatus includes:
the device comprises an obtaining unit, a judging unit and a judging unit, wherein the obtaining unit is used for obtaining a target dynamic loading sequence of a plurality of dynamic link libraries if the preset storage path has a plurality of dynamic link libraries for delivering items; the target dynamic loading order is determined by the dependency relationship of the plurality of dynamic link libraries;
and the loading unit is used for loading the dynamic link libraries in the test tool according to the target dynamic loading sequence.
Optionally, the obtaining unit includes a loading subunit and a first obtaining subunit;
the loading subunit is configured to load the plurality of dynamic link libraries in the test tool according to a preset loading order;
the first obtaining subunit is configured to, if a crash occurs and a cause of the crash is that the dependency relationships of the plurality of dynamic link libraries do not conform to the preset loading sequence; adjusting the preset loading sequence based on the dependency relationship of the dynamic link libraries to obtain a target dynamic loading sequence of the dynamic link libraries; the crash reason is obtained from analyzing a crash log.
Optionally, if a dynamic loading sequence configuration file exists in a preset storage path, the preset loading sequence is a dynamic loading sequence specified by the dynamic loading sequence configuration file; and if the preset storage path does not have the dynamic loading sequence configuration file, the preset loading sequence is the dynamic loading sequence appointed by the test tool.
Optionally, the loading unit is specifically configured to:
and reloading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
Optionally, the obtaining unit includes a second obtaining subunit and a third obtaining subunit;
the second obtaining subunit is configured to obtain the dependency relationships of the plurality of dynamic link libraries by using a dependency relationship viewing tool;
the third obtaining subunit is configured to obtain a target dynamic loading order of the plurality of dynamic link libraries based on the dependency relationships of the plurality of dynamic link libraries.
Optionally, the apparatus further comprises a compiling unit;
the compiling unit is used for compiling a first version testing tool and a second version testing tool in advance; the first version test tool comprises a dynamic link library of each platform architecture, and the second version test tool comprises a dynamic link library of a preset platform architecture.
Optionally, the apparatus further includes a first determining unit and a second determining unit;
the first determining unit is configured to determine the first version test tool as the test tool if a platform architecture corresponding to the delivery item is consistent with platform architectures corresponding to the plurality of dynamic link libraries of the delivery item;
the second determining unit is configured to determine the second version test tool as the test tool if a platform architecture corresponding to the delivery item is inconsistent with platform architectures corresponding to the plurality of dynamic link libraries of the delivery item; the preset platform architecture is a platform architecture corresponding to a plurality of dynamic link libraries of the delivery item.
In a third aspect, an embodiment of the present application provides a terminal device, where the terminal device includes a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the method for loading a dynamically linked library according to any one of the first aspect described above according to instructions in the program code.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing program code for executing the method for loading a dynamically linked library according to any one of the above first aspects.
Compared with the prior art, the method has the advantages that:
by adopting the technical scheme of the embodiment of the application, when the preset storage path has a plurality of dynamic link libraries for delivering the project, the target dynamic loading sequence of the plurality of dynamic link libraries is obtained, and the target dynamic loading sequence is determined by the dependency relationship of the plurality of dynamic link libraries; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence. Therefore, when a plurality of dynamic link libraries needing to be loaded with delivery items in the test tool are judged, the dependency relationships of the dynamic link libraries are considered, and a target dynamic loading sequence determined by the dependency relationships of the dynamic link libraries is obtained; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence so as to solve the problem that the dynamic link libraries for loading the delivery items by using the preset loading sequence in the test tool are necessary to be broken down.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a system framework related to an application scenario in an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for loading a dynamic link library according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an apparatus for loading a dynamic link library according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
At the present stage, in order to avoid the problems that when a testing tool is used for testing different delivery projects, an android application development tool android studio needs to be installed, engineering source codes of the testing tool are imported, different dynamic link libraries are replaced aiming at the different delivery projects, and the problems of time and labor waste and low efficiency are caused when the testing tool is used for compiling and packaging again to realize testing; the test tool can be used for testing different delivery items in a mode of loading a plurality of dynamic link libraries of the delivery items in the test tool by utilizing a preset loading sequence. However, after the delivery item adds, deletes or modifies the dynamic link libraries according to the self-requirement, a certain dependency relationship exists among the dynamic link libraries, and the preset loading sequence is still used in the process of loading the dynamic link libraries of the delivery item, so that the delivery item is extremely easy to crash.
In order to solve the problem, in the embodiment of the application, when a plurality of dynamic link libraries for delivering items exist in a preset storage path, a target dynamic loading sequence of the plurality of dynamic link libraries is obtained, wherein the target dynamic loading sequence is determined by the dependency relationship of the plurality of dynamic link libraries; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence. Therefore, when a plurality of dynamic link libraries needing to be loaded with delivery items in the test tool are obtained through judgment, the dependency relationships of the dynamic link libraries are considered, and a target dynamic loading sequence determined by the dependency relationships of the dynamic link libraries is obtained; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence so as to solve the problem that the dynamic link libraries for loading the delivery items by using the preset loading sequence in the test tool are necessary to be broken down.
For example, one of the scenarios in the embodiment of the present application may be applied to the scenario shown in fig. 1, where the scenario includes the terminal device 101, the processor 102, and the test tool 103. When the processor 102 judges that a plurality of dynamic link libraries for delivering items exist in a preset storage path of the terminal device 101, the processor 102 obtains a target dynamic loading sequence of the plurality of dynamic link libraries; the processor 102 loads the plurality of dynamically linked libraries in the test tool 103 according to the target dynamic loading order.
First, in the application scenario described above, although the actions of the embodiments provided in the embodiments of the present application are described as being performed by the processor 102; however, the embodiments of the present application are not limited in terms of executing subjects as long as the actions disclosed in the embodiments provided by the embodiments of the present application are executed.
Next, the above scenario is only one example of the scenario provided in the embodiment of the present application, and the embodiment of the present application is not limited to this scenario.
The following describes in detail a specific implementation manner of the method for loading a dynamic link library and a related apparatus in the embodiment of the present application by way of an embodiment with reference to the accompanying drawings.
Exemplary method
Referring to fig. 2, a flowchart of a method for loading a dynamic link library in an embodiment of the present application is shown. In this embodiment, the method may include, for example, the steps of:
step 201: if a plurality of dynamic link libraries for delivering items exist in a preset storage path, acquiring a target dynamic loading sequence of the plurality of dynamic link libraries; the target dynamic loading order is determined by the dependency relationships of the plurality of dynamically linked libraries.
In the embodiment of the application, whether a plurality of dynamic link libraries for delivering items exist in a preset storage path of the terminal equipment needs to be judged; if so, indicating that a plurality of dynamic link libraries of the delivery items need to be loaded in the test tool; if not, multiple dynamically linked libraries representing items not to be delivered need to be loaded in the test tool.
Secondly, because the plurality of dynamic link libraries for loading the delivery items in the test tool at present refer to the plurality of dynamic link libraries for loading the delivery items by using the preset loading sequence; after the delivery item adds, deletes or modifies the dynamic link libraries according to the self requirements, a certain dependency relationship exists among a plurality of dynamic link libraries; the prior art is adopted to load a plurality of dynamic link libraries of delivery items by utilizing a preset loading sequence, and if the dependency relationship of the plurality of dynamic link libraries does not accord with the preset loading sequence, the dynamic link libraries are extremely easy to crash. Therefore, in the embodiment of the present application, it is necessary to obtain one dynamic loading order determined by the dependency relationship of the plurality of dynamic link libraries for delivering the item as the target dynamic loading order of the plurality of dynamic link libraries for delivering the item.
Specifically, in the embodiment of the present application, at least the following two alternative specific implementations may be adopted in step 201:
in a first optional embodiment of step 201, first, a plurality of dynamic link libraries for delivering items are loaded in a test tool according to a preset loading sequence; then, monitoring the loading process of a plurality of dynamic link libraries, and analyzing a crash reason obtained by a crash log when the loading process crashes; if the crash reason is that the dependency relationships of the plurality of dynamic link libraries do not conform to the preset loading sequence, at this time, the preset loading sequence needs to be adjusted according to the dependency relationships of the plurality of dynamic link libraries to obtain a new dynamic loading sequence as the target dynamic loading sequence of the plurality of dynamic link libraries. Therefore, in an optional implementation manner of this embodiment of the present application, the step 201 may include, for example, the following steps:
step A: loading the plurality of dynamic link libraries in the test tool according to a preset loading sequence;
and B: if the crash happens and the crash reason is that the dependency relationship of the dynamic link libraries does not accord with the preset loading sequence; adjusting the preset loading sequence based on the dependency relationship of the dynamic link libraries to obtain a target dynamic loading sequence of the dynamic link libraries; the crash reason is obtained from analyzing a crash log.
In the embodiment of the application, the preset loading sequence has two sources, one is a dynamic loading sequence configuration file existing in a preset storage path, and the dynamic loading sequence configuration file is configured in advance by a technician and is used for specifying the dynamic loading sequence; the other is a test tool, and the dynamic loading order is the dynamic loading order that a technician empirically specifies when compiling the test tool. For example, it may be default that the priority of the dynamic loading order specified by the dynamic loading order configuration file is higher than the dynamic loading order specified by the test tool, that is, when the dynamic loading order configuration file exists in the preset storage path, the dynamic loading order specified by the dynamic loading order configuration file is preferentially taken as the preset loading order; and otherwise, taking the dynamic loading sequence specified by the test tool as a preset loading sequence. Therefore, in an optional implementation manner of the embodiment of the present application, if a dynamic loading order configuration file exists in a preset storage path, the preset loading order is a dynamic loading order specified by the dynamic loading order configuration file; and if the preset storage path does not have the dynamic loading sequence configuration file, the preset loading sequence is the dynamic loading sequence appointed by the test tool.
As an example, the plurality of dynamic link libraries for the delivered item are "dynamic link library a, dynamic link library B, and dynamic link library C", and the preset loading order is "dynamic link library a-dynamic link library B-dynamic link library C". Loading a plurality of dynamic link libraries, namely a dynamic link library A, a dynamic link library B and a dynamic link library C, in a test tool according to a preset loading sequence; if the crash occurs and the crash reason obtained by analyzing the crash log is that the dynamic link library A depends on the dynamic link library B because of the dependency relationship of the dynamic link libraries, and the dynamic link library C depends on the dynamic link library A and does not accord with the preset loading sequence of the dynamic link library A, the dynamic link library B and the dynamic link library C; according to the dependency relationship of the dynamic link libraries, namely ' the dynamic link library A depends on the dynamic link library B ', the dynamic link library C depends on the dynamic link library A ' to adjust the preset loading sequence ' the dynamic link library A-the dynamic link library B-the dynamic link library C ', and the ' the dynamic link library B ' is adjusted to be before the ' the dynamic link library A ', namely, the target dynamic loading sequence of the dynamic link libraries is ' the dynamic link library B-the dynamic link library A-the dynamic link library C '.
In addition, in this embodiment of the application, on the basis of the steps a to B, the crash may be further prompted to the user, and the prompt may specifically be, for example: "the plurality of dynamic link libraries for loading the delivered items in the test tool according to the preset loading sequence are crashed, and the reason of the crash is that the dependency relationship of the plurality of dynamic link libraries for delivering the items does not accord with the preset loading sequence".
In a second optional implementation manner of step 201, a plurality of dynamic link libraries for delivering items are not loaded in the test tool according to the preset loading order, regardless of the preset loading order, so as to avoid a crash in the loading process; the dependency relationship of a plurality of dynamic link libraries is obtained by using a dependency relationship viewing tool, and then a dynamic loading sequence is directly obtained as a target dynamic loading sequence of the plurality of dynamic link libraries according to the dependency relationship of the plurality of dynamic link libraries. Therefore, in an optional implementation manner of this embodiment of the present application, the step 201 may include, for example, the following steps:
and C: obtaining the dependency relationships of the plurality of dynamic link libraries by using a dependency relationship viewing tool;
step D: and obtaining the target dynamic loading sequence of the dynamic link libraries based on the dependency relationship of the dynamic link libraries.
As an example, the plurality of dynamic link libraries for the delivered project are "dynamic link library a, dynamic link library B, and dynamic link library C", and the dependency relationship of the plurality of dynamic link libraries obtained by using the dependency relationship check tool is that "dynamic link library a depends on dynamic link library B, and dynamic link library C depends on dynamic link library a"; according to the dependency relationship of the dynamic link libraries, a dynamic loading sequence of 'dynamic link library B-dynamic link library A-dynamic link library C' can be obtained and used as a target dynamic loading sequence of the dynamic link libraries, and the target dynamic loading sequence of the dynamic link libraries is 'dynamic link library B-dynamic link library A-dynamic link library C'.
Step 202: and loading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
In the embodiment of the present application, after obtaining the target dynamic loading sequence of the plurality of dynamic link libraries for the delivery item in step 201, the plurality of dynamic link libraries for the delivery item need to be loaded by using the target dynamic loading sequence. Because the dependency relationship of the plurality of dynamic link libraries for the delivered item conforms to the target dynamic loading sequence, the step 202 can be executed to solve the problem that the plurality of dynamic link libraries for loading the delivered item in the test tool by using the preset loading sequence are necessary to be broken down, so that the plurality of dynamic link libraries for the delivered item are successfully loaded in the test tool, and the test tool can successfully use the interface of the dynamic link libraries to test the delivered item.
Specifically, in the embodiment of the present application, corresponding to two alternative specific implementations of step 201, at least the following two alternative specific implementations of step 202 may be adopted:
in a first optional specific implementation manner of step 202, when step 201 includes steps a to B, loading multiple dynamic link libraries in a test tool according to a preset loading order to cause a crash, and after obtaining a target dynamic loading order of the multiple dynamic link libraries, reloading the multiple dynamic link libraries in the test tool according to the target dynamic loading order; through the mode of reloading, the problem that the dynamic link libraries for loading the delivery items in the test tool are necessarily broken down is solved. Therefore, in an optional implementation manner of this embodiment of the present application, the step 202 may specifically be, for example: and reloading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
In a second optional specific implementation manner of step 202, when step 201 includes steps C to D, the plurality of dynamic link libraries are not loaded in the test tool, and after a target dynamic loading sequence of the plurality of dynamic link libraries is obtained, the plurality of dynamic link libraries may be directly loaded in the test tool according to the target dynamic loading sequence, so as to solve the problem that the plurality of dynamic link libraries for loading the delivery items in the test tool by using the preset loading sequence have a crash. Therefore, in an optional implementation manner of this embodiment of the present application, the step 202 may specifically be, for example: and directly loading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
In addition, a delivery project of the android application generally selects a dynamic link library of the platform architecture consistent with the self platform architecture according to the corresponding self platform architecture, a testing tool in the prior art generally has a dynamic link library of each platform architecture, for example, a dynamic link library of arm32, a dynamic link library of arm64, a dynamic link library of x86-64, and the like, and the testing tool generally loads a dynamic link library of the platform architecture consistent with the self platform architecture according to the self platform architecture corresponding to the delivery project based on the above characteristics of the android application.
However, for some specific delivery items, the corresponding platform architecture of the specific delivery items is inconsistent with the platform architectures of the specific delivery items corresponding to the dynamic link libraries; in this case, using the test tool in the prior art, loading a plurality of dynamic link libraries of the delivery item in the test tool, and loading a dynamic link library of a platform architecture consistent with the own platform architecture according to the own platform architecture corresponding to the specific delivery item; rather than a dynamically linked library that is consistent with the platform architecture corresponding to the dynamically linked library for that particular delivery item, the loading process must break down.
For example, the self platform architecture corresponding to the delivery item 1 is arm64, and the platform architectures corresponding to the multiple dynamic link libraries of the delivery item 1 are arm32 (for compatibility of the platform architecture, the dynamic link library of arm32 can be used when the self platform architecture is arm64 in the android application); in this case, using the testing tool in the prior art, loading multiple dynamic link libraries for delivery item 1 in the testing tool would load the dynamic link library for arm64 instead of the dynamic link library for arm32 according to the own platform architecture arm64 corresponding to delivery item 1, resulting in a necessary crash of the loading process.
At present, in order to solve the above-mentioned crash problem, a way of recompiling a specific delivery item is generally adopted, so that platform architectures corresponding to a plurality of dynamic link libraries of the specific delivery item are consistent with their corresponding platform architectures; however, recompiling the delivery items involves a large amount of work, which makes the original specific delivery items unusable due to historical reasons. Therefore, in the embodiment of the present application, when the test tool is compiled, the above situation is considered, and not only a version of the test tool including the dynamic link library of each platform architecture is compiled as a first version of the test tool, so as to satisfy the common delivery item; the platform architecture corresponding to the common delivery item is consistent with the platform architectures corresponding to the dynamic link libraries of the common delivery item. Compiling a version of test tool of a dynamic link library comprising a preset platform architecture as a second version of test tool to meet specific delivery items; the self platform architecture corresponding to the specific delivery item is inconsistent with the platform architectures corresponding to the dynamic link libraries of the specific delivery item. That is, in an optional implementation manner of the embodiment of the present application, the method may further include, for example, step E: pre-compiling a first version test tool and a second version test tool; the first version test tool comprises a dynamic link library of each platform architecture, and the second version test tool comprises a dynamic link library of a preset platform architecture.
In this embodiment of the application, on the basis of the step E, when there are multiple dynamic link libraries for delivering the item in the preset storage path and multiple dynamic link libraries for delivering the item need to be loaded in the test tool, it is further necessary to determine whether a platform architecture corresponding to the delivered item is consistent with a platform architecture corresponding to the multiple dynamic link libraries for delivering the item, so as to select one of the first version test tool and the second version test tool as the test tool. Specifically, if the test result is consistent, selecting a first version test tool as the test tool; and if the test result is inconsistent, selecting the second version test tool as the test tool. Therefore, in an optional implementation manner of the embodiment of the present application, after step E, for example, the following steps may be further included:
step F: if the platform architecture corresponding to the delivery project is consistent with the platform architectures corresponding to the dynamic link libraries of the delivery project, determining the first version test tool as the test tool;
step G: if the platform architecture corresponding to the delivered project is inconsistent with the platform architectures corresponding to the dynamic link libraries of the delivered project, determining the second version test tool as the test tool; the preset platform architecture is a platform architecture corresponding to a plurality of dynamic link libraries of the delivery item.
Through various implementation manners provided by the embodiment, when a preset storage path has a plurality of dynamic link libraries for delivering items, a target dynamic loading sequence of the plurality of dynamic link libraries is obtained, wherein the target dynamic loading sequence is determined by the dependency relationship of the plurality of dynamic link libraries; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence. Therefore, when a plurality of dynamic link libraries needing to be loaded with delivery items in the test tool are judged, the dependency relationships of the dynamic link libraries are considered, and a target dynamic loading sequence determined by the dependency relationships of the dynamic link libraries is obtained; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence so as to solve the problem that the dynamic link libraries for loading the delivery items by using the preset loading sequence in the test tool are necessary to be broken down.
Exemplary devices
Referring to fig. 3, a schematic structural diagram of an apparatus for loading a dynamic link library in an embodiment of the present application is shown. In this embodiment, the apparatus may specifically include:
an obtaining unit 301, configured to obtain a target dynamic loading order of multiple dynamic link libraries if multiple dynamic link libraries for delivering a project exist in a preset storage path; the target dynamic loading order is determined by the dependency relationship of the plurality of dynamic link libraries;
a loading unit 302, configured to load the plurality of dynamic link libraries in the test tool according to the target dynamic loading order.
In an optional implementation manner of this embodiment of the present application, the obtaining unit 301 includes a loading subunit and a first obtaining subunit;
the loading subunit is configured to load the plurality of dynamic link libraries in the test tool according to a preset loading order;
the first obtaining subunit is configured to, if a crash occurs and a cause of the crash is that the dependency relationships of the plurality of dynamic link libraries do not conform to the preset loading sequence; adjusting the preset loading sequence based on the dependency relationship of the dynamic link libraries to obtain a target dynamic loading sequence of the dynamic link libraries; the crash reason is obtained from analyzing a crash log.
In an optional implementation manner of the embodiment of the present application, if a dynamic loading order configuration file exists in a preset storage path, the preset loading order is a dynamic loading order specified by the dynamic loading order configuration file; and if the preset storage path does not have the dynamic loading sequence configuration file, the preset loading sequence is the dynamic loading sequence appointed by the test tool.
In an optional implementation manner of the embodiment of the present application, the loading unit 302 is specifically configured to:
and reloading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
In an optional implementation manner of this embodiment of the present application, the obtaining unit 301 includes a second obtaining subunit and a third obtaining subunit;
the second obtaining subunit is configured to obtain the dependency relationships of the plurality of dynamic link libraries by using a dependency relationship viewing tool;
the third obtaining subunit is configured to obtain a target dynamic loading order of the plurality of dynamic link libraries based on the dependency relationships of the plurality of dynamic link libraries.
In an optional implementation manner of the embodiment of the present application, the apparatus further includes a compiling unit;
the compiling unit is used for compiling a first version testing tool and a second version testing tool in advance; the first version test tool comprises a dynamic link library of each platform architecture, and the second version test tool comprises a dynamic link library of a preset platform architecture.
In an optional implementation manner of the embodiment of the present application, the apparatus further includes a first determining unit and a second determining unit;
the first determining unit is configured to determine the first version test tool as the test tool if a platform architecture corresponding to the delivery item is consistent with platform architectures corresponding to the plurality of dynamic link libraries of the delivery item;
the second determining unit is configured to determine the second version test tool as the test tool if a platform architecture corresponding to the delivery item is inconsistent with platform architectures corresponding to the plurality of dynamic link libraries of the delivery item; the preset platform architecture is a platform architecture corresponding to a plurality of dynamic link libraries of the delivery item.
Through various implementation manners provided by this embodiment, an apparatus for loading a dynamic link library includes an obtaining unit and a loading unit, where the obtaining unit is configured to obtain a target dynamic loading order of a plurality of dynamic link libraries when the plurality of dynamic link libraries for a delivery item exist in a preset storage path, and the target dynamic loading order is determined by a dependency relationship of the plurality of dynamic link libraries; the loading unit is used for loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence. Therefore, when a plurality of dynamic link libraries needing to be loaded with delivery items in the test tool are judged, the dependency relationships of the dynamic link libraries are considered, and a target dynamic loading sequence determined by the dependency relationships of the dynamic link libraries is obtained; and loading a plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence so as to solve the problem that the dynamic link libraries for loading the delivery items by using the preset loading sequence in the test tool are necessary to be broken down.
In addition, an embodiment of the present application further provides a terminal device, where the terminal device includes a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is used for executing the method for loading the dynamic link library according to the instructions in the program code.
The embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium is configured to store a program code, where the program code is configured to execute the method for loading a dynamic link library according to the foregoing method embodiment.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a preferred embodiment of the present application and is not intended to limit the present application in any way. Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application. Those skilled in the art can now make numerous possible variations and modifications to the disclosed embodiments, or modify equivalent embodiments, using the methods and techniques disclosed above, without departing from the scope of the claimed embodiments. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present application still fall within the protection scope of the technical solution of the present application without departing from the content of the technical solution of the present application.

Claims (10)

1. A method for loading a dynamically linked library, comprising:
if a plurality of dynamic link libraries for delivering items exist in a preset storage path, acquiring a target dynamic loading sequence of the plurality of dynamic link libraries; the target dynamic loading order is determined by the dependency relationship of the plurality of dynamic link libraries;
and loading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
2. The method of claim 1, wherein obtaining the target dynamic loading order of the plurality of dynamically linked libraries comprises:
loading the plurality of dynamic link libraries in the test tool according to a preset loading sequence;
if the crash happens and the crash reason is that the dependency relationship of the dynamic link libraries does not accord with the preset loading sequence; adjusting the preset loading sequence based on the dependency relationship of the dynamic link libraries to obtain a target dynamic loading sequence of the dynamic link libraries; the crash reason is obtained from analyzing a crash log.
3. The method according to claim 2, wherein if a dynamic loading order configuration file exists in a preset storage path, the preset loading order is a dynamic loading order specified by the dynamic loading order configuration file; and if the preset storage path does not have the dynamic loading sequence configuration file, the preset loading sequence is the dynamic loading sequence appointed by the test tool.
4. The method of claim 2, wherein the plurality of dynamic link libraries are loaded in the test tool according to the target dynamic loading order, specifically:
and reloading the plurality of dynamic link libraries in the test tool according to the target dynamic loading sequence.
5. The method of claim 1, wherein obtaining the target dynamic loading order of the plurality of dynamically linked libraries comprises:
obtaining the dependency relationships of the plurality of dynamic link libraries by using a dependency relationship viewing tool;
and obtaining the target dynamic loading sequence of the dynamic link libraries based on the dependency relationship of the dynamic link libraries.
6. The method of claim 1, further comprising:
pre-compiling a first version test tool and a second version test tool; the first version test tool comprises a dynamic link library of each platform architecture, and the second version test tool comprises a dynamic link library of a preset platform architecture.
7. The method of claim 6, further comprising:
if the platform architecture corresponding to the delivery project is consistent with the platform architectures corresponding to the dynamic link libraries of the delivery project, determining the first version test tool as the test tool;
if the platform architecture corresponding to the delivered project is inconsistent with the platform architectures corresponding to the dynamic link libraries of the delivered project, determining the second version test tool as the test tool; the preset platform architecture is a platform architecture corresponding to a plurality of dynamic link libraries of the delivery item.
8. An apparatus for loading a dynamically linked library, comprising:
the device comprises an obtaining unit, a judging unit and a judging unit, wherein the obtaining unit is used for obtaining a target dynamic loading sequence of a plurality of dynamic link libraries if the preset storage path has a plurality of dynamic link libraries for delivering items; the target dynamic loading order is determined by the dependency relationship of the plurality of dynamic link libraries;
and the loading unit is used for loading the dynamic link libraries in the test tool according to the target dynamic loading sequence.
9. A terminal device, comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the method for loading a dynamically linked library of any of claims 1-7 according to instructions in the program code.
10. A computer-readable storage medium for storing program code for performing the method of loading a dynamically linked library of any of claims 1-7.
CN202010915690.9A 2020-09-03 2020-09-03 Method and related device for loading dynamic link library Active CN111984342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010915690.9A CN111984342B (en) 2020-09-03 2020-09-03 Method and related device for loading dynamic link library

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010915690.9A CN111984342B (en) 2020-09-03 2020-09-03 Method and related device for loading dynamic link library

Publications (2)

Publication Number Publication Date
CN111984342A true CN111984342A (en) 2020-11-24
CN111984342B CN111984342B (en) 2023-04-07

Family

ID=73448054

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010915690.9A Active CN111984342B (en) 2020-09-03 2020-09-03 Method and related device for loading dynamic link library

Country Status (1)

Country Link
CN (1) CN111984342B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032046A (en) * 2021-03-29 2021-06-25 北京字节跳动网络技术有限公司 Method, device and equipment for repairing so file and storage medium
CN114237742A (en) * 2021-12-10 2022-03-25 北京奇艺世纪科技有限公司 Loading and compiling method and device of dynamic library, terminal and storage medium
CN115048155A (en) * 2022-08-11 2022-09-13 成都智暄科技有限责任公司 Method and system for loading dynamic library, computer readable storage medium and device
CN117742782A (en) * 2024-02-19 2024-03-22 成都九洲电子信息系统股份有限公司 Log data cross-language automatic recording method and system for software system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6463583B1 (en) * 1999-04-08 2002-10-08 Novadigm, Inc. Dynamic injection of execution logic into main dynamic link library function of the original kernel of a windowed operating system
US20050144608A1 (en) * 2003-12-26 2005-06-30 Hiroshi Oyama Operating system allowing running of real-time application programs, control method therefor, and method of loading dynamic link libraries
US20090013163A1 (en) * 2007-07-02 2009-01-08 Yuan Cheng Method and system for monitoring and adaptively pre-loading crucial dynamic link libraries
CN103415837A (en) * 2010-12-21 2013-11-27 现代重工业株式会社 Method for using real-time loading of DLL for AM CAD
CN106897080A (en) * 2015-12-18 2017-06-27 北京国双科技有限公司 The processing method and processing device of dynamic link library
CN109976820A (en) * 2019-04-09 2019-07-05 苏州浪潮智能科技有限公司 A kind of application program operation method and application architecture
CN110362356A (en) * 2018-04-09 2019-10-22 腾讯科技(深圳)有限公司 Function data processing method, device, computer equipment and storage medium
CN110362487A (en) * 2019-07-11 2019-10-22 腾讯科技(深圳)有限公司 A kind of test method and device of application program
CN111063432A (en) * 2019-12-13 2020-04-24 深圳开立生物医疗科技股份有限公司 Ultrasonic data processing method and device, ultrasonic equipment and storage medium
CN111104648A (en) * 2018-10-29 2020-05-05 鸿合科技股份有限公司 Software processing method and device, application program and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6463583B1 (en) * 1999-04-08 2002-10-08 Novadigm, Inc. Dynamic injection of execution logic into main dynamic link library function of the original kernel of a windowed operating system
US20050144608A1 (en) * 2003-12-26 2005-06-30 Hiroshi Oyama Operating system allowing running of real-time application programs, control method therefor, and method of loading dynamic link libraries
US20090013163A1 (en) * 2007-07-02 2009-01-08 Yuan Cheng Method and system for monitoring and adaptively pre-loading crucial dynamic link libraries
CN103415837A (en) * 2010-12-21 2013-11-27 现代重工业株式会社 Method for using real-time loading of DLL for AM CAD
CN106897080A (en) * 2015-12-18 2017-06-27 北京国双科技有限公司 The processing method and processing device of dynamic link library
CN110362356A (en) * 2018-04-09 2019-10-22 腾讯科技(深圳)有限公司 Function data processing method, device, computer equipment and storage medium
CN111104648A (en) * 2018-10-29 2020-05-05 鸿合科技股份有限公司 Software processing method and device, application program and electronic equipment
CN109976820A (en) * 2019-04-09 2019-07-05 苏州浪潮智能科技有限公司 A kind of application program operation method and application architecture
CN110362487A (en) * 2019-07-11 2019-10-22 腾讯科技(深圳)有限公司 A kind of test method and device of application program
CN111063432A (en) * 2019-12-13 2020-04-24 深圳开立生物医疗科技股份有限公司 Ultrasonic data processing method and device, ultrasonic equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
付林强: "基于三层架构的插件体系结构设计", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
姚砺: "一种改进的基于动态链接库的代码插装技术", 《山东师范大学学报(自然科学版)》 *
邢彬等: "一种可信计算平台完整性度量的新模型", 《信息网络安全》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032046A (en) * 2021-03-29 2021-06-25 北京字节跳动网络技术有限公司 Method, device and equipment for repairing so file and storage medium
WO2022206254A1 (en) * 2021-03-29 2022-10-06 北京字节跳动网络技术有限公司 So file repairing method and apparatus, device, and storage medium
CN114237742A (en) * 2021-12-10 2022-03-25 北京奇艺世纪科技有限公司 Loading and compiling method and device of dynamic library, terminal and storage medium
CN114237742B (en) * 2021-12-10 2023-09-01 北京奇艺世纪科技有限公司 Method, device, terminal and storage medium for loading and compiling dynamic library
CN115048155A (en) * 2022-08-11 2022-09-13 成都智暄科技有限责任公司 Method and system for loading dynamic library, computer readable storage medium and device
CN115048155B (en) * 2022-08-11 2022-11-15 成都智暄科技有限责任公司 Method and system for loading dynamic library, computer readable storage medium and device
CN117742782A (en) * 2024-02-19 2024-03-22 成都九洲电子信息系统股份有限公司 Log data cross-language automatic recording method and system for software system
CN117742782B (en) * 2024-02-19 2024-06-11 成都九洲电子信息系统股份有限公司 Log data cross-language automatic recording method and system for software system

Also Published As

Publication number Publication date
CN111984342B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN111984342B (en) Method and related device for loading dynamic link library
CN108399132B (en) Scheduling test method, device and storage medium
US8954930B2 (en) System and method for reducing test effort by object risk analysis
KR20190107664A (en) Smart Contract Processing Method and Device
US7069474B2 (en) System and method for assessing compatibility risk
US20130326486A1 (en) Keyword based software testing system and method
US20040054988A1 (en) Certification test suite
CN111045944A (en) Regression testing method, device and system and computer readable storage medium
CN113127347A (en) Interface testing method, device, equipment and readable storage medium
CN111338943A (en) Test method, test device, electronic equipment and readable storage medium
CN110543427B (en) Test case storage method and device, electronic equipment and storage medium
JP6891780B2 (en) Software quality judgment device, software quality judgment method, and software quality judgment program
CN115617780A (en) Data import method, device, equipment and storage medium
CN111984527A (en) Software performance testing method, device, equipment and medium
CN110362416B (en) Page component loading method and device, electronic equipment and storage medium
CN111078558B (en) Log storage method and device for automatic test and computer readable storage medium
CN107301105B (en) Method and device for checking hot patch or dynamic library
CN109684205B (en) System testing method, device, electronic equipment and storage medium
CN112540916A (en) Automatic rerun method and device for failed case, computer equipment and storage medium
KR101252358B1 (en) Apparatus and method for testing plc command
CN112558982B (en) Code detection method and device and computer equipment
CN115048082A (en) Micro front-end system construction method and device, server and readable storage medium
CN111209197B (en) Application continuous integration test method, system, equipment and storage medium
CN111143229A (en) Software testing method and device, computer equipment and computer readable storage medium
CN111352852A (en) Regression test case selection method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant