System testing method, device and equipment

By using a shared message queue architecture for baseline and swimlane testing environments, the problem of high testing and maintenance costs for software development teams in multiple testing environments is solved, achieving more efficient test environment management and isolation.

CN121833476APending Publication Date: 2026-04-10FUTU NETWORK TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Software development teams face challenges such as high testing and maintenance costs and difficulties in managing multiple testing environments.

Method used

The architecture employs a baseline testing environment and a swimlane testing environment. By sharing a basic message queue, test requests are received and the target microservice is determined based on the target swimlane label to respond, thereby realizing the distribution and processing of test requests.

Benefits of technology

It reduces testing and maintenance costs, facilitates the management of multiple testing environments, and improves testing efficiency and environment isolation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833476A_ABST
    Figure CN121833476A_ABST
Patent Text Reader

Abstract

The invention provides a system testing method, device and equipment, and the method comprises the steps: creating a baseline testing environment comprising all baseline micro-services and at least one lane testing environment comprising at least one lane micro-service corresponding to the baseline micro-services, and enabling the baseline testing environment and the lane testing environment to share a basic message queue; receiving a test request for a to-be-tested object, determining a target lane label based on the to-be-tested object, and determining a target test request carrying the target lane label; distributing the target test request as an upstream service message to a candidate baseline micro-service of the baseline test environment and / or a candidate lane micro-service of the lane test environment through the basic message queue; and according to the target lane label, determining a target micro-service in the candidate baseline micro-service and / or the candidate lane micro-service, and responding to the test request through the target micro-service. Test and maintenance cost is reduced, and management of multiple sets of test environments is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a system testing method, apparatus, and device. Background Technology

[0002] Currently, software development teams typically require multiple isolated testing environments to develop and test software systems. Each testing environment usually deploys a full set of testing resources, such as application instances and databases. Therefore, this results in high testing and maintenance costs and difficulties in managing testing environments. Summary of the Invention

[0003] This application provides a system testing method, apparatus, and equipment that can solve the problems of high testing and maintenance costs and difficult test environment management in related technologies, reduce testing and maintenance costs, and facilitate the management of multiple test environments.

[0004] Firstly, this application provides a system testing method, including creating a baseline test environment and at least one swimlane test environment. The baseline test environment includes all baseline microservices, and the swimlane test environment includes at least one swimlane microservice corresponding to a baseline microservice. The baseline test environment and the swimlane test environment share a basic message queue (MQ). The method involves receiving a test request for an object to be tested, determining a target swimlane label based on the object to be tested, and determining a target test request carrying the target swimlane label. The method also involves distributing the target test request as an upstream service message to candidate baseline microservices in the baseline test environment and / or candidate swimlane microservices corresponding to the swimlane test environment via the basic message queue. Finally, the method involves determining the target microservice among the candidate baseline microservices and / or candidate swimlane microservices based on the target swimlane label, and responding to the test request through the target microservice.

[0005] Secondly, this application provides a system testing apparatus, comprising: an environment creation module for creating a baseline test environment and at least one swimlane test environment, wherein the baseline test environment includes all baseline microservices, and the swimlane test environment includes at least one swimlane microservice corresponding to a baseline microservice, and the baseline test environment and the swimlane test environment share a basic message queue; a request receiving module for receiving a test request for an object to be tested, determining a target swimlane label based on the object to be tested, and determining a target test request carrying the target swimlane label; a service selection module for distributing the target test request as an upstream service message to the candidate baseline microservices of the baseline test environment and / or the candidate swimlane microservices corresponding to the swimlane test environment through the basic message queue; and a request response module for determining the target microservice among the candidate baseline microservices and / or candidate swimlane microservices according to the target swimlane label, and responding to the test request through the target microservice.

[0006] Thirdly, this application provides an electronic device, including: a processor and a memory, the memory for storing a computer program, and the processor for calling and running the computer program stored in the memory to perform the methods as described in the first aspect or its various implementations.

[0007] Fourthly, this application provides a computer-readable storage medium for storing a computer program that causes a computer to perform the methods described in the first aspect or its various implementations.

[0008] Fifthly, this application provides a computer program product including computer program instructions that cause a computer to perform the methods as described in the first aspect or its various implementations.

[0009] Sixthly, this application provides a computer program that causes a computer to perform the methods described in the first aspect or its various implementations.

[0010] Other technical features and effects involved in the technical solution of this application will be described in subsequent embodiments, and will not be repeated here to avoid repetition. Attached Figure Description

[0011] The accompanying drawings used in the following description of the embodiments are introduced.

[0012] Figure 1 An application scenario diagram provided for an embodiment of this application; Figure 2 A flowchart illustrating a system testing method provided in this application embodiment; Figure 3 A schematic diagram of a system testing method provided in an embodiment of this application; Figure 4 A schematic diagram of another system testing method provided in an embodiment of this application; Figure 5 A schematic diagram of another system testing method provided in an embodiment of this application; Figure 6 A schematic diagram of the system testing apparatus provided in the embodiments of this application; Figure 7 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

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

[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0015] In one embodiment, the technical solution of this application can be used in system testing scenarios, for example, in software or hardware testing scenarios.

[0016] For example, Figure 1 An application scenario diagram provided for an embodiment of this application, such as... Figure 1 As shown, this application scenario can include terminal devices 120 and servers 110 connected via wired or wireless networks. The server can be a single server, a server cluster consisting of multiple servers, or a cloud platform control center, but is not limited to these. Terminal devices can be mobile phones, tablets, laptops, or desktop computers, but are not limited to these.

[0017] It should be noted that, Figure 1 The terminal devices and servers mentioned are merely examples; in practice, other numbers or types of devices may also be included.

[0018] Specifically, the server can first create a baseline test environment and at least one swimlane test environment. The baseline test environment includes all baseline microservices, and the swimlane test environment includes at least one swimlane microservice corresponding to the baseline microservices. The baseline test environment and the swimlane test environment share a basic message queue. The baseline test environment and / or swimlane test environment can be deployed locally on the server or in the corresponding cloud environment. Next, developers can trigger test requests for the object under test based on their terminal devices. The object under test can be the software to be developed or a component corresponding to a certain function of the software to be developed. Then, the server can receive the test request for the object under test, determine the target swimlane tag based on the object under test, and identify the target test request carrying the target swimlane tag. Afterwards, the target test request can be distributed as an upstream service message to the candidate baseline microservices in the baseline test environment and / or the candidate swimlane microservices corresponding to the swimlane test environment through the basic message queue. Then, based on the target swimlane tag, the target microservice is determined from the candidate baseline microservices and / or candidate swimlane microservices, and the target microservice responds to the test request to test the object under test. Furthermore, the server can return the test results to the terminal device.

[0019] It should be noted that all technical solutions in this application can be combined in any way to form optional embodiments of this application. To avoid repetition, these will not be elaborated upon.

[0020] Furthermore, in the specific implementation of this application, baseline testing environment, swimlane testing environment, test object, business object, business data, and various tags are involved. When the embodiments of this application are applied to specific products or technologies, user permission, consent, or authorization is required, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0021] The technical solution of this application will be described in detail below: In one embodiment, Figure 2 A flowchart of a system testing method provided in this application embodiment, the method can be performed by, for example... Figure 1 The server shown performs the actions, but is not limited to this.

[0022] like Figure 2 As shown, the method may include S210-S240: S210: Create a baseline test environment and at least one swimlane test environment. The baseline test environment includes all baseline microservices, and the swimlane test environment includes at least one swimlane microservice corresponding to the baseline microservice. The baseline test environment and the swimlane test environment share a basic message queue.

[0023] The testing environment refers to the environment in which software or hardware systems are tested (for example, testing during the development phase). The testing environment can deploy at least one microservice (or microservice instance, which can be an application instance). The microservice can receive, forward, and respond to test requests, as well as retrieve messages sent from the message queue, retrieve data from the database, and execute specific test steps.

[0024] The baseline test environment can remain consistent with the production environment for a long time. The swimlane test environment can be created at any time according to test requirements (specifically, it can be a swimlane microservice created in the swimlane test environment according to test requirements). Different swimlane test environments can correspond to different test scopes. After the test requirements are completed, the swimlane test environment can be automatically destroyed.

[0025] The server can use different test resources to create a baseline test environment and each swimlane test environment. For example, different container clusters or virtual machines can be allocated to the baseline test environment and each swimlane test environment to ensure that each test environment is physically and / or logically isolated from other test environments during runtime. Alternatively, each swimlane test environment can share the same test resources, while the baseline test environment can be allocated independent test resources. Furthermore, the baseline test environment can be deployed in a central cloud, and the swimlane test environments can be deployed on edge nodes of the central cloud. Here, the central cloud refers to the data center cluster of a cloud computing network, and the edge nodes are small computing units closer to the data generation source. This facilitates lower latency execution of subsequent embodiments that jointly test the object under test based on the baseline microservices and swimlane microservices.

[0026] The baseline microservices in the baseline testing environment include all microservices of the system under test; the swimlane microservices in the swimlane testing environment may include microservices corresponding to some of the baseline microservices, and the swimlane microservices and their corresponding baseline microservices implement the same service function. For example, if the system under test includes 5 microservices A, B, C, D, and E, the baseline microservices in the baseline testing environment include these 5 microservices, while the swimlane environment may only deploy microservice A.

[0027] The basic message queue can be used to store and deliver / distribute messages. These messages can be target test requests corresponding to test requests for objects under test, and can be delivered to baseline microservices or swimlane microservices. Subsequent embodiments will describe this in more detail.

[0028] In addition to the microservices and basic message queues mentioned above, testing the objects under test also requires databases and data storage systems. Therefore, the baseline test environment and swimlane test environments can share the basic database and basic data storage system. The basic data storage system can include a remote dictionary server (Redis) and Elasticsearch (ES). For example, all baseline microservices, as well as the basic message queue, basic database, and basic data storage system, can be deployed / assigned to the baseline test environment; swimlane microservices can be deployed / assigned to the swimlane test environment.

[0029] In the above embodiments, by adopting swimlane deployment, microservices are deployed to swimlane testing environments on demand. The swimlane testing environment and the basic testing environment can share basic components (e.g., database / REDIS / MQ). Therefore, while ensuring environment isolation, it can solve the problems of high testing resource costs, high maintenance costs, difficult environment management, and difficult development and debugging caused by deploying multiple identical testing environments. It can reduce testing and maintenance costs and facilitate the management of multiple testing environments.

[0030] S220: Receive a test request for the object to be tested, determine the target swimlane label based on the object to be tested, and determine the target test request carrying the target swimlane label.

[0031] The object to be tested can be the system under test (software system or hardware system) or a portion of the software entities or functional characteristics of the system under test, such as microservices. Test requests can be triggered by developers on the client side, or they can be automatically triggered by automated test scripts in response to the initial completion of the object under test.

[0032] The target swimlane label is used to identify the test environment required for testing the object under test. For example, the target swimlane label can be the environment swimlane label of any swimlane test environment, or it can be the environment swimlane label of the baseline test environment. The environment swimlane label is used to uniquely identify the test environment.

[0033] Specifically, the above-mentioned determination of the target swimlane label based on the test object includes: obtaining the target test requirements of the test object (the target test requirements may be the specific functional information or change information corresponding to the test object that the test request needs to verify) and the swimlane test scope of each swimlane test environment (the swimlane test scope may be the set of functional changes corresponding to the test steps that can be executed by the swimlane microservices contained in the swimlane test environment); matching the target test requirements with each swimlane test scope; if the target test requirements match the target swimlane test scope, then the environment swimlane label of the swimlane test environment corresponding to the target swimlane test scope is determined as the target swimlane label; if the target test requirements do not match any swimlane test scope, then the environment swimlane label of the baseline test environment is determined as the target swimlane label.

[0034] In addition, after receiving a test request, the creation of a swimlane test environment in S210 can be executed, and the swimlane test scope of the swimlane test environment can be matched with the target test requirements of the object to be tested.

[0035] Specifically, determining the target test request carrying the target swimlane label includes: writing the target swimlane label into the test request to obtain the target test request. For example, to prevent unauthorized terminal devices or developer test accounts from sending test requests to the server and enabling testing of the object under test outside of authorized permissions, the generation rules and sending routes of the test requests can be predetermined. Authorized / permitted terminal devices and / or test accounts can generate and send test requests based on the generation rules and sending routes. After receiving the test request, the server can first verify the sending route of the test request. If the sending route of the test request passes the verification (for example, if the sending route of the test request is a preset sending route, then the verification passes), the server parses the test request based on the generation rules to verify whether the test request was generated according to the preset generation rules. If the test request was generated according to the preset generation rules, the target swimlane label can be written into the test request to obtain the target test request.

[0036] For example, the sending route can be a designated routing interface of the server. This interface receives various test requests. The designated routing interface can be any of multiple routing interfaces included on the server. For instance, the server can locally store a designated routing table to store the routing interfaces that can receive test requests within each preset time period. (Specifically, the server can randomly select one routing interface from all routing interfaces when the preset time period arrives; that is, the routing interfaces in the designated routing table are randomly generated according to the preset time period.) The designated routing interface can be the routing interface that the server retrieves from the designated routing table when the preset time period arrives. The server can then send the designated routing interface to a terminal device with test permissions / authorized access. Before sending a test request, the terminal device can first determine the designated routing interface that is closest to the current time, and then send the test request to the server through that designated routing interface. Accordingly, the above-mentioned verification test request sending route includes: verifying whether the routing interface receiving the test request is a routing interface in the specified routing storage table; if it is a routing interface in the specified routing storage table, then verifying whether the current time belongs to the preset time period corresponding to the routing interface receiving the test request in the specified routing storage table; if it does, then determining that the test request sending route verification has passed.

[0037] For example, the device authorization identifier of each authorized terminal device and / or the account authorization identifier of each authorized test account can be predetermined. The generation rule instructs the test request to include the device authorization identifier and / or account authorization identifier generated according to the preset rule at a specified location, based on a specified field name, and instructs the test request to be compressed using a specified compression method before sending. Correspondingly, the above-mentioned parsing of the test request based on the generation rule and verification of whether the test request was generated according to the preset generation rule can include decompressing the received test request according to the specified decompression method corresponding to the specified compression method indicated by the generation rule; if decompression is successful, then searching for the specified field name at the specified location indicated by the generation rule; if the specified field name can be found, then obtaining the device authorization identifier and / or account authorization identifier generated according to the preset rule, and performing the reverse processing steps on the device authorization identifier and / or account authorization identifier generated according to the preset rule to obtain the device authorization identifier and / or account authorization identifier; verifying whether the obtained device authorization identifier and / or account authorization identifier are the predetermined authorized device authorization identifier and / or account authorization identifier.

[0038] S230: Distribute the target test request as an upstream service message to the candidate baseline microservices in the baseline test environment and / or the candidate swimlane microservices in the swimlane test environment through the basic message queue.

[0039] Among them, the candidate baseline microservice can be the baseline microservice used to consume upstream service messages in the baseline test environment, and the candidate swimlane microservice can be the swimlane microservice corresponding to each swimlane test environment used to consume the upstream service messages.

[0040] For example, the request content (e.g., target swimlane label) contained in the target test request can be used as the message content of the upstream service message.

[0041] For example, the target test request can be distributed as an upstream service message through the basic message queue to the candidate baseline microservices in the baseline test environment and the candidate swimlane microservices in each swimlane test environment.

[0042] Alternatively, the target test request can be sent as an upstream service message through the basic message queue to both the candidate baseline microservices in the baseline test environment and the candidate swimlane microservices in each swimlane test environment.

[0043] S240: Based on the target swimlane label, determine the target microservice among the candidate baseline microservices and / or candidate swimlane microservices, and respond to the test request through the target microservice.

[0044] In this context, after receiving the upstream service message, the candidate swimlane microservices in each swimlane test environment and the candidate baseline microservices in the baseline test environment can determine whether they are the microservices that actually consume the upstream service message based on the environment swimlane message carried in the upstream service message and the environment swimlane tag of their test environment before entering the actual business logic.

[0045] Specifically, S240 includes the following steps: S240-1: Determine the environment swimlane labels for the test environment corresponding to each candidate baseline microservice and candidate swimlane microservice.

[0046] Among them, the environment swimlane label of the test environment (i.e., swimlane test environment) where the candidate swimlane microservice is located is a non-null value, which is used to identify the corresponding swimlane test environment; the environment swimlane label of the test environment (i.e., baseline test environment) where the candidate baseline microservice is located can be a null value.

[0047] S240-2: For candidate baseline microservices and / or candidate swimlane microservices, perform consistency judgment on the target swimlane label and the corresponding environment swimlane label of the candidate microservice through the candidate microservice.

[0048] As mentioned above, the environment swimlane label of the test environment (i.e., swimlane test environment) where the candidate swimlane microservice is located is not null, while the environment swimlane label of the test environment (i.e., baseline test environment) where the candidate baseline microservice is located can be null. If both the target swimlane label and the environment swimlane label corresponding to the candidate microservice are null, or both the target swimlane label and the environment swimlane label corresponding to the candidate microservice are not null and their characters are the same, then it can be determined that the target swimlane label and the environment swimlane label corresponding to the candidate microservice are the same. If one of the target swimlane label and the environment swimlane label corresponding to the candidate microservice is null and the other is not null, or both the target swimlane label and the environment swimlane label corresponding to the candidate microservice are not null but their characters are different, then it can be determined that the target swimlane label and the environment swimlane label corresponding to the candidate microservice are not the same.

[0049] S240-3: If the target swimlane label matches the environment swimlane label corresponding to the candidate microservice, then the candidate microservice is determined as the target microservice.

[0050] S240-4: If the target swimlane label is inconsistent with the environment swimlane label corresponding to the candidate microservice, and the candidate microservice is a candidate baseline microservice, then check whether a swimlane microservice corresponding to the candidate baseline microservice exists in the test environment corresponding to the environment swimlane label that is consistent with the target swimlane label. If not, the candidate microservice is determined as the target microservice. If it exists, then the swimlane microservice corresponding to the candidate baseline microservice can be determined as the target microservice.

[0051] Among them, the swimlane microservices corresponding to the candidate baseline microservices refer to swimlane microservices that provide the same service content as the candidate baseline microservices, that is, swimlane microservices that implement the same service functions as the candidate baseline microservices.

[0052] S240-5: If the target swimlane label does not match the environment swimlane label corresponding to the candidate microservice (i.e., the labels are inconsistent) and the candidate microservice is a candidate swimlane microservice, then the target test request is returned to the basic message queue; the candidate baseline microservice and / or the candidate swimlane microservice corresponding to the baseline test environment that distribute the target test request as an upstream service message to the baseline test environment through the basic message queue are re-executed.

[0053] For example, candidate baseline microservices and candidate swimlane microservices can act as consumers of the basic message queue, upon receiving upstream service messages sent by the basic message queue ( Figure 3 Following the phrase "and in subsequent content, upstream service messages will be referred to as messages" for short, you can first proceed as follows: Figure 3The steps are as shown. Specifically, you can first obtain the target swimlane label (e.g., marked as ctx-swimlane) carried in the message and the instance swimlane label (e.g., marked as local-swimlane, i.e., the environment swimlane label corresponding to the candidate microservice) of the current instance microservice (i.e., the candidate baseline microservice or any candidate swimlane microservice) of the test environment; then, determine whether the instance swimlane label is null.

[0054] If the instance swimlane label is not null, meaning the current instance microservice is a swimlane microservice in the swimlane testing environment, then we can determine whether the target swimlane label and the instance swimlane label are equal / identical. If the target swimlane label and the instance swimlane label are the same, then the instance microservice is identified as the target microservice, meaning that consumption can be performed based on this instance microservice. If the target swimlane label and the instance swimlane label are different, then the instance microservice does not consume the received messages, meaning that the instance microservice does not consume the received messages and does not execute any business logic.

[0055] If the instance swimlane label is null, meaning the current instance microservice is the baseline microservice in the baseline test environment, then we can determine if the target swimlane label is null. If the target swimlane label is null, the instance microservice is identified as the target microservice and can consume messages based on it. If the target swimlane label is not null, we check if a swimlane microservice exists in the swimlane test environment with the same instance and target swimlane labels to consume the message. If it exists, the instance microservice does not consume the message; otherwise, it consumes the message.

[0056] In other words, if the target swimlane label and the instance swimlane label are the same (both empty, or non-empty and equal), the message is consumed through the current instance. If the instance swimlane label corresponds to the baseline test environment (i.e., empty), and the target swimlane label does not correspond to the baseline test environment (i.e., not empty), it checks whether the swimlane test environment corresponding to the environment swimlane label that matches the target swimlane label exists as an instance, i.e., the swimlane microservice. If it does not exist, the message is consumed through the current instance. In all other scenarios, the message is not consumed through the current instance. Instead, a RabbitMQ NACK (Negative Acknowledgment) operation is performed (i.e., the current instance is returned as refusing to execute the message), and the message is thrown back to the basic message queue, causing RabbitMQ in the basic message queue to redeliver the message to other consumers.

[0057] By using the aforementioned consumer-prevention methods, the following lane separation objectives can be achieved: First, messages generated by swimlane microservices in swimlane test environment A (i.e., upstream service messages) are consumed by swimlane test environment A if swimlane test environment A has downstream consumers (i.e., swimlane microservices) that can consume the message; otherwise, they are consumed by downstream consumers (i.e., baseline microservices) in the baseline test environment that can consume the message.

[0058] 2. Messages generated by the baseline microservice in the baseline test environment (i.e., upstream service messages) can be consumed by downstream consumers (i.e., baseline microservices) in the baseline test environment if the baseline microservice producing the message does not have a swimlane label in its context (i.e., the message does not carry a swimlane label). If the baseline microservice producing the message has a swimlane label from swimlane test environment A in its context and swimlane test environment A has downstream consumers (i.e., swimlane microservices) consuming the message, then the message can be consumed by the downstream consumers of swimlane test environment A. If swimlane test environment A does not have downstream consumers consuming the message, then the message can be consumed by downstream consumers in the baseline test environment.

[0059] For example, such as Figure 4 As shown, the baseline test environment contains four microservices: services 1-4, and the swimlane test environment contains two microservices: services 2 and 4. Request 1, which does not carry any swimlane label, demonstrates a baseline request chain, meaning it can be responded to by all services in the baseline test environment. Request 2, which carries a swimlane label, can be routed through transparent swimlane label transmission, providing a full application experience: Upon receiving request 2, transparent transmission (microservice addressing) is performed based on the swimlane label of the current test environment. The system then determines whether the corresponding microservice exists in the swimlane test environment based on the transmitted swimlane label; if it exists, the swimlane test environment is addressed; otherwise, the baseline test environment is addressed.

[0060] For example, a middleware proxy layer corresponding to the basic message queue can be set up, and upstream service messages in the basic message queue can be obtained through the middleware proxy layer, and the embodiments in S240-1 to S240-5 can be executed.

[0061] The following describes an embodiment involving the basic database shared by the baseline testing environment and the swimlane testing environment.

[0062] In one embodiment, the baseline testing environment and the lane testing environment share a basic database. The technical solution of this application also includes the following steps: S250: Obtain the environment swimlane labels for each test environment. The environment swimlane labels uniquely identify the corresponding test environment.

[0063] S260: Based on the relationship between different business objects and different test environments, data swimlane labels for the corresponding business data of each business object are generated through the environment swimlane labels of each test environment.

[0064] Business data can be data stored in the underlying database.

[0065] For example, the business object can be the business object applied to by the object to be tested.

[0066] For example, a test environment associated with a business object can be a test environment in which the business object has access rights and / or a test environment required for the object under test corresponding to the business object.

[0067] For example, the data swimlane labels corresponding to the business data of the business object can be determined, including: the environment swimlane labels of the test environment that are associated with the business object.

[0068] S270: In response to the triggering of a scheduled task for any target microservice in the baseline microservice and swimlane microservices, based on the target environment swimlane label corresponding to the target microservice and the data swimlane label of the business data corresponding to each business object, the target business data is obtained from the basic database, and the scheduled task is executed by the target microservice using the target business data.

[0069] The scheduled task can be a task tested through the target microservice. For example, it could be the task corresponding to S240, where the target microservice responds to test requests for the object under test corresponding to the business object.

[0070] Alternatively, the scheduled task can be a task other than testing the object under test. For example, it can be the task in the above embodiment of generating the route interface that can receive test requests in each preset time period in the specified route storage table and sending the specified route to the client when the preset time period is reached.

[0071] Specifically, such as Figure 5 As shown, S270 may include any of the following cases: Scenario 1, the target microservice (i.e. Figure 5 The microservice in the current test environment is the baseline microservice in the baseline test environment. S270 includes the following steps: pull business data of all business objects (e.g., a company) in the basic database; for any target business object, obtain the data swimlane label (i.e., ...) corresponding to the business data under the target business object. Figure 5(Company swimlane label in the baseline test environment). If the data swimlane label corresponding to the business data under the target business object is consistent with the target environment swimlane label (e.g., both are null values), then the test object to be tested is tested using the corresponding business data and the target microservice response in the baseline test environment. If the data swimlane label corresponding to the business data under the target business object is inconsistent with the target environment swimlane label (e.g., the target environment swimlane label is null, but the data swimlane label is not null), then it is checked whether there is a swimlane microservice corresponding to the target microservice in the test environment corresponding to the environment swimlane label that is consistent with the data swimlane label. If there is no corresponding swimlane microservice in the corresponding test environment, the test object to be tested is tested using the corresponding business data and the target microservice response in the baseline test environment (e.g., scheduled task). In addition, if there is a corresponding swimlane microservice in the corresponding test environment, the test object to be tested is not tested using the corresponding business data and the target microservice response in the baseline test environment, i.e., the scheduled task is not executed. Of course, in this case, the test object to be tested can be tested using the corresponding swimlane microservice in the corresponding test environment, where the business data under the target business object can be used.

[0072] Scenario 2: The target microservice is a swimlane microservice in a swimlane testing environment. S270 includes the following steps: pull business data of the business object corresponding to the data swimlane label that is consistent with the environment swimlane label of the swimlane testing environment where the target microservice is located from the basic database to obtain the target business data; and use the target business data to execute a scheduled task through the target microservice.

[0073] In one embodiment, for the aforementioned base database, data changes can be configured to be backward compatible, meaning that fields can only be added to the base database, and fields in the base database cannot be deleted or their names modified, to ensure that changes to the data structure in the base database do not affect the normal operation of each test environment.

[0074] Specifically, this can be achieved through the following steps: in response to a delete operation or a field name modification operation on any field in the basic database, disable the delete operation or field name modification operation; or disable the function corresponding to the delete operation or field name modification operation on any field in the basic database.

[0075] In the above embodiments, by assigning swimlane tags to the business data of different business objects and controlling access to the business data when executing different scheduled tasks in combination with swimlane tags, the correct ownership of business data can be ensured. This ensures that each test environment can only access and process the corresponding business data when executing scheduled tasks, avoiding data usage chaos and improving the overall security and reliability of the data system.

[0076] In the above embodiments, isolation of the basic database and basic message queue can be achieved for different test environments, test objects and business objects, thereby avoiding business logic interference and data pollution that may occur in different test environments; the following embodiments introduce the implementation of isolation for basic data storage systems, for example, isolation for Redis.

[0077] For example, in a business scenario where the basic data storage system is used as a message queue, specific implementations can be found in the implementations described above for the basic message queue.

[0078] When using a basic data storage system to store or cache data involved in the execution of scheduled tasks or response to test requests, there is no need to distinguish between the test environment, the object under test, and the business object. That is, it can be used in the same way as a regular database to cache or store data during the execution of scheduled tasks or response to test requests under any test environment, object under test, and business object. The identifiers corresponding to these data can be auto-incrementing like serial numbers.

[0079] For business scenarios using a basic data storage system to implement a distributed database, since distributed locks are typically associated with employee or company identifiers, the basic data storage system can be directly shared. However, in the single-instance mode of scheduled tasks, hot standby locks are required. Sharing the basic data storage system in this scenario would cause scripts in the swimlane test environment to malfunction, leading to lock contention between test environments. For example, a hot standby lock for a scheduled task that should be executed by the baseline test environment might be acquired by a microservice in the swimlane test environment, or a microservice in the swimlane test environment might never acquire the lock. This would result in the baseline test environment's scheduled tasks failing to execute on time, or the swimlane test environment's scheduled tasks failing to trigger at all. Therefore, the hot standby lock service can be directly removed / disabled.

[0080] Figure 6 A schematic diagram of a system testing apparatus provided in an embodiment of this application. Figure 6 As shown, the system testing device 600 includes: The environment creation module 610 is used to create a baseline test environment and at least one swimlane test environment. The baseline test environment includes all baseline microservices, and the swimlane test environment includes at least one swimlane microservice corresponding to the baseline microservices. The baseline test environment and the swimlane test environment share a basic message queue. The request receiving module 620 is used to receive test requests for objects to be tested, determine the target swimlane label based on the objects to be tested, and determine the target test request carrying the target swimlane label. The service selection module 630 is used to distribute the target test request as an upstream service message to the candidate baseline microservices of the baseline test environment and / or the candidate swimlane microservices corresponding to the swimlane test environment through the basic message queue. The request response module 640 is used to determine the target microservice among the candidate baseline microservices and / or candidate swimlane microservices according to the target swimlane label, and respond to the test request through the target microservice.

[0081] In one embodiment, the request-response module 640 is specifically used to determine the environment swimlane labels of the test environment corresponding to the candidate baseline microservice and the candidate swimlane microservice; for the candidate microservices among the candidate baseline microservices and / or candidate swimlane microservices, a consistency judgment is made on the target swimlane label and the environment swimlane label corresponding to the candidate microservice; if the target swimlane label is consistent with the environment swimlane label corresponding to the candidate microservice, then the candidate microservice is determined as the target microservice; if the target swimlane label is inconsistent with the environment swimlane label corresponding to the candidate microservice and the candidate microservice is a candidate baseline microservice, then it is checked whether there is a swimlane microservice corresponding to the candidate baseline microservice in the test environment corresponding to the environment swimlane label consistent with the target swimlane label; if not, the candidate microservice is determined as the target microservice.

[0082] In one embodiment, the request response module 640 is specifically configured to, if the target swimlane label does not match the environment swimlane label corresponding to the candidate microservice and the candidate microservice is a candidate swimlane microservice, then resubmit the target test request to the basic message queue; and re-execute the distribution of the target test request as an upstream service message to the candidate baseline microservice and / or the candidate swimlane microservice corresponding to the baseline test environment through the basic message queue.

[0083] In one embodiment, the baseline test environment and the swimlane test environment share a basic database; the data acquisition module 650 is used to acquire the environment swimlane tags of each test environment, and the environment swimlane tags uniquely identify the corresponding test environment; the tag generation module 660 is used to generate data swimlane tags for the business data corresponding to each business object based on the association relationship between different business objects and different test environments, through the environment swimlane tags of each test environment; the request response module 640 is also used to respond to the triggering of the scheduled task of any target microservice in the baseline microservice and swimlane microservice, and to acquire the target business data in the basic database based on the target environment swimlane tag corresponding to the target microservice and the data swimlane tags for the business data corresponding to each business object, and to execute the scheduled task through the target microservice using the target business data.

[0084] In one embodiment, the target microservice is the baseline microservice in the baseline test environment. The request-response module 640 is specifically used to: pull business data under all business objects in the basic database; for any target business object, obtain the data swimlane label corresponding to the business data under the target business object; if the data swimlane label corresponding to the business data under the target business object is consistent with the target environment swimlane label, then respond to the test request with the corresponding business data and the target microservice in the baseline test environment to test the object under test; if the data swimlane label corresponding to the business data under the target business object is inconsistent with the target environment swimlane label, then check whether there is a swimlane microservice corresponding to the target microservice in the test environment corresponding to the environment swimlane label that is consistent with the data swimlane label; if there is no corresponding swimlane microservice in the corresponding test environment, respond to the test request with the corresponding business data and the target microservice in the baseline test environment to test the object under test.

[0085] In one embodiment, the target microservice is a swimlane microservice in a swimlane testing environment. The request-response module 640 is specifically used to: pull business data of the business object corresponding to the environment swimlane label of the swimlane testing environment where the target microservice is located from the basic database to obtain the target business data; and use the target business data to execute a scheduled task through the target microservice.

[0086] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be found in the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 6 The apparatus 600 shown can execute the above-described method embodiments, and the foregoing and other operations and / or functions of each module in the apparatus 600 are respectively for implementing the corresponding processes in the above-described methods. For the sake of brevity, they will not be described in detail here.

[0087] The apparatus 600 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.

[0088] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 700 may include: The system includes a memory 710 and a processor 720. The memory 710 stores computer programs and transfers the program code to the processor 720. In other words, the processor 720 can retrieve and run the computer program from the memory 710 to implement the methods described in the embodiments of this application.

[0089] For example, the processor 720 can be used to execute the above-described method embodiments according to instructions in the computer program.

[0090] In some embodiments of this application, the processor 720 may include, but is not limited to: General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0091] In some embodiments of this application, the memory 710 includes, but is not limited to: Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0092] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 710 and executed by the processor 720 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.

[0093] like Figure 7 As shown, the electronic device may also include: Transceiver 730, which can be connected to processor 720 or memory 710.

[0094] The processor 720 can control the transceiver 730 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 730 may include a transmitter and a receiver. The transceiver 730 may further include antennas, and the number of antennas may be one or more.

[0095] It should be understood that the various components in the electronic device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.

[0096] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.

[0097] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, the computer can perform all or part of the corresponding processes in the methods of the embodiments of this application, producing the functions achievable by the methods of the embodiments of this application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid state disks (SSDs)).

[0098] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0099] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0100] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0101] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A system testing method, characterized in that, include: Create a baseline test environment and at least one swimlane test environment. The baseline test environment includes all baseline microservices, and the swimlane test environment includes at least one swimlane microservice corresponding to the baseline microservice. The baseline test environment and the swimlane test environment share a basic message queue. Receive a test request for the object to be tested, determine the target swimlane label based on the object to be tested, and determine the target test request carrying the target swimlane label; The target test request is distributed as an upstream service message to the candidate baseline microservice of the baseline test environment and / or the candidate swimlane microservice corresponding to the swimlane test environment through the basic message queue. Based on the target swimlane label, a target microservice is determined from the candidate baseline microservices and / or the candidate swimlane microservices, and the test request is responded to through the target microservice.

2. The method according to claim 1, characterized in that, The step of determining the target microservice from the candidate baseline microservices and / or the candidate swimlane microservices based on the target swimlane label includes: Determine the environment swimlane labels of the test environment corresponding to the candidate baseline microservice and the candidate swimlane microservice; For the candidate baseline microservice and / or the candidate microservices in the candidate swimlane microservices, a consistency judgment is made on the target swimlane label and the environment swimlane label corresponding to the candidate microservice through the candidate microservice; If the target swimlane label matches the environment swimlane label corresponding to the candidate microservice, then the candidate microservice is determined as the target microservice; If the target swimlane label is inconsistent with the environment swimlane label corresponding to the candidate microservice and the candidate microservice is the candidate baseline microservice, then check whether there is a swimlane microservice corresponding to the candidate baseline microservice in the test environment corresponding to the environment swimlane label that is consistent with the target swimlane label. If not, the candidate microservice is determined as the target microservice.

3. The method according to claim 2, characterized in that, The method further includes: If the target swimlane label does not match the environment swimlane label corresponding to the candidate microservice and the candidate microservice is the candidate swimlane microservice, then the target test request is returned to the basic message queue. Re-execute the process of distributing the target test request as an upstream service message to the candidate baseline microservice of the baseline test environment and / or the candidate swimlane microservice corresponding to the swimlane test environment through the basic message queue.

4. The method according to any one of claims 1-3, characterized in that, The baseline testing environment and the lane testing environment share a basic database; the method further includes: Obtain the environment swimlane labels for each test environment, where each environment swimlane label uniquely identifies the corresponding test environment; Based on the association between different business objects and different test environments, data swimlane tags for the corresponding business data of each business object are generated through the environment swimlane tags of each test environment; In response to the triggering of a scheduled task for any target microservice among the baseline microservice and swimlane microservices, target business data is obtained from the basic database based on the target environment swimlane tag corresponding to the target microservice and the data swimlane tag corresponding to the business data of each business object, and the scheduled task is executed by the target microservice using the target business data.

5. The method according to claim 4, characterized in that, The target microservice is the baseline microservice in the baseline test environment. The step of obtaining target business data from the basic database based on the target environment swimlane label corresponding to the target microservice and the data swimlane labels corresponding to the business data of each business object, and then using the target business data through the target microservice to execute the scheduled task, includes: Retrieve business data from all business objects in the underlying database; For any given target business object, obtain the data swimlane label corresponding to the business data under the target business object; If the data swimlane label corresponding to the business data under the target business object is consistent with the target environment swimlane label, then the test object is tested by responding to the test request through the corresponding business data and the target microservice in the baseline test environment. If the data swimlane label corresponding to the business data under the target business object is inconsistent with the target environment swimlane label, then check whether there is a swimlane microservice corresponding to the target microservice in the test environment corresponding to the environment swimlane label that is consistent with the data swimlane label. If there is no corresponding swimlane microservice in the corresponding test environment, the test object is tested by responding to the test request through the corresponding business data and the target microservice in the baseline test environment.

6. The method according to claim 4, characterized in that, The target microservice is a swimlane microservice in the swimlane testing environment. The step of retrieving target business data from the basic database based on the target environment swimlane tag corresponding to the target microservice and the data swimlane tags corresponding to the business data of each business object, and then using the target business data through the target microservice to execute the scheduled task, includes: Retrieve business data of the business objects corresponding to the swimlane tags of the swimlane test environment where the target microservice is located from the basic database to obtain the target business data. The target microservice executes the scheduled task using the target business data.

7. A system testing device, characterized in that, include: An environment creation module is used to create a baseline test environment and at least one swimlane test environment. The baseline test environment includes all baseline microservices, and the swimlane test environment includes at least one swimlane microservice corresponding to the baseline microservice. The baseline test environment and the swimlane test environment share a basic message queue. The request receiving module is used to receive test requests for the object to be tested, determine the target swimlane label based on the object to be tested, and determine the target test request carrying the target swimlane label; The service selection module is used to distribute the target test request as an upstream service message to the candidate baseline microservice of the baseline test environment and / or the candidate swimlane microservice corresponding to the swimlane test environment through the basic message queue. The request-response module is used to determine the target microservice among the candidate baseline microservices and / or the candidate swimlane microservices based on the target swimlane label, and respond to the test request through the target microservice.

8. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-6 by executing the executable instructions.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-6.

10. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device, the electronic device performs the method of any one of claims 1-6.