Methods for generating performance test scripts and their application in systems, electronic devices, and storage media.

By acquiring and integrating event tracking data, performance test scripts corresponding to user access behavior are generated, solving the problem of inaccurate test results in existing technologies and achieving accurate performance testing.

CN115687055BActive Publication Date: 2026-07-17JINGDONG TECH HLDG CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINGDONG TECH HLDG CO LTD
Filing Date
2021-07-22
Publication Date
2026-07-17

Smart Images

  • Figure CN115687055B_ABST
    Figure CN115687055B_ABST
Patent Text Reader

Abstract

This application discloses a method, system, electronic device, and storage medium for generating performance test scripts. The method includes: acquiring data collected from multiple preset data points in the product under test; summarizing information on external interfaces associated with each page in the product under test to obtain first correspondence information; determining internal interfaces associated with each external interface to obtain second correspondence information; acquiring page traffic information corresponding to each time period within a target time range based on the data points; wherein, the traffic information corresponding to a page includes the traffic percentage and average dwell time of each redirected page corresponding to that page; integrating the first correspondence information, the second correspondence information, and the page traffic information into association information corresponding to each time period; determining multiple user access behaviors from the association information corresponding to each time period within the target time range, and generating a performance test script corresponding to each user access behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of performance testing technology, and in particular to a method and system for generating performance test scripts, an electronic device, and a storage medium. Background Technology

[0002] Performance testing is a crucial part of the internet software development lifecycle and a vital component of software testing. Conducting performance testing requires planning performance test scenarios to generate corresponding performance test scripts, which are then used for testing. The planning of performance test scenarios is key to the success of performance testing.

[0003] Currently, there are two main approaches to performance test scenario planning. One is user-volume-based planning: this involves extracting user registration data from related products and combining it with empirical data to estimate the number of users for each scenario and interface, or based on the number of users in older versions of the application currently online. Traffic is then allocated to each interface or page, and test scenarios are planned manually, generating corresponding performance test scripts based on the planning results. The other approach is pressure duration-based planning: this involves specifying test scenarios based on a gradual, stepped increase in pressure and control over the duration of pressure.

[0004] However, the first method, which infers the scenario and the number of users for each interface, is prone to inaccuracies, leading to inaccurate test results. Planning based on the number of users from older application versions cannot adapt to changing needs, making it unsuitable and also causing inaccurate results. Planning based on the duration of stress has issues with its consistency with real-world application scenarios, resulting in relatively low accuracy. Summary of the Invention

[0005] In view of the shortcomings of the prior art, this application provides a method and system for generating performance test scripts, an electronic device, and a storage medium to solve the problem of inaccurate test results in test scripts generated by existing planning methods.

[0006] To achieve the above objectives, this application provides the following technical solution:

[0007] The first aspect of this application provides a method for generating performance test scripts, including:

[0008] Acquire the data collected from multiple preset tracking points in the product under test;

[0009] Summarize the information of the external interfaces associated with each page in the product under test to obtain the first correspondence information;

[0010] Determine the internal interfaces associated with each of the external interfaces to obtain the second correspondence information;

[0011] Based on the data points, traffic information for each page within multiple time periods of the target time range is obtained, resulting in page traffic information for each time period. The traffic information for a single page includes the traffic percentage and average dwell time for each redirected page. The redirected pages include all pages accessed from the page. The traffic percentage of the redirected pages is the ratio of traffic from the page to the redirected page to the total traffic of the page. The average dwell time of the redirected pages is the average dwell time before each redirect from the page to the redirected page.

[0012] The first correspondence information, the second correspondence information, and the page traffic information corresponding to each time period are integrated to obtain the association information corresponding to each time period.

[0013] For each time period within the target time range, the associated information is used to determine multiple user access behaviors, and a performance test script is generated for each user access behavior.

[0014] Optionally, in the above method, obtaining the data collected from multiple preset tracking points in the product under test includes:

[0015] The data collected from the multiple preset data points in the cache is retrieved from the message middleware at a preset frequency.

[0016] Optionally, in the above method, after acquiring the data collected from multiple preset tracking points in the product under test, the method further includes:

[0017] The embedded data is preprocessed; wherein the preprocessing includes at least data idempotency verification, data cleaning and completion, and data anonymization.

[0018] Optionally, the above method further includes:

[0019] Based on the association information and the inbound traffic of the product to be detected, the theoretical traffic of each target interface is calculated; wherein, the target interface includes each of the external interfaces and each of the internal interfaces in the association information;

[0020] For each target interface, the theoretical traffic of the target interface is compared with the actual traffic of the target interface;

[0021] If the theoretical traffic of the target interface is greater than the actual traffic of the target interface by more than the preset ratio threshold, then duplicate records about the target interface in the associated information are detected and deleted.

[0022] If the theoretical traffic of the target interface is less than the actual traffic of the target interface by more than a preset ratio threshold, then the value of the page traffic information corresponding to the target interface in the associated information is increased.

[0023] Optionally, in the above method, the step of determining multiple user access behaviors from the association information corresponding to each time period within the target time range, and generating a performance test script corresponding to each user access behavior, includes:

[0024] Based on the traffic information corresponding to each page in the associated information of each time period in the target time range, the behavior of sequentially jumping the page to its corresponding jump page is used to determine the user access behavior until the sum of the traffic proportions of the selected page and the corresponding jump page is greater than a preset proportion threshold.

[0025] Based on each user access behavior and the average dwell time of the corresponding redirected page, a performance test script is generated for each user access behavior.

[0026] A second aspect of this application provides a system for generating performance test scripts, comprising:

[0027] The acquisition unit is used to acquire the data collected from multiple preset tracking points in the product under test.

[0028] The summarization unit is used to summarize the information of the external interfaces associated with each page in the product under test to obtain the first correspondence information;

[0029] The first determining unit is used to determine the internal interfaces associated with each of the external interfaces and obtain the second correspondence information.

[0030] The statistics unit is used to obtain traffic information corresponding to each page within multiple time periods of the target time range based on the data points, thereby obtaining page traffic information corresponding to each time period. The traffic information corresponding to a page includes the traffic percentage and average dwell time of each redirected page. The redirected pages include all pages accessed from the page. The traffic percentage of the redirected pages is the ratio of traffic from the page to the redirected page to the total traffic of the page. The average dwell time of the redirected pages is the average dwell time before each redirection from the page to the redirected page.

[0031] An integration unit is used to integrate the first correspondence information, the second correspondence information, and the page traffic information corresponding to each time period to obtain the association information corresponding to each time period.

[0032] The generation unit is used to determine multiple user access behaviors from the associated information corresponding to each time period in the target time range, and generate a performance test script corresponding to each user access behavior.

[0033] Optionally, in the above system, the acquisition unit includes:

[0034] The acquisition subunit is used to acquire the cached data collected from the multiple preset data points from the message middleware at a preset frequency.

[0035] Optionally, the system described above also includes:

[0036] A preprocessing unit is used to preprocess the embedded data; wherein the preprocessing includes at least data idempotency verification, data cleaning and completion, and data desensitization.

[0037] Optionally, the system described above also includes:

[0038] A calculation unit is used to calculate the theoretical traffic of each target interface based on the association information and the inbound traffic of the product to be detected; wherein, the target interface includes each of the external interfaces and each of the internal interfaces in the association information;

[0039] For each target interface, the theoretical traffic of the target interface is compared with the actual traffic of the target interface;

[0040] If the theoretical traffic of the target interface is greater than the actual traffic of the target interface by more than the preset ratio threshold, then duplicate records about the target interface in the associated information are detected and deleted.

[0041] If the theoretical traffic of the target interface is less than the actual traffic of the target interface by more than a preset ratio threshold, then the value of the page traffic information corresponding to the target interface in the associated information is increased.

[0042] Optionally, in the above system, the generation unit includes:

[0043] The second determining unit is used to determine user access behavior by sequentially jumping the page to its corresponding redirect page based on the traffic information of each page in the associated information of each time period in the target time range, until the sum of the traffic proportions of the selected page and the corresponding redirect page is greater than a preset proportion threshold.

[0044] A generation subunit is used to generate a performance test script for each user access behavior based on each user access behavior and the average dwell time of the corresponding redirected page.

[0045] A third aspect of this application provides an electronic device, comprising:

[0046] Memory and processor;

[0047] The memory is used to store programs;

[0048] The processor is used to execute the program, which, when executed, is specifically used to implement the performance test script generation method as described in any of the above.

[0049] A fourth aspect of this application provides a computer storage medium for storing a computer program, which, when executed, implements the method for generating performance test scripts as described in any of the preceding claims.

[0050] This application provides a method for generating performance test scripts. By acquiring data from multiple pre-set tracking points in the product under test, it accurately simulates real user behavior and allows for better adaptation to changing needs through planning based on this data. Then, it aggregates information about external interfaces associated with each page in the product under test to obtain a first correspondence, and identifies internal interfaces associated with each external interface to obtain a second correspondence. Based on the tracking data, it acquires traffic information for each page within multiple time periods of the target time range, obtaining page traffic information for each time period. Specifically, the traffic information for a page includes the traffic percentage and average dwell time of each redirected page; the redirected pages include all pages navigated to from the current page; the traffic percentage of the redirected pages is the ratio of traffic from the current page to the redirected pages to the total page traffic; and the average dwell time of the redirected pages is the average dwell time before each redirect. This method segments the tracking data into time slices, mapping them to corresponding traffic and interface calls, achieving fine-grained management and dynamic generation of performance test scripts. Finally, the first correspondence information, the second correspondence information, and the page traffic information corresponding to each time period are integrated to obtain the association information corresponding to each time period. Then, for the association information corresponding to each time period, multiple user access behaviors are determined from the association information, and a performance test script corresponding to each user access behavior is generated, which can effectively ensure the accuracy of the test results. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0052] Figure 1 A flowchart illustrating a method for generating a performance test script, as provided in an embodiment of this application;

[0053] Figure 2 A flowchart illustrating an information verification method provided in this application embodiment;

[0054] Figure 3 A flowchart illustrating a method for determining user access behavior and generating performance test scripts, provided in an embodiment of this application;

[0055] Figure 4 A schematic diagram of the structure of a performance test script generation system provided in another embodiment of this application;

[0056] Figure 5 This is a schematic diagram of the structure of a generation unit provided in another embodiment of this application;

[0057] Figure 6 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0059] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0060] This application provides a method for generating performance test scripts, such as... Figure 1 As shown, the specific steps include:

[0061] S101. Obtain the data collected from multiple preset tracking points in the product under test.

[0062] The data collected includes at least user access information. User access information mainly refers to data generated when a user is within a specified scope, specifically including the pages visited, API calls made, user actions, and access time. It can also include the user's personal information. Alternatively, other relevant information can be collected as needed for testing. Generally, the collected information can be categorized into the following key components:

[0063] 1. User information related to the event.

[0064] 2. The actual time when the event occurred.

[0065] 3. Geographic location of the event. This can be determined by resolving the IP address to identify the corresponding province and city.

[0066] 4. The way and method by which the user completes the event, broadly speaking, includes information such as the user's device, browser, operating system version, source channel, visited webpage, and reference ID.

[0067] 5. The specific details of the user-initiated event, such as which button was clicked, what event was triggered, or what interface was called.

[0068] It should be noted that this application collects data based on pre-defined event tracking points. Specifically, this tracking can primarily focus on backend API tracking, supplemented by frontend SDK tracking. The data collected from frontend tracking points can be used for task profiling and user habit analysis, while subsequent tracking data directly reflects information such as the frequency and changes of service and API calls. By combining frontend and backend data, it is possible not only to accurately grasp the key user behaviors that trigger a function on the backend, but also to simulate the operations performed by the user during the frontend waiting time. Analyzing user behavior on both the frontend and backend allows for more refined performance testing scenarios.

[0069] Optionally, the collected event tracking data can be sent to a data server for unified processing. Specifically, this server will collect relevant data and perform modeling to prepare for the next stage of analysis.

[0070] Optionally, in another embodiment of this application, a specific implementation of step S101 includes:

[0071] The data collected from multiple preset data points in the cache is retrieved from the message middleware at a preset frequency.

[0072] Using message middleware as a data buffer, connecting the event tracking data and the data collection server, during peak traffic periods when a large amount of event tracking data is generated, middleware such as Kafka and RabbitMQ plays a good buffering role, and the server collects the middleware message data at a set frequency.

[0073] Optionally, in another embodiment of this application, after performing step S101, the following can be further performed: preprocessing the embedded data.

[0074] Preprocessing includes at least data idempotency verification, data cleaning and completion, and data anonymization. It may also include antispam functionality, as well as features like adding IP blacklists and domain blacklists / whitelists via check switches to clean the data from the event tracking points.

[0075] S102. Summarize the information of the external interfaces associated with each page in the product to be tested to obtain the first correspondence information.

[0076] The external interfaces managed by the page refer to the external interfaces that need to be called when implementing the page's functions.

[0077] It should be noted that the first correspondence information must include at least the names of each page and its associated external interfaces. Of course, the summarized content may vary depending on the complexity of the product under test and the division of functionalities; it can be specifically set according to requirements and business needs. Optionally, when a page's function calls more than one interface, it should be recorded according to the principle of one interface per row, and the first correspondence information can be stored in a table, defined as the first correspondence table. For example, as shown in Table 1, the first correspondence table stores the first correspondence information where the homepage's function can call multiple interfaces, which are then sorted and recorded. The table also records element tags, i.e., the page's function, and the methods called by the interfaces.

[0078] Table 1

[0079]

[0080] S103. Determine the internal interfaces associated with each external interface to obtain the second correspondence information.

[0081] Among them, the internal interface associated with the external interface refers to the internal interface that will be called when the external interface is called.

[0082] It should be noted that the second correspondence information mainly includes the correspondence between each external interface and its associated internal interface. Of course, it can also include other information, such as the methods of the external interface and the number of times the corresponding internal interface needs to be called when an external interface is called once. The second correspondence can also be stored in a table, such as Table 2, to obtain more refined performance test scenarios.

[0083] Table 2

[0084]

[0085] Optionally, all external interfaces of the product under test can be associated with internal interfaces. Alternatively, only some external interfaces of the product under test can be associated with some internal interfaces. For example, considering that interfaces with relatively low traffic may not be tested and therefore do not need to be statistically analyzed, all internal and external interfaces above a given TPS threshold can be identified, and their relationships can be determined based on this identification.

[0086] S104. Based on the data tracking, obtain the traffic information corresponding to each page in multiple time periods within the target time range, and obtain the page traffic information corresponding to each time period.

[0087] The traffic information for a single page includes the traffic share and average dwell time of each redirecting page. The redirecting pages for a single page include all pages accessed from that page. The traffic share of the redirecting pages for a single page is the ratio of traffic from the page to the redirecting pages to the total page traffic. The average dwell time of the redirecting pages for a single page is the average dwell time before each redirect from the page to the redirecting page.

[0088] It should be noted that, due to significant differences in traffic and user behavior across different time periods, this embodiment of the application, in order to accurately conduct performance testing on the product under test, statistical data is collected for a target time range according to preset time slices. That is, for a given time range, such as a single day, this time range is divided into multiple time periods, and the traffic information corresponding to the page within each time period is obtained. Optionally, the page traffic information can also be stored in a table to better reflect the relationships between information and facilitate processing. For example, the page traffic information corresponding to each hour of a day can be statistically analyzed, as shown in Table 3, which analyzes traffic from 9:00 AM to 10:00 AM on a certain day. It should also be noted that, depending on different needs, the page traffic information may include other data. For example, in Table 3, to more accurately consider user behavior, redirection methods are also included.

[0089] Table 3

[0090]

[0091]

[0092] S105. Integrate the first correspondence information, the second correspondence information, and the page traffic information corresponding to each time period to obtain the association information corresponding to each time period.

[0093] It should be noted that since the first correspondence information includes the correspondence between pages and external interfaces, the second correspondence information stores the correspondence between external interfaces and internal interfaces, and the page traffic information stores the correspondence between pages and traffic information, there is common information among the three types of information. That is, there are common fields among the three tables storing the three types of information. Therefore, the three tables can be integrated based on the common fields to obtain the association information that summarizes all information, and it can also be stored in a tabular form, as shown in Table 4 below. Table 4 is obtained by integrating the above Tables 1, 2, and 3.

[0094] Table 4

[0095]

[0096]

[0097] It should be noted that, since the information in this embodiment is based on statistical analysis of tracking data, there may be some deviation in the data due to inaccurate or incomplete tracking. Therefore, optionally, in another embodiment of this application, after executing step S105, the information in the associated information can be further verified. Specifically, the verification process is as follows: Figure 2 As shown, it includes the following steps:

[0098] S201. Based on the associated information and the inbound traffic of the product to be tested, calculate the theoretical traffic of each target interface.

[0099] The target interface includes the various external interfaces and various internal interfaces in the associated information.

[0100] Specifically, based on the traffic share of the redirected pages associated with each interface in the association information and the total traffic of the entry point, the theoretical traffic of each interface is calculated.

[0101] S202. For each target interface, compare the theoretical traffic of the target interface with the actual traffic of the target interface.

[0102] S203. Determine whether the theoretical traffic of the target interface exceeds the preset ratio threshold if the actual traffic of the target interface is greater than the preset ratio threshold.

[0103] If it is determined that the theoretical traffic of the target interface exceeds the actual traffic of the target interface by a preset ratio threshold, it indicates that there is a duplicate record for the target interface in either the first or second correspondence information, so step S205 is executed. If it is determined that the theoretical traffic of the target interface does not exceed the actual traffic of the target interface by a preset ratio threshold, then step S204 is executed.

[0104] S204. Determine whether the theoretical traffic of the target interface is less than the actual traffic of the target interface by more than a preset ratio threshold.

[0105] If it is determined that the theoretical traffic of the target interface is less than the actual traffic of the target interface by more than a preset ratio threshold, then step S206 is executed. It should be noted that the execution order of steps S203 and S204 in this embodiment is only an optional method. The two are independent steps, so they can be executed simultaneously, or step S204 can be executed first, and step S203 can be executed if the determination is negative.

[0106] S205. Detect and delete duplicate records related to the target interface in the associated information.

[0107] Specifically, one approach is to directly detect and delete duplicate records related to the target interface in the association information. Alternatively, one can detect and delete duplicate records related to the target interface in both the first and second relationship tables, and then update the association tables based on the first and second correspondence information.

[0108] S206. Increase the value of page traffic information corresponding to the target interface in the associated information.

[0109] Specifically, it can improve the traffic share and other traffic-related information of pages that can be redirected through the target interface.

[0110] S106. For each time period in the target time range, identify multiple user access behaviors from the associated information and generate a performance test script for each user access behavior.

[0111] It should be noted that user access behavior mainly refers to the actions of navigating between different pages during the access process. In this embodiment, user behavior on different pages is planned as an independent scenario.

[0112] Specifically, based on the information in the associated information, performance test scripts for each user's access behavior are generated.

[0113] Optionally, in another embodiment of this application, one specific implementation of step S106 is as follows: Figure 3 As shown, the specific steps include:

[0114] S301. Based on the traffic information of each page in the associated information for each time period, determine the user access behavior by sequentially redirecting the page to its corresponding redirect page, until the total traffic ratio of the selected page to the redirect page is greater than a preset ratio threshold.

[0115] It should be noted that in this embodiment, not all page redirection behaviors are identified as user access behaviors, but rather they are selected sequentially until the total traffic percentage of the redirected pages corresponding to the selected pages exceeds a preset threshold.

[0116] S302. Generate a performance test script for each user access behavior based on each user access behavior and the average dwell time of the corresponding redirected page.

[0117] Specifically, user access behaviors can be categorized, and the same performance test script can be assigned to the same category of user access behavior. Then, for each category of user access behavior, the page call order and time allocation during the call process are determined, i.e., the average dwell time on the redirected page, and the corresponding API call order is determined based on the page call order. Finally, intelligent matching is performed using correlation information to transform the API calls into corresponding performance test scripts based on the result call order. It should be noted that consistency of user characteristics should be maintained across upstream and downstream scripts, such as tokens, cookies, context, and permissions, to ensure data consistency of each user's business data in their respective behavioral scenarios.

[0118] After obtaining the performance test scripts corresponding to each user's access behavior, the performance test scripts can be used as input to the pressure engine, which will then call them one by one according to the time slice plan to complete the performance script execution test.

[0119] This application provides a method for generating performance test scripts. By acquiring multiple preset tracking points in the product under test, including user access information, the method collects tracking data to accurately simulate real user behavior. Furthermore, planning based on this tracking data allows for better adaptation to changing needs. Then, it aggregates information about external interfaces associated with each page in the product under test to obtain a first correspondence relationship, and determines the internal interfaces associated with each external interface to obtain a second correspondence relationship. Based on the tracking data, it acquires traffic information for each page within multiple time periods within a target time range, obtaining page traffic information for each time period. Specifically, the traffic information for a page includes the traffic percentage and average dwell time of each redirected page; the redirected pages include all pages accessed from the current page; the traffic percentage of the redirected pages is the ratio of traffic from the current page to the redirected pages to the total page traffic; and the average dwell time of the redirected pages is the average dwell time before each redirect. This method segments the tracking data into time slices, mapping them to corresponding traffic and interface calls, achieving fine-grained management and dynamic generation of performance test scripts. Finally, the first correspondence information, the second correspondence information, and the page traffic information corresponding to each time period are integrated to obtain the association information corresponding to each time period. Then, for the association information corresponding to each time period in the target time range, multiple user access behaviors are determined from the association information, and a performance test script corresponding to each user access behavior is generated, which can effectively ensure the accuracy of the test results.

[0120] Another embodiment of this application provides a system for generating performance test scripts, such as... Figure 4 As shown, it includes the following units:

[0121] The acquisition unit 401 is used to acquire the data collected from multiple preset data points in the product under test.

[0122] The embedded data includes at least user access information.

[0123] The summarization unit 402 is used to summarize the information of the external interfaces associated with each page in the product under test to obtain the first correspondence information.

[0124] The first determining unit 403 is used to determine the internal interfaces associated with each of the external interfaces and obtain the second correspondence information.

[0125] The statistics unit 404 is used to obtain the traffic information corresponding to each page in multiple time periods within the target time range based on the embedded data, and obtain the page traffic information corresponding to each time period.

[0126] The traffic information for a given page includes the traffic percentage and average dwell time for each redirected page. The redirected pages include all pages accessed from the given page. The traffic percentage for each redirected page is the ratio of traffic from the given page to that redirected page to the total traffic of the given page. The average dwell time for each redirected page is the average dwell time before each redirect from the given page to that redirected page.

[0127] The integration unit 405 is used to integrate the first correspondence information, the second correspondence information, and the page traffic information corresponding to each time period to obtain the association information corresponding to each time period.

[0128] The generation unit 406 is used to determine multiple user access behaviors from the associated information corresponding to each time period in the target time range, and generate a performance test script corresponding to each user access behavior.

[0129] Optionally, in a performance test script generation system provided in another embodiment of this application, the acquisition unit includes:

[0130] The acquisition subunit is used to acquire the cached data collected from the multiple preset data points from the message middleware at a preset frequency.

[0131] Optionally, in another embodiment of the performance test script generation system provided in this application, the system further includes:

[0132] The preprocessing unit is used to preprocess the embedded data.

[0133] The preprocessing includes at least data idempotency verification, data cleaning and completion, and data anonymization.

[0134] Optionally, in another embodiment of the performance test script generation system provided in this application, the system further includes:

[0135] The calculation unit is used to calculate the theoretical traffic of each target interface based on the association information and the inbound traffic of the product to be detected.

[0136] The target interface includes each of the external interfaces and each of the internal interfaces in the associated information.

[0137] For each target interface, the theoretical traffic of the target interface is compared with the actual traffic of the target interface.

[0138] If the theoretical traffic of the target interface exceeds the actual traffic of the target interface by more than the preset ratio threshold, then duplicate records about the target interface in the associated information are detected and deleted.

[0139] If the theoretical traffic of the target interface is less than the actual traffic of the target interface by more than a preset ratio threshold, then the value of the page traffic information corresponding to the target interface in the associated information is increased.

[0140] Optionally, in another embodiment of the performance test script generation system provided in this application, the generation unit, such as... Figure 5 As shown, it includes:

[0141] The second determining unit 501 is used to determine user access behavior by sequentially jumping the page to its corresponding redirect page based on the traffic information corresponding to each page in the associated information of each time period in the target time range, until the sum of the traffic proportions of the selected page and the corresponding redirect page is greater than a preset proportion threshold.

[0142] The generation subunit 502 is used to generate a performance test script for each user access behavior based on each user access behavior and the average dwell time of the corresponding redirected page.

[0143] It should be noted that the specific working process of each unit provided in the above embodiments of this application can be referred to the corresponding steps in the above method embodiments, and will not be repeated here.

[0144] Another embodiment of this application provides an electronic device, such as... Figure 6 As shown, it includes:

[0145] Memory 601 and processor 602.

[0146] The memory 601 is used to store programs. The processor 602 is used to execute the programs stored in the memory 601, and when the programs are executed, they are specifically used to implement the method for generating performance test scripts as provided in any of the above embodiments.

[0147] A fourth aspect of this application provides a computer storage medium for storing a computer program, which, when executed, implements the method for generating performance test scripts as provided in any of the above embodiments.

[0148] Computer storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0149] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0150] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating performance test scripts, characterized in that, include: Acquire the data collected from multiple preset tracking points in the product under test; Summarize the information of the external interfaces associated with each page in the product under test to obtain the first correspondence information; Determine the internal interfaces associated with each of the external interfaces to obtain the second correspondence information; Based on the data points, traffic information for each page within multiple time periods of the target time range is obtained, resulting in page traffic information for each time period. The traffic information for a single page includes the traffic percentage and average dwell time for each redirected page. The redirected pages include all pages accessed from the page. The traffic percentage of the redirected pages is the ratio of traffic from the page to the redirected page to the total traffic of the page. The average dwell time of the redirected pages is the average dwell time before each redirect from the page to the redirected page. The first correspondence information, the second correspondence information, and the page traffic information corresponding to each time period are integrated to obtain the association information corresponding to each time period. For each time period within the target time range, the associated information is used to determine multiple user access behaviors, and a performance test script is generated for each user access behavior.

2. The method according to claim 1, characterized in that, The acquisition of data from multiple preset data points in the product under test includes: The data collected from the multiple preset data points in the cache is retrieved from the message middleware at a preset frequency.

3. The method according to claim 1, characterized in that, After acquiring the data collected from multiple preset tracking points in the product under test, the process also includes: The embedded data is preprocessed; wherein the preprocessing includes at least data idempotency verification, data cleaning and completion, and data anonymization.

4. The method according to claim 1, characterized in that, The step of determining multiple user access behaviors from the association information corresponding to each time period within the target time range, and generating a performance test script corresponding to each user access behavior, includes: Based on the traffic information corresponding to each page in the associated information of each time period in the target time range, the behavior of sequentially jumping the page to its corresponding jump page is used to determine the user access behavior until the sum of the traffic proportions of the selected page and the corresponding jump page is greater than a preset proportion threshold. Based on each user access behavior and the average dwell time of the corresponding redirected page, a performance test script is generated for each user access behavior.

5. A performance test script generation system, characterized in that, include: The acquisition unit is used to acquire the data collected from multiple preset tracking points in the product under test. The summarization unit is used to summarize the information of the external interfaces associated with each page in the product under test to obtain the first correspondence information; The first determining unit is used to determine the internal interfaces associated with each of the external interfaces and obtain the second correspondence information. The statistics unit is used to obtain traffic information corresponding to each page within multiple time periods of the target time range based on the data points, thereby obtaining page traffic information corresponding to each time period. The traffic information corresponding to a page includes the traffic percentage and average dwell time of each redirected page. The redirected pages include all pages accessed from the page. The traffic percentage of the redirected pages is the ratio of traffic from the page to the redirected page to the total traffic of the page. The average dwell time of the redirected pages is the average dwell time before each redirection from the page to the redirected page. An integration unit is used to integrate the first correspondence information, the second correspondence information, and the page traffic information corresponding to each time period to obtain the association information corresponding to each time period. The generation unit is used to determine multiple user access behaviors from the associated information corresponding to each time period in the target time range, and generate a performance test script corresponding to each user access behavior.

6. The system according to claim 5, characterized in that, The generation unit includes: The second determining unit is used to determine user access behavior by sequentially jumping the page to its corresponding redirect page based on the traffic information of each page in the associated information of each time period in the target time range, until the sum of the traffic proportions of the selected page and the corresponding redirect page is greater than a preset proportion threshold. A generation subunit is used to generate a performance test script for each user access behavior based on each user access behavior and the average dwell time of the corresponding redirected page.

7. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program, which, when executed, is specifically used to implement the method for generating performance test scripts as described in any one of claims 1 to 4.

8. A computer storage medium, characterized in that, Used to store a computer program, which, when executed, implements the method for generating a performance test script as described in any one of claims 1 to 4.