Test case generation method and device, storage medium and electronic equipment

By collecting departure system log data, building a business association network and performing metadata replacement, the problem of low test case editing efficiency in airline departure system testing was solved, and automated test case generation and the accuracy and stability of system functions were achieved.

CN120803947APending Publication Date: 2025-10-17TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511061023.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

During the testing of the airline departure system, due to the large number of business scenarios, testers are required to repeatedly analyze specific businesses and edit test cases, resulting in low test case editing efficiency.

Method used

Collect log data from the departure system, extract business metadata, build a business association network, retrieve relevant metadata from the network through test requests, mask and replace irrelevant metadata, and generate test cases.

Benefits of technology

It realizes the automatic generation of test cases, improves editing efficiency, ensures the security of test data and the accuracy and stability of system functions, and optimizes business processes and data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803947A_ABST
    Figure CN120803947A_ABST
Patent Text Reader

Abstract

The invention discloses a test case generation method and device, a storage medium and electronic equipment, the method is applied to the field of airline company testing, and the method comprises the following steps: collecting log data of a departure system, and extracting service metadata from the log data; constructing a service association network comprising the multiple service scenes according to the metadata related to the multiple service scenes and the service metadata; retrieving in a service association network according to a target service scene corresponding to the test request to obtain a metadata list related to the target service scene; and performing mask replacement on the to-be-replaced metadata irrelevant to the service information in the metadata list, and generating a test case corresponding to the test request according to the replaced metadata list. According to the method and the device, the problem that in the related technology, in the testing process of the airline departure system, due to the fact that the number of service scenes is large, a tester needs to repeatedly analyze specific services and edit the test case, and the editing efficiency of the test case is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of airline testing, in particular to a test case generation method and device, a storage medium and an electronic device. BACKGROUND

[0002] The departure system is a support system for providing full-process departure check-in services for airlines, airports and passengers. In the process of departure open software construction, in order to improve system stability and ease of use, reduce use and maintenance costs, a large amount of software function and business scenario testing and verification work is carried out. After continuous updating and iteration of each software and each module of the departure open, the open departure has entered the reconstruction optimization, expansion production and complex scenario scheme construction period, which brings new challenges to the system testing work.

[0003] Under such background, the test team needs to spend more effort to arrange the relationship between the business scenarios and the test cases, and also needs to try to restore and create various business scenario test case sets, which has high requirements for the business understanding depth of the test personnel. With the increase of user demand and complex scenarios, data preparation and test case arrangement adjustment before testing become low-attention and high-repetitive work. In addition, the business authenticity of the test cases created according to experience cannot be guaranteed.

[0004] In the related art, in the test process of the airline departure system, due to the large number of business scenarios, the test personnel needs to repeatedly analyze specific businesses and edit test cases, which leads to low editing efficiency of test cases. At present, there is no effective solution to this problem. SUMMARY

[0005] The main purpose of the present application is to provide a test case generation method and device, a storage medium and an electronic device to solve the problem of low editing efficiency of test cases in the test process of the airline departure system in the related art due to the large number of business scenarios, which requires the test personnel to repeatedly analyze specific businesses and edit test cases.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a test case generation method is provided, which is applied to a departure system, and the method comprises: collecting log data of the departure system, and extracting business metadata from the log data; constructing a business association network containing multiple business scenarios according to the metadata involved in the multiple business scenarios and the business metadata; searching for a metadata list related to a target business scenario in the business association network according to a target business scenario corresponding to a test request; performing mask replacement on the metadata list for the business information irrelevant to-be-replaced metadata, and generating a test case corresponding to the test request according to the replaced metadata list.

[0007] Further, the log data of the departure system is collected, and business metadata is extracted from the log data, including: collecting software application logs and host logs of the departure system from distributed storage servers of the departure system by distributed consumption nodes in parallel to execute timing tasks to obtain the log data; extracting metadata and data indexes of key information from the log data line by line, wherein the key information includes at least one of the following: instruction information, message information, and interface information; respectively aggregating the metadata of the key information and the data indexes of the key information; and determining the business metadata according to the aggregated metadata and the aggregated data indexes.

[0008] Further, the metadata and data indexes of the key information are extracted from the log data line by line, including: determining the metadata of the key information according to request data and response data corresponding to the interface information, request data and response data corresponding to the instruction information, and one-way request information corresponding to the message information; and determining the data indexes of the key information according to target fields and index information of the key information, wherein the target fields include at least one of the following: airline, flight number, flight date, passenger host number, passenger name, log time sequence, and log time information; the index information of the interface information at least includes: interface name and method name; the index information of the message information at least includes: message name and message part information; and the index information of the instruction information at least includes: instruction name.

[0009] Further, the metadata list is masked and replaced, including: determining the metadata list to be replaced which is irrelevant to business information according to the mask replacement information in the test request; determining the to-be-replaced interface, to-be-replaced message, and to-be-replaced instruction in the to-be-replaced metadata according to a target mask rule, wherein the target mask rule is a rule obtained by using a node data structure to represent a preset mask replacement rule; directly replacing the to-be-replaced interface, and replacing the to-be-replaced message and the to-be-replaced instruction using a regular expression to obtain the replaced metadata.

[0010] Further, before determining the to-be-replaced interface, to-be-replaced message, and to-be-replaced instruction in the to-be-replaced metadata according to the target mask rule, the method further includes: determining a mask data type of metadata processed by the mask replacement rule; determining a first node according to the metadata processed by the mask replacement rule, wherein the first node includes at least one of the following: interface information, message information, and instruction information; determining a second node under the first node according to metadata that needs to be replaced in the interface information, the message information, or the instruction information; and generating the target mask rule according to the mask data type, the first node, and the second node.

[0011] Further, the business association network containing multiple business scenarios is constructed according to the metadata related to the multiple business scenarios and the business metadata, including: receiving a construction rule corresponding to the multiple business scenarios, and determining sequence information of metadata related to the construction rule; wherein the construction rule at least includes: a first type of rule, a second type of rule, the first type of rule is used to construct a network path related to a flight, and the second type of rule is used to construct a network path related to a passenger; according to the sequence information of the metadata related to the construction rule, the business metadata is sequentially matched to obtain target metadata that hits the target construction rule; and the target metadata is connected according to the sequence information of the metadata related to the target construction rule to obtain the business association network.

[0012] Further, after the business association network containing multiple business scenarios is constructed according to the sequence information of the metadata related to the multiple business scenarios and the business metadata, the method further includes: determining scene index information of at least one business scenario corresponding to the target construction rule, determining data index information of at least one target metadata corresponding to each business scenario in the at least one business scenario; according to a target business scenario corresponding to a test request, the business association network is searched to obtain a metadata list related to the target business scenario, including: according to the scene index information and the data index information, the business association network is searched to obtain business metadata associated with the target business scenario; and according to the business metadata associated with the target business scenario, a metadata list related to the target business scenario is generated.

[0013] In order to achieve the above purpose, according to another aspect of the present application, a test case generation device is provided, the device is deployed with a departure system, and the device includes: an extraction unit configured to collect log data of the departure system and extract business metadata from the log data; a construction unit configured to construct a business association network containing multiple business scenarios according to metadata related to the multiple business scenarios and the business metadata; a search unit configured to search the business association network according to a target business scenario corresponding to a test request to obtain a metadata list related to the target business scenario; and a replacement unit configured to mask and replace metadata to be replaced in the metadata list that is irrelevant to business information, and generate a test case corresponding to the test request according to the metadata list after replacement.

[0014] Further, the extraction unit comprises: a collection subunit, configured to collect software application logs and host logs of the departure system from distributed storage servers of the departure system in parallel by distributed consumption nodes to obtain the log data; an extraction subunit, configured to extract metadata and data indexes of key information from the log data line by line, wherein the key information comprises at least one of the following: instruction information, message information and interface information; an aggregation subunit, configured to aggregate the metadata of the key information and the data indexes of the key information respectively; and a first determination subunit, configured to determine the service metadata according to the aggregated metadata and the aggregated data indexes.

[0015] Further, the extraction subunit comprises: a first determination module, configured to determine the metadata of the key information according to request data and response data corresponding to the interface information, request data and response data corresponding to the instruction information and one-way request information corresponding to the message information; and a second determination module, configured to determine the data indexes of the key information according to target fields and index information of the key information, wherein the target fields comprise at least one of the following: airline, flight number, flight date, passenger host number, passenger name, log time sequence and log time information; the index information of the interface information at least comprises interface name and method name; the index information of the message information at least comprises message name and message part information; and the index information of the instruction information at least comprises instruction name.

[0016] Further, the replacement unit comprises: a second determination subunit, configured to determine, according to mask replacement information in the test request, to-be-replaced metadata in the metadata list that is irrelevant to service information; a third determination subunit, configured to determine, according to a target mask rule, to-be-replaced interfaces, to-be-replaced messages and to-be-replaced instructions in the to-be-replaced metadata, wherein the target mask rule is a rule obtained by representing a preset mask replacement rule by using a node data structure; and a replacement subunit, configured to directly replace the to-be-replaced interfaces, replace the to-be-replaced messages and to-be-replaced instructions by using a regular expression, and obtain the replaced metadata.

[0017] Further, the replacing unit further comprises: a fourth determining sub-unit, configured to determine a mask data type of the metadata processed by the mask replacing rule before determining the to-be-replaced interface, the to-be-replaced message and the to-be-replaced instruction in the to-be-replaced metadata according to the target mask rule; a fifth determining sub-unit, configured to determine a first-level node according to the metadata processed by the mask replacing rule, wherein the first-level node comprises at least one of the following: interface information, message information and instruction information; a sixth determining sub-unit, configured to determine a second-level node under the first-level node according to the metadata that needs to be replaced in the interface information, the message information or the instruction information; and a first generating sub-unit, configured to generate the target mask rule according to the mask data type, the first-level node and the second-level node.

[0018] Further, the constructing unit comprises: a seventh determining sub-unit, configured to receive a plurality of business scenarios corresponding to a constructing rule, and determine sequence information of metadata involved in the constructing rule; wherein the constructing rule comprises at least: a first type of rule and a second type of rule, the first type of rule is used for constructing a network path related to a flight, and the second type of rule is used for constructing a network path related to a passenger; a matching sub-unit, configured to sequentially match in the business metadata according to the sequence information of the metadata involved in the constructing rule, to obtain target metadata that hits a target constructing rule; and a connecting sub-unit, configured to connect the target metadata according to the sequence information of the metadata involved in the target constructing rule, to obtain the business-related network.

[0019] Further, the constructing unit further comprises: an eighth determining sub-unit, configured to, after sequentially matching in the business metadata according to the sequence information of the metadata involved in the constructing rule, to obtain target metadata that hits a target constructing rule, determine scene index information of at least one business scenario corresponding to the target constructing rule, and determine data index information of at least one target metadata corresponding to each business scenario in the at least one business scenario; and the retrieving unit comprises: a retrieving sub-unit, configured to retrieve in the business-related network according to the scene index information and the data index information, to obtain business metadata related to a target business scenario; and a second generating sub-unit, configured to generate a metadata list related to the target business scenario according to the business metadata related to the target business scenario.

[0020] In order to achieve the above-mentioned purpose, according to an aspect of the present application, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the test case generation method of any one of the above-mentioned aspects, and the computer program, when executed by the processor, implements the steps of the test case generation method in the embodiments of the present application.

[0021] In order to achieve the above object, according to an aspect of the present application, a computer readable storage medium is provided, which comprises stored computer instructions, wherein the computer instructions, when executed by a processor, implement the test case generation method of any one of the above.

[0022] In order to achieve the above object, according to an aspect of the present application, an electronic device is provided, comprising one or more processors and a memory, the memory being configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the test case generation method of any one of the above.

[0023] According to the present application, the following steps are adopted: collecting log data of the departure system, and extracting business metadata from the log data; constructing a business association network containing multiple business scenarios according to metadata related to the multiple business scenarios and the business metadata; searching for metadata related to a target business scenario corresponding to a test request in the business association network to obtain a metadata list related to the target business scenario; performing mask replacement on business information unrelated metadata to be replaced in the metadata list, and generating a test case corresponding to the test request according to the replaced metadata list, thereby solving the problem in the related art that, due to a large number of business scenarios, a test personnel needs to repeatedly analyze specific business and edit test cases, resulting in low editing efficiency of the test cases.

[0024] By collecting log data of the departure system, information flow in the whole process of business operation can be systematically captured, and a detailed business metadata set can be constructed. Meanwhile, by constructing a business association network according to metadata related to multiple business scenarios and the extracted business metadata, the departure platform can intuitively understand the data dependency relationship between the business scenarios, realize automation of data integration and scenario association, further optimize the business process and improve the data processing efficiency. In addition, by searching for metadata in the network according to a target business scenario corresponding to a test request, the metadata set in a specific scenario can be quickly located and extracted, the test preparation is more accurate, the targeted test case generation is realized, and the accuracy and stability of the system function in the specific business process are ensured. On this basis, by performing mask processing on the metadata to be replaced, the safety of the test data is ensured, sensitive information is avoided from being exposed in the test environment, and the technical effects of enhancing system security and compliance are further achieved, thereby providing a solid foundation for continuous improvement and system verification. BRIEF DESCRIPTION OF DRAWINGS

[0025] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and are incorporated herein for explanation of the present application and are not intended to constitute improper limitations of the present application. In the drawings:

[0026] Figure 1 is a flow chart of a test case generation method according to the embodiment one of the present application;

[0027] Figure 2 is a schematic diagram of an optional association relationship between a construction rule, a real scene and a data index of metadata according to the embodiment one of the present application;

[0028] Figure 3 is a flow chart of an optional business association network generation method according to the embodiment one of the present application;

[0029] Figure 4 is a flow chart of an optional test case generation method according to the embodiment one of the present application;

[0030] Figure 5 is a flow chart of an optional data processing method according to the embodiment one of the present application;

[0031] Figure 6 is a schematic diagram of an optional business association network according to the embodiment one of the present application;

[0032] Figure 7 is a flow chart of an optional metadata masking replacement method according to the embodiment one of the present application;

[0033] Figure 8 is a schematic diagram of a test case generation device according to the embodiment two of the present application;

[0034] Figure 9 is a schematic diagram of a test case generation electronic device according to the embodiment five of the present application. DETAILED DESCRIPTION

[0035] It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0036] It should be noted that the user information (including but not limited to user equipment information, user personal information, collected data, used data, generated data, processed data, etc.) and data (including but not limited to data for analysis, stored data, displayed data, collected information, used information, generated information, processed information, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards of relevant countries and regions, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal. For example, interfaces are provided between the system and related users or institutions, and before obtaining the relevant information, the interface needs to send an acquisition request to the aforementioned user or institution, and after receiving the consent information feedback from the aforementioned user or institution, the relevant information is acquired.

[0037] It should be noted that the present application provides a corresponding operation portal for the user to choose to agree or refuse the automatic decision result; if the user chooses to refuse, the expert decision process is entered.

[0038] In order to enable personnel in the art to better understand the present application scheme, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0039] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0040] Embodiment one

[0041] The present application will be described below in conjunction with preferred implementation steps, Figure 1 is a flowchart of the test case generation method provided according to the first embodiment of the present application, as Figure 1 shown, the method comprises the following steps:

[0042] Step S101, collect log data of the departure system, and extract service metadata from the log data.

[0043] In this embodiment one, in order to generate test cases according to the actual business requirements of the departure system (for example, departure host software (which can be referred to as DCS), departure open core function system (which can be referred to as DI), and departure open access function system (which can be referred to as DC)), it is necessary to obtain the original log file generated by the departure system, to perform concurrent processing on the obtained log file, to identify and aggregate key information from the log file, and to refer to the key information as service metadata.

[0044] The extraction of metadata needs to pay attention to specific fields such as airline code, flight number, date, timestamp, interface or message name, etc., aiming to comprehensively reflect the core elements of system operation and business process. The extracted service metadata is persistently stored, i.e., recorded into the corresponding database, for subsequent analysis and retrieval. This series of operations ensures the accuracy and integrity of the metadata, and provides a solid foundation for building a business association network.

[0045] Step S102, constructing a business association network containing multiple business scenarios according to the metadata and service metadata involved in multiple business scenarios.

[0046] In this embodiment one, a series of business scenario rules can be defined according to the metadata involved in multiple business scenarios, which details the scenario range, metadata type and specific operation, such as flight status update, passenger protection and seat allocation, etc. Subsequently, by traversing the stored service metadata and matching with the preset scenario rules, the links between the metadata are established, forming a business association network. The business association network contains metadata nodes corresponding to the business metadata related to multiple business scenarios, and the metadata nodes are connected through the time sequence and logical association of events.

[0047] Step S103, searching in the business association network according to the target business scenario corresponding to the test request, to obtain a list of metadata related to the target business scenario.

[0048] In this embodiment, the specific target business scenario is determined according to the test request, and then an accurate search is performed in the previously constructed business association network according to the target business scenario. This search process aims to find all metadata records directly associated with the target business scenario, i.e., the above-mentioned metadata list related to the target business scenario. The search strategy involves traversing the path related to the target business scenario in the network, identifying and collecting metadata along the way. These metadata may include detailed information of passengers, attribute description of luggage, and status update of flights, etc. Once all relevant nodes are traversed, the collected information is summarized to form a metadata list. This list lists all the key metadata required in the target business scenario in detail, providing a basis for subsequent business testing or data analysis.

[0049] For example, by analyzing the parameters in the request, such as flight number, boarding time, passenger identity, etc., the corresponding nodes in the business association network are located, and the metadata list is obtained.

[0050] In step S104, the non-business-related metadata to be replaced in the metadata list is replaced by masking, and the test case corresponding to the test request is generated according to the replaced metadata list.

[0051] In this embodiment, the non-business-related metadata to be replaced in the metadata list is replaced by masking, i.e., identifying and selecting those data items that do not directly affect the business logic, such as the personal information of passengers, for shielding or desensitization processing. This process ensures the safety and compliance of data in the testing process and avoids the leakage of sensitive information. The masking replacement strategy usually includes using pre-set rules or patterns to replace sensitive metadata with meaningless but format-similar virtual data. For example, a randomly generated string is used to replace the real passenger ID or passport number.

[0052] After the replacement is completed, the corresponding test case is generated based on the processed metadata list. The design of the test case is around the functional requirements of the target business scenario, which verifies the system performance by simulating the input and expected output in actual operation. The generated test case contains the metadata replaced by masking to ensure the behavior consistency of the test environment and the real environment, while maintaining data privacy.

[0053] Through masking replacement and test case generation, not only the sensitive data in the business information is protected, but also an effective testing means is provided to ensure the correctness and stability of the system function in various business scenarios.

[0054] In summary, the method for generating test cases provided in the embodiment one of the present application collects log data of the departure system, and extracts business metadata from the log data; constructs a business association network containing multiple business scenarios according to the metadata related to the multiple business scenarios and the business metadata; searches for the metadata list related to the target business scenario in the business association network according to the target business scenario corresponding to the test request, performs mask replacement on the to-be-replaced metadata irrelevant to the business information in the metadata list, and generates the test case corresponding to the test request according to the metadata list after replacement, thereby solving the problem in the related art that the test process of the departure system of the airline company needs the test personnel to repeatedly analyze specific business and edit test cases, resulting in low editing efficiency of the test cases.

[0055] By collecting log data of the departure system, the information flow in the whole process of business operation can be systematically captured, and the technical effect of constructing detailed business metadata set is achieved. Meanwhile, by constructing the business association network according to the metadata related to the multiple business scenarios and the extracted business metadata, the departure platform can intuitively understand the data dependency relationship between the business scenarios, the automation of data integration and scenario association is realized, and the technical effects of optimizing the business process and improving the data processing efficiency are further achieved. In addition, by searching in the network according to the target business scenario corresponding to the test request, the metadata set under the specific scenario can be quickly located and extracted, the test preparation is more accurate, the targeted test case generation is realized, and the accuracy and stability of the system function in the specific business process are ensured. On this basis, by performing mask processing on the to-be-replaced metadata, the security of the test data is ensured, the sensitive information is avoided from being exposed in the test environment, and the technical effects of enhancing the system security and compliance are further achieved, which provides a solid foundation for continuous improvement and system verification.

[0056] Optionally, in the method for generating test cases provided in the embodiment one of the present application, collecting log data of the departure system and extracting business metadata from the log data comprises: performing a timing task in parallel through a distributed consumption node, collecting software application logs and host logs of the departure system from a distributed storage server of the departure system to obtain log data; extracting metadata and data indexes of key information from the log data line by line, wherein the key information comprises at least one of the following: instruction information, message information, and interface information; respectively aggregating the metadata of the key information and the data indexes of the key information; and determining the business metadata according to the aggregated metadata and the aggregated data indexes.

[0057] In the first embodiment, in order to extract key metadata in each business scenario, a pre-set timing task can be started to utilize the parallel processing capability of the distributed consumption node to batch call software application logs and host logs from the distributed storage server of the departure system, which ensures comprehensive collection of log data. Then, the obtained log data is analyzed line by line to filter out key information metadata, and data indexes associated with the key information are recorded for subsequent retrieval and positioning. The metadata information can include, but is not limited to, interface information in the calling interface in the departure system, instruction information of the input instruction, and message information of the sent message. Secondly, the extracted key information metadata and data indexes are aggregated respectively to integrate similar information and eliminate redundancy, preparing for the next step of analysis. Finally, combined with the aggregated metadata and data indexes, business metadata reflecting actual business operations in each business scenario is extracted to form clear business data description and structure.

[0058] Through the above steps, the details of business operations are accurately captured from massive log data, and the goal of forming unified management of business metadata is achieved, providing a data foundation for building business association networks and subsequent automatic generation of test cases. This process optimizes data processing efficiency, ensures the integrity and accuracy of business metadata, and thus improves the automation level of system testing and the precision of scenario building.

[0059] Optionally, in the test case generation method provided in the first embodiment of the present application, the key information metadata and data indexes are extracted from the log data line by line, including: determining the key information metadata according to the request data and response data corresponding to the interface information, the request data and response data corresponding to the instruction information, and the one-way request information corresponding to the message information; and determining the data index of the key information according to the target field and index information of the key information, wherein the target field includes at least one of the following: airline, flight number, flight date, passenger host number, passenger name, log time sequence, and log time information; the index information of the interface information at least includes: interface name and method name; the index information of the message information at least includes: message name and message part information; and the index information of the instruction information at least includes: instruction name.

[0060] In the first embodiment, in order to extract the key metadata in each business scenario, the request and response data of the interface, the request and response data of the instruction, and the one-way request information of the message can be analyzed to extract the metadata constituting the core of these interactions, ensuring the integrity and accuracy of the data. Then, according to the specific target fields in the key information, such as airline code, flight identification, date, etc., data indexes are generated. These indexes not only identify the context of business operations, but also contain timing and time information, providing key clues for subsequent data retrieval. Secondly, for interface information, its interface name and method name can be recorded as indexes to locate specific business functions; for message information, it at least contains the message name and part of the message information to identify the type and structure of the message; and the index of instruction information at least covers the instruction name to distinguish different operation commands. Finally, using these detailed index information, the key information stored on the server can be accurately located and retrieved, forming an efficient data indexing mechanism.

[0061] Through the above steps, the technical effect of automatically extracting and structuring key business information from complex logs is achieved, which provides a solid data foundation for building a business association network, simplifies the data retrieval process, and improves the efficiency of test preparation and abnormal analysis.

[0062] In an optional embodiment, the data in the metadata file of the interface is stored in JSON format, for example, {"parts":[{"content":"{\"sys\":\"di\",\"version\":\"1.20\",\"method\":\"acceptPassenger\",\"auditcontext\":{},\"firstcode\":{\"svccode\":\"DC-6058-15\",\"desc\":\"NEEDINITIALIZE\",……},"tag": "RS"},{{"content":"{\"interface\":\"PaService\",……}","tag":"RQ"}]}". Among them, the outermost parts array node represents the composition of the metadata, and the interface and instruction each have 2 parts: request and response, while the message has only 1 part: one-way request. Each element of the parts array node contains two fields, content represents the data content of the metadata, and tag represents whether the metadata is a request or a response.

[0063] In an alternative embodiment, the data index of the key information includes, but is not limited to, the following specific fields: UNIT_ID represents a unique identification of the data index of the key information; AIRLINE represents an airline related to the key information; FLIGHT_NO represents a flight number related to the key information; FLIGHT_DATE represents a flight date related to the key information; HOST_NO represents a passenger host number related to the key information; PASSENGER_NAME represents a passenger name related to the key information; SEQ represents a log sequence related to the key information; LOG_TIME represents log time information related to the key information; FILE_NAME is used to locate the full path filename of the metadata corresponding to the data index in the file storage server, facilitating direct access to the metadata content; and UNIT_TYPE identifies the type of the data index: I represents an interface type, M represents a message type, and C represents a command type. Illustratively, when UNIT_TYPE = I, INTERFACE_NAME (interface name) and METHOD_NAME (method name) need to be recorded; when UNIT_TYPE = M, MESSAGE_NAME (message name, such as PNL) and MESSAGE_PART (message part number, such as 1) need to be recorded; and when UNIT_TYPE = C, COMMAND_NAME (command name, such as PA) needs to be recorded.

[0064] Optionally, in the method for generating a test case provided in Embodiment One of the present application, the masking replacement of the to-be-replaced metadata unrelated to the business information in the metadata list includes: determining the to-be-replaced metadata unrelated to the business information in the metadata list according to the masking replacement information in the test request; determining the to-be-replaced interface, the to-be-replaced message, and the to-be-replaced command in the to-be-replaced metadata according to a target masking rule, wherein the target masking rule is a rule obtained by representing a preset masking replacement rule using a node data structure; directly replacing the to-be-replaced interface, and replacing the to-be-replaced message and the to-be-replaced command using a regular expression, to obtain the replaced metadata.

[0065] In Embodiment One, when the user has a personalized requirement to replace part of the business data, the masking replacement information is supplemented in the test request, so that the metadata retrieved in the business-related network can be masked and replaced.

[0066] In the case of receiving a test request, the mask replacement information of the user customization requirement is determined according to the test request, that is, the business information that the user intends to shield or replace is determined. Then, according to the mask replacement information provided in the test request, specific data items in the metadata list that are irrelevant to the business operation (that is, the above-mentioned to-be-replaced metadata) are screened out, which usually contain sensitive or personalized information such as passenger name, flight number, etc. Secondly, the target mask rule is used, which is represented by a node data structure (that is, a JsonNode structure) to accurately guide the subsequent replacement operation. By analyzing the target mask rule, the interface, message or instruction that needs to be replaced (that is, the above-mentioned to-be-replaced interface, to-be-replaced message and to-be-replaced instruction) is determined. Finally, the data replacement is performed. For the to-be-replaced interface, the information is directly replaced; and for the to-be-replaced message and the to-be-replaced instruction, the regular expression is used for matching and replacement to ensure the integrity of the data structure and the accuracy of the replacement.

[0067] Through the above steps, the technical effect of dynamically processing sensitive or personalized information in the metadata according to the user requirement is achieved, the safety and universality of the test data are ensured, unnecessary data leakage risk is avoided, and the data protection capability of the system is enhanced.

[0068] Optionally, in the test case generation method provided in Embodiment One of the present application, before determining the to-be-replaced interface, to-be-replaced message and to-be-replaced instruction in the to-be-replaced metadata according to the target mask rule, the above-mentioned method further comprises: determining the mask data type of the metadata processed by the mask replacement rule; determining the first-level node according to the metadata processed by the mask replacement rule, wherein the first-level node at least includes one of the following: interface information, message information and instruction information; determining the second-level node under the first-level node according to the metadata that needs to be replaced in the interface information, message information or instruction information; and generating the target mask rule according to the mask data type, the first-level node and the second-level node.

[0069] In Embodiment One, in order to construct the target mask rule, the metadata type involved in the mask replacement rule can be identified, and the specific information category that needs to be protected by privacy or data deformation is determined. Then, based on the definition of the mask replacement rule, the first-level node for processing data is determined, which corresponds to the data type of the to-be-replaced data, mainly including interface information, message information or instruction information, to ensure that each data type has a corresponding processing entry. Secondly, the data replacement strategy under the first-level node is refined, and the specific fields or data items that need to be replaced are identified, which constitute the second-level node. For example, in the interface information, the fields that may involve replacement include sensitive information such as airline code and flight number. Finally, the target mask rule is generated by comprehensively configuring the mask data type, the first-level node and the second-level node.

[0070] In an alternative embodiment, a target mask rule associated with an interface can include: a root node interface-method, indicating that the rule applies to metadata of the interface type (UNIT_TYPE=I) (in addition, a root node message-method indicates that the rule applies to metadata associated with a message, and a root node command-method indicates that the rule applies to metadata associated with a command); a plurality of first-level child nodes, each first-level child node representing an interface method; and a plurality of second-level child nodes, the second-level child nodes listing, in an array, field information of all interfaces that need to be masked (in addition, the second-level child nodes of the target mask rule corresponding to a message also need to include regular expressions used to replace the message, and the second-level child nodes of the target mask rule corresponding to a command also need to include regular expressions used to replace the command).

[0071] Through the above steps, the technical effect of maintaining the validity and usability of the test case while protecting data privacy is achieved, thereby providing a strong guarantee for safe and efficient test preparation and business scenario simulation.

[0072] Optionally, in the method for generating a test case provided in Embodiment One of the present application, a business association network containing multiple business scenarios is constructed according to metadata and business metadata involved in the multiple business scenarios, including: receiving construction rules corresponding to the multiple business scenarios, and determining sequence information of metadata involved in the construction rules; wherein the construction rules at least include: a first type of rule for constructing a network path related to a flight, and a second type of rule for constructing a network path related to a passenger; sequentially matching the business metadata according to the sequence information of the metadata involved in the construction rules to obtain target metadata that hits the target construction rule; and connecting the target metadata according to the sequence information of the metadata involved in the target construction rule to obtain the business association network.

[0073] In Embodiment One, the construction rules of the multiple business scenarios are received by the test personnel or preset, these rules contain specific requirements for metadata processing in different scenarios, including the appearance sequence of the metadata in the business process. Then, according to the sequence information in the construction rules, the preprocessed business metadata set is matched item by item, aiming to identify the metadata that matches the rules, and this process ensures the accurate restoration of the business scenario. Figure 2 is a schematic diagram of the association relationship between the optional construction rules, real scenarios, and data indexes of the metadata provided in Embodiment One of the present application. As shown in Figure 2 In the matching process of the construction rules, a data record of a real scenario is created every time a construction rule hits is identified, and the SCENE_ID of each data record of a real scenario is associated with the UNIT_ID of multiple metadata feature indexes.

[0074] Secondly, for the matched metadata, further according to the sequence information in the construction rule, the metadata is sequenced, to prepare for constructing the business correlation network. Finally, the sequenced metadata is connected according to the logic and sequence defined in the construction rule, to generate the business correlation network reflecting the specific business scenario, including the flight-related path and the passenger-related path, thereby supporting the subsequent testing and analysis activities.

[0075] Exemplarily, when the construction rule is the flight type, the business correlation network can construct a data index set of messages, instructions, interfaces and the like executed in a vertical sequence from top to bottom; when the construction rule is the passenger type, the business correlation network can construct a data index set of messages, instructions, interfaces and the like with the passenger information and the flight information crossing vertically and horizontally.

[0076] Through the above steps, the technical effect of automatically identifying and constructing the business scenario correlation network is achieved. This mechanism can effectively filter out the data conforming to the specific business process from a large amount of metadata, and form an ordered network structure, which helps to improve the pertinence and efficiency of testing, and reduces the dependence on the business understanding depth of the tester.

[0077] In an optional embodiment, the construction rule corresponding to the business scenario can include but is not limited to the following field information: SCENE RANGE represents the path classification; FLT represents the flight type; PSG represents the passenger type; UNIT_TYPE represents the type of data index of the business metadata; INTERFACE_NAME represents the interface name; METHOD_NAME represents the method name; SCENE represents the serial number of the business scenario; SCENE_DESC represents the scene description, the serial number and the description of the same scene are the same; SEQ is the sequence of the instructions, interfaces and messages in the business scenario, and the construction or analysis of the business correlation network will strictly match and find the feature index of the correlation point according to the sequence.

[0078] Optionally, in the method for generating test cases provided in the first embodiment of the application, after the target metadata of the hit target construction rule is obtained by sequentially matching the metadata according to the sequence information of the construction rule involved in the metadata, the method further includes: determining the scene index information of at least one business scenario corresponding to the target construction rule, and determining the data index information of at least one target metadata corresponding to each business scenario in the at least one business scenario; searching in the business correlation network according to the target business scenario corresponding to the test request to obtain a metadata list related to the target business scenario, including: searching in the business correlation network according to the scene index information and the data index information to obtain the business metadata associated with the target business scenario; and generating the metadata list related to the target business scenario according to the business metadata associated with the target business scenario.

[0079] In the first embodiment, after the matching of the metadata and the construction rules is completed, the hit target construction rule is further parsed to determine the scene index information of the associated business scenario, which indicates the unique identification and characteristics of the scene. Then, according to the scene index information of the business scenario, the specific index information of the relevant metadata in each specific business scenario is identified, and the index information contains the accurate location and associated attributes of the metadata storage, which is crucial for efficient retrieval. Secondly, when receiving a test request with a specific business scenario identification, targeted retrieval is performed in the constructed business association network according to the scene index and metadata index, which ensures that the relevant metadata is quickly located. Finally, the retrieval results are integrated to generate a metadata list highly related to the requested target business scenario.

[0080] For example, when querying, according to the business scenario serial number parameter carried by the test request, the latest recorded scene is first searched from the current business network scene list for matching. If no scene is hit, an empty list is returned. If a scene is hit, the data index list associated with the scene is read. The file storage location information of each data index record in the data index list is traversed to obtain its metadata, which is integrated into the data index list to obtain the above-mentioned metadata list.

[0081] Through the above steps, the technical effect of automatically retrieving the metadata related to the specific business scenario in the business association network according to the test request is achieved. This mechanism significantly improves the efficiency of the test preparation stage, reduces manual intervention, and enhances data security and test accuracy.

[0082] Optionally, Figure 3is an optional flow diagram of generating a business correlation network according to the embodiment one of the present application. First, the log data generated in the departure system is analyzed for content, and the business operation details in the log are extracted. Then, each piece of analyzed log information is judged for metadata to determine whether it contains valuable key information such as instructions, messages or interface call details. If it is determined to be yes, the next step is performed, otherwise, the system will discard the data and end the current processing flow. Secondly, for the log confirmed to contain key information, the metadata is stored persistently, and the corresponding feature index (i.e. the data index described above) is recorded, including but not limited to airline, flight number, flight date, interface name, etc., thereby providing a data basis for subsequent business correlation network construction. Finally, according to the stored metadata and feature index, the business correlation network is constructed, and by comparing the preset scene rules (i.e. the construction rules described above), the metadata matching the scene rules is identified. If the scene rule matching is successful, the business correlation network containing the business scene is generated, including scene description, correlation metadata and its index; if the matching fails, the network construction step will be continued, and other scene rules will be tried to match until all rules are traversed or the business correlation network is successfully constructed.

[0083] Optionally, Figure 4 is an optional flow diagram of generating a test case according to a test request according to the embodiment one of the present application. First, after receiving the test request, the scene index list that has been constructed is searched according to the business scene serial number in the test request. Then, it is checked whether there is a feature index (i.e. the data index described above) record corresponding to the request scene. If the scene has not been defined or does not exist in the database, an empty list is returned, indicating that the corresponding test case cannot be generated, and the flow ends. Secondly, if the scene exists, the specific metadata related to the feature index is further read. If the metadata does not exist or cannot be accessed, a data acquisition exception is reported, and the flow is terminated. Finally, once the metadata is successfully retrieved, the scene information, feature index and metadata are combined to form an aggregated test case result. On this basis, if the test request contains specific mask replacement rules, the sensitive information in the test case will be replaced to ensure the safety and compliance of the data, and then the flow is completed.

[0084] Optionally, Figure 5is an optional data processing flowchart provided by Embodiment One of the present application. First, starting from the recorded business metadata, search in the constructed business correlation network according to the business scenario serial number, which directly points to the database resources, and filter out the feature index and metadata combination that meets the scenario rule. Then, if the test request contains the requirement of mask replacement, perform mask replacement operation on the retrieved metadata, which aims to protect sensitive information while ensuring the availability of test data. The mask replacement is based on the preset mask rule, and the replaced data still maintains the form of metadata. Secondly, whether it is the original business metadata or the data after the correlation network construction or mask replacement processing, it will be stored in the database, which ensures the traceability of the data and the convenience of subsequent processing. Before constructing the business correlation network, extract and generate metadata from the original log, which will be stored in the database or file storage system for subsequent construction of business correlation network or retrieval in the business correlation network.

[0085] Optionally, Figure 6 is an optional schematic diagram of a business correlation network provided by Embodiment One of the present application, including the interaction relationship between flights and passenger actions in the business correlation network. From the vertical dimension, flights CA1590 and CA1591 each experience a series of business processes, such as initialization, transfer / connection, check-in, boarding, and flight closure, which reflects the processing path of flight business from the system level. Then, after the flight initialization is completed, the passenger begins to participate in it, Figure 6 shows the passenger's activities on the CA1590 flight, such as initial boarding procedures. Secondly, as the business progresses, Figure 6 horizontally presents the situation of passenger cross-flight operations, i.e., the passenger completes the transfer / connection on CA1590 and then transfers to CA1591, which reflects the passenger's flow between different flights. Finally, the passenger continues the business operations of check-in, boarding, and flight closure on CA1591, which fully presents the business scenario of the passenger switching from one flight to another.

[0086] Optionally, Figure 7 is an optional flowchart of mask replacement on the retrieved metadata provided by Embodiment One of the present application. First, the network service (such as Figure 7 in "NetService") receives the test request parameter params containing the business scenario serial number, and through the query() function, based on the given business scenario serial number, searches in the business correlation network (such as Figure 7accurately matched in the "RelationNetMap" in the "MaskResultSet", the sensitive fields are replaced with placeholders, such as replacing the flight number, passenger name, etc., to generate a safe and compliant test data set. Finally, the metadata after the mask replacement processing is integrated into the UnMaskResultSet for subsequent test case arrangement and execution, ensuring data security and business authenticity during testing. Figure 7

[0087] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0088] Embodiment Two

[0089] The embodiment two of the present application also provides a test case generation device. It should be noted that the test case generation device of the embodiment two of the present application can be used to execute the test case generation method provided in the embodiment one of the present application. The test case generation device provided in the embodiment two of the present application is introduced as follows.

[0090] Figure 8 is a schematic diagram of the test case generation device provided in the embodiment two of the present application. As shown in Figure 8 the device includes an extraction unit 801, a construction unit 802, a retrieval unit 803 and a replacement unit 804.

[0091] Specifically, the extraction unit 801 is configured to collect log data of a departure system and extract business metadata from the log data.

[0092] The construction unit 802 is configured to construct a business association network containing multiple business scenarios according to the metadata involved in the multiple business scenarios and the business metadata.

[0093] The retrieval unit 803 is configured to retrieve the metadata list related to the target business scenario according to the target business scenario corresponding to the test request in the business association network.

[0094] The replacement unit 804 is configured to perform mask replacement on the to-be-replaced metadata irrelevant to the business information in the metadata list, and generate a test case corresponding to the test request according to the metadata list after the replacement. ​

[0095] The test case generation device provided in the second embodiment of the application, through the extraction unit 801, is used to collect log data of the departure system, and extract service metadata from the log data; the construction unit 802 is used to construct a service association network containing multiple service scenarios according to the metadata involved in the multiple service scenarios and the service metadata; the retrieval unit 803 is used to retrieve the metadata list related to the target service scenario corresponding to the test request in the service association network, and obtain the metadata list related to the target service scenario; the replacement unit 804 is used to mask replace the to-be-replaced metadata irrelevant to the service information in the metadata list, and generate the test case corresponding to the test request according to the replaced metadata list, solving the problem in the related art that the test process of the airline departure system needs the test personnel to repeatedly analyze the specific service and edit the test case, resulting in low editing efficiency of the test case.

[0096] By collecting the log data of the departure system, the information flow in the whole process of the service operation can be systematically captured, and the technical effect of constructing detailed service metadata set is achieved. At the same time, by constructing the service association network according to the metadata involved in the multiple service scenarios and the extracted service metadata, the departure platform can intuitively understand the data dependency relationship between the service scenarios, realizing the automation of data integration and scene association, and further achieving the technical effects of optimizing the business process and improving the data processing efficiency. In addition, by retrieving the metadata set in the network according to the target service scenario corresponding to the test request, the metadata set in the specific scene can be quickly located and extracted, the test preparation is more accurate, the targeted test case generation is realized, and the accuracy and stability of the system function in the specific business process are ensured. On this basis, by the mask processing of the to-be-replaced metadata, the safety of the test data is ensured, the sensitive information is avoided to be exposed in the test environment, and the technical effects of enhancing the system security and compliance are further achieved, providing a solid foundation for continuous improvement and system verification.

[0097] Optionally, in the test case generation device provided in the second embodiment of the application, the extraction unit 801 includes: a collection subunit, configured to collect software application logs and host logs of the departure system from a distributed storage server of the departure system by parallel execution of a timing task through a distributed consumption node, to obtain log data; an extraction subunit, configured to extract metadata and data indexes of key information from the log data line by line, wherein the key information includes at least one of the following: instruction information, message information, and interface information; an aggregation subunit, configured to aggregate the metadata of the key information and the data indexes of the key information respectively; and a first determination subunit, configured to determine service metadata according to the aggregated metadata and the aggregated data indexes.

[0098] Optionally, in the test case generation apparatus provided in Embodiment Two of the present application, the extraction subunit comprises: a first determination module configured to determine the metadata of the key information according to the request data and the response data corresponding to the interface information, the request data and the response data corresponding to the instruction information, and the one-way request information corresponding to the message information; and a second determination module configured to determine the data index of the key information according to the target field and the index information of the key information, wherein the target field comprises at least one of the following: airline, flight number, flight date, passenger host number, passenger name, log time sequence, and log time information; the index information of the interface information comprises at least the interface name and the method name; the index information of the message information comprises at least the message name and the message part information; and the index information of the instruction information comprises at least the instruction name.

[0099] Optionally, in the test case generation apparatus provided in Embodiment Two of the present application, the replacement unit 804 comprises: a second determination subunit configured to determine the to-be-replaced metadata in the metadata list that is irrelevant to the business information according to the mask replacement information in the test request; a third determination subunit configured to determine the to-be-replaced interface, the to-be-replaced message, and the to-be-replaced instruction in the to-be-replaced metadata according to the target mask rule, wherein the target mask rule is a rule obtained by representing a preset mask replacement rule by using a node data structure; and a replacement subunit configured to directly replace the to-be-replaced interface, replace the to-be-replaced message and the to-be-replaced instruction by using a regular expression, and obtain the replaced metadata.

[0100] Optionally, in the test case generation apparatus provided in Embodiment Two of the present application, the replacement unit 804 further comprises: a fourth determination subunit configured to determine the mask data type of the metadata processed by the mask replacement rule before determining the to-be-replaced interface, the to-be-replaced message, and the to-be-replaced instruction in the to-be-replaced metadata according to the target mask rule; a fifth determination subunit configured to determine a first node according to the metadata processed by the mask replacement rule, wherein the first node comprises at least one of the following: interface information, message information, and instruction information; a sixth determination subunit configured to determine a second node under the first node according to the metadata that needs to be replaced in the interface information, the message information, or the instruction information; and a first generation subunit configured to generate the target mask rule according to the mask data type, the first node, and the second node.

[0101] Optionally, in the test case generation apparatus provided in Embodiment Two of the present application, the construction unit 802 comprises: a seventh determination subunit, configured to receive construction rules corresponding to a plurality of service scenarios, and determine sequence information of metadata involved in the construction rules; wherein the construction rules at least include: a first type of rule and a second type of rule, the first type of rule is used for constructing a flight-related network path, and the second type of rule is used for constructing a passenger-related network path; a matching subunit, configured to sequentially match in service metadata according to the sequence information of the metadata involved in the construction rules, to obtain target metadata that hits a target construction rule; and a connection subunit, configured to connect the target metadata according to the sequence information of the metadata involved in the target construction rule, to obtain a service-related network.

[0102] Optionally, in the test case generation apparatus provided in Embodiment Two of the present application, the construction unit 802 further comprises: an eighth determination subunit, configured to, after sequentially matching in service metadata according to the sequence information of the metadata involved in the construction rules, to obtain target metadata that hits a target construction rule, determine scene index information of at least one service scenario corresponding to the target construction rule, and determine data index information of at least one target metadata corresponding to each service scenario in the at least one service scenario; and the retrieval unit 804 comprises: a retrieval subunit, configured to retrieve in the service-related network according to the scene index information and the data index information, to obtain service metadata associated with a target service scenario; and a second generation subunit, configured to generate a metadata list related to the target service scenario according to the service metadata associated with the target service scenario.

[0103] The test case generation apparatus comprises a processor and a memory, and the extraction unit 801, the construction unit 802, the retrieval unit 803 and the replacement unit 804 are all stored in the memory as program units, and the processor executes the above program units stored in the memory to realize the corresponding functions.

[0104] The processor comprises a core, and the core retrieves the corresponding program units from the memory. The core can be one or more, and the editing efficiency of the test case can be improved by adjusting the core parameters.

[0105] The memory can include a non-persistent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory comprises at least one memory chip.

[0106] Embodiment Three of the present application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to realize the test case generation method.

[0107] Embodiment four of the present application provides a processor for running a program, wherein the program implements the generation method of the test case when running.

[0108] Figure 9 is a schematic diagram of an electronic device for generating a test case according to embodiment five of the present application. As shown in Figure 9 embodiment five of the present application provides an electronic device, the device comprising a processor, a memory, and a program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program: collecting log data of a departure system, and extracting service metadata from the log data; constructing a service association network containing multiple service scenarios according to the metadata involved in the multiple service scenarios and the service metadata; searching for the metadata list related to the target service scenario in the service association network according to the target service scenario corresponding to the test request, and generating the test case corresponding to the test request according to the metadata list after masking and replacing the metadata in the metadata list that is irrelevant to the service information.

[0109] The processor further implements the following steps when executing the program: collecting log data of a departure system, and extracting service metadata from the log data, comprising: executing a timing task in parallel through a distributed consumption node, collecting software application logs and host logs of the departure system from a distributed storage server of the departure system to obtain log data; extracting metadata and data indexes of key information from the log data line by line, wherein the key information includes at least one of the following: instruction information, message information, and interface information; respectively aggregating the metadata of the key information and the data indexes of the key information; determining the service metadata according to the aggregated metadata and the aggregated data indexes.

[0110] The processor further implements the following steps when executing the program: extracting metadata and data indexes of key information from the log data line by line, comprising: determining the metadata of the key information according to the request data and response data corresponding to the interface information, the request data and response data corresponding to the instruction information, and the one-way request information corresponding to the message information; determining the data indexes of the key information according to the target fields and index information of the key information, wherein the target fields include at least one of the following: airline, flight number, flight date, passenger host number, passenger name, log time sequence, and log time information; the index information of the interface information at least includes: interface name and method name; the index information of the message information at least includes: message name and message part information; and the index information of the instruction information at least includes: instruction name.

[0111] The processor further implements the following steps when executing the program: performing mask replacement on the metadata in the metadata list that is irrelevant to the service information, including: determining the metadata in the metadata list that is irrelevant to the service information according to the mask replacement information in the test request; determining the to-be-replaced interface, the to-be-replaced message, and the to-be-replaced instruction in the to-be-replaced metadata according to the target mask rule, wherein the target mask rule is a rule obtained by using a node data structure to represent a preset mask replacement rule; directly replacing the to-be-replaced interface, and replacing the to-be-replaced message and the to-be-replaced instruction using a regular expression, to obtain the replaced metadata.

[0112] The processor further implements the following steps when executing the program: before determining the to-be-replaced interface, the to-be-replaced message, and the to-be-replaced instruction in the to-be-replaced metadata according to the target mask rule, the above method further includes: determining a mask data type of the metadata processed by the mask replacement rule; determining a first-level node according to the metadata processed by the mask replacement rule, wherein the first-level node includes at least one of the following: interface information, message information, and instruction information; determining a second-level node under the first-level node according to the metadata that needs to be replaced in the interface information, the message information, or the instruction information; and generating the target mask rule according to the mask data type, the first-level node, and the second-level node.

[0113] The processor further implements the following steps when executing the program: constructing a service association network containing multiple business scenarios according to the metadata involved in the multiple business scenarios and the service metadata, including: receiving a construction rule corresponding to the multiple business scenarios, and determining sequence information of the metadata involved in the construction rule; wherein the construction rule includes at least: a first type of rule and a second type of rule, the first type of rule is used to construct a network path related to a flight, and the second type of rule is used to construct a network path related to a passenger; sequentially matching the service metadata according to the sequence information of the metadata involved in the construction rule to obtain target metadata that hits the target construction rule; and connecting the target metadata according to the sequence information of the metadata involved in the target construction rule to obtain the service association network.

[0114] The processor further implements the following steps when executing the program: after sequentially matching the service metadata according to the sequence information of the metadata involved in the construction rule to obtain the target metadata that hits the target construction rule, the above method further includes: determining scene index information of at least one business scenario corresponding to the target construction rule, and determining data index information of at least one target metadata corresponding to each business scenario in the at least one business scenario; searching the service association network according to a target business scenario corresponding to a test request to obtain a metadata list related to the target business scenario, including: searching the service association network according to the scene index information and the data index information to obtain service metadata associated with the target business scenario; and generating the metadata list related to the target business scenario according to the service metadata associated with the target business scenario.

[0115] The device herein can be a server, a PC, a PAD, a mobile phone, etc.

[0116] The application further provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with the following method steps: collecting log data of a departure system, and extracting service metadata from the log data; constructing a service correlation network containing multiple service scenarios according to metadata related to the multiple service scenarios and the service metadata; searching for metadata related to a target service scenario corresponding to a test request in the service correlation network to obtain a metadata list related to the target service scenario; performing mask replacement on to-be-replaced metadata irrelevant to service information in the metadata list, and generating a test case corresponding to the test request according to the replaced metadata list.

[0117] When executed on a data processing device, the program is further adapted to be initialized with the following method steps: collecting log data of a departure system, and extracting service metadata from the log data, comprising: collecting software application logs and host logs of the departure system from a distributed storage server of the departure system by parallel execution of a timing task through a distributed consumption node to obtain log data; extracting metadata of key information and data indexes of the key information from the log data line by line, wherein the key information comprises at least one of the following: instruction information, message information, and interface information; respectively aggregating the metadata of the key information and the data indexes of the key information; determining the service metadata according to the aggregated metadata and the aggregated data indexes.

[0118] When executed on a data processing device, the program is further adapted to be initialized with the following method steps: extracting metadata of key information and data indexes of the key information from the log data line by line, comprising: determining the metadata of the key information according to request data and response data corresponding to the interface information, request data and response data corresponding to the instruction information, and one-way request information corresponding to the message information; determining the data indexes of the key information according to target fields and index information of the key information, wherein the target fields comprise at least one of the following: an airline, a flight number, a flight date, a passenger host number, a passenger name, a log time sequence, and log time information; the index information of the interface information at least comprises an interface name and a method name; the index information of the message information at least comprises a message name and message part information; and the index information of the instruction information at least comprises an instruction name.

[0119] When executed on the data processing device, the program is also adapted to execute the steps of initializing the method: masking and replacing the metadata to be replaced in the metadata list irrelevant to the service information, comprising: determining the metadata to be replaced in the metadata list irrelevant to the service information according to the masking and replacing information in the test request; determining the interface to be replaced, the message to be replaced and the instruction to be replaced in the metadata to be replaced according to the target masking rule, wherein the target masking rule is obtained by using the node data structure to represent the preset masking and replacing rule; directly replacing the interface to be replaced, replacing the message to be replaced and the instruction to be replaced by using the regular expression, and obtaining the replaced metadata.

[0120] When executed on the data processing device, the program is also adapted to execute the steps of initializing the method: before determining the interface to be replaced, the message to be replaced and the instruction to be replaced in the metadata to be replaced according to the target masking rule, the above-mentioned method further comprises: determining the masking data type of the metadata processed by the masking and replacing rule; determining the first node according to the metadata processed by the masking and replacing rule, wherein the first node at least comprises one of the following: interface information, message information and instruction information; determining the second node under the first node according to the metadata to be replaced in the interface information, the message information or the instruction information; generating the target masking rule according to the masking data type, the first node and the second node.

[0121] When executed on the data processing device, the program is also adapted to execute the steps of initializing the method: constructing the service association network containing multiple service scenarios according to the metadata and the service metadata involved in the multiple service scenarios, comprising: receiving the construction rule corresponding to the multiple service scenarios, and determining the sequence information of the metadata involved in the construction rule; wherein the construction rule at least comprises: the first type of rule and the second type of rule, the first type of rule is used to construct the network path related to the flight, and the second type of rule is used to construct the network path related to the passenger; sequentially matching in the service metadata according to the sequence information of the metadata involved in the construction rule, obtaining the target metadata hitting the target construction rule; connecting the target metadata according to the sequence information of the metadata involved in the target construction rule, and obtaining the service association network.

[0122] When executed on the data processing device, the program is also adapted to perform the following method steps: after sequentially matching the sequence information of the metadata involved according to the construction rule in the business metadata, obtaining target metadata of the hit target construction rule, the method further comprises: determining scene index information of at least one business scene corresponding to the target construction rule, and determining data index information of at least one target metadata corresponding to each business scene in the at least one business scene; searching the business association network according to a target business scene corresponding to the test request, obtaining a metadata list related to the target business scene, comprising: searching the business association network according to the scene index information and the data index information, obtaining business metadata associated with the target business scene; and generating a metadata list related to the target business scene according to the business metadata associated with the target business scene.

[0123] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer usable program code.

[0124] The present application is described with reference to the flowcharts and / or block diagrams according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks

[0125] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks

[0126] These computer program instructions can also be loaded into 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 block or blocks. Figure 1 Figure 1

[0127] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0128] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the processor can execute instructions. The memory can also include non-volatile memory, such as read only memory (ROM), electrically programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), flash memory, or a combination of non-volatile memories in different types. The memory can also include a compact disk read only memory (CD-ROM), digital versatile disk (DVD), Blu-ray, or another non-transitory computer readable medium, which is non-volatile and non-transitory in nature, but volatile in that it can lose its content if the power to the computer is turned off or if the computer crashes. The memory is an example of a computer readable medium.

[0129] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media 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 programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD), or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carriers.

[0130] It should also be noted that the terms "comprising," "including," 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 recited, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0131] ​​Those skilled in the art will appreciate that embodiments of the present application can be devised for a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer-readable program code thereon for use by or in connection with an instruction execution system. For the purposes of this description, a computer-usable or computer readable storage medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The medium can be electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. The computer-usable or computer readable program code can be downloaded from an Internet website, server, or other remote source via a network or a data stream communication path. From the Internet website, server, or other remote source, the code can be downloaded into the instruction execution system, apparatus, or device where execution of the same can take place. The present application is directed to any number and type of computer-usable storage media, apparatuses, and devices self-evidently known to one of ordinary skill in the art.

[0132] The foregoing is merely illustrative of the embodiments of this application, and is not intended to limit the application. Numerous variations and modifications can be made to the embodiments of the present application without departing from the spirit and scope of the application. Any equivalent modifications, variations, and improvements that are within the spirit and scope of the present application are intended to be included within the scope of

Claims

1. A method for generating a test case, characterized in that: The method is applied to a departure system and includes: Collecting log data of the departure system and extracting business metadata from the log data; Building a business association network including multiple business scenarios based on metadata related to multiple business scenarios and the business metadata; Searching the business association network according to the target business scenario corresponding to the test request to obtain a metadata list related to the target business scenario; Perform mask replacement on the metadata to be replaced that is not related to the business information in the metadata list, and generate a test case corresponding to the test request based on the replaced metadata list.

2. The method according to claim 1, characterized in that Collecting log data of the departure system and extracting business metadata from the log data includes: By executing scheduled tasks in parallel through distributed consumption nodes, software application logs and host logs of the departure system are collected from the distributed storage server of the departure system to obtain the log data; Extracting metadata and data indexes of key information from the log data line by line, wherein the key information includes at least one of the following: instruction information, message information, and interface information; Aggregating metadata of the key information and data indexes of the key information respectively; The business metadata is determined based on the aggregated metadata and the aggregated data index.

3. The method according to claim 2, characterized in that Extract metadata and data indexes of key information from the log data line by line, including: Determining metadata of the key information based on the request data and response data corresponding to the interface information, the request data and response data corresponding to the instruction information, and the one-way request information corresponding to the message information; The data index of the key information is determined based on the target field and index information of the key information, wherein the target field includes at least one of the following: airline, flight number, flight date, passenger host number, passenger name, log sequence, and log time information; the index information of the interface information includes at least: interface name, method name; the index information of the message information includes at least: message name, message part information; the index information of the instruction information includes at least: instruction name.

4. The method according to claim 2, characterized in that Performing mask replacement on the metadata to be replaced that is not related to the business information in the metadata list includes: Determining metadata to be replaced that is not related to business information in the metadata list according to the mask replacement information in the test request; Determining the interface to be replaced, the message to be replaced, and the instruction to be replaced in the metadata to be replaced according to a target mask rule, wherein the target mask rule is a rule obtained by characterizing a preset mask replacement rule using a node data structure; The interface to be replaced is directly replaced, and the message to be replaced and the instruction to be replaced are replaced using a regular expression to obtain the replaced metadata.

5. The method according to claim 4, characterized in that Before determining the interface to be replaced, the message to be replaced, and the instruction to be replaced in the metadata to be replaced according to the target mask rule, the method further includes: Determining a mask data type of metadata processed by the mask replacement rule; Determining a first-level node based on metadata processed by the mask replacement rule, wherein the first-level node includes at least one of the following: interface information, message information, and instruction information; Determining a secondary node under the primary node according to metadata that needs to be replaced in the interface information, the message information, or the instruction information; The target mask rule is generated according to the mask data type, the primary node, and the secondary node.

6. The method according to claim 1, characterized in that A business association network including various business scenarios is constructed based on metadata related to various business scenarios and the business metadata, including: Receive construction rules corresponding to multiple business scenarios and determine sequence information of metadata involved in the construction rules; wherein the construction rules include at least: a first type of rules and a second type of rules, wherein the first type of rules is used to construct flight-related network paths and the second type of rules is used to construct passenger-related network paths; Matching the business metadata in sequence according to the sequence information of the metadata involved in the construction rule to obtain target metadata that matches the target construction rule; The target metadata are connected according to sequence information of metadata involved in the target construction rule to obtain the business association network.

7. The method according to claim 6, characterized in that After sequentially matching the business metadata according to the sequence information of the metadata involved in the construction rule to obtain target metadata that matches the target construction rule, the method further includes: Determine scenario index information of at least one business scenario corresponding to the target construction rule, and determine data index information of at least one target metadata corresponding to each business scenario in the at least one business scenario; Search the business association network according to the target business scenario corresponding to the test request to obtain a metadata list related to the target business scenario, including: The business association network is searched based on the scenario index information and the data index information to obtain business metadata associated with the target business scenario; and a metadata list related to the target business scenario is generated based on the business metadata associated with the target business scenario.

8. A test case generation device, characterized in that: The device deploys a departure system, including: an extraction unit, configured to collect log data of the departure system and extract business metadata from the log data; A construction unit, configured to construct a business association network including multiple business scenarios based on metadata related to multiple business scenarios and the business metadata; A retrieval unit, configured to search the business association network according to a target business scenario corresponding to the test request, and obtain a metadata list related to the target business scenario; The replacement unit is configured to perform mask replacement on the metadata to be replaced that is not related to the business information in the metadata list, and generate a test case corresponding to the test request based on the replaced metadata list.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes stored computer instructions, wherein when the computer instructions are executed by a processor, the test case generation method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: The invention comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the test case generation method described in any one of claims 1 to 7.