Streaming interface multi-dimensional performance test method, device, equipment and medium

By dynamically injecting business parameters and identifying and splicing timestamps of streaming response data, the problem of existing tools being unable to quantify streaming interface performance is solved, achieving comprehensiveness and stability of multi-dimensional performance testing and generating intuitive test reports.

CN120835013APending Publication Date: 2025-10-24CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510974640.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

Existing streaming interface testing tools cannot fully quantify performance metrics such as first token latency and streaming rate, which may lead to transaction failures or affect doctors' judgment in scenarios such as financial transactions and medical monitoring.

Method used

Dynamic business parameters are injected by obtaining query parameters from test cases, streaming response data is identified, incomplete JSON is concatenated across blocks, timestamps are extracted to calculate performance metrics, and test reports are generated.

Benefits of technology

It improves the reference value of test results, reduces resource consumption, ensures the stability of the interface under diverse inputs, can intuitively reflect performance and generate structured reports, and facilitates quick understanding of test conclusions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120835013A_ABST
    Figure CN120835013A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of performance testing, can be applied to business system platforms of financial science and technology, medical treatment and health and the like, and discloses a streaming interface multi-dimensional performance testing method, device, equipment and medium, and the method comprises the following steps: obtaining query parameters in a test case, and carrying out dynamic business parameter injection on the query parameters to obtain a test request; obtaining streaming response data according to the test request, and performing effective identification on the streaming response data to obtain effective data; performing incomplete JSON cross-block splicing on the effective data to obtain a complete JSON token fragment; extracting a timestamp of the complete JSON token fragment, and determining performance index data of the complete JSON token fragment according to the timestamp; and generating a test report according to the performance index data and preset original request parameters. And calculating performance index data through the timestamps, and quantifying the response capability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of performance testing, in particular to a stream interface multi-dimensional performance testing method, device, equipment and medium. BACKGROUND

[0002] The stream interface multi-dimensional performance testing is essentially a method of carrying out systematic performance testing from multiple dimensions such as throughput, delay and concurrent processing capability for an interface of continuous output data stream; and with the deepening development of digital scenarios, the application of stream interface has covered diversified scenarios such as real-time clearing of financial transactions and transmission of medical monitoring data, for example, in the scenarios of stock high-frequency trading and cross-border payment clearing in the field of financial technology, transaction instructions and market data are continuously pushed in the form of stream, the interface needs to process massive order streams in real time, and the delay requirement is usually in the order of milliseconds, otherwise it may cause transaction failure or loss of funds; in the medical and health scenario, ICU intensive care equipment continuously pushes patient vital sign data, and the stream interface needs to receive and analyze data in real time, and if the delay exceeds 1 second, it may affect the doctor's judgment of critical conditions.

[0003] The current mainstream stream interface testing tools in the industry use Postman and JMeter, but these tools only count the total response time and lack quantitative analysis of dimensions such as first token delay and stream transmission rate, and the performance indicators are single. SUMMARY

[0004] The present application provides a stream interface multi-dimensional performance testing method, device, equipment and medium, which calculates performance indicator data through timestamp and quantifies system response capability.

[0005] In a first aspect, a stream interface multi-dimensional performance testing method is provided, comprising: Obtaining query parameters in a test case, dynamically injecting business parameters into the query parameters to obtain a test request; Obtaining stream response data according to the test request, effectively identifying the stream response data to obtain effective data; Performing non-complete JSON cross-block splicing on the effective data to obtain a complete JSON token segment; Extracting a timestamp of the complete JSON token segment, and determining performance indicator data of the complete JSON token segment according to the timestamp; Generating a test report according to the performance indicator data and a preset original request parameter.

[0006] In a second aspect, a stream interface multi-dimensional performance testing device is provided, comprising: An obtaining injection module for obtaining query parameters in a test case, dynamically injecting business parameters into the query parameters to obtain a test request; an acquisition module configured to acquire streaming response data according to the test request; an identification module configured to effectively identify the streaming response data to obtain valid data; a splicing module configured to perform non-complete JSON cross-block splicing on the valid data to obtain a complete JSON token fragment; an extraction and determination module configured to extract a timestamp of the complete JSON token fragment and determine performance index data of the complete JSON token fragment according to the timestamp; a generation module configured to generate a test report according to the performance index data and preset original request parameters.

[0007] In a third aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above-described multi-dimensional performance test method for a streaming interface when executing the computer program.

[0008] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program implements the steps of the above-described multi-dimensional performance test method for a streaming interface when executed by a processor.

[0009] In the above-described multi-dimensional performance test method for a streaming interface, the parameters of different business scenarios are dynamically injected to avoid the limitation of hard-coded parameters, cover more boundary conditions, and ensure the stability of the interface under diversified inputs. The parameters are dynamically generated according to business logic, so that the test request is closer to the real calling scenario of the production environment, and the reference value of the test result is improved. Invalid content is filtered through an identification rule to avoid misjudgment of the test result caused by noise data, reduce the analysis and storage overhead of invalid data, and especially in a high-concurrency streaming scenario, the resource consumption of the test tool can be reduced. In the streaming transmission, the JSON data may be split into multiple blocks due to network fragmentation or buffer limitations, and cross-block splicing can avoid parsing failure caused by data truncation. The core indexes such as request response time and throughput are calculated through the timestamp to intuitively reflect the performance of the interface under different loads. The performance indexes (such as response time and error rate), original request parameters, and test results are integrated into a structured report, and the system performance is intuitively displayed through charts, which facilitates the test and development team to quickly understand the test conclusion. BRIEF DESCRIPTION OF DRAWINGS

[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without any creative effort.

[0011] Figure 1 is a schematic diagram of an application environment of a flow interface multi-dimensional performance test method in an embodiment of the present application; Figure 2 is a flowchart of a flow interface multi-dimensional performance test method in an embodiment of the present application; Figure 3 is a structural schematic diagram of a flow interface multi-dimensional performance test device in an embodiment of the present application; Figure 4 is a structural schematic diagram of a computer device in an embodiment of the present application; Figure 5 is another structural schematic diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

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

[0013] The flow interface multi-dimensional performance test method provided in the embodiments of the present application can be applied in, for example, Figure 1In an application environment of the application, a client communicates with a server through a network. The server can obtain a query parameter in a test case, perform dynamic business parameter injection on the query parameter to obtain a test request, obtain streaming response data according to the test request, perform effective identification on the streaming response data to obtain effective data, perform non-complete JSON cross-block splicing on the effective data to obtain a complete JSON token segment, extract a timestamp of the complete JSON token segment, determine performance index data of the complete JSON token segment according to the timestamp, generate a test report according to the performance index data and a preset original request parameter, and feed back the test report to the client. The application provides a streaming interface multi-dimensional performance testing device, which is used for test report business, calculates performance index data through a timestamp, and quantifies system response capability. The client can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers. The application will be described in detail through specific embodiments.

[0014] Please refer to Figure 2 as shown, Figure 2 A flowchart of a streaming interface multi-dimensional performance testing method provided by an embodiment of the application is shown in the figure, and includes the following steps: S1, obtaining a query parameter in a test case and performing dynamic business parameter injection on the query parameter to obtain a test request.

[0015] In the embodiment of the application, the obtaining refers to extracting a query parameter from preset content of a test case, and the dynamic business parameter injection refers to merging a dynamically generated business parameter into the obtained query parameter to cover or supplement an original value, so that the parameter meets a real business scenario.

[0016] Specifically, the query parameter is extracted from the preset content of the test case, such as key = value in URL and fields in a request body. The structured query parameter set is obtained by parsing a test case document, an automated script or data storage (such as Excel or a database) to locate and extract the preset parameter key-value pair. The parameter value is not fixed, and is dynamically generated or replaced according to real-time business scenarios, rules or external data. The dynamically generated business parameter is merged into the obtained query parameter to cover or supplement the original value.

[0017] In a medical health specific scenario, when an electronic medical record system is tested, real patient diagnosis codes, medication records and other parameters are injected to verify the processing logic of the system for different cases. When a medical device interface is tested, patient vital sign data is dynamically injected to ensure the accuracy of data transmission and storage.

[0018] In the financial technology scenario, different transaction type parameters such as "transaction type = transfer", "amount = 100.01", and "account type = credit card" are injected to test the processing capability of the payment system for small / large, cross-account transactions.

[0019] In the embodiment of the application, the dynamic service parameter injection on the query parameter is to obtain a test request, which comprises: The query parameter is parsed into a structured object, and the structured object is legally verified to obtain a legal parameter object; The legal parameter object is matched with a service parameter template; The service parameter template and the legal parameter object are dynamically injected to obtain an injected parameterized request body; The injected parameterized request body is legally packaged to obtain a test request.

[0020] In the embodiment of the application, the parsing refers to converting the original query parameter into a structured object, so that the parameter has a machine-recognizable logical structure, the legal verification refers to checking whether the parsed parameter meets the expected rules to ensure the legality of the parameter, the matching refers to matching the legal parameter with a predefined service parameter template to ensure that the parameter meets the requirements of the service interface, the dynamic injection refers to dynamically filling the legal parameter into the service parameter template to generate a complete request body, and the legal packaging refers to converting the injected parameter into a request format that meets the interface requirements.

[0021] Specifically, when the query parameter is parsed into a structured object, the parameter fragments are divided by & and the key-value pairs are parsed by =, special character encoding is processed, and a JSON object, a dictionary or an entity class is converted, the structured object is verified whether the key parameters such as user_id exist, the format verification is performed, for example, the amount parameter must be a number, the date parameter must meet the specified format, the value domain verification is performed, for example, the type can only be a value in ["query", "update", "delete"], the amount cannot be negative, and finally the legal parameter object is output.

[0022] Further, according to the parameter characteristics (such as type=query), the corresponding service template is found, the parameters are mapped to the placeholders of the template, the mapping relationship between the parameters and the template is output, the placeholders in the template are replaced with the actual parameter values, the dynamic parameters not contained in the template are supplemented, and the injected parameterized request body is obtained.

[0023] Further, the parameterized request body after injection is formatted and serialized, a protocol header is added, and encryption / signature processing is performed, specifically, the JSON object is converted into a specified format (such as a JSON string, an XML document, form data), for example, an HTTP request needs to be encapsulated as {"headers":{"Content-Type": "application / json"}, "body":"parameter body"}, in the financial scenario, the request body is RSA signed, in the medical scenario, sensitive data (such as medical records) is desensitized and encrypted, and finally, a test request meeting the requirements of the target system is output.

[0024] In the embodiment of the application, structured data facilitates direct code calling, avoids the complexity of string parsing, can process nested parameters, adapts to multi-level business scenarios, filters format errors and missing required parameters in advance, prevents test failure due to "illegal parameters", focuses on real business logic problems, and the template predefines the parameter structure of the business scenario to avoid missing key parameters in test cases.

[0025] In the embodiment of the application, different parameter combinations are dynamically injected, a large number of test scripts do not need to be manually written, test requests covering boundary conditions and abnormal scenarios can be batch generated, test comprehensiveness is improved, and when business parameter rules change, the injection logic only needs to be adjusted, test cases do not need to be modified one by one, and maintenance cost is reduced.

[0026] S2, obtaining streaming response data according to the test request, and effectively identifying the streaming response data to obtain valid data.

[0027] In the embodiment of the application, the obtaining refers to receiving streaming response data from a server side through an HTTP request, and the effective identification refers to extracting, filtering and parsing valid information meeting business requirements from streaming data, and ignoring noise or irrelevant data.

[0028] Specifically, after sending a test request to a target system, streaming response data (such as content transmitted in byte stream segments) returned by the target system is continuously received, and the data is screened: first, the original byte stream is decoded into a string line, invalid content such as empty lines and protocol headers is filtered out, and then data segments containing valid information are identified through business identification (such as a data: prefix) or format rules (such as a JSON starting symbol), and finally, a valid data set that can be used for subsequent parsing is obtained, and this process ensures that valuable business data is accurately extracted from streaming response.

[0029] In the medical health scene, the vital sign data and image examination data transmitted in real time by the medical equipment are filtered in real time after effective identification, invalid signals are filtered, key indicators such as heart rate and blood oxygen saturation are extracted, and the medical staff is helped to quickly locate the abnormality.

[0030] In the financial scene, when the payment system receives streaming transaction data such as bank card consumption and cross-border transfer, effective identification can extract transaction features such as IP address, device fingerprint and transaction amount in real time, and match with the risk control rule library, such as identifying the "early morning overseas large consumption" label, triggering secondary verification or interception immediately.

[0031] In the embodiment of the application, the effective identification of the streaming response data obtains valid data, comprising: segment decoding the streaming response data to obtain an original data row list; invalid filtering the original data row list to obtain a candidate data row set; identity stripping the candidate data row set, and legally screening the stripping result to obtain valid data.

[0032] In the embodiment of the application, the segment decoding refers to decomposing the streaming response data into an original data row list according to a protocol or format rule, the invalid filtering refers to removing invalid data from the original data row list to obtain a candidate data row set, the identity stripping refers to removing non-business data identifiers (such as prefixes, suffixes and metadata markers) from the candidate data row set and only retaining core data, and the legal screening refers to performing business rule verification on the stripping result to ensure that the data meets the legal requirements and obtains valid data.

[0033] Specifically, a binary byte stream of a streaming response (such as segmented data of HTTP chunked transmission) is split into independent data segments according to data boundaries (such as \r\n line feed characters or specified byte length markers); each data segment is converted by encoding, binary data is converted into a string, and then the string is divided by line to generate an original data row list; the original data row list is traversed, invalid content is filtered through regular expression or rule matching, for example, empty lines, protocol control lines, discarded data with verification failure and repeated data are filtered, and data rows meeting the basic format requirements are retained to form a candidate data row set.

[0034] Further, transmission identifiers or protocol prefixes (such as data: and event: prefixes of the SSE protocol) in the data row are removed, pure business data content is extracted, the stripped data is format-verified (such as JSON parsing and XML Schema verification), and invalid data is filtered based on business rules.

[0035] In the embodiment of the present application, the segmented processing can avoid the influence of a single data segment error on the overall analysis, for example, when a segment of market data transmission is incorrect in a financial market stream, only the segment is discarded instead of interrupting the entire data stream; in medical image streaming, noise data in the preheating stage of the filtering device is filtered to ensure the accuracy of the diagnostic image data.

[0036] In the embodiment of the present application, invalid information is filtered to ensure that the obtained data is real and available, and to avoid misjudgment. The data usability is improved, the key business data is quickly located, the occupation of system resources by invalid data is reduced, and the response link is accelerated; through format checking and rule screening, it is ensured that the data conforms to the industry standard, and the compliance risk is reduced.

[0037] S3, non-complete JSON cross-block splicing is performed on the valid data to obtain a complete JSON token segment.

[0038] In the embodiment of the present application, the non-complete JSON cross-block splicing refers to restoring a complete JSON token segment through caching, splicing and syntax analysis when processing an incomplete JSON segment in streaming data.

[0039] Specifically, when the valid data in the streaming response exists in fragmented JSON segments (for example, a complete JSON object is split into multiple data blocks for transmission), the non-complete JSON segments across blocks are spliced into complete tokens (for example, complete JSON objects) by identifying segment boundaries (for example, bracket matching, field interruption markers), to ensure the structural integrity of the business data.

[0040] In the specific scenario of medical health, for example, when an ICU monitor transmits patient vital sign data in a streaming manner, a complete JSON medical record may be split into multiple data blocks due to network fragmentation; cross-block splicing can avoid missing of diagnostic information caused by data fragmentation, and ensure that the electronic medical record system obtains complete real-time physiological indicators to support accurate judgment by doctors.

[0041] In the financial scenario, real-time transaction streams received by financial institutions, such as UnionPay payment messages and stock order data, are often transmitted in segmented JSON, and after splicing, complete transaction records (including merchant information, amount, timestamp, etc. Full field) can be formed to meet the requirements of transaction traceability for supervision, such as the need for complete analysis of the JSON structure of each transaction when performing anti-money laundering audit.

[0042] In the embodiment of the present application, the non-complete JSON cross-block splicing of the valid data to obtain a complete JSON token segment comprises: The valid data is subjected to non-complete JSON segment identification, and the identified non-complete segments are subjected to stateful caching to obtain a non-complete JSON segment cache queue; taking out a first incomplete fragment in the non-complete JSON fragment cache queue, and merging the first incomplete fragment with a fragment in the valid data into a merged fragment; calculating a bracket balance degree of the merged fragment, and checking a quotation closing condition of the merged fragment; generating a complete JSON token fragment according to the bracket balance degree and the quotation closing condition.

[0043] In the embodiment of the application, the non-complete JSON fragment identification refers to identifying a JSON fragment with incomplete syntax (such as missing closing brackets, unclosed quotation marks, etc.) from a valid data stream, the state-based caching refers to caching the identified non-complete JSON fragment into a queue according to a parsing state, the taking out refers to taking out a first fragment from the non-complete JSON fragment cache queue, the merging refers to splicing the taken-out non-complete fragment with a fragment in subsequent valid data, the calculating refers to counting a number difference of brackets in the merged fragment, the checking refers to checking whether strings in the merged fragment are closed in pairs, and the generating refers to judging whether the merged fragment is a complete JSON according to the bracket balance degree and the quotation closing condition, and generating a result.

[0044] Specifically, the valid data fragments are traversed, the fragment completeness is judged by bracket balance degree counting and quotation closing state, if the fragment is {"data": [1, 2, then the count + 1, [count + 1, the end is not closed, and it is determined to be non-complete; the parsing state (such as bracket nesting layer, whether in a string) of each non-complete fragment is maintained and stored in a queue; for example, the bracket level of {"data": [ is recorded as 1, and the string state is not started.

[0045] Further, the first non-complete fragment in the cache queue (first in, first out principle) is taken out and spliced with a new incoming valid data fragment, and direct string splicing is performed, for example, the first fragment in the queue is {"price": 123.4, and the new fragment is 5}, and the merging is {"price": 123.45}; the number difference of / and / is recorded by using a counter, and the merged fragment is traversed; the state (open / close) of " is tracked while traversing the string, and the escape character \" is skipped. For example, "message": "hello is determined to be invalid because the quotation is not closed.

[0046] Further, when the bracket balance degree is 0 and all the quotations are closed, it is determined to be a complete JSON fragment, otherwise, it continues to be cached and waits for subsequent data; finally, a standard JSON string (such as {"status": "ok", "data": [1, 2]} is generated, which can be directly processed by a JSON parser.

[0047] In the embodiment of the present application, the scene that the streaming data is split into multiple segments due to network transmission or protocol restriction is dealt with, data loss is avoided, the segments are cached in the queue according to the receiving order to ensure that the data timing is correct when subsequent merging, the segments are merged according to the receiving order to avoid JSON structure error caused by out-of-order splicing, and the bracket balance and the quotation closure are calculated and checked to ensure that the merged segments meet the basic syntax of JSON, and the exception is avoided during parsing.

[0048] In the embodiment of the present application, the fragmented data caused by network transmission or protocol splitting can be recombined into a structured JSON token segment through non-integral JSON cross-block splicing in valid data, data loss or parsing exception can be avoided, and the accuracy and timeliness of data processing can be improved while ensuring that the business system performs analysis, storage and other operations based on complete data.

[0049] S4, extracting the timestamp of the complete JSON token segment, and determining the performance index data of the complete JSON token segment according to the timestamp.

[0050] In the embodiment of the present application, the extraction refers to parsing the time-related field from the complete JSON token segment and converting it into a usable time format, and the determination refers to calculating or deriving the performance-related index (such as delay, throughput, response time, etc.) according to the extracted timestamp.

[0051] Specifically, the timestamp (such as the time identifier of data generation or reception) is extracted from the complete JSON token segment, and the performance index data related to time, such as data processing delay and processing throughput per unit time, is calculated according to the timestamp, so as to measure the efficiency of data transmission, parsing and other links and provide quantitative basis for system performance optimization in time dimension.

[0052] In the embodiment of the present application, the determination of the performance index data of the complete JSON token segment according to the timestamp comprises: determining the core time difference of the complete JSON token segment according to the timestamp; mapping the core time difference to a preset standard performance index to obtain the standard performance index of the token; performing aggregate calculation on the standard performance index to obtain the performance index data of the complete JSON token segment.

[0053] In the embodiment of the present application, the determination refers to calculating the time difference between key events in the JSON token segment according to the extracted timestamp, and the aggregate calculation refers to statistical aggregation (such as calculating the average value, maximum value, minimum value, distribution, etc.) of the standard performance index of multiple JSON token segments.

[0054] Specifically, key timestamp fields such as generation time, reception time and processing time are parsed from the JSON token, and the calculation formula is: core time difference = target timestamp - reference timestamp; for example, transmission delay = receiveTime-createTime (time consumed from data generation to reception); processing delay = processTime-receiveTime (time consumed from reception to processing completion).

[0055] Further, the correspondence between the threshold interval and the standard index is defined; for example, core time difference < 100 ms, and the standard performance index is excellent, in addition, the mapping threshold can be adjusted through a configuration file or a dynamic parameter to adapt to the sensitivity of different businesses to performance.

[0056] Further, when the standard performance index is aggregated and calculated, the index distribution (such as the proportion of tokens of the "excellent" level per hour) is first calculated according to the time window such as minute and hour, and the average value, maximum value, minimum value, quantile, frequency distribution are calculated, and the aggregation result is encapsulated in the form of JSON or table.

[0057] In addition, the performance index calculation includes first token time, stream transmission duration and throughput, first token time = first valid data arrival time - request start time, stream transmission duration = last token time - first token time, and throughput = response character number / total response time.

[0058] In the embodiment of the application, the core time difference of the complete JSON token segment is determined according to the timestamp, which includes: The structured timestamp object of the complete JSON token segment is parsed according to the timestamp; The key time point difference value of the structured timestamp object is calculated to obtain a basic time difference; The basic time difference is mapped to a business time index; The business time index is converted to obtain the core time difference of the complete JSON token segment.

[0059] In the embodiment of the application, the parsing refers to extracting the timestamp field from the complete JSON token segment and converting it into a structured time object, the key time point difference calculation refers to calculating the difference between key time points (such as request-response time difference, processing time consumption, etc.) of the structured timestamp object, the business mapping refers to mapping the basic time difference to a business time index, and the unit conversion refers to converting the business time index (such as time difference) to a unit required by the business (such as millisecond, minute, percentage, etc.).

[0060] Specifically, the timestamp-related fields are located from the JSON token, multiple timestamp fields (such as containing three timestamps of generation, reception and processing) are supported, the multiple timestamp fields are subjected to format standardization processing, for example, if it is a Unix timestamp, it is converted into a millisecond-level or second-level time object; if it is a string format, it is parsed according to ISO 8601 or a custom format; if it is a multiple timestamp combination, it is encapsulated as a dictionary or an object storage, and a non-UTC timestamp is converted into a uniform time zone.

[0061] Further, when calculating the key time point difference, two or more key time points (such as request time and response time) are selected from the parsed time object, and the time difference between the two or more key time points is calculated, so as to obtain a basic time difference value (such as a second or millisecond level time consumption) for subsequent analysis.

[0062] Further, a mapping relationship is defined through a JSON / XML configuration file or a database table, a mapping rule is matched according to the basic time difference value, for example, delta_seconds=0.3s (300ms) is mapped to 'fast', and multiple dimensions are supported, such as simultaneously mapping delay levels and business impact levels; finally, an output unit is determined according to business requirements, for example, technical monitoring: millisecond (ms), microsecond (μs); business report: second (s), minute (min); visual display: percentage (such as deviation rate relative to threshold); wherein the conversion includes numerical conversion, proportional conversion and precision processing; the converted core time difference is associated with a business index to form structured data.

[0063] In the embodiment of the application, the time difference directly reflects the efficiency bottleneck of data in transmission, processing and other links, and provides a clear direction for performance optimization; the time difference is converted into a standardized index; the performance performance is facilitated to be compared across systems and across scenes; the overall trend is grasped through aggregated data, rather than isolated single-point index.

[0064] In the embodiment of the application, the timestamps of the complete JSON token segment are extracted and the performance index data is determined according to the timestamps, the efficiency and quality of data processing can be quantified with time dimension as the core, the whole cycle time from data generation to processing completion can be accurately tracked through the timestamps, and key performance parameters such as analysis speed and response delay are analyzed, thereby providing data support for system optimization, resource scheduling and performance bottleneck positioning.

[0065] S5、According to the performance index data and the preset original request parameter, a test report is generated.

[0066] In the embodiment of the present application, the generating refers to integrating, analyzing, typesetting and visualizing the data according to the established logic and format rules based on the performance index data (such as response time, throughput, error rate and other quantitative results) and the preset original request parameters (such as request URL, method, input parameter, header and other test conditions), and finally forming a test report document with complete structure and detailed content.

[0067] Specifically, the performance index data (such as response time, throughput, error rate and the like) is combined with the original request parameters (such as URL, request method, input parameter and the like) used during the test, and a test report containing test results, data comparison and conclusion suggestions is automatically arranged, analyzed and generated according to the preset report template and format requirements, so that the report can not only reflect the correlation between the request parameters and the performance, but also present the running state of the system under different test conditions through quantitative indicators.

[0068] In the embodiment of the present application, the generating of the test report according to the performance index data and the preset original request parameters comprises: extracting core values in the performance index data and extracting interface information of the preset original request parameters; merging the core values and the interface information into a structured data object; organizing chapters of the structured data object to obtain a report basic data block; adding analysis conclusions and visual elements based on the report basic data block, and generating a test report according to the analysis conclusions and the visual elements.

[0069] In the embodiment of the present application, the extracting core values refers to extracting key values (such as response time, throughput, error rate and the like) from the performance index data, the extracting interface information refers to extracting interface-related information (such as interface name, URL, request method, parameter and the like) from the original request parameters, the merging refers to associating and integrating the extracted core values and interface information according to a preset data model, and the chapter organization refers to organizing the structured data object according to chapters or logic of the report, and the adding refers to inserting the analysis conclusions and visual elements into the structured data object according to a preset rule.

[0070] Specifically, the core values (such as response time, throughput, error rate and other quantitative indicators) are screened from the performance index data, and the interface information (such as interface URL, request method, request parameter format, header configuration and the like) is extracted from the original request parameters, the extracted core values and interface information are associated and integrated according to a preset data model (such as JSON, XML or table structure), and a structured data object containing the mapping relationship of "interface identifier-performance index" is formed.

[0071] Further, based on the structured data object, logical analysis is performed, for example, comparison of performance indicators with preset thresholds, trend analysis, and outlier identification, to generate qualitative conclusions such as "interface response time exceeds industry standard by 20%" and "throughput under high concurrency does not meet expectations"; then, core numerical values are converted into charts, such as bar charts showing comparison of different interface response times, line charts presenting throughput trends, and dashboards displaying error rate percentages, and the like visual components are matched with the analysis conclusions; finally, the analysis conclusions and visual elements are inserted into the structured data object according to preset rules to form a report basic data block containing "data-analysis-visualization" in one.

[0072] Further, according to a report template such as "overview-interface performance data-problem analysis-suggestions", the structured data block, analysis conclusion, and visual element are grouped in logical order to form a report chapter framework, such as the "interface performance details" chapter containing structured data and charts for each interface; the data block is automatically filled into the preset template by a template engine to complete text layout, chart layout, page generation, and the like format processing; and a final test report (such as in PDF, Word, or HTML format) is generated, containing table of contents, index, data source description, and the like auxiliary information.

[0073] In addition, an automated report can be generated through multi-threaded testing, the thread pool size can be configured, and dynamic resource release can be achieved in combination with streaming response status; test cases are executed concurrently through threading_run_list_case, and an Excel test report is automatically generated after the results are collected, containing request parameters, response data, performance indicators, and the like.

[0074] In the embodiments of the present application, the dispersed performance data and interface information are unified in a format, facilitating subsequent processing and storage, and avoiding data fragmentation; the visual elements convert abstract data into intuitive charts, reducing the understanding cost and facilitating non-technical personnel to quickly obtain key information; the analysis conclusions are based on data quantization results, avoiding subjective judgment and providing an objective basis for problem positioning and optimization suggestions; through template generation, the repetitive work of manually writing reports is avoided, and the report production time is greatly shortened.

[0075] In the embodiments of the present application, the performance indicator data is combined with the preset original request parameters to generate a test report, which can use the request parameters as test condition anchors, accurately associate the quantization results of performance indicators, and intuitively present the system performance under different request parameter configurations through data integration and analysis, facilitating the tracing of the causal relationship between the test scene and performance, providing a basis for positioning parameter optimization direction, and improving the readability and persuasiveness of test results through a standardized report structure.

[0076] It can be seen that in the above scheme, for the test report business, the query parameters in the test case are obtained, and the query parameters are dynamically injected with business parameters to obtain a test request; streaming response data is obtained according to the test request, and the streaming response data is effectively identified to obtain valid data; incomplete JSON cross-block splicing is performed on the valid data to obtain a complete JSON token fragment; the timestamp of the complete JSON token fragment is extracted, and the performance indicator data of the complete JSON token fragment is determined according to the timestamp; a test report is generated according to the performance indicator data and the preset original request parameters, and the performance indicator data is calculated through the timestamp to quantify the system response capability.

[0077] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0078] In one embodiment, a streaming interface multi-dimensional performance testing device is provided, which corresponds one-to-one to a streaming interface multi-dimensional performance testing method in the above embodiment. Figure 3 As shown, the multi-dimensional performance testing device for a streaming interface includes an acquisition and injection module 101, an acquisition module 102, an identification module 103, a splicing module 104, an extraction and determination module 105, and a generation module 106. The functional modules are described in detail as follows: The acquisition and injection module 101 is used to obtain query parameters in the test case, and perform dynamic business parameter injection on the query parameters to obtain a test request; An acquisition module 102 is configured to acquire streaming response data according to the test request; The identification module 103 is used to effectively identify the streaming response data to obtain valid data; A splicing module 104 is configured to perform incomplete JSON cross-block splicing on the valid data to obtain complete JSON token segments; An extraction and determination module 105 is configured to extract a timestamp of the complete JSON token segment and determine performance indicator data of the complete JSON token segment based on the timestamp; The generating module 106 is configured to generate a test report based on the performance indicator data and preset original request parameters.

[0079] In one embodiment, the acquisition and injection module 101, when performing dynamic business parameter injection on the query parameter to obtain a test request, is used to: Parsing the query parameters into a structured object and performing a legal check on the structured object to obtain a legal parameter object; match a service parameter template with the legal parameter object; perform dynamic injection on the service parameter template and the legal parameter object to obtain an injected parameterized request body; perform legal format packaging on the injected parameterized request body to obtain a test request.

[0080] In an embodiment, the identification module 103, when effectively identifying the streaming response data to obtain effective data, is configured to: perform segmented decoding on the streaming response data to obtain a list of raw data rows; perform invalid filtering on the list of raw data rows to obtain a candidate data row set; perform identification stripping on the candidate data row set, and perform legal screening on the stripping result to obtain effective data.

[0081] In an embodiment, the splicing module 104, when non-integrally splicing the effective data to obtain a complete JSON token fragment, is configured to: perform non-integral JSON fragment identification on the effective data, and perform stateful caching on the identified non-integral fragments to obtain a non-integral JSON fragment cache queue; take out a first non-integral fragment in the non-integral JSON fragment cache queue, and combine the first non-integral fragment with a fragment in the effective data into a combined fragment; calculate the bracket balance degree of the combined fragment, and check the quotation closing condition of the combined fragment; generate a complete JSON token fragment according to the bracket balance degree and the quotation closing condition.

[0082] In an embodiment, the extraction determination module 105, when determining the performance indicator data of the complete JSON token fragment according to the timestamp, is configured to: determine the core time difference of the complete JSON token fragment according to the timestamp; map the core time difference to a preset standard performance indicator to obtain a standard performance indicator of the token; perform aggregation calculation on the standard performance indicator to obtain the performance indicator data of the complete JSON token fragment.

[0083] In an embodiment, when determining the core time difference of the complete JSON token fragment according to the timestamp, the method is configured to: parse a structured timestamp object of the complete JSON token fragment according to the timestamp; perform key time point difference calculation on the structured timestamp object to obtain a basic time difference; The base time difference is business mapped to obtain a business time index; The business time index is unit converted to obtain a core time difference of a complete JSON token segment.

[0084] In an embodiment, a generating module 106 is configured to: extract core values in the performance index data and interface information of the preset original request parameters; merge the core values and the interface information into a structured data object; organize chapters of the structured data object to obtain a report base data block; add analysis conclusions and visual elements based on the report base data block, and generate a test report according to the analysis conclusions and the visual elements.

[0085] The application provides a kind of stream interface multidimensional performance testing device, for test report business, obtain the query parameter in test case, the query parameter is dynamically business parameter injection, obtains test request;According to the test request, obtain stream response data, effectively identify the stream response data, obtain effective data;The effective data is not complete JSON cross block splicing, and complete JSON token segment is obtained;Extract the timestamp of the complete JSON token segment, determine the performance index data of the complete JSON token segment according to the timestamp;According to the performance index data and preset original request parameter generation test report, the performance index data is calculated by timestamp, quantifies system response capability.

[0086] The specific limitation of the stream interface multidimensional performance testing device can be referred to the limitation of the stream interface multidimensional performance testing method in the above, and will not be repeated here. Each module in the above stream interface multidimensional performance testing device can be realized by software, hardware and combination thereof in whole or in part. The above each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operation corresponding to each module.

[0087] In one embodiment, a computer device is provided, which can be a server, and its internal structure diagram can be as shown in Figure 4As shown in the figure. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile and / or volatile storage media, internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with the external client through the network connection. The computer program is executed by the processor to realize the functions or steps of the server side of the stream interface multi-dimensional performance test method.

[0088] In one embodiment, a computer device is provided, which can be a client, and its internal structure diagram can be as shown in the figure. Figure 5 As shown in the figure. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile storage media, internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with the external server through the network connection. The computer program is executed by the processor to realize the functions or steps of the client side of the stream interface multi-dimensional performance test method.

[0089] In one embodiment, a computer device is provided, including a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor executes the computer program to realize the following steps: Obtain the query parameters in the test case, and perform dynamic business parameter injection on the query parameters to obtain a test request; According to the test request, obtain stream response data, and perform effective identification on the stream response data to obtain effective data; Perform non-complete JSON cross-block splicing on the effective data to obtain a complete JSON token fragment; Extract the timestamp of the complete JSON token fragment, and determine the performance index data of the complete JSON token fragment according to the timestamp; According to the performance index data and the preset original request parameter, a test report is generated.

[0090] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to realize the following steps: Obtaining a query parameter in a test case, performing dynamic business parameter injection on the query parameter to obtain a test request; Obtaining streaming response data according to the test request, and performing effective identification on the streaming response data to obtain effective data; Performing non-complete JSON cross-block splicing on the effective data to obtain a complete JSON token segment; Extracting a timestamp of the complete JSON token segment, and determining performance index data of the complete JSON token segment according to the timestamp; Generating a test report according to the performance index data and preset original request parameters.

[0091] It should be noted that the functions or steps described above in relation to the computer-readable storage medium or the computer device can correspond to the related descriptions of the server side and the client side in the foregoing method embodiments, and for the sake of brevity, they will not be described again.

[0092] Those skilled in the art can understand that all or part of the processes in the foregoing method embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the foregoing embodiments of the method can be included. In each embodiment provided in the present application, any reference to a memory, storage, database or other medium can include a non-volatile and / or volatile memory. The non-volatile memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM) or a flash memory. The volatile memory can include a random access memory (RAM) or an external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct RAM bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM).

[0093] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual applications, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0094] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit them. If a software tool or component that is not from the company appears in the application examples, it is only used for example introduction and does not represent actual use. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents. These modifications or replacements do not change the essence of the corresponding technical solutions, and should be included in the protection scope of the present application.

Claims

1. A method for testing the multi-dimensional performance of a streaming interface, characterized in that: The method comprises the following steps: Obtaining query parameters in a test case, performing dynamic business parameter injection on the query parameters to obtain a test request; Obtaining streaming response data according to the test request, and performing effective identification on the streaming response data to obtain effective data; Performing non-complete JSON cross-block splicing on the effective data to obtain a complete JSON token fragment; Extracting a timestamp of the complete JSON token fragment, and determining performance index data of the complete JSON token fragment according to the timestamp; Generating a test report according to the performance index data and preset original request parameters.

2. The streaming interface multi-dimensional performance test method of claim 1, wherein, The step of performing dynamic business parameter injection on the query parameters to obtain a test request comprises the following steps: Parsing the query parameters into a structured object, and performing legal verification on the structured object to obtain a legal parameter object; Matching a business parameter template for the legal parameter object; Performing dynamic injection on the business parameter template and the legal parameter object to obtain an injected parameterized request body; Performing legal format packaging on the injected parameterized request body to obtain a test request.

3. The streaming interface multi-dimensional performance test method of claim 1, wherein, The step of performing effective identification on the streaming response data to obtain effective data comprises the following steps: Performing segmented decoding on the streaming response data to obtain an original data row list; Performing invalid filtering on the original data row list to obtain a candidate data row set; Performing identification stripping on the candidate data row set, and performing legal screening on the stripping result to obtain effective data.

4. The streaming interface multi-dimensional performance test method of claim 1, wherein, The step of performing non-complete JSON cross-block splicing on the effective data to obtain a complete JSON token fragment comprises the following steps: Performing non-complete JSON fragment identification on the effective data, and performing stateful caching on the identified non-complete fragments to obtain a non-complete JSON fragment cache queue; Taking out a first non-complete fragment in the non-complete JSON fragment cache queue, and merging the first non-complete fragment with a fragment in the effective data into a merged fragment; Calculating a bracket balance degree of the merged fragment, and checking a quotation closing condition of the merged fragment; Generating a complete JSON token fragment according to the bracket balance degree and the quotation closing condition.

5. The streaming interface multi-dimensional performance test method of claim 1, wherein, The step of determining performance index data of the complete JSON token fragment according to the timestamp comprises the following steps: Determining a core time difference of the complete JSON token fragment according to the timestamp; Mapping the core time difference to a preset standard performance index to obtain a standard performance index of a token; Performing aggregation calculation on the standard performance index to obtain performance index data of the complete JSON token fragment.

6. The streaming interface multi-dimensional performance test method of claim 5, wherein, The step of determining a core time difference of the complete JSON token fragment according to the timestamp comprises the following steps: Parsing a structured timestamp object of the complete JSON token fragment according to the timestamp; Performing key time point difference calculation on the structured timestamp object to obtain a basic time difference; Performing business mapping on the basic time difference to obtain a business time index; Performing unit conversion on the business time index to obtain a core time difference of the complete JSON token fragment.

7. The streaming interface multi-dimensional performance testing method of claim 1, wherein, The step of generating a test report according to the performance index data and preset original request parameters comprises the following steps: extract core values in the performance index data, and extract interface information of the preset original request parameter; merge the core values and the interface information into a structured data object; organize chapters of the structured data object to obtain a report base data block; add analysis conclusions and visual elements based on the report base data block, and generate a test report according to the analysis conclusions and the visual elements.

8. A streaming interface multi-dimensional performance testing apparatus, comprising: comprise: an acquisition module, configured to acquire a query parameter in a test case, and perform dynamic business parameter injection on the query parameter to obtain a test request; an acquisition module, configured to acquire streaming response data according to the test request; an identification module, configured to effectively identify the streaming response data to obtain effective data; a splicing module, configured to perform non-complete JSON cross-block splicing on the effective data to obtain a complete JSON token segment; an extraction and determination module, configured to extract a timestamp of the complete JSON token segment, and determine performance index data of the complete JSON token segment according to the timestamp; a generation module, configured to generate a test report according to the performance index data and preset original request parameters.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the streaming interface multi-dimensional performance test method in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the streaming interface multi-dimensional performance test method in any one of claims 1 to 7.

Citation Information

Cited By

  • Test resource configuration method and device

    CN121509510A