A performance index evaluation method, client, server, device and medium

By identifying and evaluating the response time of the first data frame of the SSE interface, the problem of inaccurate performance evaluation of SSE interface in the prior art is solved, and the accurate evaluation of the performance of the SSE interface is realized, reflecting the processing capabilities and performance of the server.

CN118646690BActive Publication Date: 2024-11-01ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411116117.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-01
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

The prior art uses the time-consuming time-consuming client from sending a request to receiving a full response when evaluating the performance of the Server-Sent Events (SSE) interface to evaluate performance metrics, resulting in inaccurate performance metrics.

Method used

By sending an SSE request to the server, generating and identifying the response time of the first data frame, the performance indicators of the SSE interface are evaluated based on this response time and number of requests, and the total time-consuming use of multiple streaming messages is avoided for evaluation.

Benefits of technology

The accurate performance indicator evaluation of the SSE interface is realized, which directly reflects the processing capabilities and performance of the server, and improves the accuracy and accuracy of the evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646690B_ABST
    Figure CN118646690B_ABST
Patent Text Reader

Abstract

The present application provides a performance indicator evaluation method, client, server, device and medium. According to an example of the present application, the method is applied to the client, and the method may include: sending an SSE request to the server, so that the server generates the first data frame and identification information corresponding to the first data frame; wherein the identification information is used to identify the response time of the first data frame, and the first data frame is the first data frame in the SSE request that processes the business logic; based on the obtained identification information, the response time of the first data frame is obtained; according to the number and response time of the SSE request, the performance indicator of the SSE interface corresponding to the SSE request is evaluated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of performance testing technology, and in particular to a performance indicator evaluation method, a client, a server, a device and a medium. Background Art

[0002] Server-Sent Events (SSE) is a technology that allows a server to send streaming messages to a client without further request from the client. This technology is well suited for implementing push notifications, real-time updates, and data streaming.

[0003] At present, when performing performance testing on an interface, the time taken by the client from sending a request to receiving a complete response is used to evaluate the performance index of the interface. However, if this evaluation method is used to evaluate the performance index of the SSE interface, the obtained performance index will be inaccurate. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present application provides a performance indicator evaluation method, a client, a server, a device and a medium.

[0005] According to a first aspect of any embodiment of the present application, a performance indicator evaluation method is provided, the method being applied to a client, the method comprising:

[0006] Sending an SSE request to a server, so that the server generates a first data frame and identification information corresponding to the first data frame; wherein the identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request;

[0007] Based on the acquired identification information, obtaining the response time of the first data frame;

[0008] According to the number of the SSE requests and the response time, a performance indicator of the SSE interface corresponding to the SSE request is evaluated.

[0009] According to a second aspect of any embodiment of the present application, a performance indicator evaluation method is provided, the method being applied to a server, the method comprising:

[0010] Receive the SSE request sent by the client;

[0011] Generate a first data frame and identification information corresponding to the first data frame, so that the client obtains a response time of the first data frame based on the identification information, and evaluates a performance indicator of an SSE interface corresponding to the SSE request according to the number of the SSE requests and the response time;

[0012] The identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request.

[0013] According to a third aspect of any embodiment of the present application, a client is provided, the client comprising:

[0014] A request sending module, used for sending an SSE request to a server, so that the server generates a first data frame and identification information corresponding to the first data frame; wherein the identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request;

[0015] A response time acquisition module, used to obtain the response time of the first data frame based on the acquired identification information;

[0016] The indicator evaluation module is used to evaluate the performance indicator of the SSE interface corresponding to the SSE request according to the number of the SSE requests and the response time.

[0017] According to a fourth aspect of any embodiment of the present application, a server is provided, the server comprising:

[0018] A request receiving module is used to receive the SSE request sent by the client;

[0019] an identification generation module, configured to generate a first data frame and identification information corresponding to the first data frame, so that the client obtains a response time of the first data frame based on the identification information, and evaluates a performance indicator of an SSE interface corresponding to the SSE request according to the number of SSE requests and the response time;

[0020] The identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request.

[0021] According to a fifth aspect of any embodiment of the present application, there is provided an electronic device, including:

[0022] processor;

[0023] a memory for storing processor-executable instructions;

[0024] The processor executes the executable instructions to implement the method executed by the client or the method executed by the server in any of the above-mentioned embodiments of the present application.

[0025] According to the sixth aspect of any embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the method executed by the client or the method executed by the server in any embodiment of the present application described above is implemented.

[0026] According to the seventh aspect of any embodiment of the present application, a computer program product is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, it implements the method executed by the client or the method executed by the server in any embodiment of the present application as described above.

[0027] The technical solution provided by this application may have the following beneficial effects:

[0028] According to the above embodiment, an SSE request is sent to the server so that the server generates the first data frame in the SSE request and identification information corresponding to the first data frame. Based on the acquired identification information, the response time of the first data frame is obtained, and the performance indicators of the SSE interface corresponding to the SSE request are evaluated according to the number of SSE requests and the response time. Since the response time of the first data frame in the SSE request is used for performance testing, the response time of the first data frame can directly reflect the processing capability and performance of the server for the SSE interface, avoiding the use of the total time consumption of multiple streaming messages in the SSE request for evaluation, thereby obtaining accurate performance indicators of the SSE interface.

[0029] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.

[0031] Figure 1 is a schematic diagram of a communication scenario of an SSE interface according to an exemplary embodiment of the present application;

[0032] Figure 2 is a flow chart of a performance indicator evaluation method shown in the present application according to an exemplary embodiment;

[0033] Figure 3 is a flow chart of another performance indicator evaluation method shown in the present application according to an exemplary embodiment;

[0034] Figure 4 is an interactive diagram of a performance indicator evaluation method shown in the present application according to an exemplary embodiment;

[0035] Figure 5is a structural schematic diagram of an electronic device according to an exemplary embodiment of the present application;

[0036] Figure 6 is a block diagram of a client according to an exemplary embodiment of the present application;

[0037] Figure 7 It is a block diagram of a server according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0038] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0039] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0040] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0041] The SSE interface based on SSE technology is a mechanism for the server to actively push real-time data to the client. SSE technology uses the long connection feature of the Hypertext Transfer Protocol (HTTP) to enable the server to push data to the client in real time when data is updated, without the client having to continuously send requests to query.

[0042] After the SSE interface sends an SSE request from the client, the server will send multiple messages to the client, and a single connection will last for a long time. In this case, the duration of a single SSE request is actually the sum of the durations of multiple messages in a single SSE request.

[0043] See also Figure 1 , Figure 1 A schematic diagram of a communication scenario of an SSE interface is shown. The client sends a connection request to the server through the JavaScript EventSource interface (SSE interface) to open an event stream (Event Stream).

[0044] The SSE interface uses a standard HTTP connection. Once the client connects to the server, the HTTP connection remains open until the client or server explicitly closes the connection.

[0045] SSE requests use a special Content-Type (text / event-stream) to identify the data stream during the communication process. The client uses the onMessage event in the EventSource interface to receive messages (events) sent by the server, while the implementation of the server depends on specific server technology.

[0046] Currently, when evaluating the test indicators of the SSE interface, the total time consumption of multiple messages in a single SSE request is used to evaluate the test indicators of the performance test of the SSE interface.

[0047] Taking the number of requests per second (RPS) as an example, when the number of SSE requests remains unchanged, the increase in total time consumption will eventually lead to a decrease in the RPS indicator, making it impossible to evaluate the actual number of requests per second and unable to accurately reflect the processing capacity of the server.

[0048] In order to solve the above problems, the present application proposes a performance index evaluation method. To further illustrate the present application, the following embodiments are provided:

[0049] See also Figure 2 , Figure 2 This is a flowchart of a performance indicator evaluation method according to an exemplary embodiment of the present application. The performance indicator evaluation method can be applied to clients such as web browsers and applications (Application, App), and the performance indicator evaluation method may include the following steps:

[0050] Step 202: Send an SSE request to the server to enable the server to generate the first data frame and identification information corresponding to the first data frame; wherein the identification information is used to identify the response time of the first data frame; the first data frame is the first data frame in the SSE request that processes the business logic.

[0051] In this step, the client sends an SSE request to the server through the SSE interface and records the time point of sending the SSE request.

[0052] The server opens an HTTP connection between the client and the server in response to the received SSE request. The server may first send an information frame to the client indicating that the server is executing.

[0053] After the server sends the information frame to the client, the server starts to process the business corresponding to the SSE request and generates the first data frame of the processing business logic in the SSE request.

[0054] The server determines whether the generated data frame is the first data frame by judging whether the data frame is data for processing business logic and whether the business logic starts to output streaming messages.

[0055] The server may also generate identification information corresponding to the first data frame to identify the response time of the first data frame.

[0056] Among them, the SSE request is an HTTP request sent to the server using its long connection feature. The information frame may include the meta information of the server, such as: service version number, interface information, etc. The data frame includes the service data information of the server.

[0057] The first data frame is the first data frame in the SSE request that processes the business logic. The identification information is used to identify the response time of the first data frame. The response time can be the time it takes the server to process the first data frame in the SSE request, or it can be the time it takes the client to send the SSE request and obtain the identification information.

[0058] Step 204: Based on the acquired identification information, obtain the response time of the first data frame.

[0059] In this step, the client can obtain the identification information of the server by polling the identification information, monitoring the received identification information, etc., and obtain the response time of the first data frame.

[0060] The method for obtaining the response time, for example, can be that when the server generates the first data frame, the server uses the time point from receiving the SSE request to the response time point of the first data frame as the response time of the first data frame, and stores the response time in the identification information so that the client can obtain the response time.

[0061] The client may also use the time from when the SSE request is sent to when the identification information is obtained as the response time of the first data frame, which is not limited in this embodiment of the present application.

[0062] After calculating the response time of the first data frame, the server can continue to send data frames to the client. The client receives the subsequent data frames sent by the server, but the subsequent data frames are not included in the response time of the first data frame, and there is no need to use the time consumption of subsequent data frames to evaluate performance indicators.

[0063] In one embodiment, the client may record in advance the time point of sending the SSE request, and record the time point of obtaining the identification information corresponding to the first data frame as the response time point of the first data frame.

[0064] The time from the sending time point of the SSE request to the response time point of the first data frame is calculated to obtain the response time of the first data frame.

[0065] The sending time is the time when the client sends the SSE request to the server, which can be a millisecond timestamp. The response time is the time when the client obtains the identification information corresponding to the first data frame, which can be a millisecond timestamp.

[0066] The client can calculate the response time of the first data frame according to the following formula (1):

[0067] (1)

[0068] Where t represents the response time of the first data frame in the SSE request. Indicates the response time of the first data frame. Indicates the time when the SSE request is sent, in milliseconds.

[0069] As mentioned above, by recording the sending time point of the SSE request, the time point when the identification information is obtained is recorded as the response time point of the first data frame, and the response time from the sending time point to the response time point is calculated. The response time of the end-to-end first data frame can be obtained, so that the response time for indicator evaluation is closer to the actual scenario, further improving the accuracy of the performance indicators of the SSE interface, and accurately reflecting the performance of the SSE interface in actual use.

[0070] Step 206: According to the number and response time of the SSE requests, the performance index of the SSE interface corresponding to the SSE request is evaluated.

[0071] In this step, the response time of the first data frame can reflect the efficiency of the server in processing new connections and starting data flows. As long as the server can process the first data frame in the SSE request, it can be considered that the server has the ability to process the SSE interface.

[0072] The client can evaluate the actual number of requests per second and number of queries per second (QPS) of the SSE interface corresponding to the SSE request based on the number of SSE requests and the response time of the first data frame. Performance indicators are used to reflect the processing capability of the server for the SSE interface.

[0073] The client may also set a response time range according to the actual business scenario, compare the response time with the response time range, and analyze the response time distribution to implement performance testing of the SSE interface, which is not limited in this embodiment of the present application.

[0074] For example, the client can calculate the number of requests per second according to the following formula (2):

[0075] (2)

[0076] RPS stands for requests per second, n stands for the number of SSE requests, and t stands for the response time of the first data frame in an SSE request. Since requests per second is a performance parameter for each second and the response time is in milliseconds, the response time needs to be converted into a response time in seconds.

[0077] The client can also calculate the number of queries per second in the performance indicator according to the following formula (3):

[0078] (3)

[0079] Among them, QPS stands for the number of queries per second, n stands for the number of SSE requests, and t stands for the response time of the first data frame in the SSE request. Since the number of queries per second is a performance parameter for each second and the unit of response time is milliseconds, the response time needs to be converted into the response time in seconds.

[0080] The performance indicator evaluation method of this embodiment sends an SSE request to the server to enable the server to generate the first data frame in the SSE request and identification information corresponding to the first data frame, obtains the response time of the first data frame based on the obtained identification information, and evaluates the performance indicator of the SSE interface corresponding to the SSE request according to the number and response time of the SSE requests. Since the response time of the first data frame in the SSE request is used when performing the performance test, the response time of the first data frame can directly reflect the processing capability and performance of the server for the SSE interface, avoiding the use of the total time consumption of multiple streaming messages in the SSE request for evaluation, thereby obtaining accurate performance indicators of the SSE interface.

[0081] See also Figure 3 , Figure 3This is a flowchart of another performance indicator evaluation method according to an exemplary embodiment of the present application. The performance indicator evaluation method can be applied to the server, and the performance indicator evaluation method can include the following steps:

[0082] Step 302: Receive an SSE request sent by the client.

[0083] In this step, the server receives the SSE request sent by the client and opens an HTTP connection between the client and the server. The server can first send an information frame to the client.

[0084] Step 304: Generate the first data frame and identification information corresponding to the first data frame, so that the client obtains the response time of the first data frame based on the identification information, and evaluates the performance indicators of the SSE interface corresponding to the SSE request according to the number and response time of SSE requests; wherein the identification information is used to identify the response time of the first data frame; the first data frame is the first data frame in the SSE request that processes the business logic.

[0085] In this step, after the server sends the information frame to the client, the server starts to process the service corresponding to the SSE request and generates the first data frame of the processing service logic in the SSE request.

[0086] The server may also generate identification information corresponding to the first data frame so that the client can obtain the response time of the first data frame.

[0087] The client obtains the response time of the first data frame based on the identification information, and evaluates the performance indicators of the SSE interface corresponding to the SSE request according to the number and response time of the SSE requests.

[0088] In one embodiment, the server includes: a server of a large language model. The performance indicator evaluation method described in the embodiment of the present application can be used to evaluate the performance indicator of the SSE interface in the server of the large language model.

[0089] Among them, the large language model can be a chat generative pre-trained transformer (Chat Generative Pre-trainedTransformer, ChatGPT), a natural language processing model based on the Transformer architecture (BidirectionalEncoder Representations from Transformers, BERT), etc.

[0090] As described above, by evaluating the performance indicators of the SSE interface in the server of the large language model, the response speed and processing efficiency of the server of the large language model can be accurately evaluated.

[0091] The performance indicator evaluation method of this embodiment generates the first data frame and the identification information corresponding to the first data frame by receiving the SSE request sent by the client, so that the client obtains the response time of the first data frame based on the identification information, and evaluates the performance indicator of the SSE interface corresponding to the SSE request according to the number and response time of the SSE requests. Since the response time of the first data frame in the SSE request is used when performing the performance test, the response time of the first data frame can directly reflect the processing capability and performance of the server for the SSE interface, avoiding the use of the total time consumption of multiple streaming messages in the SSE request for evaluation, thereby obtaining accurate performance indicators of the SSE interface.

[0092] In the above embodiment, it is introduced that the performance index of the SSE interface corresponding to the SSE request is evaluated according to the number of SSE requests and the response time of the first data frame. In the following embodiment, the concurrent test of the SSE interface is described in detail and can be applied to any of the above embodiments.

[0093] In one embodiment, the client can simulate a large number of concurrent users through a test tool such as Jmeter, and the client sends multiple concurrent SSE requests corresponding to the SSE interface to the server. The server processes the received multiple concurrent SSE requests respectively and generates the first data frame and identification information corresponding to each concurrent SSE request.

[0094] The client calculates the total number of multiple concurrent SSE requests and cumulatively calculates the response time of the first data frame of multiple concurrent SSE requests to obtain the total response time of multiple concurrent SSE requests. The total number of requests is the total number of multiple concurrent SSE requests. The total response time is the total time taken to respond to the first data frame of multiple concurrent SSE requests.

[0095] For example, the client can calculate the total response time according to the following formula (4):

[0096] (4)

[0097] Where s represents the total response time of multiple concurrent SSE requests. Indicates the response time of the first data frame of each SSE request. Indicates the sending time of each SSE request, in milliseconds.

[0098] The client calculates the performance indicators of the SSE interface based on the total number of requests and total response time of multiple concurrent SSE requests.

[0099] For example, the client can calculate the number of requests per second in a concurrent scenario according to the following formula (5):

[0100] (5)

[0101] RPS stands for requests per second, n stands for the total number of concurrent SSE requests, and s stands for the total response time of the first data frame of multiple concurrent SSE requests. Since the number of requests per second is a performance parameter for each second and the total response time is in milliseconds, the total response time needs to be converted into the total response time in seconds.

[0102] The client can also calculate the number of queries per second in a concurrent scenario according to the following formula (6):

[0103] (6)

[0104] Among them, QPS represents the number of queries per second, n represents the total number of requests of multiple concurrent SSE requests, and s represents the total response time of the first data frame of multiple concurrent SSE requests. Since the number of queries per second is a performance parameter for each second and the total response time is in milliseconds, the total response time needs to be converted into the total response time in seconds.

[0105] As mentioned above, by obtaining the total number of requests and the total response time of multiple concurrent SSE requests corresponding to the SSE interface, the performance indicators such as the number of requests per second and the number of queries per second of the SSE interface are calculated based on the total number of requests and the total response time. By accumulating the response time of the first data frame of multiple concurrent SSE requests and combining it with the total number of concurrent requests, the performance indicators of the SSE interface can be calculated, thereby comprehensively and accurately evaluating the processing capability of the SSE interface in concurrent scenarios.

[0106] In the above embodiment, the performance index of the SSE interface is calculated based on the total number of requests and the total response time of multiple concurrent SSE requests. In the following embodiment, a more detailed description will be given on the method of obtaining the identification information, which can be applied to any of the above embodiments.

[0107] In one embodiment, the server sets the identification information in the first data frame through a preset extended parameter in the first data frame, and sends the first data frame carrying the identification information to the client. The extended parameter is used to carry the identification information.

[0108] The client obtains the identification information carried in the first data frame based on the first data frame received from the server.

[0109] As described above, by the client obtaining the identification information carried by the extended parameters in the first data frame based on the first data frame sent by the server, the client can accurately obtain the response time from sending the SSE request to receiving the first data frame, thereby further ensuring the accuracy of the performance indicators of the SSE interface.

[0110] In one embodiment, the client periodically sends requests to the server in a polling manner to query and obtain identification information corresponding to the first data frame from the server.

[0111] The server may also store the generated identification information in a database, and the client may periodically query and obtain the identification information in the database by polling.

[0112] As described above, by polling, the client queries the server for identification information, which can reduce the processing pressure on the server.

[0113] To further introduce the performance indicator evaluation process of the SSE interface, Figure 4 An interactive diagram of a performance indicator evaluation method is shown. The performance indicator evaluation method may include the following steps:

[0114] Step 402: The client sends an SSE request to the server.

[0115] Step 404: The client records the time point of sending the SSE request.

[0116] Step 406: The server establishes a connection with the client.

[0117] Step 408: The server starts processing the SSE request.

[0118] In this step, the server starts to process the SSE request and executes the relevant logic of the SSE request.

[0119] Step 410: The server sends an information frame to the client.

[0120] In this step, the server sends an information frame including the service version number, interface information, etc. to the client, and the client receives the message of the information frame.

[0121] Step 412: The server sets the identification information to be carried in the first data frame through the extended parameters of the first data frame.

[0122] In this step, the server starts to process the business logic of the SSE request and generates the first data frame in the SSE request.

[0123] Take the extended parameter as a preset key-value pair as an example, where the key in the extended parameter is flag, and the value in the extended parameter defaults to false. The identification information carried in the first data frame is true.

[0124] The server sets the extended parameter of the first data frame to {"flag": true}.

[0125] Step 414: The server sends the first data frame carrying identification information to the client.

[0126] In this step, the server sends the first data frame carrying identification information to the client, and the extended parameter of the first data frame is {"flag": true}.

[0127] When the server sends an information frame and a non-first data frame to the client, the extended parameter in the information frame and the non-first data frame is {"flag":false}. The client does not perform timing processing on the message with the extended parameter {"flag":false}.

[0128] Step 416: The client obtains the time point of the identification information carried in the first data frame and records it as the response time point.

[0129] In this step, the client records the time point of receiving the identification information carried in the first data frame as the response time point according to the extended parameter {"flag": true} of the first data frame.

[0130] Step 418: The client calculates the response time from the sending time point of the SSE request to the response time point of the first data frame.

[0131] Step 420: The client evaluates the performance index of the SSE interface corresponding to the SSE request according to the number and response time of the SSE request.

[0132] In this step, the client evaluates the performance indicators of the SSE interface corresponding to the SSE request based on the number of SSE requests and the response time, and calculates the performance indicators of the SSE interface such as the number of requests per second and the number of queries per second.

[0133] The client can also calculate the total number of requests and total response time of multiple concurrent SSE requests, and calculate performance indicators such as the number of requests per second and the number of queries per second of the SSE interface in concurrent scenarios based on the total number of requests and total response time.

[0134] Step 422: The server sends a non-first data frame to the client.

[0135] In this step, the server maintains continuous streaming output of the SSE interface, and the server can continue to send non-first data frames to the client.

[0136] Step 424: The server determines that the SSE request execution is complete and disconnects.

[0137] In this step, the server completes the business logic of the SSE request, determines that the SSE request is completed, and disconnects from the client.

[0138] Figure 5 1 is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present application. The electronic device may be, for example, a mobile phone, a computer, a digital broadcast terminal, a message transceiver, a game console, a tablet device, a personal digital assistant, a server, a smart home appliance, a car computer, etc. Figure 5 At the hardware level, the electronic device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other services. The processor 502 reads the corresponding computer program from the non-volatile memory 510 into the memory 508 and then runs it, forming a client or server at the logical level. Of course, in addition to the software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0139] Figure 6 is a block diagram of a client according to an exemplary embodiment of the present application. Figure 6 , the client may include: a request sending module 602, a response time acquisition module 604 and an indicator evaluation module 606, wherein:

[0140] The request sending module 602 is used to send an SSE request to the server, so that the server generates a first data frame and identification information corresponding to the first data frame; wherein the identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request;

[0141] The response time acquisition module 604 is used to obtain the response time of the first data frame based on the acquired identification information;

[0142] The indicator evaluation module 606 is used to evaluate the performance indicator of the SSE interface corresponding to the SSE request according to the number of the SSE requests and the response time.

[0143] In one example, the SSE request includes: multiple concurrent SSE requests corresponding to the SSE interface; the indicator evaluation module 606, when used to evaluate the performance indicator of the SSE interface corresponding to the SSE request based on the number of SSE requests and the response time, includes: obtaining the total request number and total response time of the multiple concurrent SSE requests; wherein the total response time is obtained by accumulating the response time of the first data frame of the multiple concurrent SSE requests; and calculating the performance indicator of the SSE interface based on the total request number and the total response time.

[0144] In one example, the response time acquisition module 604, before being used to obtain the response time of the first data frame based on the acquired identification information, further includes: recording the sending time point of sending the SSE request; the response time acquisition module 604, when being used to obtain the response time of the first data frame based on the acquired identification information, includes: recording the time point when the identification information is obtained as the response time point of the first data frame; and calculating the response time from the sending time point to the response time point.

[0145] In one example, the response time acquisition module 604, before being used to obtain the response time of the first data frame based on the acquired identification information, further includes: obtaining the identification information based on the first data frame received and sent by the server; wherein the first data frame carries the identification information through an extended parameter.

[0146] In one example, the response time acquisition module 604, before being used to obtain the response time of the first data frame based on the obtained identification information, further includes: obtaining the identification information by polling.

[0147] Figure 7 is a block diagram of a server according to an exemplary embodiment of the present application. Figure 7 , the server may include: a request receiving module 702 and an identification generating module 704, wherein:

[0148] The request receiving module 702 is used to receive the SSE request sent by the client;

[0149] The identification generation module 704 is used to generate a first data frame and identification information corresponding to the first data frame, so that the client obtains the response time of the first data frame based on the identification information, and evaluates the performance index of the SSE interface corresponding to the SSE request according to the number of the SSE requests and the response time;

[0150] The identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request.

[0151] In one example, the identification generation module 704, when used to generate the first data frame and the identification information corresponding to the first data frame, includes: setting the first data frame to carry the identification information through the extended parameters of the first data frame; sending the first data frame to the client so that the client obtains the identification information.

[0152] In one example, the server includes: a server of a large language model.

[0153] The implementation process of the functions and effects of each unit in the above-mentioned server and client is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0154] For the device embodiments of the server and the client, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0155] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor to implement a method executed by a client or a method executed by a server as in any of the above embodiments.

[0156] The non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc., and the present application does not limit this.

[0157] In an exemplary embodiment, a computer program product including a computer program / instruction is also provided. The computer program / instruction can be executed by a processor to implement the method executed by the client or the method executed by the server in any of the above embodiments.

[0158] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0159] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the inventions claimed herein. The present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

[0160] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A performance index evaluation method, characterized in that: The method is applied to a client, and the method comprises: Sending an SSE request to a server, so that the server generates a first data frame and identification information corresponding to the first data frame; wherein the identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request; Based on the acquired identification information, obtaining the response time of the first data frame; According to the number of the SSE requests and the response time, a performance indicator of the SSE interface corresponding to the SSE request is evaluated.

2. The method according to claim 1, characterized in that The SSE request includes: a plurality of concurrent SSE requests corresponding to the SSE interface; The evaluating, according to the number of the SSE requests and the response time, a performance indicator of the SSE interface corresponding to the SSE request includes: Obtaining the total number of requests and the total response time of the multiple concurrent SSE requests; wherein the total response time is obtained by accumulating the response time of the first data frame of the multiple concurrent SSE requests; The performance index of the SSE interface is calculated according to the total number of requests and the total response time.

3. The method according to claim 1, characterized in that: Before obtaining the response time of the first data frame based on the acquired identification information, the method further includes: Record the time point of sending the SSE request; The obtaining, based on the acquired identification information, a response time of the first data frame includes: The time point at which the identification information is obtained is recorded as the response time point of the first data frame; The response time from the sending time point to the response time point is calculated.

4. The method according to claim 1, characterized in that: The method for obtaining the identification information includes at least one of the following: Acquire the identification information according to the first data frame received and sent by the server; wherein the first data frame carries the identification information through an extended parameter; The identification information is obtained by polling.

5. A performance index evaluation method, characterized in that: The method is applied to the server, and the method includes: Receive the SSE request sent by the client; Generate a first data frame and identification information corresponding to the first data frame, so that the client obtains a response time of the first data frame based on the identification information, and evaluates a performance indicator of an SSE interface corresponding to the SSE request according to the number of the SSE requests and the response time; The identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request.

6. The method according to claim 5, characterized in that The generating of the first data frame and the identification information corresponding to the first data frame includes: By using the extended parameters of the first data frame, setting the first data frame to carry the identification information; The first data frame is sent to the client, so that the client obtains the identification information.

7. The method according to claim 5, characterized in that The server includes: a server of a large language model.

8. A client, characterized in that: The client comprises: A request sending module, used for sending an SSE request to a server, so that the server generates a first data frame and identification information corresponding to the first data frame; wherein the identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request; A response time acquisition module, used to obtain the response time of the first data frame based on the acquired identification information; The indicator evaluation module is used to evaluate the performance indicator of the SSE interface corresponding to the SSE request according to the number of the SSE requests and the response time.

9. A server, characterized in that: The server includes: A request receiving module is used to receive the SSE request sent by the client; an identification generation module, configured to generate a first data frame and identification information corresponding to the first data frame, so that the client obtains a response time of the first data frame based on the identification information, and evaluates a performance indicator of an SSE interface corresponding to the SSE request according to the number of SSE requests and the response time; The identification information is used to identify the response time of the first data frame; the first data frame is the first data frame for processing business logic in the SSE request.

10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 4 or the method according to any one of claims 5 to 7 by running the executable instructions.

11. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by the processor, the method described in any one of claims 1 to 4 or the method described in any one of claims 5 to 7 is implemented.

12. A computer program product having a computer program / instructions stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 4 or the method according to any one of claims 5 to 7 is implemented.