System capacity assessment method, device, equipment and medium
By identifying the source identifier of the service request and setting an isolation processing path, the shortcomings of read and write traffic testing in complex business scenarios in the prior art are solved, and a more accurate system capacity evaluation is achieved.
Patent Information
- Application Number
- CN202110949190.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-18
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2041-08-18
AI Technical Summary
In the prior art, the traffic playback method is difficult to support read and write traffic testing in complex business scenarios, and the test results cannot reflect the real system capacity.
By identifying the source identifier of the service request, setting different service processing paths, and isolating the test users and online production environment users separately to realize business link testing for reading and writing traffic.
It realizes accurate capacity evaluation of complex business links during system testing, and the test results are closer to real traffic production scenarios.
Smart Images

Figure CN113656307B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of software testing technology, and in particular to a system capacity assessment method, apparatus, device and medium. Background Art
[0002] As business systems evolve, business links become more complex and the coupling between multiple businesses increases. Software testing is necessary to determine the stability of business systems, facilitate their maintenance, and provide a positive user experience. Currently, to ensure that system testing closely resembles real-world business traffic production scenarios, most business system tests utilize production traffic recording and playback.
[0003] However, in the process of implementing the present invention, it was found that there are at least the following technical problems in the prior art:
[0004] The existing technology uses traffic replay for system testing, which is mostly suitable for small application scenarios with a single business link or coupled business systems. The purpose of replaying stress testing is achieved by clearly isolating the replay system link range by business type, but it is difficult to support complex business scenarios. Moreover, when replaying stress test traffic, in order to avoid data conflicts with production traffic, most traffic replays are business scenario practices of read traffic, and cannot support the playback of write traffic. As a result, the test results cannot reflect the actual capacity of the system under test. Summary of the Invention
[0005] Embodiments of the present invention provide a system capacity assessment method, apparatus, equipment, and medium to enable testing of complex business links including read traffic and write traffic during the testing of a business system, so that the system capacity test results are closer to the actual traffic production scenario to a greater extent.
[0006] In a first aspect, an embodiment of the present invention provides a system capacity assessment method, the method comprising:
[0007] During a system test period, obtaining a service request and determining a source identifier of the service request, wherein the source identifier is a test user identifier or a non-test user identifier;
[0008] Determining a business processing path that matches the business request based on the source identifier, and executing the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes a process of reading and / or writing to a database of the system under test;
[0009] Based on the service traffic generated by service requests from different sources during the system test period, a result of the service system capacity assessment is generated.
[0010] In a second aspect, an embodiment of the present invention further provides a system capacity assessment device, the device comprising:
[0011] A request source identification module is used to obtain a service request during a system test period and determine a source identifier of the service request, wherein the source identifier is a test user identifier or a non-test user identifier;
[0012] a request processing module, configured to determine, based on the source identifier, a business processing path matching the business request, and execute the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes a process of reading and / or writing to a database of the system under test;
[0013] The capacity assessment module is used to generate a result of a business system capacity assessment based on the business traffic generated by business requests from different sources during the system test period.
[0014] In a third aspect, an embodiment of the present invention further provides a server device, the server device comprising:
[0015] one or more processors;
[0016] a memory for storing one or more programs;
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the system capacity assessment method provided by any embodiment of the present invention.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the system capacity assessment method provided by any embodiment of the present invention.
[0019] The embodiments of the above invention have the following advantages or beneficial effects:
[0020] The embodiment of the present invention, by identifying and determining the source identifier of the business request for the acquired business request during the system test time period, wherein the source identifier includes a test user identifier and a non-test user identifier; then, according to the source identifier, determining the business processing path that matches the business request, executing the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes the process of reading and / or writing to the database of the tested system, that is, setting different business processing paths for the business request of the test user and the business request of the online production environment user respectively, to achieve isolation of the test and production business during the system test process; finally, based on the business traffic generated by the business requests from different sources during the system test time period, the result of the business system capacity assessment is generated. The technical solution of this embodiment solves the problem in the prior art that the test link for system testing by means of traffic playback is single, the test scenario is simple, and the test results cannot represent the actual system capacity, and realizes that during the test of the business system, complex business links including read traffic and write traffic can be tested, so that the system capacity test results are closer to the actual traffic production scenario to a greater extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a flow chart of a system capacity assessment method provided in Example 1 of the present invention;
[0022] Figure 2 This is a schematic diagram of an implementation scenario of a system capacity assessment method provided in Example 1 of the present invention;
[0023] Figure 3 This is a flow chart of a system capacity assessment method provided by Embodiment 2 of the present invention;
[0024] Figure 4 This is a schematic diagram of a production traffic recording process provided by the second embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of the entire process of traffic recording and playback provided by the second embodiment of the present invention;
[0026] Figure 6 This is a schematic diagram of the structure of a system capacity assessment device provided in Embodiment 3 of the present invention;
[0027] Figure 7 This is a structural diagram of a server device provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0028] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.
[0029] Example 1
[0030] Figure 1 This is a flowchart of a system capacity assessment method provided in Example 1 of the present invention. This embodiment is applicable to system capacity testing, and is particularly suitable for capacity testing of business systems within large websites or large-scale system clusters. This method can be performed by a system capacity assessment device, which can be implemented using software and / or hardware and integrated into a computer device with application development capabilities.
[0031] like Figure 1 As shown, the system capacity assessment method includes the following steps:
[0032] S110 : During a system test period, obtain a service request and determine a source identifier of the service request.
[0033] To make the stress testing process of an application system more similar to the application system's online usage, traffic recording and playback methods are usually used to obtain test cases for the application system. First, the requests made by the application system's online users to the application system, as well as the application system's feedback on the user requests, are recorded. Then, the recorded online traffic of the application system is imported into the test system. Then, when testing the application system, the test system replays the imported online traffic and issues business requests to the application system under test, thereby simulating the actual operating environment, evaluating the system capacity of the application system under test, and troubleshooting performance issues and risks of the application system under test. The test system is a system that issues business requests through a test account and can be a stress test cluster composed of stress test equipment used for system stress testing. Each stress test equipment can create many test accounts to simulate the operations of real users.
[0034] During the system testing period, the service requests received by the tested application system may be from legitimate online users or from test accounts. Therefore, upon receiving a task request, it is necessary to identify and determine the source of the service request, whether it is from a test user or a non-test user. This allows the system to determine whether the received service request is from a test user and to further process the service request.
[0035] Specifically, a business request refers to a request from a user to obtain service feedback from the system under test. The requested business is also the function and service capability of the system under test, such as requesting to browse specified content, query service progress, place an order, and other operations.
[0036] S120: Determine a service processing path that matches the service request according to the source identifier, and execute the service request according to the service processing path to generate service traffic.
[0037] Business requests can be categorized into two types based on their impact on the application system. One type of request does not alter the application system's database content; it simply feeds data from the application system back to the requester. The other type of request causes changes to the application system's database content. For example, when a user changes their account information or places an order on the application system platform, the application system writes order information and changes item inventory information, which in turn updates the data in the application system's database. For business requests that affect the business system's database data, it's particularly important to distinguish between requests from test users and requests from online users, as otherwise, they will affect the online users' ability to use the application system.
[0038] In this embodiment, different service request processing paths are set for service requests from different sources. That is, different request routing links correspond to service requests from different sources. Specifically, the process of executing a service request includes reading and / or writing to the database of the system under test. Therefore, for service requests from different sources, service requests from test accounts can be processed according to the preset test service processing path, while service requests from regular online users can be processed according to the regular service request processing path. Different service processing paths operate on different database objects.
[0039] Exemplarily, when the source identifier of a service request is a test user identifier, the service request is accessed based on the application layer in the preset test service path; data is read from and / or written to the storage layer or cache layer in the preset test service path according to the service request, that is, through the message middleware in the preset test service path, data is read from or written to the storage layer or cache layer in the preset test service path according to the content of the service request; finally, the results of the data reading and / or writing are fed back to the test user who issued the service request through the application layer in the preset test service path.
[0040] S130 : Generate a result of a service system capacity assessment based on the service traffic generated by service requests from different sources during the system test period.
[0041] During the system testing period, all business requests received by the tested application system and the traffic generated by processing the received business requests represent the request capacity that the tested application system can withstand, and to a certain extent reflect the capacity of the tested system.
[0042] Figure 2 , is an example of an application of the technical solution of this embodiment. A shopping platform application system can receive and process business requests from online users to generate online production traffic, and can also receive and process business requests from stress test accounts of stress test systems to generate stress test traffic. Business requests can be business requests issued by mobile application terminals (APP), embedded applets or web pages (mobile terminals) and computers (PC terminals). Online users or test users can access the shopping platform homepage, search, product details, shopping cart, checkout page, any product, inventory, price, promotion and order pages through business requests, and read or write corresponding information of the corresponding data center (storage layer database). Using the method of this embodiment, different business request processing paths are set to isolate online production traffic from stress test traffic. The data generated when processing business requests issued by test accounts will not affect the relevant business data of online users. In particular, during the testing of the application system, the total amount of test traffic can be a certain multiple of the recorded traffic, such as testing the business system to be tested with a traffic volume of 1.5 times or 2 times the recorded traffic.
[0043] The technical solution of this embodiment is to identify and determine the source identifier of the business request for the acquired business request during the system test time period, wherein the source identifier includes a test user identifier and a non-test user identifier; then, according to the source identifier, determine the business processing path that matches the business request, and execute the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes the process of reading and / or writing to the database of the tested system, that is, setting different business processing paths for the business requests of the test user and the business requests of the online production environment user respectively, so as to achieve the isolation of the test and production business during the system test process; finally, based on the business traffic generated by the business requests from different sources during the system test time period, generate the result of the business system capacity assessment. The technical solution of this embodiment solves the problem in the prior art that the test link for system testing by means of traffic playback is single, the test scenario is simple, and the test results cannot represent the actual system capacity, and realizes that during the test of the business system, complex business links including read traffic and write traffic can be tested, so that the system capacity test results are closer to the actual traffic production scenario to a greater extent.
[0044] Example 2
[0045] Figure 3 This is a flowchart of a system capacity assessment method provided in Example 2 of the present invention. This embodiment, which shares the same inventive concept as the location information acquisition method described in the previous embodiment, further describes a system capacity assessment scheme that includes a traffic recording process. This method can be performed by a system capacity assessment device, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.
[0046] like Figure 3 As shown, the system capacity assessment method includes the following steps:
[0047] S210: Obtain traffic data obtained by replicating and distributing production traffic by a core switch of an Internet data center.
[0048] The Internet Data Center (IDC) is the source interface for internet traffic entering the business system. It can capture all business requests entering the application system, covering all functional modules of the application system.
[0049] For details on the process of obtaining production traffic, please refer to Figure 4 First, the production traffic is copied from the optical splitter port of the core switch in the IDC room, so Figure 4 As shown, live traffic is split into two paths from the core switch node. One path is distributed to the target application server according to the normal load balancing policy, while the other path is split by the optical splitter. Because the split traffic volume is large, a single server cannot receive it completely. Therefore, further traffic is split by the splitter and directed to the traffic recording service cluster for processing.
[0050] S220: Desensitize and encrypt the acquired traffic data to form traffic to be replayed for system testing.
[0051] Specifically, in this step, the acquired traffic data can be parsed, filtered, and desensitized to obtain traffic data that can be used for playback. Filtering includes filtering out requests that failed and did not receive feedback. Desensitization is to remove the requesting user information content in the request and cancel the correspondence between the business request and the account that issued the business request. Furthermore, to ensure the security of data storage, the traffic data will be encrypted before it is actually stored in the database to ensure data security, and the final traffic to be replayed (i.e., the test case for user testing) will be obtained.
[0052] S230 , synchronously storing the data in the database of the storage layer in the production environment of the tested system into the database of the storage layer in the preset test service path.
[0053] After the test case preparation is completed, it is necessary to completely copy the contents of the business system database in the online production environment to the database in the test environment of the business system, that is, to copy the shadow storage layer of the storage layer. This ensures that the data reading and writing processes during the test are consistent with the data reading and writing processes in the online production environment, making the test environment closer to the production environment.
[0054] S240: During the system test period, obtain a service request and determine a source identifier of the service request.
[0055] Source identifiers include test user identifiers and non-test user identifiers. The service requests received by the tested application system may be from a legitimate online user or from a test account. Therefore, upon receiving a task request, it is necessary to identify and determine the source identifier of the service request, whether it is a test user identifier or a non-test user identifier. This allows for further processing of the service request, and confirms whether the received service request is from a test user.
[0056] Business requests issued by test users are made through a test account in the test system. The test system can be a stress testing cluster consisting of stress testing devices used for system stress testing. Each stress testing device can create numerous test accounts to simulate real user operations. The test system can be directly mounted on the cloud storage disk storing the traffic to be replayed, efficiently acquiring the traffic files for testing. Using this method to transfer the traffic files to be replayed, a single traffic file can be in the GB range. With thousands of stress testing devices, the transfer of test traffic files can be completed in minutes.
[0057] S250: Determine a service processing path that matches the service request according to the source identifier, and execute the service request according to the service processing path to generate service traffic.
[0058] The process of executing the service request includes a process of reading and / or writing to a database of the system under test.
[0059] In this step, different data reading and writing service processing paths are set up for service requests from different sources. When a service request comes from a test user, the service request is accessed from the application layer in the preset test service path. Data is read and / or written to the storage layer or cache layer in the preset test service path based on the service request. That is, data is read and / or written to the storage layer or cache layer in the preset test service path based on the content of the service request through the message middleware in the preset test service path. Finally, the results of the data reading and / or writing are fed back to the test user who issued the service request through the application layer in the preset test service path.
[0060] By identifying business requests from different sources, introducing production traffic into the production environment and storage layer, and stress testing traffic into the stress testing environment and shadow storage layer, we can ensure that production and testing are not affected by each other. In addition, it can also ensure that the cleanup of stress test data is more convenient after the stress test is completed.
[0061] S260 . Generate a result of a service system capacity assessment based on the service traffic generated by service requests from different sources during the system test period.
[0062] During the system testing period, all business requests received by the tested application system and the traffic generated by processing the received business requests represent the request capacity that the tested application system can withstand, and to a certain extent reflect the capacity of the tested system.
[0063] exist Figure 5 The entire process of traffic recording and playback is shown in Figure 2. The production traffic (public network traffic) obtained through the core switch in the computer room is desensitized and encrypted through the application protection system (Web Application Firewall, WAF), and stored in the traffic recording cluster database to complete the traffic recording. At the same time, the production traffic will also be distributed to the target business system server through the load balancing server and processed by the target business system server. When testing the application system, the stress testing equipment obtains the traffic file to be tested through the message middleware, and then issues a test business request. After the load balancing server receives the test business request, it is allocated to the target business system server for identification and processing according to the corresponding processing path, thereby completing the system testing process.
[0064] Typically, in actual business system configurations, a "dual-active" model is adopted, with two application system service clusters set up. One service cluster is used for normal online production, processing business requests from online non-test users; the other service cluster is used for system testing, specifically receiving and processing business requests from test users. The business processing objects of the two service clusters can be swapped, meaning that the two server clusters can be tested separately.
[0065] The technical solution of this embodiment is to pre-copy the production traffic through the core switch of the IDC computer room to obtain the traffic to be replayed for testing, and copy the content of the database in the production environment to the database in the test environment, so that the test environment and the production environment are highly consistent. Then, during the system test time period, for the obtained business request, identify and determine the source identifier of the business request, wherein the source identifier includes a test user identifier and a non-test user identifier; then, according to the source identifier, determine the business processing path that matches the business request, execute the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes the process of reading and / or writing the database of the tested system, that is, setting different business processing paths for the business requests of the test user and the business requests of the online production environment users, respectively, to achieve isolation of test and production business during the system test process; finally, based on the business traffic generated by business requests from different sources during the system test time period, generate the results of the business system capacity assessment. The technical solution of this embodiment solves the problems in the prior art of system testing through traffic playback, such as a single test link, a simple test scenario, and test results that cannot represent the actual system capacity. It enables the testing of complex business links including read traffic and write traffic during the testing of the business system, so that the system capacity test results are closer to the actual traffic production scenario to a greater extent.
[0066] In a preferred embodiment, during system testing, a system operation monitoring tool can be set up to monitor the processing of service requests whose source identifier is the test user identifier. This tool can identify problems that may arise when the system is under high service traffic pressure, such as problems with calls between different service function modules. The monitoring results can then be used to optimize the application system.
[0067] Example 3
[0068] Figure 6 This is a structural diagram of a system capacity assessment device provided in Example 3 of the present invention. This embodiment is applicable to system capacity assessment and testing situations. The device can be implemented by software and / or hardware and integrated into a computer terminal device with application development capabilities.
[0069] like Figure 6 As shown, the system capacity assessment device includes: a request source identification module 310 , a request processing module 320 and a capacity assessment module 330 .
[0070] Among them, the request source identification module 310 is used to obtain business requests and determine the source identifier of the business requests during the system test time period, wherein the source identifier is a test user identifier or a non-test user identifier; the request processing module 320 is used to determine the business processing path that matches the business request based on the source identifier, and execute the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes the process of reading and / or writing the database of the tested system; the capacity assessment module 330 is used to generate the results of the business system capacity assessment based on the business traffic generated by business requests from different sources during the system test time period.
[0071] The technical solution of this embodiment is to identify and determine the source identifier of the business request for the acquired business request during the system test time period, wherein the source identifier includes a test user identifier and a non-test user identifier; then, according to the source identifier, determine the business processing path that matches the business request, and execute the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes the process of reading and / or writing to the database of the tested system, that is, setting different business processing paths for the business requests of the test user and the business requests of the online production environment user respectively, so as to achieve the isolation of the test and production business during the system test process; finally, based on the business traffic generated by the business requests from different sources during the system test time period, generate the result of the business system capacity assessment. The technical solution of this embodiment solves the problem in the prior art that the test link for system testing by means of traffic playback is single, the test scenario is simple, and the test results cannot represent the actual system capacity, and realizes that during the test of the business system, complex business links including read traffic and write traffic can be tested, so that the system capacity test results are closer to the actual traffic production scenario to a greater extent.
[0072] Optionally, the request processing module 320 is specifically configured to:
[0073] When the source identifier is a test user identifier, accessing the service request based on the application layer in a preset test service path;
[0074] Reading data and / or writing data to the storage layer or cache layer in the preset test service path according to the service request;
[0075] The result of reading and / or writing data is fed back to the test user who issued the service request through the application layer in the preset test service path.
[0076] Optionally, the root request processing module 320 is further configured to:
[0077] Through the message middleware in the preset test service path, data is read from or written to the storage layer or cache layer in the preset test service path according to the content of the service request.
[0078] Optionally, the service request corresponding to the test user identifier is a service request generated by replaying production traffic within a preset historical time period, and the system capacity assessment device further includes a traffic recording module for:
[0079] Obtain traffic data from production traffic replicated and distributed by the core switches in the Internet data center;
[0080] The acquired traffic data is desensitized and encrypted to form the traffic to be replayed for system testing.
[0081] Optionally, the test user identifier is an account identifier of a preset test device mounted on the cloud storage network disk that stores the traffic to be replayed.
[0082] Optionally, the system capacity assessment device further includes a data replication module, configured to:
[0083] Before the system test, the data in the database of the storage layer in the production environment of the tested system is synchronously stored in the database of the storage layer in the preset test service path.
[0084] Optionally, the system capacity assessment device further includes a test monitoring module, configured to:
[0085] Based on a preset monitoring tool, the processing process of the service request whose source identifier is the test user identifier is monitored.
[0086] The system capacity assessment device provided in the embodiment of the present invention can execute the system capacity assessment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0087] Example 4
[0088] Figure 7 A schematic diagram of the structure of a server provided in embodiment 4 of the present invention. Figure 7 A block diagram of an exemplary server 12 suitable for use in implementing embodiments of the present invention is shown. Figure 7 The server 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention. The server 12 can be any terminal device with computing capabilities, such as an intelligent controller and server, a mobile phone, and other terminal devices.
[0089] like Figure 7 As shown, server 12 is implemented as a general-purpose computing device. Components of server 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing units 16).
[0090] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0091] The server 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the server 12, including volatile and non-volatile media, removable and non-removable media.
[0092] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Server 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 7 Not shown, often called a "hard drive"). Although Figure 7 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0093] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0094] The server 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the server 12, and / or any device that enables the server 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may occur via an input / output (I / O) interface 22. Furthermore, the server 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the server 12 via the bus 18. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with server 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0095] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the system capacity assessment method provided in the embodiment of the present invention, which includes:
[0096] During a system test period, obtaining a service request and determining a source identifier of the service request, wherein the source identifier is a test user identifier or a non-test user identifier;
[0097] Determining a business processing path that matches the business request based on the source identifier, and executing the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes a process of reading and / or writing to a database of the system under test;
[0098] Based on the service traffic generated by service requests from different sources during the system test period, a result of the service system capacity assessment is generated.
[0099] Example 5
[0100] This fifth embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the system capacity assessment method provided by any embodiment of the present invention is implemented.
[0101] During a system test period, obtaining a service request and determining a source identifier of the service request, wherein the source identifier is a test user identifier or a non-test user identifier;
[0102] Determining a business processing path that matches the business request based on the source identifier, and executing the business request according to the business processing path to generate business traffic, wherein the process of executing the business request includes a process of reading and / or writing to a database of the system under test;
[0103] Based on the service traffic generated by service requests from different sources during the system test period, a result of the service system capacity assessment is generated.
[0104] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0105] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0106] Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0107] The computer program code for performing the operations of the present invention can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0108] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computer device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
[0109] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A system capacity assessment method, characterized in that: The method comprises: Before system testing, the data in the storage layer database in the production environment of the tested system is synchronized and stored in the storage layer database in the preset test business path; During a system test period, a service request is obtained and a source identifier of the service request is determined, wherein the source identifier is a test user identifier or a non-test user identifier; when the source identifier is a test user identifier, the service request is accessed based on the application layer in a preset test service path, and the service request is executed according to the preset test service path to generate service traffic, wherein the process of executing the service request includes a process of reading and / or writing to a database of the system under test; the preset test service path is a service processing path corresponding to a server of the target service system under test determined after load balancing in the service cluster under test; Based on the service traffic generated by service requests from different sources during the system test period, a result of the service system capacity assessment is generated.
2. The method according to claim 1, characterized in that The executing the service request according to the preset test service path includes: Reading data and / or writing data to the storage layer or cache layer in the preset test service path according to the service request; The result of reading and / or writing data is fed back to the test user who issued the service request through the application layer in the preset test service path.
3. The method according to claim 2, characterized in that The reading or writing data to the storage layer or cache layer in the preset test service path according to the service request includes: Through the message middleware in the preset test service path, data is read from or written to the storage layer or cache layer in the preset test service path according to the content of the service request.
4. The method according to claim 1, wherein The service request corresponding to the test user identifier is a service request generated by replaying production traffic within a preset historical time period, and the recording process of the production traffic includes: Obtain traffic data from production traffic replicated and distributed by the core switches in the Internet data center; The acquired traffic data is desensitized and encrypted to form the traffic to be replayed for system testing.
5. The method according to claim 4, characterized in that The test user identifier is an account identifier of a preset test device mounted on the cloud storage network disk storing the traffic to be replayed.
6. The method according to claim 1, characterized in that The method further comprises: Based on a preset monitoring tool, the processing process of the service request whose source identifier is the test user identifier is monitored.
7. A system capacity assessment device, characterized in that: The device comprises: A data synchronization module is used to synchronize the data in the storage layer database in the production environment of the tested system to the storage layer database in the preset test business path before the system is tested; A request source identification module is used to obtain a service request during a system test period and determine a source identifier of the service request, wherein the source identifier is a test user identifier or a non-test user identifier; a request processing module configured to, when the source identifier is a test user identifier, access the service request based on the application layer in a preset test service path, execute the service request according to the preset test service path to generate service traffic, wherein the process of executing the service request includes the process of reading and / or writing to the database of the system under test; the preset test service path is the service processing path corresponding to the server of the target service system under test determined after load balancing in the service cluster under test; The capacity assessment module is used to generate a result of a business system capacity assessment based on the business traffic generated by business requests from different sources during the system test period.
8. A server device, characterized in that: The server device includes: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the system capacity assessment method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the system capacity assessment method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Network traffic playback test method and device
CN106878108A
Test method, test device and computer readable storage medium
CN110134587A
System capacity testing method and device based on production environment
CN111464383A