Method and device for optimizing performance of pathological slice preview of Web program based on Python
By simulating user operations and analyzing performance bottlenecks, the pathological slice preview performance of web programs is optimized, and the lag problem during pathological slice preview in the prior art is solved, and the image quality is maintained efficient.
Patent Information
- Application Number
- CN202411170257.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-08-26
AI Technical Summary
In the prior art, when performing high-resolution preview of pathological slices, web programs occupy more memory resources, resulting in lag problems, and reducing resolution to optimize performance will lead to a decrease in image quality, affecting the accuracy of disease analysis.
By building a test environment that is the same as the actual deployment environment, writing performance test scripts to simulate user operations, collecting environmental load information in real time, analyzing performance bottlenecks, and formulating optimization plans based on this to optimize web programs to improve the performance performance of pathological slice previews.
It realizes that while ensuring image quality, optimizes the preview performance of web programs, improves the fluency of preview, solves the problem of lag, and ensures the optimization effect through accurate testing.
Smart Images

Figure CN118733418B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing, and in particular to a method and device for optimizing the performance of pathological slice preview of a Web program based on Python. Background Art
[0002] With the development of medical informatization, digital processing and online preview of pathological slice images have become important auxiliary means of medical diagnosis. The existing technology generally uses Web programs to preview pathological slices. However, due to the high resolution and large amount of data of pathological slices, the performance requirements of Web programs are very high. Web programs will occupy more memory resources when previewing high-resolution images, so there will be freezes when performing operations such as panning and zooming on pathological slices. Therefore, it is necessary to test and optimize the Web program to improve the user experience.
[0003] In the prior art, when optimizing Web programs, the image compression or format conversion method is often used to reduce the resolution of the original image, so as to achieve fast loading and preview. However, due to the particularity of pathological sections, reducing the resolution of pathological sections will lead to the loss of important information, thus making it impossible to accurately analyze the disease. Therefore, how to optimize the preview of the Web program while ensuring the image quality and improve the smoothness of the preview is an issue that needs to be urgently addressed. Summary of the invention
[0004] The embodiment of the present application provides a method and device for optimizing the performance of pathological slice preview of a Web program based on Python. The method simulates user operations and monitors the operation of the Web program to analyze performance bottlenecks, and then formulates an optimization plan based on the performance bottlenecks to improve the performance of the Web program for pathological slice preview.
[0005] In a first aspect, an embodiment of the present application provides a method for optimizing the performance of pathological slice preview of a Web program based on Python, the method comprising:
[0006] Build a test environment that is identical to the actual deployment environment, and use the Web program to be optimized to load pathological slices in the test environment;
[0007] Writing a performance test script, executing the performance test script in the test environment and collecting environmental load information in real time during the execution of the performance test script, wherein the performance test script is used to simulate a user's viewing operation of a pathological slice in the Web program to be optimized;
[0008] The environmental load information is analyzed to obtain the performance bottleneck of the Web program to be optimized, an optimization plan is formulated based on the performance bottleneck, and the Web program to be optimized is optimized using the optimization plan.
[0009] In a second aspect, the embodiment of the present application provides a Web program pathology slice preview performance optimization device based on Python, comprising:
[0010] Build a module to build a test environment that is the same as the actual deployment environment, and use the Web program to be optimized to load pathological slices in the test environment;
[0011] A test module, used for writing a performance test script, executing the performance test script in the test environment and collecting the environment load information in real time during the execution of the performance test script, wherein the performance test script is used to simulate the user's viewing operation of the pathological slice in the Web program to be optimized;
[0012] The optimization module is used to analyze the environmental load information to obtain the performance bottleneck of the Web program to be optimized, formulate an optimization plan based on the performance bottleneck, and use the optimization plan to optimize the Web program to be optimized.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute a method for optimizing the performance of pathological slice preview of a Web program based on Python.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute a process, and the process includes a method for optimizing the performance of pathological slice preview of a Web program based on Python.
[0015] The main contributions and innovations of the present invention are as follows:
[0016] The embodiment of the present application tests the program to be optimized by building a test environment that is identical to the actual deployment environment, thereby ensuring the accuracy of the test of the Web program to be optimized; the present solution simulates a series of viewing operations of the user on the pathological slices in the Web program to be optimized by writing a performance test script, truly simulating the user's behavior, so that the problems exposed during the test are more in line with the real-time situation; the present solution uses a visual method to obtain the source of the problem of the jamming situation, and finds out the performance bottleneck, and then formulates a targeted optimization plan based on the performance bottleneck to solve the jamming situation at the lowest cost; the present solution uses the performance test script for a second test after each optimization to determine whether the optimization result meets expectations.
[0017] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 It is a flowchart of a method for optimizing the performance of pathological slice preview of a Web program based on Python according to an embodiment of the present application;
[0020] Figure 2 is a schematic diagram of a portion of the core code of a performance test script according to an embodiment of the present application;
[0021] Figure 3 It is a structural block diagram of a Web program pathology slice preview performance optimization device implemented based on Python according to an embodiment of the present application;
[0022] Figure 4 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0024] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0025] Embodiment 1
[0026] The embodiment of the present application provides a method for optimizing the performance of pathological slice preview of a Web program based on Python. By simulating user operations and monitoring the operation of the Web program, performance bottlenecks are analyzed, and then an optimization plan is formulated based on the performance bottlenecks to improve the performance of the Web program for pathological slice preview. Specifically, refer to Figure 1 , the method comprising:
[0027] Build a test environment and use the web program to be optimized to load pathological slices in the test environment;
[0028] Writing a performance test script, executing the performance test script in the test environment and collecting environmental load information in real time during the execution of the performance test script, wherein the performance test script is used to simulate a user's viewing operation of a pathological slice in the Web program to be optimized;
[0029] The environmental load information is analyzed to obtain the performance bottleneck of the Web program to be optimized, an optimization plan is formulated based on the performance bottleneck, and the Web program to be optimized is optimized using the optimization plan.
[0030] In this solution, in order to ensure the accuracy of the test of the Web program to be optimized, the test environment is the same as the actual deployment environment, and the test environment includes a Web server, a database server, and a client test environment.
[0031] Specifically, any Web server software, such as Nginx, Apache, etc., is selected to build the Web server software to build the Web server, and the specific configuration of the Web server is adjusted according to the concurrency of the Web program to be optimized and the server requirements. The specific configuration of the Web server includes: thread pool size, cache settings, etc.
[0032] Specifically, any database system, such as MySQL, PostgreSQL, NoSQL or MongoDB, is selected to build a database server, and the database server supports storage and retrieval of pathological slice images.
[0033] Specifically, the client test environment refers to the hardware requirements and network requirements for running the Web program to be optimized. The hardware requirements include CPU, memory, storage, etc., and the network requirements include network bandwidth, latency, etc.
[0034] In some specific embodiments, the performance testing script is written in Python.
[0035] In the step of "executing the performance test script in the test environment and collecting environmental load information in real time during the execution of the performance test script", the environmental load information includes CPU usage, memory occupancy and response time, and the environmental load information is recorded in the form of a log.
[0036] Specifically, Python's cProfile, memory_profiler and other modules are used to collect environmental load information in real time.
[0037] Specifically, by collecting environmental load information, we can accurately understand the impact of different running states of the Web program on the test environment, so as to perform targeted optimization in subsequent steps.
[0038] In the step of "the performance test script is used to simulate the viewing operation of the pathology slice by the user in the Web program to be optimized", the viewing operation of the pathology slice includes the user loading, zooming and panning the pathology image.
[0039] Specifically, in actual applications, users usually perform a series of operations when viewing pathological sections, including loading, zooming, and panning. These operations will affect the smoothness of previewing pathological sections. Therefore, this solution simulates these operations through performance testing scripts and optimizes them to ensure smooth previewing of pathological sections.
[0040] Furthermore, the loading, scaling and translation operations of the pathological image are completed through HTTP requests. This solution uses Python's requests library to simulate HTTP requests for implementing loading, scaling and translation operations.
[0041] For example, some core codes of the performance test script are as follows: Figure 2 As shown, first use base_url to define the URL of the target server. Base_url is the basic URL of the Web program to be optimized and is used to build a specific http request.
[0042] Then define the simulated user operation function, simulated loading function, simulated scaling function and simulated translation function respectively, among which the simulated user operation function simulate_user_operations(session) is used to simulate the user's operation sequence, such as first loading the pathological slice, then scaling the pathological slice, and finally translating the pathological slice. It is worth mentioning that in actual applications, the user will have a more complex operation sequence to more realistically simulate the user's operation behavior, so it needs to be expanded according to specific needs.
[0043] The simulated loading function load_image(session) realizes the loading of the pathological slice by sending a loading GET request to the URL of the target server, uses the image ID as a parameter in the loading GET request to indicate the pathological slice to be loaded, and uses the time.sleep() function to simulate the loading time.
[0044] The simulated zoom function zoom_image(session) implements the zooming of the pathological slice by sending a zoom GET request to the URL of the target server, uses the zoom factor as a parameter in the zoom GET request to represent the zoom ratio, and uses the time.sleep() function to simulate the time interval between two zoom operations of the user.
[0045] The simulated translation function pan_image(session) realizes the translation of the pathological slice by sending a translation GET request to the URL of the target server, in which the translation factor is used as a parameter to represent the translation distance, and the time.sleep() function is used to simulate the time interval between two translation operations of the user.
[0046] In the step of "analyzing the environmental load information to obtain the performance bottleneck of the Web program to be optimized", the environmental load information is statistically analyzed to obtain the problem source, and then the performance bottleneck of the Web program to be optimized is obtained based on the problem source, wherein the problem source refers to the specific viewing operation that causes a freeze when viewing the pathological slice, and the performance bottleneck refers to the cause of the problem source.
[0047] In some specific embodiments, the environmental load information is visualized or counted as a response time distribution graph, and the operations or requests with longer response times are found based on the response time distribution graph to obtain the source of the problem. For example, it is known from the response time distribution graph that the response time of the Web program to be optimized is long when performing a translation operation on a pathological slice, which indicates that the source of the problem is a freeze during the translation operation.
[0048] Specifically, when obtaining performance bottlenecks, comparative analysis methods are used to determine the type of performance bottlenecks. For example, comparative analysis methods are used to compare performance data in different time periods, and to compare the performance of servers with different configurations to determine the type of performance bottlenecks. The types of performance bottlenecks include network delays, low database query efficiency, high complexity of image processing algorithms, insufficient server configuration, etc.
[0049] Furthermore, the performance bottleneck can be obtained through the following methods:
[0050] 1. Directly view the source code of the Web program to be optimized and analyze the algorithm complexity to check whether there is inefficient algorithm time that causes lag;
[0051] 2. Analyze whether the choice of data structure is reasonable and whether it is not suitable for the current application scenario, thus causing lag;
[0052] 3. Check memory usage to determine whether there is memory leak or unnecessary memory allocation that causes lag;
[0053] 4. Analyze the concurrency control strategy and check whether there are any race conditions, deadlocks, and other problems that cause lag.
[0054] In the step of "formulating an optimization plan based on performance bottlenecks", the optimization plan is a targeted strategy for solving performance bottlenecks. When there are multiple performance bottlenecks, a different optimization level is formulated for each performance bottleneck, and an optimization plan is formulated and executed for each performance bottleneck in order of priority.
[0055] In some specific embodiments, if the performance bottleneck is the high complexity of the image processing algorithm, the optimization solution is to replace it with a low-complexity image processing algorithm to reduce the time complexity and space complexity of the Web program to be optimized;
[0056] If the performance bottleneck is the unreasonable selection of data structure, the optimization solution is to select a suitable data structure according to the needs of the Web program to be optimized, such as using a hash table instead of a list to improve search efficiency, optimizing the storage and access methods of the data structure, reducing memory usage and increasing access speed;
[0057] If the performance bottleneck is low memory usage efficiency, the optimization solution is to use technologies such as memory pool to manage memory and improve memory usage efficiency. If the performance bottleneck is unnecessary memory allocation and release, the optimization solution is to reduce unnecessary memory allocation and release to improve memory usage efficiency. Furthermore, by introducing HTTP cache and browser cache mechanisms, for loaded image blocks or slices, they can be read directly from the cache when the user visits again, reducing server load and loading time. Smarter caching strategies can also be implemented, such as caching popular slices or image blocks based on user behavior predictions.
[0058] In addition, since digital pathology slides usually have extremely high resolution and clarity, directly loading full-resolution images to the Web front end will result in long loading times and excessive memory consumption. Multi-level image pyramid technology can be used to first load low-resolution preview images, and then gradually load high-resolution image blocks when users need to view details. Efficient image compression algorithms (such as JPEG 2000, WebP, etc.) can also be used. These algorithms can significantly reduce file size and speed up loading while maintaining image quality.
[0059] If the performance bottleneck is a poor concurrency control strategy, the optimization solution is to redesign the concurrency strategy reasonably to avoid competition conditions and deadlocks, or use multi-threading or asynchronous programming techniques to improve the concurrent performance of the program, or make full use of multi-core processor resources to improve the execution efficiency of the program. Furthermore, technologies such as Web Workers or Service Workers can be used to process time-consuming operations such as image loading and decoding in background threads to avoid blocking the main thread and improve user experience. Image resources can also be loaded asynchronously so that the Web page can continue to respond to other user operations while loading images.
[0060] In addition, loading time can be reduced by using on-demand loading methods, such as loading an image only when it enters the viewport to reduce initial loading time. For large pathology slices, image data for a specific area is loaded only when the user scrolls or clicks on that area to avoid loading the entire slice at once.
[0061] If the performance bottleneck is a cache problem, the optimization solution is to use cache technology to reduce data access time and improve program performance, or to use local cache and distributed cache reasonably to optimize the cache strategy based on data access frequency and importance.
[0062] If the performance bottleneck is that the code of the Web program to be optimized is cumbersome, the optimization solution is to streamline, refactor and rewrite the code to improve the execution efficiency of the program, or remove useless code and libraries, reduce the size and complexity of the program, or use compiler optimization options to optimize the execution efficiency of the code.
[0063] If the performance bottleneck is insufficient hardware configuration, the optimization plan is to check whether the server hardware meets the performance requirements, such as CPU, memory, disk I / O, etc., use faster hardware devices or upgrade existing hardware to improve performance, or optimize server configuration to improve hardware performance, such as adjusting JVM parameters, database connection pool size, etc. Furthermore, you can increase the number of CPU cores, increase memory capacity, use faster storage devices, etc. to improve processing power and response speed.
[0064] If the performance bottleneck is poor network conditions, the optimization plan is to optimize the network configuration, reduce network latency and packet loss, or use load balancing technology to disperse network traffic and improve the system's concurrent processing capabilities, or compress transmission data to reduce network bandwidth consumption. Furthermore, CDN (content distribution network) can be used to accelerate global access to images, or HTTP / 2 or HTTP / 3 protocols can be enabled to take advantage of the multiplexing and header compression features of these protocols to reduce network latency and bandwidth consumption.
[0065] After the step of "Using the optimization solution to optimize the Web program to be optimized", use the performance test script again to test the optimized Web program to be optimized in order to verify whether the optimization effect meets expectations.
[0066] Specifically, when the test results indicate that the optimization effect does not meet expectations, new performance bottlenecks are obtained and a new optimization plan is formulated again to ensure that the optimization effect meets expectations.
[0067] Specifically, record each optimization plan and implementation process for subsequent reference and audit, and summarize optimization experiences and lessons to provide reference for future performance optimization.
[0068] In this solution, an optimization report is generated based on the optimization results, and the optimization report includes the test environment, test steps, test results, performance bottlenecks, optimization solutions and effect verification.
[0069] Embodiment 2
[0070] Based on the same idea, refer to Figure 3 , the application also proposes a Web program pathology slice preview performance optimization device based on Python, including:
[0071] Build a module to build a test environment that is the same as the actual deployment environment, and use the Web program to be optimized to load pathological slices in the test environment;
[0072] A test module, used for writing a performance test script, executing the performance test script in the test environment and collecting the environment load information in real time during the execution of the performance test script, wherein the performance test script is used to simulate the user's viewing operation of the pathological slice in the Web program to be optimized;
[0073] The optimization module is used to analyze the environmental load information to obtain the performance bottleneck of the Web program to be optimized, formulate an optimization plan based on the performance bottleneck, and use the optimization plan to optimize the Web program to be optimized.
[0074] Embodiment 3
[0075] This embodiment also provides an electronic device, referring to Figure 4 , comprises a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above method embodiments.
[0076] Specifically, the processor 402 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0077] Among them, the memory 404 may include a large capacity memory 404 for data or instructions. For example, but not limitation, the memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 404 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 404 may be inside or outside the data processing device. In a specific embodiment, the memory 404 is a non-volatile memory. In a specific embodiment, the memory 404 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable Programmable Read-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0078] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .
[0079] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any one of the Web program pathology slice preview performance optimization methods based on Python in the above embodiments.
[0080] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .
[0081] The transmission device 406 can be used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 406 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0082] The input and output device 408 is used to input or output information. In this embodiment, the input information may be a test environment, a performance test script, etc., and the output information may be a performance bottleneck, an optimization solution, etc.
[0083] Optionally, in this embodiment, the processor 402 may be configured to perform the following steps through a computer program:
[0084] Build a test environment that is identical to the actual deployment environment, and use the Web program to be optimized to load pathological slices in the test environment;
[0085] Writing a performance test script, executing the performance test script in the test environment and collecting environmental load information in real time during the execution of the performance test script, wherein the performance test script is used to simulate a user's viewing operation of a pathological slice in the Web program to be optimized;
[0086] The environmental load information is analyzed to obtain the performance bottleneck of the Web program to be optimized, an optimization plan is formulated based on the performance bottleneck, and the Web program to be optimized is optimized using the optimization plan.
[0087] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0088] In general, various embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the boxes, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0089] Embodiments of the present invention may be implemented by computer software that is executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros may be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. A computer program product may include one or more computer executable components configured to perform an embodiment when the program is run. One or more computer executable components may be at least one software code or a portion thereof. In addition, at this point, it should be noted that, for example, Figure 4 Any block of the logic flow in the program may represent program steps, or interconnected logic circuits, blocks and functions, or a combination of program steps and logic circuits, blocks and functions. The software may be stored on physical media such as memory chips or storage blocks implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and their data variants, CDs, etc. Physical media are non-transitory media.
[0090] Those skilled in the art should understand that the technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0091] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for optimizing the performance of pathological slice preview of Web programs based on Python, characterized in that: The following steps are involved: Build a test environment that is identical to the actual deployment environment, and use the Web program to be optimized to load pathological slices in the test environment; Writing a performance test script, executing the performance test script in the test environment and collecting environmental load information in real time during the execution of the performance test script, wherein the performance test script is used to simulate the user's viewing operation on the pathological slice in the Web program to be optimized, defining a simulated user operation function to simulate the user's operation sequence, and defining a simulated loading function, a simulated scaling function and a simulated translation function respectively, wherein the simulated loading function realizes the loading of the pathological slice by sending a loading GET request, the simulated scaling function realizes the scaling of the pathological slice by sending a scaling GET request, and the simulated translation function realizes the translation of the pathological slice by sending a translation GET request, the environmental load information includes CPU usage, memory occupancy and response time, and the environmental load information is recorded in the form of a log, and the viewing operation of the pathological slice includes the loading, scaling and translation of the pathological slice by the user based on an HTTP request; The environmental load information is analyzed to obtain the performance bottleneck of the Web program to be optimized, wherein the environmental load information is statistically analyzed to obtain the problem source, and then the performance bottleneck of the Web program to be optimized is obtained based on the problem source, wherein the environmental load information is statistically analyzed in a visual manner or as a response time distribution graph, and based on the response time distribution graph, operations or requests with longer response times are found to obtain the problem source, wherein the problem source refers to a specific viewing operation that causes a freeze when viewing a pathological section, and the performance bottleneck refers to the cause of the problem source, and then an optimization plan is formulated based on the performance bottleneck, and the Web program to be optimized is optimized using the optimization plan, wherein the optimization plan is a targeted strategy for solving performance bottlenecks, wherein when there are multiple performance bottlenecks, a different optimization level is formulated for each performance bottleneck, and an optimization plan is formulated and executed for each performance bottleneck in order of priority.
2. According to a method for optimizing the performance of pathological slice preview of a Web program based on Python implementation in claim 1, it is characterized in that: The test environment is the same as the actual deployment environment, and the test environment includes a Web server, a database server, and a client test environment.
3. A Web program pathology slice preview performance optimization device based on Python, characterized in that: include: Build a module to build a test environment that is the same as the actual deployment environment, and use the Web program to be optimized to load pathological slices in the test environment; A test module, for writing a performance test script, executing the performance test script in the test environment and collecting environmental load information in real time during the execution of the performance test script, wherein the performance test script is used to simulate the user's viewing operation on the pathological slice in the Web program to be optimized, and a simulated user operation function is defined to simulate the user's operation sequence, and a simulated loading function, a simulated scaling function and a simulated translation function are defined respectively, the simulated loading function realizes the loading of the pathological slice by sending a loading GET request, the simulated scaling function realizes the scaling of the pathological slice by sending a scaling GET request, and the simulated translation function realizes the translation of the pathological slice by sending a translation GET request, the environmental load information includes CPU usage, memory occupancy and response time, and the environmental load information is recorded in the form of a log, and the viewing operation of the pathological slice includes the loading, scaling and translation of the pathological slice by the user based on an HTTP request; An optimization module is used to analyze the environmental load information to obtain the performance bottleneck of the Web program to be optimized, wherein the environmental load information is statistically analyzed to obtain the problem source, and then the performance bottleneck of the Web program to be optimized is obtained based on the problem source, wherein the environmental load information is statistically analyzed in a visual manner or as a response time distribution graph, and based on the response time distribution graph, operations or requests with longer response times are found to obtain the problem source, wherein the problem source refers to a specific viewing operation that causes a freeze when viewing a pathological section, and the performance bottleneck refers to the cause of the problem source, and then an optimization plan is formulated based on the performance bottleneck, and the Web program to be optimized is optimized using the optimization plan, wherein the optimization plan is a targeted strategy for solving performance bottlenecks, wherein when there are multiple performance bottlenecks, a different optimization level is formulated for each performance bottleneck, and an optimization plan is formulated and executed for each performance bottleneck in order of priority.
4. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute a method for optimizing the performance of pathological slice preview of a Web program based on Python as described in any one of claims 1-2.
5. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which includes a program code for controlling a process to execute a process, and the program code includes a method for optimizing the performance of pathological slice preview of a Web program based on Python according to any one of claims 1-2.
Citation Information
Patent Citations
Software test method and system
CN107193735A
Method and system for web-based medical image processing
US20220392615A1