Test data marking method and device, equipment, storage medium and program product
By double matching and marking business requests and processing data in the production system, the problem of isolating test data and actual data is solved, resource requirements and costs are reduced, and marking accuracy is improved.
Patent Information
- Application Number
- CN202410912189.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-29
AI Technical Summary
During production regression testing, it is difficult to completely isolate test data from actual data, resulting in dirty data affecting data business accuracy. Existing methods require additional server resources and are costly.
By matching the received business request data with the preset configuration data in the production system, the calibration information is added to ensure the matching of the business processing data. It is marked as test data to avoid separate channel settings and uses two matches to ensure accuracy.
It achieves effective isolation between test data and actual data, reduces resource requirements and costs, and improves the accuracy of test data labeling.
Smart Images

Figure CN118860873A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a test data marking method, device, equipment, storage medium and program product. Background Art
[0002] System testing can verify the quality of the system, but during the production regression testing process, test data will be generated. If the test data and the actual data in the production environment are not isolated, the test data may become dirty data, which will directly affect the accuracy of the actual data business.
[0003] Based on this, some methods propose to prevent the generation of test data during testing to avoid the test data affecting the accuracy of the actual data, but this method cannot completely avoid the generation of test data, and a small amount of test data will still be generated that cannot be isolated from the actual data; in other methods, a separate channel is set up for the test process, and the data passing through the channel is marked as test data, so as to achieve the separation of test data and family data, but this method requires setting up a separate channel for test data, which requires more server resources and is more costly. Summary of the invention
[0004] The present application provides a test data labeling method, device, equipment, storage medium and program product to solve the problem of low test data labeling accuracy.
[0005] In a first aspect, the present application provides a test data marking method, comprising:
[0006] Matching the service request data received by the production system with the preset configuration data, and if the match is successful, adding first calibration information to the service request data, wherein the service request data represents information of a request sending end that sends the service request data, and the preset configuration data includes information of a test sending end that tests the production system;
[0007] receiving business processing data, wherein the business processing data is data obtained by business processing the business request data, and the business processing data obtained by business processing the business request data having the first calibration information includes the first calibration information;
[0008] If the business processing data has the first calibration information, matching the business processing data with the preset configuration data, and if the match succeeds, adding the second calibration information to the business processing data having the first calibration information;
[0009] The business processing data having the first calibration information and the second calibration information is marked as test data.
[0010] In an implementable manner, the preset configuration data includes at least one configuration string, the configuration string corresponds one-to-one to the information of the test sending end, and the configuration string is obtained by encrypting the configuration string using a preset key; matching the service request data received by the production system with the preset configuration data includes:
[0011] Encrypting the service request data based on the preset key to obtain a service request character string;
[0012] The service request character string is matched with the at least one configuration character string.
[0013] In an implementable manner, the production system includes a plurality of target business interfaces, the business request data sequentially passes through the plurality of target business interfaces to complete the business request, and each target business interface corresponds to a piece of business processing data; the method further includes:
[0014] Detect the business processing data corresponding to each target business interface in turn;
[0015] If the first calibration information exists in the business processing data, and the second calibration information does not exist, matching the business processing data with preset configuration data;
[0016] If the first calibration information exists in the business processing data and the second calibration information exists, the business processing data is marked as test data. If the business processing data corresponding to the previous target business interface among the multiple target business interfaces has the first calibration information and the second calibration information, then the business processing data corresponding to the next target business interface among the multiple target business interfaces has the first calibration information and the second calibration information.
[0017] In an implementable manner, after marking the business processing data having the first calibration information and the second calibration information as test data, the method further includes:
[0018] Acquire target test data related to the cost from the test data, wherein the target test data is data obtained by performing a test related to the cost on the production system;
[0019] The target test data is matched with the preset configuration data. If the match is successful, the cost-related value in the target test data is set as the preset value, and the test corresponding to the target test data is completed based on the set preset value.
[0020] In an implementable manner, after marking the business processing data having the first calibration information and the second calibration information as test data, the method further includes:
[0021] Matching the test data that has completed the test with the preset configuration data, and using the successfully matched test data as the test data to be cleaned;
[0022] The test data to be cleared is processed based on the secondary cache, so as to clear the test data to be cleared in the secondary cache at a preset time.
[0023] In an implementable manner, after marking the business processing data having the first calibration information and the second calibration information as test data, the method further includes:
[0024] When the production system sends request data to the target system, if the request data is the test data, stopping sending the request data to the target system; and / or,
[0025] When displaying the data in the production system, the test data is screened out.
[0026] In an implementable manner, before matching the service request data received by the production system with the preset configuration data, the method further includes:
[0027] Detecting the reception time of the service request data;
[0028] If the receiving time is within the preset configuration time period, the step of matching the business request data received by the production system with the preset configuration data is performed.
[0029] In a second aspect, the present application provides a test data marking device, comprising: a first matching module, used to match business request data received by a production system with preset configuration data, and if the match is successful, add first calibration information to the business request data, wherein the business request data represents information of a request sending end that sends the business request data, and the preset configuration data includes information of a test sending end that tests the production system;
[0030] A business processing data acquisition module, used to receive business processing data, wherein the business processing data is data obtained by business processing the business request data, and the business processing data obtained by business processing the business request data having the first calibration information includes the first calibration information;
[0031] A second matching module, configured to match the business processing data with preset configuration data if the business processing data contains the first calibration information, and if the match succeeds, to add second calibration information to the business processing data containing the first calibration information;
[0032] A test data marking module is used to mark the business processing data containing the first calibration information and the second calibration information as test data.
[0033] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory; the memory is used to store instructions; the processor is used to execute the instructions in the memory, so that the electronic device executes the method described in the first aspect.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0035] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0036] The test data marking method, device, equipment, storage medium and program product provided by the present application match the data processed in the production system with the preset configuration data, specifically, match it once when the business request data just enters the production system, and match it again with the business processing data obtained by the production system based on the business request data. The calibration information is marked by matching twice to determine the test data in the environment. This process does not require setting up a separate test channel, is low in cost, and multiple matching marks can ensure the accuracy of the test data marking. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] Figure 1 This is an implementation scenario diagram shown for an exemplary embodiment;
[0039] Figure 2 A structural diagram of the preset configuration data shown in an exemplary embodiment;
[0040] Figure 3 A flowchart of a test data marking method shown as an exemplary embodiment;
[0041] Figure 4 A structural diagram of a test data marking device is shown as an exemplary embodiment;
[0042] Figure 5 The present invention is a block diagram of an electronic device showing an exemplary embodiment.
[0043] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0044] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0045] It should be noted that the test data, business request data, business processing data, etc. involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data that are understood and authorized by the relevant users or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and comply with the principles of legality, legitimacy and necessity.
[0046] First, the terms involved in this application are explained:
[0047] Test data: non-routine data generated by the production environment, that is, data generated by testers during the testing process due to production environment testing.
[0048] Data isolation: Isolate normal data from production test data, and mark dirty data through strong matching.
[0049] Dirty data: non-production regular data.
[0050] After the program is officially released (production system), testers need to perform regression testing on the production system. The test data produced by the testers during the production verification process is not conducive to the actual data statistics of the production system and is dirty data. Especially in the insurance business field, after the policy-related data is synchronized to the supervision platform, it will hinder the subsequent normal insurance of the insured, so the marking and isolation of test data is particularly important.
[0051] In some solutions, data transmitted through a test channel is marked as test data, and the test data is isolated from actual data through the test channel and the test mark.
[0052] However, this solution needs to distinguish two channels: one channel is used for users' actual applications to generate actual data, and the other channel is used for testers to test and produce test data. This requires more server resources, and there are fewer users in the resources dedicated to storing isolated data, so the utilization rate is low.
[0053] At the same time, the solution only marks and isolates the test data without any subsequent processing, which will backlog service resources and eventually lead to resource load problems. In some special scenarios, such as insurance-related production systems, it cannot solve the problem of testers being marked as abnormal user portraits due to operations such as insurance, preservation, and claims, nor can it solve the difficulties in refunds caused by testing, nor can it solve the problem of test data causing differences in results when statistics are collected on the production system.
[0054] Based on this, a test data marking method, device, equipment, storage medium and program product are proposed in this embodiment. The process does not require the setting of a separate test channel, the cost is low, and the secondary marking can improve the accuracy of test data marking and achieve isolation of test data from actual data.
[0055] The test data labeling method provided in the present application can be implemented on any electronic device with data processing capabilities, or it can be a test data labeling system. It should be noted that the test data labeling system can be deployed separately on an electronic device in any environment (for example: deployed separately on an edge server in an edge environment), or it can be deployed entirely in a cloud environment, or it can be deployed in a distributed manner in different environments.
[0056] For example, the test data marking system can be logically divided into multiple parts, each with different functions. The various parts in the test data marking system can be deployed in any two or three of the electronic device (located on the user side, such as the client), the edge environment, and the cloud environment. The edge environment is an environment that includes a collection of edge electronic devices that are close to the electronic device. The edge electronic devices include: edge servers, edge stations with computing power, etc. The various parts of the test data marking system deployed in different environments or devices work together to realize the functions of the data processing platform.
[0057] It should be understood that this application does not make any restrictive division on which parts of the test data labeling system are deployed in what specific environment. In actual application, it can be adaptively deployed according to the computing power of the electronic device, the resource usage of the edge environment and the cloud environment, or the specific application requirements.
[0058] like Figure 1 This is an implementation scenario diagram showing an exemplary embodiment. The test data marking system corresponding to the implementation scenario includes a client 10 and a server 11. The client 10 and the server 11 are connected via network communication.
[0059] The test data marking method can be specifically applied to the test data marking system in the server 11. The test data marking system can be a production system or a separate system. It can interact with the data in the production system and process the data in the production system to mark the test data in the production system.
[0060] The production system is the system that needs to be tested. The data generated by testers when testing on the production system is test data, and the data generated by users (non-tester) operations on the production system is application data. The production system is a system composed of one or more software programs. The production system can realize one or more business functions. Testing can be performed on the production system, and normal business processing can also be performed at the same time.
[0061] The execution subject of the method of the embodiment of the present application is the server 11, and the client 10 can receive business request data. The client 10 sends the business request data to the server 11 through the network. The server 11 marks the test data and can feed back the marked test data to the client 10 through the network. The client 10 has a graphic user interface, and the test data can be displayed in the graphic interface.
[0062] In some embodiments, after receiving the business request data, the server 11 matches the business request data received by the production system with the preset configuration data. If the match is successful, the first calibration information is added to the business request data, where the business request data represents the information of the request sender that sends the business request data, and the preset configuration data includes information of the test sender that tests the production system; business processing data is received, where the business processing data is data obtained by performing business processing on the business request data, and the business processing data obtained by performing business processing on the business request data with the first calibration information includes the first calibration information; if the business processing data has the first calibration information, the business processing data is matched with the preset configuration data. If the match is successful, the second calibration information is added to the business processing data with the first calibration information; and the business processing data with the first calibration information and the second calibration information is marked as test data.
[0063] It is understandable that the test data marking device can be set at Figure 1 In the server 11, but the example shown in this embodiment Figure 1 The implementation environment shown is only exemplary. In other embodiments, the test data marking method may also be applied to other implementation environments, and the test data marking device may also be set in other structures in other implementation environments, which is not specifically limited here.
[0064] In this embodiment, the client 10 is an electronic device on the user side, which can be a wired terminal with a visualization structure or a wireless terminal. In other embodiments, the terminal can be an electronic device with a visualization structure such as a mobile phone, a computer, a tablet, and a vehicle-mounted device.
[0065] The server 11 can be an edge environment and a cloud environment, such as a physical server, a server cluster, and a cloud server, etc., and no specific limitations are made here.
[0066] It is understandable that the test data marking device can be set at Figure 1 In the server 11, but the example shown in this embodiment Figure 1 The implementation environment shown is only exemplary. In other embodiments, the test data marking method may also be applied to other implementation environments, and the test data marking device may also be set in other structures in other implementation environments, which is not specifically limited here.
[0067] Figure 2 is a flowchart of a test data marking method shown in an exemplary embodiment, which is applied to Figure 1 The server 11 in Figure 2 As shown, the method includes steps S210 to S270, which are described in detail as follows:
[0068] Step S210: Match the business request data received by the production system with the preset configuration data. If the match is successful, add the first calibration information to the business request data.
[0069] The service request data represents information of a request sending end that sends the service request data, and the preset configuration data includes information of a test sending end that tests the production system.
[0070] In this embodiment, the business request data is a request issued for a business supported by the production system. For example, if a production system supports insurance business and maintenance business, the business request data may be request data corresponding to the insurance business or request data corresponding to the maintenance business. The business request data may be a request issued by a customer or a request issued by a tester to test the production system.
[0071] The business request data represents the information of the sender that issues the business request data. The business request data not only includes data for making business requests to the production system, but also represents the information of the request sender that issues the business request data. It can be understood that the information of the request sender includes the user data that sends the business request data and the device data that issues the business request data. The user data may include user attribute information and account information, and the device data may include the device number and MAC address (Media Access Control Address) corresponding to the device that issues the business request data, and other information.
[0072] The user attribute information may include the user's name, gender, age, etc., and the account information may be the account information for logging into the production system.
[0073] In this embodiment, it is possible to determine whether the service request data is a request sent by a client or a request sent by a tester through information of a sender that sends the service request data represented by the service request data.
[0074] After obtaining the service request data, the service request data and the preset configuration data are matched. If the match is successful, it can be characterized that the service request data is a request issued by the tester, and the first calibration information is added to the service request data.
[0075] The preset configuration data includes information of the test sender for testing the production system, such as Figure 3 As shown, the preset configuration data includes the tester's user data and the tester's device data. If the business request data and the preset configuration data match successfully, it indicates that the business request data is the account corresponding to the tester and the information sent by the device corresponding to the tester.
[0076] It can be understood that a successful match means that the service request data matches both the user data and the device data in the preset configuration data successfully. If there is one item that does not match successfully, the first calibration information will not be added. For example, if the user data corresponding to the service request data matches successfully, but the MAC address corresponding to the service request data is not in the preset configuration data, then the service request data does not need to add the first calibration information.
[0077] In this embodiment, the service request data may be a character or a string or a field added at a predetermined position in the service request data, and no specific limitation is made here, but the added first calibration information needs to be distinguished from the service request data.
[0078] In one embodiment, the matching of the service request data and the preset configuration data can be a direct match, such as directly matching the request sender information with the test sender information to determine whether the request sender information exists in the test sender information, that is, the request sender information can find the same data in the test sender information.
[0079] In other embodiments, at least one configuration string may be set in the preset configuration data, and the configuration string corresponds to the information of the test sender one-to-one. If there is information of a test sender, there is a corresponding configuration string, and different information of test senders corresponds to different configuration strings. It can be understood that the configuration string is obtained by encrypting the information of the test sender with a preset key, such as configuration string = preset key (information of a test sender), the information of the test sender may include user data of the tester and device data of the tester, then the configuration string = preset key (user data of the tester + device data of the tester), that is, the information of each test sender in the preset configuration data is encrypted with the preset key to obtain the configuration string, and after receiving the service request data, the information of the request sender corresponding to the service request data can also be encrypted with the same preset key to obtain the service request string.
[0080] At this time, the preset configuration data includes at least one configuration string, and the service request string can be directly matched with the at least one configuration string. If the match is successful, the first calibration information is added to the service request data.
[0081] In some embodiments, before matching the service request data with the preset configuration data, the reception time of the service request data may be detected, and if the reception time is within the preset configuration time period, the step of matching the service request data with the preset configuration data is performed.
[0082] The preset configuration time period can be set in advance. During the preset configuration time period, the tester can test the production system, and no testing is performed during other time periods. In this way, the business request data received during other time periods can be regarded as sent by the customer, and there is no need to match the relevant data to confirm the test data. Only the business request data within the preset configuration time period is matched, and the business processing data obtained by the production system performing business processing based on the business request data within the preset time period is matched to determine whether the business management data is test data.
[0083] By setting a preset configuration time period, unnecessary test data marking processes can be reduced, test data marking efficiency can be improved, and resource usage can be reduced.
[0084] Step S230: receiving business processing data, where the business processing data is data obtained by business processing the business request data, and the business processing data obtained by business processing the business request data having the first calibration information includes the first calibration information.
[0085] In this embodiment, after receiving the business request data, the production system performs business processing based on the business request data. If the business request data is insurance request data, the production system performs relevant business processing based on the business request data to complete the insurance.
[0086] It is understandable that when a business request data is making a business request, a lot of business processing data will be generated in the process. For example, when the business request data of an insurance request is making an insurance business, it may need to go through steps such as registration, review, and calculation, and then complete the insurance request business. In each step, corresponding business processing data will be generated based on the business request data. For example, when the business request corresponding to the business request data reaches the registration stage, business processing data of the registration stage will be generated in the registration stage. If the business request corresponding to the business request data reaches the review stage, business processing data of the review stage will be generated in the review stage.
[0087] It should be noted that when a business request data is undergoing corresponding business processing, it should have the necessary business processing logic, that is, a corresponding business processing sequence. For example, for the insurance request proposed above, the registration, review, calculation and other steps have a certain processing sequence and need to be processed according to the registration, review, calculation and other steps. That is, the business processing data of the registration step will reach the review module, undergo the review step, and obtain the reviewed business processing data. The calculation module calls the reviewed business processing data for calculation and obtains the business processing data of the calculation step.
[0088] In this embodiment, if the first calibration information is added to the business request data, the business processing data obtained by the business request data with the first calibration information added will also include the first calibration information when the business processing is subsequently performed, while the business request data without the first calibration information added will not include the first calibration information when the business processing is subsequently performed.
[0089] Step S250: If the business processing data has the first calibration information, the business processing data is matched with the preset configuration data. If the match is successful, the second calibration information is added to the business processing data having the first calibration information.
[0090] In this embodiment, if the business processing data includes the first calibration information, the business processing data can be regarded as data obtained by performing business processing on the business request data sent by the tester.
[0091] However, in some embodiments, in order to further improve the accuracy of test data acquisition or prevent some non-testing personnel from directly adding the first calibration information to the sent business processing data and disguising themselves as testers to send business processing data, after determining that the business processing data includes the first calibration information, the business processing data including the first calibration information will be matched with the preset configuration data. If the match is successful, the second calibration information will be added to the business processing data with the first calibration information.
[0092] In this embodiment, the second calibration information may be a character, a string, or a field added to the agreed position in the business request data. It may also be that when the first calibration information is a field, the second calibration information is assigned a value on the field. No specific restrictions are made on the second calibration information here, but the added second calibration information needs to be distinguished from the first calibration information, and the second calibration information also needs to be distinguished from the business request data.
[0093] The matching method between the business processing data and the preset configuration data may refer to the matching method between the business request data and the preset configuration data, which will not be described in detail here.
[0094] It can be understood that there may be multiple interfaces in the production system, and the service request data enters the production system through the request receiving interface, and the service request data is matched with the preset configuration data at the request receiving interface.
[0095] In addition to the request receiving interface, the production system also includes multiple business interfaces. Different business interface combinations can implement different business requests. In this embodiment, for business request data, there is a corresponding target business interface that implements the business corresponding to the business request data. Through the target business interface, the business request corresponding to the business request data can be implemented.
[0096] It can be understood that the business interface can be regarded as the business implementation step of each business request. For example, the business request data of the insurance business request, and its corresponding registration, review, calculation and other steps, then the corresponding target business interface is the registration interface, audit interface, calculation interface, the registration interface receives the data of the previous interface to perform registration-related business processing, and the audit interface receives the data after the registration interface business is completed to perform audit-related business processing, etc. In this way, when each target business interface implements the business request corresponding to the business request data, there is corresponding business processing data. For example, when the request receiving interface receives the business request data, the target business interface that implements the business request corresponding to the business request data performs corresponding business processing in sequence based on the business request data.
[0097] The business processing data corresponding to the target business interface is the specific data of the interface. For example, the business processing data corresponding to the registration interface may be registration data, and the business processing data corresponding to the audit interface may be audit data, etc. The business processing data corresponding to different interfaces may be the same or different.
[0098] In this embodiment, a business request data corresponds to its target business interface. When the business request data adds the first calibration information, it will cover the interaction between the target business interfaces. That is, the business request data adds the first calibration information. When the business request data performs business processing in the subsequent target business interface, the business processing data corresponding to the target business interface will also have the first calibration information.
[0099] It should be noted that there is a calling order between the target business interfaces of the business corresponding to the time business request data, and the business requests are implemented in sequence according to the calling order, that is, the business request data passes through multiple target business interfaces in sequence to complete the business request, such as the registration interface, audit interface, calculation interface, etc. mentioned above. It is necessary to call the registration interface first, then call the audit interface, and then call the calculation interface, etc., so as to realize the business request corresponding to the insurance business.
[0100] In this way, when detecting the business request data corresponding to each target business interface, the business processing data corresponding to each target business interface is detected in turn according to the calling order between the target business interfaces; if there is first calibration information in the business processing data, and there is no second calibration information, the business processing data is matched with the preset configuration data; if there is first calibration information and second calibration information in the business processing data, the business processing data is marked as test data, and if the business processing data corresponding to the previous target business interface among multiple target business interfaces has the first calibration information and the second calibration information, then the business processing data corresponding to the next target business interface among multiple target business interfaces has the first calibration information and the second calibration information.
[0101] In this embodiment, the business data corresponding to the target business interface is detected in turn. If the business processing data does not contain the first calibration information, the business processing data is not matched with the preset configuration data. If the business processing data contains the first calibration information, the business request data corresponding to the business processing data successfully matches the preset configuration data, and the business request data can be regarded as a business request issued by the tester. At this time, it can be detected whether there is second calibration information in the business request data. If not, the business processing data is matched with the preset configuration data. If the match is successful, the second calibration information is added to the business processing data.
[0102] It can be understood that, similar to the first calibration information in the business request data, the second calibration information in the business processing data will also cover the target business interface called subsequently, that is, there is a calling order between the target business interfaces corresponding to the business request data. If there is a target business interface corresponding to the business processing data with second calibration information, the business processing data corresponding to the target business interface called after the target business interface will all have the second calibration information, that is, in the calling order of multiple target business interfaces, if the business processing data corresponding to the previous target business interface has the first calibration information and the second calibration information, then the business processing data corresponding to the next target business interface among the multiple target business interfaces will have the first calibration information and the second calibration information.
[0103] In this way, if the first calibration information exists in the business processing data and the second calibration information exists, the business processing data is marked as test data, and the matching between the business processing data and the preset configuration data is no longer performed.
[0104] Step S270: Mark the business processing data with the first calibration information and the second calibration information as test data.
[0105] The business processing data having the first calibration information and the second calibration information is marked as test data.
[0106] In this embodiment, after the test data is determined, the test data and the actual data of the production system should be stored separately, such as in different databases. It can be understood that when the test data is stored, the first calibration information and the second calibration information should be stored.
[0107] In this embodiment, if the target business interface does not detect the first calibration information, the corresponding business processing data will be directly stored in the database as actual data. If the first calibration information is detected and the business processing data does not match the preset configuration data, the business processing data will also be stored in the database as actual data. Only when the business processing data detects the first calibration information and matches the preset configuration data (and detects the second calibration information), the business processing data will be stored as test data in the corresponding database.
[0108] In this embodiment, the test data in the production system is determined by marking the data for matching twice. This process does not require setting up a separate test channel, is low-cost, and the two markings can improve the accuracy of the test data marking.
[0109] In some embodiments, after the test data is obtained, the test data in the database may be processed accordingly, such as cleaning, modifying data, blocking outbound transmission, etc.
[0110] For example, in some embodiments, some test data are related to costs, so target test data related to the costs are obtained from the test data, and the target test data are data obtained by performing cost-related tests on the production system; the target test data are matched with the preset configuration data, and if the match is successful, the value related to the costs in the target test data is set to the preset value, and the test corresponding to the target test data is completed based on the set preset value.
[0111] It is understandable that different production systems have different corresponding tests, and all businesses supported by the production system can be tested. The target test data is the data generated by testing the businesses supported by the production system that include fees, such as insurance business, which involves premiums.
[0112] During the test process, in order to ensure the accuracy of the test, the data input for the test are all data that may actually be generated. Therefore, when the target test data is related to expenses, the corresponding expense-related values may be relatively large, and the testers need to process the actual expenses, such as paying insurance premiums, resulting in relatively high test costs.
[0113] It can be understood that when the test data is stored, the data involved in different business processes are stored in different tables, and the tables related to expenses in the test data store the target test data. For example, if a database includes a policy table, a detail table, a user table, a premium table, etc., then the test data in the premium table is the target test data, and the target test data related to expenses can be obtained through the table that stores different data.
[0114] Of course, in other embodiments, the target test data may not be obtained through a table, but the target test data with cost-related attributes may be obtained through the attributes of each data in the test data, such as different data corresponding to the field attributes of the data, so as to match the target test data related to the cost.
[0115] In this embodiment, a batch running task can be configured to set the cost-related values in the target test data to preset values within certain time periods, that is, to modify costs with larger values to costs with smaller values, so as to reduce the testing costs of testers.
[0116] The preset value can be set by yourself, or it can be set according to empirical parameters, or it can be any value in a numerical range. There is no specific restriction here. However, in order to reduce the testing cost, the preset value can be a small fee value, such as not more than 100, or not more than 10, etc. There is no specific restriction here.
[0117] The time period for setting up batch tasks can be the time period after the tester enters the business request data but before the payment of fees. For example, when testing the insurance business, it can be after the tester completes the insurance process and obtains the calculated premium, but before the premium is paid.
[0118] The batch running task can be set manually or in advance, and automatically triggered within the preset time period of the batch running task.
[0119] It can be understood that the service request data related to fees may also have other supporting service request data. The other supporting service request data is used to return the amount paid by the tester after the service corresponding to the service request data is completed and the tester pays the relevant fees. The returned fee value is the preset value.
[0120] In this embodiment, in order to increase the security of the test, before setting the cost-related values in the target test data to preset values, the target test data can be matched again with the preset configuration data to ensure that the target test data with modified values is the data obtained by the tester for the business request, thereby avoiding problems in the production system, which may cause normal data to be used as test data and the cost-related values in the data to be set to preset values, thereby improving the security of data processing.
[0121] In other embodiments, after the test is completed, the test data may be cleaned up to avoid occupying resources due to storing the test data.
[0122] The test data of the completed test is matched with the preset configuration data, and the successfully matched test data is used as the test data to be cleaned; the test data to be cleaned is processed based on the secondary cache to clean the test data to be cleaned in the secondary cache at a preset time.
[0123] The judgment of the completion of the test can be that the business request corresponding to the business request data not related to the fee is realized, or the business request corresponding to the business request data stipulates a deadline for realization, and the deadline for realization has been completed. The judgment of the completion of the test corresponding to the business request data related to the fee can be that the returned payment of other business request data matching the business request data has been completed. For example, the insurance business request requires the tester to pay the premium, and the insurance business request corresponds to a matching cancellation business request. When the cancellation business request is completed and the tester receives the returned premium, the test corresponding to the business request can be deemed to be completed.
[0124] It is understandable that the actual test completion can also be achieved by adding a cooling-off period to the test completion time corresponding to the above-mentioned business request, such as adding 15 days or 10 days, etc. There is no restriction here, and the test completion time with the cooling-off period added is used as the final test completion time.
[0125] Filter the test data that meets the test completion requirements in the database. It is understandable that there may be multiple test data in a test process, such as business processing data of different target business interfaces. Therefore, it can be controlled through optimistic locking. According to the trajectory of the test data falling into the database, first use relevant tools (such as session objects used to interact with the database) to query all the related test data. Similarly, in order to avoid the situation where the actual data exists in the database corresponding to the test data, the test data that has been filtered out and completed the test will also be matched with the preset configuration data. If the match is successful, it proves that the test data obtained by the filter is the data obtained by the tester during the test, and the successfully matched test data is used as the test data to be cleaned up.
[0126] After the screening is completed, the data cleaning stage begins. The test data to be cleaned is first processed into the secondary cache. After the cache time has passed, only the secondary cache data is deleted during the off-peak period of the production system.
[0127] In some embodiments, the cleaning process should pay attention to the association of multiple tables, the association relationship and the order of process storage. First, delete the sub-table records that reference the main table data, and then complete the deletion of the main table data. During the cleaning process, operations need to be performed according to the confirmed data range. Partial cleaning should be avoided, and the introduction of new dirty data during the cleaning process should be avoided.
[0128] After the cleanup is complete, check that the deletion results are as expected and confirm the test data report results in the production system.
[0129] In other embodiments, when the production system sends request data to the target system, if the request data is test data, stop sending the request data to the target system; and / or, when displaying the data in the production system, filter out the test data.
[0130] It is understandable that some businesses corresponding to production systems require interaction between third-party systems, or need to be sent to third-party systems for subsequent processing. Testing is a test of the performance of the production system, which is not actual data. Therefore, it is necessary to block the sending of test data.
[0131] That is, the test data is only used within the production system, or used to represent the performance of the production system, and is not sent to a third-party platform, that is, the target system, to avoid the test data flowing to the target system and causing subsequent processing errors in the target system.
[0132] It is understandable that the production system may request data from the target system to complete one or more services in conjunction with the target system. When the request data is test data, the test data should be blocked from being sent to the target system.
[0133] The blocking of the production system from sending test data can be achieved by setting a request interceptor in the production system to intercept corresponding requests.
[0134] Similarly, test data is the data obtained from testing the production system. When it is necessary to report and display the data in the production system, only actual data should be displayed, not test data. Therefore, test data should be screened out to obtain more accurate actual data of users.
[0135] Figure 4 4 is a structural diagram of a test data marking device shown in an exemplary embodiment. The test data marking device 400 includes:
[0136] A first matching module 410 is used to match the service request data received by the production system with the preset configuration data. If the match is successful, first calibration information is added to the service request data, where the service request data represents information of a request sending end that sends the service request data, and the preset configuration data includes information of a test sending end that tests the production system;
[0137] The business processing data acquisition module 430 is used to receive business processing data, where the business processing data is data obtained by business processing the business request data, and the business processing data obtained by business processing the business request data having the first calibration information includes the first calibration information;
[0138] A second matching module 450 is used to match the business processing data with the preset configuration data if the business processing data has the first calibration information, and if the match is successful, add the second calibration information to the business processing data with the first calibration information;
[0139] The test data marking module 470 is used to mark the business processing data with the first calibration information and the second calibration information as test data.
[0140] In an implementable manner, the preset configuration data includes at least one configuration string, the configuration string corresponds one-to-one to the information of the test sending end, and the first matching module includes:
[0141] An encryption unit, used to encrypt the service request data based on a preset key to obtain a service request character string;
[0142] The matching unit is used to match the service request character string with at least one configuration character string.
[0143] In an implementable manner, the production system includes multiple target business interfaces, and the business request data sequentially passes through the multiple target business interfaces to complete the business request, and each target business interface corresponds to a business processing data; the test data marking device 400 also includes:
[0144] A detection module, used to detect the business processing data corresponding to each target business interface in turn;
[0145] A first detection and matching module, configured to match the business processing data with preset configuration data if the first calibration information exists in the business processing data and the second calibration information does not exist;
[0146] The second detection and matching module is used to mark the business processing data as test data if the first calibration information and the second calibration information exist in the business processing data, and if the business processing data corresponding to the previous target business interface among multiple target business interfaces has the first calibration information and the second calibration information, then the business processing data corresponding to the next target business interface among multiple target business interfaces has the first calibration information and the second calibration information.
[0147] In one possible implementation, the test data marking device further includes:
[0148] The cost test data acquisition module is used to acquire target test data related to costs from the test data, where the target test data is data obtained by performing cost-related tests on the production system;
[0149] The value modification module is used to match the target test data with the preset configuration data. If the match is successful, the cost-related value in the target test data is set to the preset value, and the test corresponding to the target test data is completed based on the set preset value.
[0150] In one possible implementation, the test data marking device further includes:
[0151] The test data acquisition module to be cleaned is used to match the test data of the completed test with the preset configuration data, and use the successfully matched test data as the test data to be cleaned;
[0152] The cleaning module is used to process the test data to be cleaned based on the secondary cache, so as to clean the test data to be cleaned in the secondary cache at a preset time.
[0153] In one possible implementation, the test data marking device further includes:
[0154] a request blocking module, configured to stop sending request data to the target system when the production system sends request data to the target system if the request data is test data; and / or,
[0155] The screening and display module is used to screen out test data when displaying data in the production system.
[0156] In one possible implementation, the test data marking device further includes:
[0157] A receiving time acquisition module is used to detect the receiving time of the service request data;
[0158] The time matching module is used to execute the step of matching the business request data received by the production system with the preset configuration data if the receiving time is within the preset configuration time period.
[0159] The test data marking device provided in this embodiment can be used to execute the above-mentioned test data marking method. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0160] Figure 5 is a block diagram of an electronic device according to an exemplary embodiment. Figure 5 The electronic device 500 may include: a processor 51 and a memory 52, wherein the processor 51 and the memory 52 can communicate; illustratively, the processor 51 and the memory 52 communicate via a communication bus 53, the memory 52 is used to store instructions, and the processor 51 is used to call the instructions in the memory to execute the test data marking method shown in any of the above method embodiments.
[0161] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0162] The present application provides a computer-readable storage medium, on which computer-executable instructions are stored; when the computer-executable instructions are executed by a processor, they are used to implement a test data marking method as described in any of the above embodiments.
[0163] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned test data marking method is implemented.
[0164] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0165] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A test data labeling method, It is characterized in that include: Matching the service request data received by the production system with the preset configuration data, and if the match is successful, adding first calibration information to the service request data, wherein the service request data represents information of a request sending end that sends the service request data, and the preset configuration data includes information of a test sending end that tests the production system; receiving business processing data, wherein the business processing data is data obtained by business processing the business request data, and the business processing data obtained by business processing the business request data having the first calibration information includes the first calibration information; If the business processing data has the first calibration information, matching the business processing data with the preset configuration data, and if the match succeeds, adding the second calibration information to the business processing data having the first calibration information; The business processing data having the first calibration information and the second calibration information is marked as test data.
2. The method according to claim 1, It is characterized in that The preset configuration data includes at least one configuration string, the configuration string corresponds to the information of the test sending end one by one, and the configuration string is obtained by encrypting with a preset key; The matching of the business request data received by the production system with the preset configuration data includes: Encrypting the service request data based on the preset key to obtain a service request character string; The service request character string is matched with the at least one configuration character string.
3. The method according to claim 1, It is characterized in that The production system includes a plurality of target business interfaces, the business request data sequentially passes through the plurality of target business interfaces to complete the business request, and each target business interface corresponds to a piece of business processing data; the method further includes: Detect the business processing data corresponding to each target business interface in turn; If the first calibration information exists in the business processing data, and the second calibration information does not exist, matching the business processing data with preset configuration data; If the first calibration information exists in the business processing data and the second calibration information exists, the business processing data is marked as test data. If the business processing data corresponding to the previous target business interface among the multiple target business interfaces contains the first calibration information and the second calibration information, then the business processing data corresponding to the next target business interface among the multiple target business interfaces contains the first calibration information and the second calibration information.
4. The method according to claim 1, It is characterized in that After marking the business processing data having the first calibration information and the second calibration information as test data, the method further includes: Acquire target test data related to costs from the test data, wherein the target test data is data obtained by performing a test related to costs on the production system; The target test data is matched with the preset configuration data. If the match is successful, the cost-related value in the target test data is set as the preset value, and the test corresponding to the target test data is completed based on the set preset value.
5. The method according to any one of claims 1, It is characterized in that After marking the business processing data having the first calibration information and the second calibration information as test data, the method further includes: Matching the test data that has completed the test with the preset configuration data, and using the successfully matched test data as the test data to be cleaned; The test data to be cleared is processed based on the secondary cache, so as to clear the test data to be cleared in the secondary cache at a preset time.
6. The method according to claim 1, It is characterized in that After marking the business processing data having the first calibration information and the second calibration information as test data, the method further includes: When the production system sends request data to the target system, if the request data is the test data, stopping sending the request data to the target system; and / or, When displaying the data in the production system, the test data is screened out.
7. The method according to any one of claims 1 to 6, It is characterized in that Before matching the business request data received by the production system with the preset configuration data, the method further includes: Detecting the reception time of the service request data; If the receiving time is within the preset configuration time period, the step of matching the business request data received by the production system with the preset configuration data is performed.
8. A test data marking device, It is characterized in that include: A first matching module is used to match the service request data received by the production system with the preset configuration data, and if the match is successful, add first calibration information to the service request data, wherein the service request data represents information of a request sending end that sends the service request data, and the preset configuration data includes information of a test sending end that tests the production system; A business processing data acquisition module, used to receive business processing data, wherein the business processing data is data obtained by business processing the business request data, and the business processing data obtained by business processing the business request data having the first calibration information includes the first calibration information; A second matching module, configured to match the business processing data with preset configuration data if the business processing data contains the first calibration information, and if the match succeeds, to add second calibration information to the business processing data containing the first calibration information; A test data marking module is used to mark the business processing data containing the first calibration information and the second calibration information as test data.
9. An electronic device, It is characterized in that The electronic device comprises: a processor and a memory; the memory is used to store instructions; the processor is used to execute the instructions in the memory, so that the electronic device executes the method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
11. A computer program product, It is characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.
