CN117130919A - Large-scale image loading problem detection method, device, equipment and computer medium - Google Patents

Large-scale image loading problem detection method, device, equipment and computer medium Download PDF

Info

Publication number
CN117130919A
CN117130919A CN202311093353.6A CN202311093353A CN117130919A CN 117130919 A CN117130919 A CN 117130919A CN 202311093353 A CN202311093353 A CN 202311093353A CN 117130919 A CN117130919 A CN 117130919A
Authority
CN
China
Prior art keywords
picture
application program
loading
target application
problem detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311093353.6A
Other languages
Chinese (zh)
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202311093353.6A priority Critical patent/CN117130919A/en
Publication of CN117130919A publication Critical patent/CN117130919A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • 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
    • 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

Abstract

The application provides a large-scale loading problem detection method, a device, equipment and a computer readable medium, wherein the application is used for realizing the detection of large-scale loading problems without modifying source codes by running a target application program, the target application program is generated after the large-scale loading problem detection codes are inserted into the source codes of the original application program in a byte code instrumentation mode, the large-scale loading problem detection codes are used for detecting the large-scale loading problems in the running process of the target application program, the detected large-scale loading information is written into a running log, the running log of the target application program is read, and whether the large-scale loading problems exist in the target application program is judged according to the existence of the large-scale loading information in the running log, so that the detection of the large-scale loading problems can be realized without modifying the source codes, and compared with the existing mode, the large-scale loading problems of the application program can be more efficiently and comprehensively detected.

Description

Large-scale image loading problem detection method, device, equipment and computer medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer readable medium for detecting a large map loading problem.
Background
This section is intended to provide a background or context to the embodiments of the application that are recited in the claims. The description herein is not to be taken as an admission of prior art as including in this section.
In the process of software development, loading a picture is a conventional operation and is also a relatively high-cost behavior, because loading a picture needs to go through multiple processes such as network request, VO read-write, memory occupation and the like. The current mainstream mode is to load pictures through open source libraries such as Coil, glide and the like, and the loading process is not needed to be concerned at all, however, through research, the following problems exist: the loaded pictures belong to large pictures, so that unnecessary performance waste is caused by loading pictures required for display, and meanwhile, OOM (Out Memory) can be caused, so that when performance optimization is performed on an application program, the loading Of the large pictures is a relatively important optimization direction, but in general, the code audit is performed manually to check the picture loading problem in the current code, and the following problems exist in the mode:
1. although the problem of large graph loading generated in the process of initializing the program can be checked, the problem of large graph loading caused by uploading the program through a network or a user in the running process is difficult to detect.
2. The program source code needs to be modified to check for large graph loading problems in the program.
In view of the foregoing, there is a need to provide a more efficient and comprehensive large graph load detection method.
Disclosure of Invention
Aspects of the present application provide a large-scale image loading problem detection method, apparatus, device, and computer-readable storage medium for detecting a large-scale image loading problem of an application more efficiently and comprehensively.
In one aspect of the present application, a method for detecting a large graph loading problem is provided, where the method includes:
the method comprises the steps of running a target application program, wherein the target application program is generated after a large-graph loading problem detection code is inserted into source codes of an original application program in a byte code instrumentation mode, and the large-graph loading problem detection code is used for detecting a large-graph loading problem in the running process of the target application program and writing detected large-graph loading information into a running log;
reading a running log of the target application program;
and judging whether the target application program has the problem of large graph loading according to whether the large graph loading information exists in the operation log.
In another aspect of the present application, there is provided a large map loading problem detection apparatus, wherein the apparatus includes:
the system comprises a target application program running module, a target application program running module and a target application program, wherein the target application program is generated by inserting a large-graph loading problem detection code into a source code of an original application program in a byte code instrumentation mode, the large-graph loading problem detection code is used for detecting a large-graph loading problem in the running process of the target application program, and the detected large-graph loading information is written into a running log;
the operation log reading module is used for reading the operation log of the target application program;
and the large-graph loading problem judging module is used for judging whether the large-graph loading problem exists in the target application program according to whether large-graph loading information exists in the operation log.
In another aspect of the present application, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the large map loading problem detection method as described above.
In another aspect of the present application, a computer readable storage medium having stored thereon computer program instructions executable by a processor to implement a large map loading problem detection method as described above is provided.
According to the scheme provided by the embodiment of the application, the target application program is generated by inserting the large-image loading problem detection code into the source code of the original application program in a byte code instrumentation mode, the large-image loading problem detection code is used for detecting the large-image loading problem in the whole running process of the target application program, the detected large-image loading information is written into the running log, the running log of the target application program is read, whether the large-image loading problem exists in the target application program is judged according to the existence of the large-image loading information in the running log, so that the large-image loading problem detection code can be inserted into the application program in a byte code instrumentation mode, the large-image loading problem can be detected without modifying the source code, and the large-image loading problem detection code is implanted into the target application program, so that the large-image loading problem can be monitored in real time in the whole running process of the target application program, and whether the large-image loading problem exists in the target application program can be judged by only reading the running log, and the large-image loading problem can be more comprehensively loaded according to the running log and the corresponding to the detection information in the existing application program.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
FIG. 1 is a flow chart of a method for detecting a large-scale loading problem according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for detecting a large-scale loading problem according to another embodiment of the present application;
FIG. 3 is a schematic diagram of a large-scale loading problem detection apparatus according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an electronic device suitable for implementing aspects of embodiments of the present application;
the same or similar reference numbers in the drawings refer to the same or similar parts.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In one exemplary configuration of the application, the terminal, the devices of the services network each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer-readable media include both permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer program instructions, data structures, modules of the program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device.
The embodiment of the application provides a large-scale loading problem detection method, a device, equipment and a computer readable storage medium, which are used for detecting large-scale loading problems of an application program more efficiently and comprehensively, and the large-scale loading problem detection code is inserted into source codes of an original application program in a byte code instrumentation mode to generate the large-scale loading problem detection code, the large-scale loading problem detection code is used for detecting the large-scale loading problem in the running process of the target application program, the detected large-scale loading information is written into a running log, the running log of the target application program is read, and whether the large-scale loading problem exists in the target application program is judged according to whether the large-scale loading information exists in the running log, so that the large-scale loading problem detection code can be detected without modifying the source codes, and the large-scale loading problem can be realized in the whole running process of the target application program, and the large-scale loading problem can be detected in real time, the large-scale loading problem can be detected in the whole running process of the target application program, and the large-scale loading problem can be more effectively loaded in the running log according to the fact that the large-scale loading problem can be detected by the large-scale loading problem is required to be more optimally loaded in the running log.
In an actual scenario, the execution body of the method may be a user device, or a device formed by integrating the user device and a network device through a network, or may also be an application running on the device, where the user device includes, but is not limited to, various terminal devices such as a computer, a mobile phone, a tablet computer, a smart watch, a bracelet, and the network device includes, but is not limited to, a network host, a single network server, a plurality of network server sets, or a computer set based on cloud computing, where the network device is implemented, and may be used to implement a part of processing functions when setting an alarm clock. Here, the Cloud is composed of a large number of hosts or web servers based on Cloud Computing (Cloud Computing), which is a kind of distributed Computing, one virtual computer composed of a group of loosely coupled computer sets.
Fig. 1 shows a processing flow of a large-scale loading problem detection method according to an embodiment of the present application, where the method at least includes the following processing steps:
step S101, a target application program is operated, wherein the target application program is generated by inserting a large-graph loading problem detection code into a source code of an original application program in a byte code instrumentation mode, the large-graph loading problem detection code is used for detecting a large-graph loading problem in the operation process of the target application program, and the detected large-graph loading information is written into an operation log.
Step S102, reading the operation log of the target application program.
Step S103, judging whether the target application program has a large-graph loading problem according to whether the large-graph loading information exists in the operation log.
According to the large-scale loading problem detection method provided by the embodiment of the application, the target application program is generated by inserting the large-scale loading problem detection code into the source code of the original application program in a byte code instrumentation mode, the large-scale loading problem detection code is used for detecting the large-scale loading problem in the running process of the target application program, the detected large-scale loading information is written into the running log, the running log of the target application program is read, whether the large-scale loading problem exists in the target application program is judged according to whether the large-scale loading information exists in the running log, and therefore the large-scale loading problem detection code can be inserted into the application program in a byte code instrumentation mode, the large-scale loading problem can be detected without modifying the source code, and because the large-scale loading problem detection code is embedded into the target application program, the large-scale loading problem can be monitored in real time in the whole running process of the target application program, and whether the large-scale loading problem exists in the running log can be judged by only reading the detected large-scale loading information, and the large-scale loading problem can be more fully loaded to the application program according to the existing loading problem detection mode.
In some variant embodiments, before the running the target application, the method further comprises:
acquiring a source code of an original application program;
inserting a large-graph loading problem detection code into the source code by adopting a compiling and packing tool in a byte code instrumentation mode, and generating an application program installation package after the byte code instrumentation is completed;
and deploying the target application program by installing the application program installation package.
According to the embodiment, the byte code instrumentation work can be realized by utilizing the compiling and packing tool, so that the large graph loading problem detection code is inserted into the source code, and the target application program is deployed by installing the application program installation package, so that the aim of automatically detecting the large graph loading problem after the target application program is operated is fulfilled.
Based on the above embodiments, in some modified embodiments, the inserting the large graph loading problem detection code in the source code by using a compiling and packing tool through a bytecode instrumentation mode includes:
extracting class files in the source codes;
and converting the class file into a byte code file by adopting a compiling and packing tool, and inserting a large map into the byte code file through byte code instrumentation to load a problem detection code.
According to the embodiment, the class file in the source code is used as a medium to insert the large-scale image loading problem detection code, and the method has the advantages of simplicity, easiness and difficulty in introducing code errors.
Based on the above embodiments, in some modified embodiments, the converting the class file into a bytecode file by using a compiling and packing tool, and inserting a large graph into the bytecode file through a bytecode instrumentation, where the loading problem detection code includes:
calling a compiling and packing tool to generate a large-graph loading problem detection file for byte code instrumentation according to the large-graph loading problem detection code;
and calling the compiling and packaging tool to convert the class file into a byte code file for compiling, and inserting the large-graph loading problem detection file into the byte code file in a byte code instrumentation mode in the compiling process.
The compiling and packaging tool is a compiling tool capable of converting an application program source code into a byte code for compiling and then packaging the byte code into an application program installation package, and is capable of executing operations such as byte code instrumentation, byte code replacement and the like at a byte code compiling stage.
In a specific implementation, the compiling and packaging tool is provided with an API (Application Programming Interface ), and each step of compiling operation can be controlled through the API provided by the compiling and packaging tool, for example, an operation is performed in a compiling process before an Android application program is packaged into a dex file, an input class file is converted into a target byte code file by traversing all methods of all class files, then the target byte code file is modified, and then a source file is replaced, so that the purpose of inserting codes can be achieved.
According to the embodiment, the aim of inserting byte codes can be efficiently and safely realized by utilizing the compiling and packing tool provided by the prior art, so that the large-graph loading problem detection code can be rapidly and safely inserted into the source code of the target application program.
In some variant embodiments, the running the target application includes:
and executing the large-graph loading problem detection code in the target application program while running the main program of the target application program.
The large-graph loading problem detection code can be executed all the time in the running process of the main program so as to realize real-time monitoring of the large-graph loading problem, and therefore, the large-graph loading problem is monitored in real time in the whole running process of the target application program.
On the basis of the above embodiments, in some modified embodiments, the performing the large-scale loading problem detection by executing the large-scale loading problem detection code in the target application program includes:
judging whether the target application program calls a picture loading method or not by executing a large picture loading problem detection code in the target application program;
if the picture loading method is called, obtaining picture loading information of a picture loaded by the picture loading method;
judging whether the picture is a large picture or not according to whether the picture loading information accords with a preset large picture loading condition or not;
if the picture is the large picture, the picture loading information is written into the operation log as the large picture loading information.
By the implementation mode, specific logic for detecting the large-scale loading problem according to the large-scale loading problem detection code is provided, and the large-scale loading problem can be detected in real time rapidly and accurately in the running process of the program.
Based on the foregoing embodiments, in some modified embodiments, the determining whether the picture is a large picture according to whether the picture loading information meets a preset large picture loading condition includes at least one of:
if the size of the picture is larger than a preset picture size threshold, judging that the picture is a large picture;
if the pixel size of the picture is larger than a preset pixel threshold value, judging that the picture is a large picture;
and if the loading time length of the picture is greater than a preset loading time length threshold value, judging that the picture is a large picture.
By the method, a plurality of examples of preset large-image loading conditions are given, whether the image is large-image or not can be comprehensively and accurately judged, and whether the large-image loading problem exists or not can be accurately judged. It should be noted that, the picture size threshold, the pixel threshold, the loading duration threshold and the like may be flexibly set according to actual requirements, the embodiment of the present application is not limited, and the loading condition of the above large picture is only exemplary, and those skilled in the art may flexibly change and implement on the basis of the above examples to achieve the purposes of the embodiment of the present application, which is also within the scope of protection of the present application.
For ease of understanding, the above-described large-scale loading problem detection method of the present application will be further described with reference to a specific example.
In a specific example, the above large image loading problem detection method provided by the embodiment of the present application is used to detect the large image loading problem of an application program, and by searching a imageload, imageview method for loading an image in a class file by means of inserting byte codes in a compiled binary class file of the program, and inserting code logic for recording the size of the image, the loading time of the image, etc. into the class file, the detection of the large image loading problem possibly existing in the program is realized without modifying code source codes.
Specifically, please refer to fig. 2, which is a flowchart illustrating a method for detecting a large-scale loading problem according to another embodiment of the present application, the method may include the following steps:
1. the project source code, i.e. the source code of the original application program, is obtained from a project source code management repository, e.g. a Gitlab, by a gitclone command.
2. And adding a biggest image loading problem detection file which is a biggest image file used for modifying the class file in the original application program based on the byte code instrumentation, wherein the biggest image loading problem detection file is realized based on a Transform API provided by a compiling and packaging tool.
3. And writing large-image loading problem detection logic in the large-image loading problem detection file, judging whether a picture loading method, such as an imageload method or a android widget imageView method, is called in the current instrumented program class file, and if so, acquiring picture related information to be processed by the method, such as the size of a picture, the loading time of the picture and the like. If the picture is opened through the imageview, the size of the picture is not more than 1MB, the pixel size of the picture is not more than 200pd, and the picture loading time is not more than 2s, the picture is not a large picture, when the picture exceeds a set value, the picture is judged to be the large picture, corresponding optimization is needed, and meanwhile, the URL path of the picture, the name of the picture, the size of the picture, the loading time, the pixel size of the picture, the class name of the picture, the path and other picture loading information of the method are recorded and are used as large picture loading information and written into an operation log, so that the subsequent optimization is facilitated.
4. The written biggecheck class file is introduced into a compiling and packing process through a command buildscript: { repositives { maven { url= (biggecheck "file path") }, by utilizing a compiling and packing tool.
5. After the source code of the original application program is compiled into a byte code file through a compiling and packing tool, a Transform action (realized through a Transform interface call) is executed, and the original application performs byte code insertion on the byte code file which is compiled and completed by the program according to the biggest code compiling logic.
6. And after the byte code instrumentation is completed on all class files of the application program, packaging the class files into an application program installation package such as an Apk installation package which can be independently installed and operated.
7. Installing an application program installation package to deploy a target application program, running the target application program, and finding related records, namely large-graph loading information (such as URL paths of pictures, names of the pictures, sizes of the pictures, loading time, pixel sizes of the pictures, class names and paths of the method) in a running log file of the program if large-graph loading occurs.
8. The problem of large graph loading of the target application program in the running process can be judged by judging whether the running log contains large graph loading information, and related codes or business logic can be modified accordingly, so that the program performance is improved.
Through the specific embodiment, the following beneficial effects can be obtained:
1. under the condition of not modifying the program source code, the aim of monitoring and checking the large graph loading problem possibly existing in the program is fulfilled.
2. The method can monitor and check the possible large graph loading performance problem in the program running stage.
Based on the same inventive concept, the embodiment of the application also provides a large-scale loading problem detection device, which can be used as the large-scale loading problem detection method in the previous embodiment, and the principle of solving the problem is similar to that of the large-scale loading problem detection method. The large-scale loading problem detection device provided by the embodiment of the application can implement the large-scale loading problem detection method, and can be realized by software, hardware or a combination of software and hardware. For example, the large map loading problem detection apparatus may include integrated or separate functional modules or units to perform the corresponding steps in the methods described above. Since the apparatus embodiments are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative. Referring to fig. 3, the large map loading problem detection apparatus may include:
a target application program running module 101, configured to run a target application program, where the target application program is generated by inserting a large-graph loading problem detection code into a source code of an original application program in a bytecode instrumentation manner, where the large-graph loading problem detection code is configured to detect a large-graph loading problem during a running process of the target application program, and write detected large-graph loading information into a running log;
a running log reading module 102, configured to read a running log of the target application program;
and the large-graph loading problem judging module 103 is used for judging whether the large-graph loading problem exists in the target application program according to whether large-graph loading information exists in the running log.
In some variations, the apparatus further comprises:
the source code acquisition module is used for acquiring source codes of the original application programs;
the byte code instrumentation module is used for inserting a large-graph loading problem detection code into the source code by adopting a compiling and packaging tool in a byte code instrumentation mode, and generating an application program installation package after the byte code instrumentation is completed;
and the program deployment module is used for deploying the target application program by installing the application program installation package.
In some variations, the bytecode instrumentation module includes:
a class file extraction unit for extracting class files in the source code;
and the byte code instrumentation unit is used for converting the class file into a byte code file by adopting a compiling and packing tool, and inserting a large-scale image loading problem detection code into the byte code file through the byte code instrumentation.
In some variations, the bytecode instrumentation unit includes:
the detection file generation subunit is used for calling the compiling and packaging tool to generate a large-graph loading problem detection file for byte code instrumentation according to the large-graph loading problem detection code;
and the byte code instrumentation subunit is used for calling the compiling and packaging tool to convert the class file into a byte code file for compiling, and inserting the large-graph loading problem detection file into the byte code file in the compiling process in a byte code instrumentation mode.
In some variant embodiments, the target application running module 101 includes:
and the large-graph detection unit is used for executing the large-graph loading problem detection code in the target application program while running the main program of the target application program.
In some modification embodiments, the large-map detection unit includes:
the picture loading judging subunit is used for judging whether the target application program invokes a picture loading method or not by executing a large picture loading problem detection code in the target application program;
the picture loading information acquisition subunit is used for acquiring picture loading information of pictures loaded by the picture loading method if the picture loading method is called;
the large picture judging subunit is used for judging whether the picture is a large picture or not according to whether the picture loading information accords with a preset large picture loading condition or not;
and the picture loading information recording subunit is used for writing the picture loading information into the operation log as the large picture loading information if the picture loading information is the large picture.
In some variant embodiments, the large graph judging subunit includes at least one of:
a picture size judging subunit, configured to judge that the picture is a large picture if the size of the picture is greater than a preset picture size threshold;
a picture pixel judging subunit, configured to judge that the picture is a large picture if the pixel size of the picture is greater than a preset pixel threshold;
and the loading time length judging subunit is used for judging that the picture is a large picture if the loading time length of the picture is greater than a preset loading time length threshold value.
The large-scale image loading problem detection device provided by the embodiment of the application has the same beneficial effects as the large-scale image loading problem detection method provided by the previous embodiment of the application due to the same inventive concept.
Based on the same inventive concept, the embodiment of the present application further provides an electronic device, where the method corresponding to the electronic device may be the large-scale loading problem detection method in the foregoing embodiment, and the principle of solving the problem is similar to that of the method. The electronic equipment provided by the embodiment of the application comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the large map loading problem detection methods and/or techniques of the various embodiments of the present application described above.
The electronic device may be a user device, or a device formed by integrating the user device and a network device through a network, or may also be an application running on the device, where the user device includes, but is not limited to, a computer, a mobile phone, a tablet computer, a smart watch, a bracelet, and other various terminal devices, and the network device includes, but is not limited to, a network host, a single network server, a plurality of network server sets, or a computer set based on cloud computing, where the network device is implemented, and may be used to implement a part of processing functions when setting an alarm clock. Here, the Cloud is composed of a large number of hosts or web servers based on Cloud Computing (Cloud Computing), which is a kind of distributed Computing, one virtual computer composed of a group of loosely coupled computer sets.
Fig. 4 shows a structure of an electronic device suitable for implementing the method and/or the technical solution in the embodiment of the present application, the electronic device 1200 includes a central processing unit (CPU, central Processing Unit) 1201, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory 1202 or a program loaded from a storage section 1208 into a random access Memory (RAM, random Access Memory) 1203. In the RAM 1203, various programs and data required for the system operation are also stored. The CPU 1201, ROM 1202, and RAM 1203 are connected to each other through a bus 1204. An Input/Output (I/O) interface 1205 is also connected to the bus 1204.
The following components are connected to the I/O interface 1205: an input section 1206 including a keyboard, mouse, touch screen, microphone, infrared sensor, etc.; an output portion 1207 including a display such as a Cathode Ray Tube (CRT), a liquid crystal display (LCD, liquid Crystal Display), an LED display, an OLED display, or the like, and a speaker; a storage portion 1208 comprising one or more computer-readable media of hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 1209 including a network interface card such as a LAN (local area network ) card, a modem, or the like. The communication section 1209 performs communication processing via a network such as the internet.
In particular, the methods and/or embodiments of the present application may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. The above-described functions defined in the method of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 1201.
Another embodiment of the present application also provides a computer readable storage medium having stored thereon computer program instructions executable by a processor to implement the method and/or the technical solution of any one or more of the embodiments of the present application described above.
In particular, the present embodiments may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowchart or block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple elements or page components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the apparatus claims can also be implemented by means of one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.

Claims (10)

1. A large graph loading problem detection method, wherein the method comprises:
the method comprises the steps of running a target application program, wherein the target application program is generated after a large-graph loading problem detection code is inserted into source codes of an original application program in a byte code instrumentation mode, and the large-graph loading problem detection code is used for detecting a large-graph loading problem in the running process of the target application program and writing detected large-graph loading information into a running log;
reading a running log of the target application program;
and judging whether the target application program has the problem of large graph loading according to whether the large graph loading information exists in the operation log.
2. The large map loading problem detection method according to claim 1, wherein before the running the target application program, further comprising:
acquiring a source code of an original application program;
inserting a large-graph loading problem detection code into the source code by adopting a compiling and packing tool in a byte code instrumentation mode, and generating an application program installation package after the byte code instrumentation is completed;
and deploying the target application program by installing the application program installation package.
3. The large graph loading problem detection method according to claim 2, wherein the inserting large graph loading problem detection code in the source code by means of byte code instrumentation using a compilation packaging tool comprises:
extracting class files in the source codes;
and converting the class file into a byte code file by adopting a compiling and packing tool, and inserting a large map into the byte code file through byte code instrumentation to load a problem detection code.
4. The large map loading problem detection method according to claim 3, wherein said converting the class file into a bytecode file using a compilation packaging tool, and inserting large map loading problem detection code in the bytecode file through bytecode instrumentation, comprises:
calling a compiling and packing tool to generate a large-graph loading problem detection file for byte code instrumentation according to the large-graph loading problem detection code;
and calling the compiling and packaging tool to convert the class file into a byte code file for compiling, and inserting the large-graph loading problem detection file into the byte code file in a byte code instrumentation mode in the compiling process.
5. The large map loading problem detection method according to claim 1, wherein the running the target application includes:
and executing the large-graph loading problem detection code in the target application program while running the main program of the target application program.
6. The large map loading problem detection method according to claim 5, wherein the large map loading problem detection by executing large map loading problem detection code in the target application program includes:
judging whether the target application program calls a picture loading method or not by executing a large picture loading problem detection code in the target application program;
if the picture loading method is called, obtaining picture loading information of a picture loaded by the picture loading method;
judging whether the picture is a large picture or not according to whether the picture loading information accords with a preset large picture loading condition or not;
if the picture is the large picture, the picture loading information is written into the operation log as the large picture loading information.
7. The big picture loading problem detection method according to claim 6, wherein the determining whether the picture is a big picture according to whether the picture loading information meets a preset big picture loading condition includes at least one of:
if the size of the picture is larger than a preset picture size threshold, judging that the picture is a large picture;
if the pixel size of the picture is larger than a preset pixel threshold value, judging that the picture is a large picture;
and if the loading time length of the picture is greater than a preset loading time length threshold value, judging that the picture is a large picture.
8. A large map loading problem detection apparatus, wherein the apparatus comprises:
the system comprises a target application program running module, a target application program running module and a target application program, wherein the target application program is generated by inserting a large-graph loading problem detection code into a source code of an original application program in a byte code instrumentation mode, the large-graph loading problem detection code is used for detecting a large-graph loading problem in the running process of the target application program, and the detected large-graph loading information is written into a running log;
the operation log reading module is used for reading the operation log of the target application program;
and the large-graph loading problem judging module is used for judging whether the large-graph loading problem exists in the target application program according to whether large-graph loading information exists in the operation log.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.
10. A computer readable medium having stored thereon computer program instructions executable by a processor to implement the method of any of claims 1 to 7.
CN202311093353.6A 2023-08-28 2023-08-28 Large-scale image loading problem detection method, device, equipment and computer medium Pending CN117130919A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311093353.6A CN117130919A (en) 2023-08-28 2023-08-28 Large-scale image loading problem detection method, device, equipment and computer medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311093353.6A CN117130919A (en) 2023-08-28 2023-08-28 Large-scale image loading problem detection method, device, equipment and computer medium

Publications (1)

Publication Number Publication Date
CN117130919A true CN117130919A (en) 2023-11-28

Family

ID=88854137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311093353.6A Pending CN117130919A (en) 2023-08-28 2023-08-28 Large-scale image loading problem detection method, device, equipment and computer medium

Country Status (1)

Country Link
CN (1) CN117130919A (en)

Similar Documents

Publication Publication Date Title
US11157640B2 (en) Protecting sensitive data in software products and in generating core dumps
JP5415557B2 (en) User script code conversion for debugging
US8930884B2 (en) Efficient extraction of software dependencies from program code
US9684786B2 (en) Monitoring an application in a process virtual machine
US10353702B2 (en) Source code element signatures
CN104137057A (en) Generating and caching software code
KR20150024842A (en) Adaptive portable libraries
CN112733158B (en) Android system vulnerability detection method, electronic equipment and storage medium
US20170054790A1 (en) System and Method for Object Compression and State Synchronization
CN110609687A (en) Compiling method, device, electronic equipment and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN112667246A (en) Application function extension method and device and electronic equipment
US11036527B2 (en) Class splitting in object-oriented environments
US9116714B2 (en) Methods and systems for file processing
WO2015003452A1 (en) Methods and systems for file processing
CN111258802A (en) Method for capturing application program crash information and related equipment
US20220308991A1 (en) Test processing method and information processing apparatus
CN117130919A (en) Large-scale image loading problem detection method, device, equipment and computer medium
US10540261B2 (en) Problem diagnosis technique of memory corruption based on regular expression generated during application compiling
CN112114811A (en) Compiling method, device and equipment
CN113139190A (en) Program file detection method and device, electronic equipment and storage medium
US11321225B2 (en) Reducing the memory load time for logic simulator by leveraging architecture simulator
CN114064050A (en) Data processing method and device, electronic equipment and storage medium
CN107632934B (en) Function copying method and device in C-sharp
US20130007517A1 (en) Checkpoint Recovery Utility for Programs and Compilers

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