CN114143236B - Service system testing method and device, electronic equipment and readable storage medium - Google Patents

Service system testing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114143236B
CN114143236B CN202010812151.2A CN202010812151A CN114143236B CN 114143236 B CN114143236 B CN 114143236B CN 202010812151 A CN202010812151 A CN 202010812151A CN 114143236 B CN114143236 B CN 114143236B
Authority
CN
China
Prior art keywords
data
execution
shadow
identifier
processing logic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010812151.2A
Other languages
Chinese (zh)
Other versions
CN114143236A (en
Inventor
王艺霖
高峰
薛昌贵
李晓菲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NetsUnion Clearing Corp
Original Assignee
NetsUnion Clearing Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NetsUnion Clearing Corp filed Critical NetsUnion Clearing Corp
Priority to CN202010812151.2A priority Critical patent/CN114143236B/en
Publication of CN114143236A publication Critical patent/CN114143236A/en
Application granted granted Critical
Publication of CN114143236B publication Critical patent/CN114143236B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a service system testing method, a service system testing device, electronic equipment and a readable storage medium. The method comprises the following steps: acquiring service data consisting of shadow data and production data, wherein the service data comprises a data identifier capable of distinguishing the shadow data and the production data; according to the execution thread and the data identifier corresponding to the service data, an execution identifier corresponding to the service data is generated, and the shadow data and the production data can be distinguished according to the execution identifier; and executing the execution thread in the functional component by using processing logic corresponding to the execution identifier according to the execution identifier so as to test the service system, wherein the processing logic of the shadow data is independent of the processing logic of the production data. The method adopts the modes of identifying, adding the shadow data processing logic and the like, decouples the processing logic of the production data and the shadow data, and does not need to reform the original business logic, thereby reducing the development difficulty and the system reform risk, reducing the possibility of generating loopholes and having better universality.

Description

Service system testing method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service system testing method, a device, an electronic apparatus, and a readable storage medium.
Background
The full-link pressure test is to simulate massive requests and data to perform pressure test on the whole service chain based on actual production service scenes and system environments. At present, shadow traffic data (shadow traffic) is widely adopted for full link pressure test, and the specific method is that a request sent to a production environment is duplicated to generate shadow data, and the shadow data and the production data are input into a service system to be tested together, so that the purposes of pressure test and correctness test are achieved.
In general service system, there are multiple service modules, and there may be some service modules that have been subjected to shadow pressure measurement, but some services have not been subjected to shadow pressure measurement, and the existing pressure measurement manner is often implemented by modifying on the basis of the system core service code, and the core service code is required to be invaded to master the service logic details to complete, so that the modification cost and risk are high, and the reusability is low.
Disclosure of Invention
The present application has been made in view of the above problems, and provides a business system testing method, apparatus, electronic device, and readable storage medium that overcome or at least partially solve the above problems.
The embodiment of the application adopts the following technical scheme:
In a first aspect, an embodiment of the present application provides a service system testing method, which is executed by a service system server, where the method includes:
acquiring service data composed of shadow data and production data, wherein the service data comprises a data identifier capable of distinguishing the shadow data from the production data;
generating an execution identifier corresponding to the service data according to the execution thread and the data identifier corresponding to the service data, wherein the execution identifier can distinguish the shadow data from the production data;
And executing the execution thread in the functional component by using processing logic corresponding to the execution identifier according to the execution identifier so as to test the service system, wherein the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data.
Optionally, the generating the execution identifier corresponding to the execution thread according to the execution thread and the data identifier corresponding to the service data includes:
The method comprises the steps of respectively obtaining data identifiers from each service data by using a component realized based on a tangent plane-oriented programming technology;
and generating a corresponding execution identifier according to the acquired data identifier, and storing the generated execution identifier into a context data structure, wherein the context data structure stores the corresponding relation between the thread identifier of the execution thread of the service data and the execution identifier.
Optionally, the executing, in the functional component, the execution thread with processing logic corresponding to the execution identifier according to the execution identifier includes:
acquiring an execution identifier corresponding to the current execution thread from the context data structure according to the thread identifier of the current execution thread;
Executing the current execution thread in the functional component by processing logic corresponding to the shadow data under the condition that the execution identifier indicates that the service data corresponding to the current execution thread is the shadow data;
And executing the current execution thread in the functional component by processing logic corresponding to the production data under the condition that the execution identifier indicates that the service data corresponding to the current execution thread is the production data.
Optionally, the functional component specifically includes an SQL database, a shadow data table corresponding to each production data table is preset in the SQL database, and executing, according to the execution identifier, the execution thread in the functional component with processing logic corresponding to the execution identifier includes:
Intercepting a database operation request related to service data;
Under the condition that the processing logic of the execution thread is the processing logic corresponding to the shadow data, the table name of a production data table to be operated is analyzed from the intercepted database operation request;
Modifying the table name of the production data table in the database operation request into the table name of the corresponding shadow data table to obtain a modified database operation request;
and executing the modified database operation request.
Optionally, executing the execution thread in the functional component with processing logic corresponding to the execution identification further includes:
and under the condition that the table name of the production data table is matched with a preset table name list, the intercepted database operation request is not modified, and the intercepted database operation request is executed.
Optionally, the functional component specifically includes a Redis client, and executing, in the functional component, the execution thread with processing logic corresponding to the execution identifier according to the execution identifier includes:
Modifying a key identifier of the shadow data in the Redis client under the condition that the processing logic of the execution thread is the processing logic corresponding to the shadow data, and caching the shadow data for a preset time according to the modified key identifier;
the processing logic corresponding to the shadow data is realized by inheriting the class in the processing logic corresponding to the production data, and the Redis client is an enhanced client comprising the processing logic corresponding to the shadow data and the processing logic corresponding to the production data.
Optionally, the functional component specifically includes a log component, and executing, in the functional component, the execution thread with processing logic corresponding to the execution identifier according to the execution identifier includes:
When the processing logic of the execution thread is the processing logic corresponding to the shadow data, outputting the log of the shadow data to a preset log catalog of the shadow data based on a log output component of the shadow data according to a filter return value of the shadow data;
Wherein the filter return value of the shadow data is different from the filter return value of the production data; the log catalog of the shadow data is independent of the log catalog of the production data, and the data under the log catalog of the shadow data can be cleaned according to an automatic failure mechanism; the log output component of the shadow data is obtained by copying the log output component of the production data.
Optionally, the method further comprises:
Acquiring timing tasks related to the service data; the timing tasks comprise a shadow task and a production task, the shadow task is obtained by copying the production task, and the availability of the shadow task can be controlled based on a switch;
Intercepting a timing task at an execution inlet of the timing task by using a component realized based on a tangent plane-oriented programming technology, and analyzing task parameters for distinguishing shadow tasks and production tasks from the intercepted timing task;
and executing each timing task according to the task parameters.
Optionally, the method further comprises:
monitoring the testing process of the service system, wherein the monitoring comprises one or more of physical resource monitoring, service monitoring and component monitoring, and acquiring one or more of the following information in the testing process: the method comprises the steps of CPU state, memory state, disk state, service data processing success rate, interface connection time consumption and data operation time consumption.
In a second aspect, an embodiment of the present application further provides a service system testing device, applied to a service system server, where the device includes:
The system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is suitable for acquiring service data composed of shadow data and production data, and the service data comprises a data identifier capable of distinguishing the shadow data from the production data;
the generation unit is suitable for generating an execution identifier corresponding to the service data according to the execution thread and the data identifier corresponding to the service data, and the execution identifier can distinguish the shadow data from the production data;
and the execution unit is suitable for executing the execution thread in the functional component by using the processing logic corresponding to the execution identifier according to the execution identifier so as to test the service system, and the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
A processor; and
A memory arranged to store computer executable instructions which, when executed, cause the processor to perform any of the methods described above.
In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium storing one or more programs, which when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform any of the methods described above.
The above at least one technical scheme adopted by the embodiment of the application can achieve the following beneficial effects:
the method adopts the modes of adding the shadow data processing logic and the like to decouple the production data processing logic from the shadow data processing logic without modifying the original business logic, thereby reducing the development difficulty and the system modification risk, reducing the possibility of generating loopholes and having better universality.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of a method for testing a service system according to an embodiment of the present application;
FIG. 2 is a flow chart of the isolation of shadow data from production data in an SQL database according to an embodiment of the application;
FIG. 3 is a flow chart of the isolation of shadow data from production data in a Redis client according to an embodiment of the application;
FIG. 4 is a schematic diagram of a service system testing device according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an Internet connection service order system architecture according to the prior art;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method for testing a service system according to an embodiment of the present application; the method is executed by a service system server, and comprises the following steps:
in step S110, service data composed of shadow data and production data is acquired, where the service data includes a data identifier capable of distinguishing the shadow data and the production data.
The method disclosed in this embodiment can be used in full-link pressure measurement of an internet-linked service order system, referring to the structural schematic diagram of the internet-linked service order system architecture shown in fig. 5, a service order request is sent from an account mechanism to an account channel of an internet-linked service, forwarded to the service order system by the account channel, and sent to a merchant channel after interacting with an EPCC transaction system (dedicated system for order processing) to complete order payment, and finally sent to a merchant acceptance mechanism. Aiming at the network connection service order system, a pressure test scheme is required to be designed for testing.
Specifically, first, request message data (i.e., production data) actually sent from a production environment and shadow data sent by a request message simulation mechanism are acquired or received, where the production data and the shadow data are collectively referred to as service data, and the service data includes a data identification field, and the data identification field can be used to distinguish the production data from the shadow data.
The shadow data may be obtained by marking the service initiation mechanism of the request message emulation mechanism as a test mechanism (i.e., as a test mechanism), and simultaneously dyeing the request message to be sent as the shadow data. In order to distinguish the shadow data from the production data, it may be agreed that a reserved bit in a data identification field (specifically, a transaction serial number) of a request message in the shadow data is set to 1, where the reserved bit may be a first bit or a last bit in the data identification field, or may be a middle bit, and the reserved bit in the data identification field of the production data is set to other numbers, so that the production data and the shadow data can be distinguished by judging the number of the reserved bit of the data identification.
Step S120, according to the execution thread and the data identifier corresponding to the service data, an execution identifier corresponding to the service data is generated, and the execution identifier can distinguish the shadow data from the production data.
Before business data enter each functional component to be processed, a data identifier of the business data can be obtained from the business data by setting middleware and other modes, and reserved bits in the data identifier are obtained from the data identifier to be used as execution identifiers; or judging that the service data is shadow data or production data according to the reserved bit, and taking the judged result as an execution identifier, for example, the execution identifier can be a judgment result of whether the service data is shadow data or not, if so, the service data is true, and if not, the service data is false.
In addition to the above-described execution identifier, data such as an issuing mechanism of business data including a test mechanism that generates shadow data, an account mechanism that generates production data, and the like may be acquired and stored in this step.
The step obtains the execution identification from the execution thread before the business data enter each functional component, thereby avoiding repeated judgment of each business data in each functional component, reducing the occupation and processing time of computing resources and improving the efficiency of pressure measurement.
And step S130, executing the execution thread in the functional component by using processing logic corresponding to the execution identifier according to the execution identifier so as to test the service system, wherein the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data.
And distinguishing whether each service data is production data or shadow data according to the execution identification in the functional component, and then processing the production data and the shadow data by adopting different processing logic, so that the pressure test is realized, and the original logic of the production data is not influenced.
In the specific implementation, means of copying original code logic to form a plug-in unit, setting a tangent plane to reduce the invasion of the original code or forming an enhanced component based on the original component by inheriting are adopted according to the characteristics of each functional component, and the processing logic of the shadow data is separated or independent from the original processing logic of the production data, so that the respective processing of the shadow data and the production data is realized, and the pollution of the shadow data to the production data is reduced.
In a word, the service system testing method disclosed by the embodiment can effectively reduce development difficulty and system transformation risk of the pressure testing component, reduce the possibility of generating loopholes, has better universality and can realize multiplexing by installing the developed software package in the existing service system.
In one or some embodiments, the step S120 includes: the method comprises the steps of respectively obtaining data identifiers from each service data by using a component realized based on a tangent plane-oriented programming technology; and generating a corresponding execution identifier according to the acquired data identifier, and storing the generated execution identifier into a context data structure, wherein the context data structure stores the corresponding relation between the thread identifier of the execution thread of the service data and the execution identifier.
The section-oriented programming technology (Aspect Oriented Programming, AOP) is a technology for realizing unified maintenance of program functions through a precompiled mode and a running-period dynamic proxy, the AOP is an important content in a spring framework, and each part of service logic can be isolated by utilizing the AOP, so that the coupling degree among the parts of the service logic is reduced, the reusability of the program is improved, and the development efficiency is improved. The embodiment utilizes the AOP setting section to acquire the data identification field from the execution thread, thereby reducing the invasion of the original code.
Specifically, a data identifier is obtained from a tangent plane using a ThreadLocal tool class, and an execution identifier is generated from the data identifier and stored in a context data structure, which may be named ShadowContext. When the thread corresponding to the service data is executed in each functional component, the execution identification corresponding to the execution thread can be acquired from the context data structure, so that the obtained service data is information of shadow data or production data.
This embodiment of the application shows a specific implementation of identifying and preserving data identities. Of course, it should be understood that step S120 may be implemented in other manners, which are not limited by the embodiment of the present application.
In one embodiment, the step 130 includes: acquiring an execution identifier corresponding to the current execution thread from the context data structure according to the thread identifier of the current execution thread; executing the current execution thread in the functional component by processing logic corresponding to the shadow data under the condition that the execution identifier indicates that the service data corresponding to the current execution thread is the shadow data; and executing the current execution thread in the functional component by processing logic corresponding to the production data under the condition that the execution identifier indicates that the service data corresponding to the current execution thread is the production data.
The embodiment provides that the execution mark is obtained by utilizing the execution thread in each functional component, the data type is determined according to the execution mark, and then the isolation processing of the shadow data and the production data is realized according to different processing logics which are preset in the functional component and aim at the shadow data or the production data.
In one embodiment, the functional component specifically includes an SQL database, in which a shadow data table corresponding to each production data table is preset, and the step S130 includes:
Intercepting a database operation request related to service data; under the condition that the processing logic of the execution thread is the processing logic corresponding to the shadow data, the table name of a production data table to be operated is analyzed from the intercepted database operation request; modifying the table name of the production data table in the database operation request into the table name of the corresponding shadow data table to obtain a modified database operation request; and executing the modified database operation request.
And, the step S130 further includes: and under the condition that the table name of the production data table analyzed to be operated is matched with a preset table name list, the intercepted database operation request is not modified, and the intercepted database operation request is executed.
Isolation of database components is an important aspect of implementing business system testing, and fig. 2 shows a schematic flow diagram of implementing isolation policies in an SQL database. In actual operation, a shadow data table needs to be created in advance, and is used for storing shadow data or result data obtained by operating a database by the shadow data. The table name of the shadow data table may be a "test_production data table name" and the number of shadow data tables corresponds to the number of production data tables.
At present, database operation is realized through sql (structured query language ) language, and comprises the operations of accessing data, querying, updating and managing a relational database system, and particularly comprises the operations of adding, deleting, modifying and the like on the data.
When the database component performs data isolation, firstly intercepting a database operation request, generally an sql instruction, and intercepting all the sql instructions through an Interceptor of Mybatis in order not to invade original code services.
After intercepting the sql instruction, firstly acquiring a stored execution identifier from the ShadowContext context data structure, and if the data is judged to be production data according to the execution identifier, continuing the original database operation.
If the processing logic of the execution thread is the processing logic corresponding to the shadow data, analyzing the table name of the sql instruction, judging whether the table name is in a preset table name list, if not, adding a test_prefix to the table name section of the shadow data to indicate that the data should be stored in the shadow data table corresponding to the table name, and then executing database operation aiming at the shadow data, wherein the database operation can be the same as or different from the database operation of the production data; if the table name is in the preset table name list, the step of adding the table name prefix is skipped, and the subsequent original database operation same as the production data is continuously executed, namely, the shadow data in the preset table name list is executed with the operation same as the production data.
The operation shows that the prefix is added before the table name identification field of the shadow data with the table name not in the preset table name list, and the table name is stored in the corresponding shadow data table after database operation; and carrying out database operation identical to the production data on the shadow data in the preset list name list, and storing the shadow data in a corresponding production data list.
The table in the preset table name list can be a table for managing configuration types, and can also be a table of other types selected according to the pressure measurement requirement. The design can flexibly process the shadow data according to the pressure measurement requirement, and better simulates the real business logic.
In this specific implementation, the method further includes the step of configuring the database: the configuration of the shadow data table is increased by utilizing the database and table dividing middleware CDS (Completed Database Sharding), and the configuration of the shadow data table is the same as the configuration of the production table such as the cut key and the rule, so that the shadow data after database operation is saved in the same mode.
It should be noted that, the sub-library sub-table middleware CDS is a sub-library sub-table middleware product developed based on a client, which realizes JDBC standard API, supports multiple functions of sub-library sub-table, read-write separation, data operation and maintenance, and the like, provides high-performance, high-concurrency and high-reliability massive data routing access service, and allows a service system to access almost at zero cost, and currently supports MySQL, oracle and SQL SERVER database clusters.
In one embodiment, the functional component specifically includes a Redis client, and executing, in the functional component, the execution thread with processing logic corresponding to the execution identifier according to the execution identifier includes: modifying a key identifier of the shadow data in the Redis client under the condition that the processing logic of the execution thread is the processing logic corresponding to the shadow data, and caching the shadow data for a preset time according to the modified key identifier; the processing logic corresponding to the shadow data is realized by inheriting the class in the processing logic corresponding to the production data, and the Redis client is an enhanced client comprising the processing logic corresponding to the shadow data and the processing logic corresponding to the production data.
Redis cache is a log-type, key-Value database written in ANSIC languages of open source, supporting network, being based on memory and being durable, and providing API of multiple languages. The embodiment does not change the whole structure of the existing Redis client, and only adds code logic for processing shadow data in an inheritance mode, so that the Redis client of an enhanced version is obtained.
FIG. 3 illustrates a specific flow for implementing shadow data isolation within a Redis client. Specifically, in this embodiment of the present application, a class inheriting from the original component is added to the Redis client, and in this class, the distinction between the shadow data and the production data is realized. If the production data still adopts the original processing logic, if the production data is the shadow data, a 'test_' prefix is added before the name of a key (key) of the shadow data, and the expiration time of the shadow data is set, for example, 5 minutes, and the next functional component is entered or automatically deleted after the expiration time.
According to the embodiment, on the basis of original logic, recognition and processing logic for shadow data is added, and isolation processing for the shadow data and production data is realized according to different key identifiers, so that an enhanced Redis client is obtained.
In one embodiment, the function component specifically includes a log component, and executing, in the function component, the execution thread with processing logic corresponding to the execution identifier according to the execution identifier includes:
When the processing logic of the execution thread is the processing logic corresponding to the shadow data, outputting the log of the shadow data to a preset log catalog of the shadow data based on a log output component of the shadow data according to a filter return value of the shadow data;
Wherein the filter return value of the shadow data is different from the filter return value of the production data; the log catalog of the shadow data is independent of the log catalog of the production data, and the data under the log catalog of the shadow data can be cleaned according to an automatic failure mechanism; the log output component of the shadow data is obtained by copying the log output component of the production data.
The shadow data log output directory is preset to be/data/appLogs/shadow/.
Taking Logback as a log component for example, logback is an open source log component designed by the log4j creator, wherein the Filter component based on Logback implements shadow log and traffic log identification and output. Specifically, a Filter that can be custom implemented as needed is used to control the appder of the log output. For example, when defining a request message belonging to production data, the app der returns a filterreply.
The shadow data and the production data have different processing modes, and if the method return value is DENY, the log object is terminated and cannot be accessed by other filters; if the method returns an ACCEPT value, the log object skips the remaining filters for immediate processing.
Logback may contain multiple appers that are responsible for exporting log event delivery to their target directories. And adding a new shadow applicator by cloning the original applicator, so as to realize the output of the shadow log.
According to the method and the device for testing the shadow data isolation in the Redis client and the log component, the shadow data isolation test is respectively realized in the Redis client and the log component, the realization of full-link pressure test is perfected, the process of passing production data is simulated more truly, and the pressure test result is more real and reliable.
In one embodiment, the method further comprises: acquiring timing tasks related to the service data; the timing tasks comprise a shadow task and a production task, the shadow task is obtained by copying the production task, and the availability of the shadow task can be controlled based on a switch;
Intercepting a timing task at an execution inlet of the timing task by using a component realized based on a tangent plane-oriented programming technology, and analyzing task parameters for distinguishing shadow tasks and production tasks from the intercepted timing task;
And executing each timing task according to the task parameters.
The timing tasks in this embodiment include a timing clearing service or the like placed to the networked service order system, such as entering a bulk order into the networked service order system at a point in time for clearing.
The specific implementation mode of the timing task is as follows: and copying the task in the timing task platform, and adding a parameter shadow=Y in the original task parameter for identifying the shadow pressure measurement. Then defining a section, intercepting an execution inlet of a timing task, reading a parameter list, judging whether a parameter of shadow=y is contained, wherein the parameter is equivalent to a switch of the timing task, if the parameter list contains the parameter, storing the identification of the batch of data into ShadowContext, and further starting to perform service system test on the batch of data, otherwise, performing pressure measurement.
It should be noted that the embodiment described above with respect to step 130 is merely an example, and embodiments of the present application may further include other policies of other functional components with respect to isolation, and the policies are not limited to the specific implementation described above, and may also include other specific implementations, which are not specifically limited herein.
In one embodiment, the method further comprises: monitoring the testing process of the service system, wherein the monitoring comprises one or more of physical resource monitoring, service monitoring and component monitoring, and acquiring one or more of the following information in the testing process: the method comprises the steps of CPU state, memory state, disk state, service data processing success rate, interface connection time consumption and data operation time consumption.
The monitoring of the service system test comprises three aspects of physical resource monitoring, service monitoring and component monitoring. The physical resource monitoring can be Zabbix monitoring system, zabbix is open source monitoring software for network, operating system and application program, aims at monitoring and tracking the states of various network services, servers and other network hardware, and can monitor the running states of physical resources from the dimensions of Central Processing Unit (CPU), memory, disk and the like; the business monitoring can set a large pressure measurement monitoring screen according to the generated shadow log, pay attention to indexes such as business processing success rate, interface connection time consumption, data operation time consumption and the like; component monitoring includes a monitoring hierarchy in each functional component.
Fig. 4 shows a service system testing apparatus according to an embodiment of the present application, for use in a server of a service system, the apparatus 400 comprising:
the obtaining unit 410 is adapted to obtain service data comprising shadow data and production data, wherein the service data comprises a data identifier capable of distinguishing the shadow data from the production data.
The generating unit 420 is adapted to generate an execution identifier corresponding to the service data according to the execution thread and the data identifier corresponding to the service data, where the execution identifier can distinguish the shadow data from the production data.
The execution unit 430 is adapted to execute the execution thread in the functional component with processing logic corresponding to the execution identifier according to the execution identifier, so as to test the service system, where the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data.
According to the service system testing device, the development difficulty of the pressure testing component and the system transformation risk can be effectively reduced, the vulnerability risk is reduced, the service system testing device has good universality, and multiplexing can be realized by installing the developed software package in other service systems.
In an embodiment, the generating unit 420 is adapted to:
The method comprises the steps of respectively obtaining data identifiers from each service data by using a component realized based on a tangent plane-oriented programming technology; and generating a corresponding execution identifier according to the acquired data identifier, and storing the generated execution identifier into a context data structure, wherein the context data structure stores the corresponding relation between the thread identifier of the execution thread of the service data and the execution identifier.
In an embodiment, the execution unit 430 is adapted to:
acquiring an execution identifier corresponding to the current execution thread from the context data structure according to the thread identifier of the current execution thread; executing the current execution thread in the functional component by processing logic corresponding to the shadow data under the condition that the execution identifier indicates that the service data corresponding to the current execution thread is the shadow data; and executing the current execution thread in the functional component by processing logic corresponding to the production data under the condition that the execution identifier indicates that the service data corresponding to the current execution thread is the production data.
In one embodiment, the functional component specifically includes an SQL database, in which a shadow data table corresponding to each production data table is preset, and the execution unit 430 is adapted to:
Intercepting a database operation request related to service data;
Under the condition that the processing logic of the execution thread is the processing logic corresponding to the shadow data, the table name of a production data table to be operated is analyzed from the intercepted database operation request;
Modifying the table name of the production data table in the database operation request into the table name of the corresponding shadow data table to obtain a modified database operation request;
and executing the modified database operation request.
In an embodiment, the functional components specifically include a Redis client, and the execution unit 430 is adapted to:
Modifying a key identifier of the shadow data in the Redis client under the condition that the processing logic of the execution thread is the processing logic corresponding to the shadow data, and caching the shadow data for a preset time according to the modified key identifier;
the processing logic corresponding to the shadow data is realized by inheriting the class in the processing logic corresponding to the production data, and the Redis client is an enhancement client Redis client which comprises the processing logic corresponding to the shadow data and the processing logic corresponding to the production data.
In an embodiment, the functional component specifically comprises a log component, and the execution unit 430 is adapted to:
When the processing logic of the execution thread is the processing logic corresponding to the shadow data, outputting the log of the shadow data to a preset log catalog of the shadow data based on a log output component of the shadow data according to a filter return value of the shadow data;
Wherein the filter return value of the shadow data is different from the filter return value of the production data; the log catalog of the shadow data is independent of the log catalog of the production data, and the data under the log catalog of the shadow data can be cleaned according to an automatic failure mechanism; the log output component of the shadow data is obtained by copying the log output component of the production data.
In an embodiment, the apparatus comprises a timed task unit adapted to:
Acquiring timing tasks related to the service data; the timing tasks comprise a shadow task and a production task, the shadow task is obtained by copying the production task, and the availability of the shadow task can be controlled based on a switch;
Intercepting a timing task at an execution inlet of the timing task by using a component realized based on a tangent plane-oriented programming technology, and analyzing task parameters for distinguishing shadow tasks and production tasks from the intercepted timing task;
And executing each timing task according to the task parameters.
In an embodiment, the device further comprises a monitoring unit adapted to:
monitoring the testing process of the service system, wherein the monitoring comprises one or more of physical resource monitoring, service monitoring and component monitoring, and acquiring one or more of the following information in the testing process: the method comprises the steps of CPU state, memory state, disk state, service data processing success rate, interface connection time consumption and data operation time consumption.
It should be noted that, the specific implementation manner of each embodiment of the apparatus may be performed with reference to the specific implementation manner of the corresponding embodiment of the method, which is not described herein.
In summary, the service system testing scheme disclosed in the embodiment of the present application includes: acquiring service data composed of shadow data and production data, wherein the service data comprises a data identifier capable of distinguishing the shadow data from the production data; generating an execution identifier corresponding to the service data according to the execution thread and the data identifier corresponding to the service data, wherein the execution identifier can distinguish the shadow data from the production data; and executing the execution thread in the functional component by using processing logic corresponding to the execution identifier according to the execution identifier so as to test the service system, wherein the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data. Compared with the existing service system test solution, the application completes the service system test function in a mode of not invading core service codes, adopts plug-in, tangent plane or enhancement components and the like, effectively decouples the service codes from the functional module, introduces a software installation package for service system test, increases relevant configuration to complete shadow pressure test, reduces system transformation risk, reduces vulnerability risk, effectively isolates components including Redis, logs and the like in a real-time transaction system, can be selectively multiplexed in other service systems, and has better universality.
Fig. 6 is a schematic structural view of an electronic device according to an embodiment of the present application. Referring to fig. 6, at the hardware level, the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (PERIPHERAL COMPONENT INTERCONNECT, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 6, but not only one bus or type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory to the memory and then runs, and the service system testing device is formed on the logic level. The processor is used for executing the programs stored in the memory and is specifically used for executing the following operations:
and acquiring service data consisting of shadow data and production data, wherein the service data comprises a data identifier capable of distinguishing the shadow data from the production data.
And generating an execution identifier corresponding to the service data according to the execution thread and the data identifier corresponding to the service data, wherein the execution identifier can distinguish the shadow data from the production data.
And executing the execution thread in the functional component by using processing logic corresponding to the execution identifier according to the execution identifier, wherein the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data.
The service system testing method disclosed in the embodiment shown in fig. 1 of the present application can be applied to a processor or implemented by the processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
The electronic device may also execute the service system testing method in fig. 1 and implement the function of the service system testing apparatus in the embodiment shown in fig. 1, which is not described herein again.
The embodiment of the present application also proposes a computer readable storage medium storing one or more programs, the one or more software installations comprising instructions that, when executed by an electronic device comprising a plurality of application programs, enable the electronic device to perform a method performed by a service system testing apparatus in the embodiment shown in fig. 1, and specifically configured to perform:
acquiring service data composed of shadow data and production data, wherein the service data comprises a data identifier capable of distinguishing the shadow data from the production data;
generating an execution identifier corresponding to the service data according to the execution thread and the data identifier corresponding to the service data, wherein the execution identifier can distinguish the shadow data from the production data;
and executing the execution thread in the functional component by using processing logic corresponding to the execution identifier according to the execution identifier, wherein the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (11)

1. A business system testing method performed by a business system server, wherein the method comprises:
Acquiring service data composed of shadow data and production data, wherein the service data comprises data identifiers capable of distinguishing the shadow data from the production data, the shadow data is sent by a request message simulation mechanism, and the production data is actually sent by a production environment; the method for obtaining the shadow data further comprises the following steps: marking the request message simulation mechanism as a test mechanism, and simultaneously dyeing the request message to be sent into shadow data; the service data sending mechanism comprises a test mechanism for generating shadow data and an account mechanism for generating production data;
generating an execution identifier corresponding to the service data according to the execution thread and the data identifier corresponding to the service data, wherein the execution identifier can distinguish the shadow data from the production data;
the generating the execution identifier corresponding to the execution thread according to the execution thread and the data identifier corresponding to the service data comprises the following steps:
The method comprises the steps of respectively obtaining data identifiers from each service data by using a component realized based on a tangent plane-oriented programming technology;
Generating a corresponding execution identifier according to the acquired data identifier, and storing the generated execution identifier into a context data structure, wherein the context data structure stores the corresponding relation between the thread identifier of the execution thread of the service data and the execution identifier;
And executing the execution thread in the functional component by using processing logic corresponding to the execution identifier according to the execution identifier so as to test the service system, wherein the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data.
2. The method of claim 1, wherein said executing the execution thread in the functional component with processing logic corresponding to the execution identification in accordance with the execution identification comprises:
acquiring an execution identifier corresponding to the current execution thread from the context data structure according to the thread identifier of the current execution thread;
Executing the current execution thread in the functional component by processing logic corresponding to the shadow data under the condition that the execution identifier indicates that the service data corresponding to the current execution thread is the shadow data;
And executing the current execution thread in the functional component by processing logic corresponding to the production data under the condition that the execution identifier indicates that the service data corresponding to the current execution thread is the production data.
3. The method of claim 1, wherein the functional component specifically includes an SQL database, a shadow data table corresponding to each production data table is preset in the SQL database, and the executing, according to the execution identifier, the execution thread in the functional component with processing logic corresponding to the execution identifier includes:
Intercepting a database operation request related to service data;
Under the condition that the processing logic of the execution thread is the processing logic corresponding to the shadow data, the table name of a production data table to be operated is analyzed from the intercepted database operation request;
Modifying the table name of the production data table in the database operation request into the table name of the corresponding shadow data table to obtain a modified database operation request;
and executing the modified database operation request.
4. The method of claim 3, wherein executing the execution thread in the functional component with processing logic corresponding to the execution identification further comprises:
and under the condition that the table name of the production data table is matched with a preset table name list, the intercepted database operation request is not modified, and the intercepted database operation request is executed.
5. The method of claim 1, wherein the functional component specifically includes a Redis client, and executing, in the functional component, the execution thread with processing logic corresponding to the execution identifier according to the execution identifier includes:
Modifying a key identifier of the shadow data in the Redis client under the condition that the processing logic of the execution thread is the processing logic corresponding to the shadow data, and caching the shadow data for a preset time according to the modified key identifier;
the processing logic corresponding to the shadow data is realized by inheriting the class in the processing logic corresponding to the production data, and the Redis client is an enhanced client comprising the processing logic corresponding to the shadow data and the processing logic corresponding to the production data.
6. The method of claim 1, wherein the functional component specifically includes a log component, and the executing the execution thread in the functional component with processing logic corresponding to the execution identification according to the execution identification includes:
When the processing logic of the execution thread is the processing logic corresponding to the shadow data, outputting the log of the shadow data to a preset log catalog of the shadow data based on a log output component of the shadow data according to a filter return value of the shadow data;
Wherein the filter return value of the shadow data is different from the filter return value of the production data; the log catalog of the shadow data is independent of the log catalog of the production data, and the data under the log catalog of the shadow data is cleaned according to an automatic failure mechanism; the log output component of the shadow data is obtained by copying the log output component of the production data.
7. The method of claim 1, wherein the method further comprises:
Acquiring timing tasks related to the service data; the timing tasks comprise a shadow task and a production task, the shadow task is obtained by copying the production task, and the availability of the shadow task is controlled based on a switch;
Intercepting a timing task at an execution inlet of the timing task by using a component realized based on a tangent plane-oriented programming technology, and analyzing task parameters for distinguishing shadow tasks and production tasks from the intercepted timing task;
and executing each timing task according to the task parameters.
8. The method of any one of claims 1-7, wherein the method further comprises:
monitoring the testing process of the service system, wherein the monitoring comprises one or more of physical resource monitoring, service monitoring and component monitoring, and acquiring one or more of the following information in the testing process: the method comprises the steps of CPU state, memory state, disk state, service data processing success rate, interface connection time consumption and data operation time consumption.
9. A business system testing device applied to a business system server, wherein the device comprises:
The system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is suitable for acquiring service data composed of shadow data and production data, the service data comprises a data identifier capable of distinguishing the shadow data from the production data, the shadow data is sent by a request message simulation mechanism, and the production data is actually sent by a production environment; the method for obtaining the shadow data further comprises the following steps: marking the request message simulation mechanism as a test mechanism, and simultaneously dyeing the request message to be sent into shadow data; the service data sending mechanism comprises a test mechanism for generating shadow data and an account mechanism for generating production data;
The generation unit is suitable for generating an execution identifier corresponding to the service data according to the execution thread and the data identifier corresponding to the service data, and the execution identifier can distinguish the shadow data from the production data; the generating the execution identifier corresponding to the execution thread according to the execution thread and the data identifier corresponding to the service data comprises the following steps:
The method comprises the steps of respectively obtaining data identifiers from each service data by using a component realized based on a tangent plane-oriented programming technology;
Generating a corresponding execution identifier according to the acquired data identifier, and storing the generated execution identifier into a context data structure, wherein the context data structure stores the corresponding relation between the thread identifier of the execution thread of the service data and the execution identifier;
and the execution unit is suitable for executing the execution thread in the functional component by using the processing logic corresponding to the execution identifier according to the execution identifier so as to test the service system, and the processing logic corresponding to the shadow data is independent of the processing logic corresponding to the production data.
10. An electronic device, comprising:
A processor; and
A memory arranged to store computer executable instructions which, when executed, cause the processor to perform the method of any of claims 1 to 8.
11. A computer readable storage medium storing one or more programs, which when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of any of claims 1-8.
CN202010812151.2A 2020-08-13 2020-08-13 Service system testing method and device, electronic equipment and readable storage medium Active CN114143236B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010812151.2A CN114143236B (en) 2020-08-13 2020-08-13 Service system testing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010812151.2A CN114143236B (en) 2020-08-13 2020-08-13 Service system testing method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114143236A CN114143236A (en) 2022-03-04
CN114143236B true CN114143236B (en) 2024-07-09

Family

ID=80437984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010812151.2A Active CN114143236B (en) 2020-08-13 2020-08-13 Service system testing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114143236B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225666A (en) * 2022-07-07 2022-10-21 支付宝(杭州)信息技术有限公司 Production drilling method, device and system, emergency rule platform and injection platform

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750584A (en) * 2019-09-18 2020-02-04 苏宁云计算有限公司 Data management method and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9836497B2 (en) * 2014-04-18 2017-12-05 International Business Machines Corporation Enabling testing of production systems without affecting customer data sets system and method
CN108090784B (en) * 2017-11-28 2021-04-30 口碑(上海)信息技术有限公司 Marketing activity simulation verification method and device
CN108933713B (en) * 2018-07-20 2022-08-26 创新先进技术有限公司 Method and device for realizing sandbox debugging based on shadow link and business server
US10742489B2 (en) * 2018-11-01 2020-08-11 Hewlett Packard Enterprise Development Lp Validating network configuration using shadow databases
CN109871320A (en) * 2019-01-21 2019-06-11 上海德启信息科技有限公司 A kind of data processing method, device, application server and storage medium
CN111478828B (en) * 2020-06-24 2020-10-20 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750584A (en) * 2019-09-18 2020-02-04 苏宁云计算有限公司 Data management method and system

Also Published As

Publication number Publication date
CN114143236A (en) 2022-03-04

Similar Documents

Publication Publication Date Title
CN111104392B (en) Database migration method and device, electronic equipment and storage medium
US10949335B2 (en) Designer defined mocking service behavior
CN110990420A (en) Data query method and device
CN114143236B (en) Service system testing method and device, electronic equipment and readable storage medium
CN113722114A (en) Data service processing method and device, computing equipment and storage medium
CN115470128A (en) Method, device and equipment for detecting connectivity of database and storage medium
CN106878365B (en) data synchronization method and device
CN113569257B (en) User authority management method and device in gray level release
CN113553214A (en) Idempotent checking method and device
CN111435327B (en) Log record processing method, device and system
CN115454851A (en) Interface regression testing method and device, storage medium and electronic device
CN113672233B (en) Server out-of-band management method, device and equipment based on Redfish
CN114138839A (en) Test account number implementation method based on database routing
US11526446B1 (en) Modifying caching amongst services from a history of requests and responses
CN110493326B (en) Zookeeper-based cluster configuration file management system and method
CN113626870A (en) Access control method, device, electronic equipment and storage medium
CN113656290A (en) Mock point automatic identification method, device and equipment
CN113553250A (en) Code testing method and device
CN111796864A (en) Data verification method and device
CN112817931A (en) Method and device for generating incremental version file
CN112306848A (en) Architecture view generation method and device of micro-service system
CN114625595B (en) Method, device and system for rechecking dynamic configuration information of service system
CN118295894A (en) Script generation method, script generation device, computing device, script generation system and readable storage medium
CN117851210A (en) Pressure performance testing method, server, system, electronic equipment and storage medium
CN118012939A (en) Method, device and equipment for Oracle EBS data query

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant