Test data processing method and related device
By embedding context information in test screenshots, the problem of complex and inefficient test data traceability process is solved, and efficient, secure storage and traceability of context information are achieved, which simplifies the system architecture and improves the credibility and efficiency of test data traceability.
Patent Information
- Application Number
- CN202511069689.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-10-24
AI Technical Summary
In the existing technology, the test log-based method cannot effectively solve the problem of complex and inefficient test data traceability process, especially when the test screenshots are bound to the context information, there are problems of information storage vulnerability and increased system architecture complexity.
By leveraging image information hiding technology during the test screenshot generation phase to embed contextual information into the test screenshots, and extracting the corresponding contextual information from the test screenshots during the test data traceability phase, test data traceability is achieved. The specific method involves generating the target test screenshot while replacing the pixel values of the test screenshot with a binary bitstream, embedding information in the least significant bits, and extracting this bitstream during traceability to obtain contextual information.
It realizes the binding of test screenshots and context information, ensures the efficient storage and security of context information, simplifies the system architecture, reduces operation and maintenance costs, and improves the credibility and efficiency of test data traceability.
Smart Images

Figure CN120835118A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information encryption and hiding, and particularly relates to a test data processing method and related device. BACKGROUND
[0002] With the acceleration of digital transformation of various industries, automated testing has become an indispensable part of system development and operation. In the system testing process, the test data recorded synchronously is the key to the traceability of test data. For example, when a test exception occurs, such as a running exception or a test result that does not meet expectations, the test data is used to locate the exception, so that the corresponding repair method is executed after analyzing the cause of the exception. SUMMARY
[0003] In view of the above problems, the present application provides a test data processing method and related device to achieve the traceability and accuracy of context information. The specific scheme is as follows:
[0004] The first aspect of the present application provides a test data processing method, comprising:
[0005] generating a target test screenshot in response to a screenshot opportunity of a target test step;
[0006] obtaining a binary bit stream of context information of the target test screenshot;
[0007] using the binary bit stream of the context information to replace the least significant bits of the binary pixel values of each target pixel in the target test screenshot one by one to obtain a steganographic image of the target test screenshot, the target pixel being a pixel in a preset context embedding region.
[0008] In one possible implementation, obtaining the binary bit stream of the context information of the target test screenshot comprises:
[0009] obtaining context information of the target test screenshot;
[0010] binary encoding the context information to obtain an original binary bit stream of the context information;
[0011] encrypting the original binary bit stream based on a preset encryption algorithm to obtain a ciphertext binary bit stream of the context information, the binary bit stream of the context information comprising the ciphertext binary bit stream of the context information.
[0012] In one possible implementation, using the binary bit stream of the context information to replace the least significant bits of the binary pixel values of each target pixel in the target test screenshot one by one to obtain a steganographic image of the target test screenshot comprises:
[0013] divide the ciphertext binary bit stream of the context information into a first ciphertext bit stream and a second ciphertext bit stream;
[0014] divide, according to a preset division rule, the pixels in the context embedding region into first type pixels and second type pixels, a neighboring pixel of a first type pixel including multiple second type pixels, and a neighboring pixel of a second type pixel including multiple first type pixels;
[0015] calculate, based on the neighboring pixels, texture complexity of each first type pixel, the texture complexity being positively correlated with a pixel value variance of the neighboring pixels;
[0016] replace, in order from high to low of the texture complexity, the least significant bits of the binary pixel values of each first type pixel with the first ciphertext bit stream;
[0017] calculate, based on the neighboring pixels, texture complexity of each second type pixel;
[0018] replace, in order from high to low of the texture complexity, the least significant bits of the binary pixel values of each second type pixel with the second ciphertext bit stream.
[0019] In a possible implementation, the method further includes:
[0020] obtain a binary bit stream of attribute information of the target test screenshot, the attribute information including length of context information;
[0021] replace, in order according to a preset order, the least significant bits of the binary pixel values of each attribute pixel with the binary bit stream of the attribute information, the attribute pixel being a pixel in a preset attribute embedding region.
[0022] The second aspect of the application provides a method for processing test data, including:
[0023] in response to reaching a data tracing opportunity, extract, from a stego image of a target test screenshot, the least significant bits of the binary pixel values of each target pixel, to obtain a binary bit stream of context information of the target test screenshot, the target pixel being a pixel in a preset context embedding region.
[0024] obtain, based on the binary bit stream of the context information, context information of the target test screenshot.
[0025] In a possible implementation, the method further includes:
[0026] According to a preset order, the least significant bits of the binary pixel values of each attribute pixel in the attribute embedding region of the stego image of the target test screenshot are extracted to obtain attribute information, the attribute information including the length of the context information.
[0027] In a possible implementation, the least significant bits of the binary pixel values of each target pixel in the stego image of the target test screenshot are extracted one by one to obtain a binary bit stream of the context information of the target test screenshot, including:
[0028] According to a preset division rule, the pixels in the context embedding region are divided into first-type pixels and second-type pixels;
[0029] Based on the adjacent pixels, the texture complexity of each second-type pixel is calculated, and the texture complexity is positively correlated with the variance of the pixel values of the adjacent pixels;
[0030] According to an order from high to low of the texture complexity, the least significant bits of the binary pixel values of a target number of second-type pixels are extracted to obtain a second bit stream, where the target number is 1 / 2 of the length of the context information;
[0031] Based on the adjacent pixels, the texture complexity of each first-type pixel is calculated;
[0032] According to an order from high to low of the texture complexity, the least significant bits of the binary pixel values of the target number of first-type pixels are extracted to obtain the first bit stream;
[0033] The first bit stream and the second bit stream are sequentially spliced to obtain the binary bit stream of the context information of the target test screenshot.
[0034] In a possible implementation, based on the binary bit stream of the context information, the context information of the target test screenshot is obtained, including:
[0035] If the binary bit stream is a ciphertext binary bit stream, the original binary bit stream is obtained by decrypting the ciphertext binary bit stream;
[0036] The original binary bit stream is subjected to binary decoding to obtain the context information of the target test screenshot.
[0037] The third aspect of the present application provides a processing apparatus for test data, including:
[0038] A screenshot unit is configured to generate a target test screenshot in response to a screenshot timing of reaching a target test step;
[0039] An information generation unit is configured to obtain a binary bit stream of context information of the target test screenshot;
[0040] an information embedding unit, configured to replace, using the binary bit stream of the context information, the least significant bits of the binary pixel values of each target pixel in the target test screenshot to obtain a stego image of the target test screenshot, the target pixel being a pixel in the preset context embedding region.
[0041] The fourth aspect of the present application provides a test data processing device, comprising:
[0042] an information extraction unit, configured to extract, from the stego image of the target test screenshot, the least significant bits of the binary pixel values of each target pixel to obtain the binary bit stream of the context information of the target test screenshot, the target pixel being a pixel in the preset context embedding region, in response to reaching a data tracing opportunity.
[0043] an information analysis unit, configured to obtain the context information of the target test screenshot based on the binary bit stream of the context information.
[0044] By the above technical solution, the test data processing method and related device provided by the present application can generate the target test screenshot while obtaining the binary bit stream of the context information of the target test screenshot in the data embedding stage, replace, using the binary bit stream of the context information, the least significant bits of the binary pixel values of each target pixel in the target test screenshot to embed the context information into the target test screenshot, achieve the purpose of hiding and storing the context information in the target test screenshot, and further extract the context information by extracting, from the stego image of the target test screenshot, the least significant bits of the binary pixel values of each target pixel in the data tracing stage. It can be seen that the present solution realizes the binding of the test screenshot and the context information, and ensures the efficient storage and security of the context information, thereby realizing the traceability and accuracy of the context information. BRIEF DESCRIPTION OF DRAWINGS
[0045] The above and other features, advantages, and aspects of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which:
[0046] Figure 1 An architecture schematic diagram of a test data processing system provided by an embodiment of the present application;
[0047] Figure 2 A flowchart of a test data processing method provided by an embodiment of the present application;
[0048] Figure 3A specific implementation flowchart of a data processing method provided by an embodiment of the present application is shown in the figure;
[0049] Figure 4 A flowchart of a context information embedding method provided by an embodiment of the present application is shown in the figure;
[0050] Figure 5 A pixel division diagram of a context embedding area provided by an embodiment of the present application is shown in the figure;
[0051] Figure 6 A flowchart of another test data processing method provided by an embodiment of the present application is shown in the figure;
[0052] Figure 7 A structural diagram of a test data processing device provided by an embodiment of the present application is shown in the figure;
[0053] Figure 8 A structural diagram of a test data processing device provided by an embodiment of the present application is shown in the figure;
[0054] Figure 9 A structural diagram of an electronic device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0055] The embodiments of the present application are described below in conjunction with the accompanying drawings. The terms used in the embodiment part of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0056] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art can know that, as technology develops and new scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0057] The terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, and this is only a distinguishing way used in the description of the embodiments of the present application to describe the objects with the same attributes. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, so that the processes, methods, systems, products or devices containing a series of units do not have to be limited to those units, but can include other units that are not clearly listed or inherent to these processes, methods, products or devices.
[0058] In a test system, a test log is usually formed by recording key information of a test key node, and test data tracing is performed based on test data, for example, when an exception occurs, the exception is located based on the test log, so as to realize problem backtracking. However, when locating a test exception based on a log, there are problems of complex locating process and low efficiency due to complex log information and large amount of data.
[0059] In order to solve the problem of complex process and low efficiency when test data tracing is performed based on a test log, test screenshots can be generated synchronously during test execution, and test data tracing is realized based on the test screenshots. However, the test screenshots can only reflect the instantaneous state of interface output statically, and cannot associate context information such as test environment configuration, execution timestamp, script version number and operation step sequence.
[0060] In one prior art, context information is bound to a test screenshot by storing test parameters in a metadata field of the test screenshot. Specifically, when a screenshot is generated, context information is written into the metadata field. For example, test execution time and script version number are recorded in EXIF of a JPEG image. Further, context information is obtained by analyzing the metadata field, and test data tracing is performed based on the context information.
[0061] However, the binding of context information and test screenshots based on metadata annotation technology has strong dependence on external systems and vulnerability of information storage. Specifically, since the storage capacity of the metadata field is limited (usually not more than 64 KB), complex test parameters cannot be accommodated, and the context information of each test screenshot is forced to be stored in an external log database. This design significantly increases the complexity of the system architecture, and requires additional maintenance of database synchronization mechanism and disaster recovery scheme, further increasing the operation and maintenance cost. In addition, metadata is easily removed during image format conversion (such as JPEG to PNG) or cross-platform editing, resulting in loss of key information of some test screenshots.
[0062] To solve the above problems, a test data processing method provided by an embodiment of the present application embeds context information into a test screenshot using image information hiding technology in the test screenshot generation stage, extracts corresponding context information based on the test screenshot in the test data tracing stage, and realizes test data tracing.
[0063] The present application can be applied in the field of automatic test technology, and specifically applied in the processing of test data in automatic test. Specifically, the present application can be applied in, but is not limited to, an application program with test data processing function or a cloud service provided by a cloud-side server, which will be introduced as follows:
[0064] Reference Figure 1 , Figure 1An architecture schematic of a test data processing system is provided in the embodiments of the present application. The system can include a terminal 100 and a server 200. The server 200 can provide the method provided in the embodiments of the present application for one or more terminals.
[0065] The terminal 100 can be installed with a test data processing application. The application and the webpage can provide an interface. The terminal 100 can receive relevant parameters input by a user on the test data processing interface and send the parameters to the server 200. The server 200 can obtain a processing result based on the received parameters and return the processing result to the terminal 100.
[0066] It should be understood that, in some optional implementations, the terminal 100 can also complete the action of obtaining a processing result based on received parameters by itself without the cooperation of the server. The embodiments of the present application are not limited in this regard.
[0067] Next, the product form of the terminal 100 is described. Figure 1
[0068] The terminal 100 in the embodiments of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiments of the present application are not limited in this regard.
[0069] The terminal 100 can include a radio frequency unit, a memory, an input unit, a display unit, a camera (optional), an audio circuit (optional), a speaker (optional), a microphone (optional), a headset jack (optional), a processor, an external interface, a power supply, etc. Those skilled in the art can understand that the above components are only examples and do not constitute a limitation on the terminal or the multifunctional device, which can include more or fewer components, or combine certain components, or different components.
[0070] The input unit can be used to receive input digital or character information and generate key signal input related to user settings and function control of the portable multifunctional device. Specifically, the input unit can include a touch screen (optional) and / or other input devices. Specifically, the other input devices can include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, on / off keys, etc.), trackballs, mice, joysticks, etc.
[0071] Among them, the input device can receive input data and so on.
[0072] The display unit can be used to display information input by the user or information provided to the user, various menus of the terminal, interactive interface, file display and / or playback of any multimedia file. In an embodiment of the present application, the display unit can be used to display the interface of the processing of the test data, the processing results, etc.
[0073] Among them, the memory can be used to store software codes related to the test data processing method, the processor can execute the steps of the test data processing method, and can also schedule other units (such as the above-mentioned input unit and display unit) to realize corresponding functions.
[0074] The radio frequency unit (optional) can be used to send and receive information or receive and send signals during a call.
[0075] In this embodiment of the present application, the radio frequency unit can send data to the server 200 and receive the processing results sent by the server 200.
[0076] It should be understood that the radio frequency unit is optional and can be replaced by other communication interfaces, such as a network port.
[0077] The terminal 100 further includes a power source (such as a battery) for supplying power to various components.
[0078] The terminal 100 also includes an external interface, which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to other devices for communication, or to connect a charger to charge the terminal 100.
[0079] The server 200 includes a bus, a processor, a communication interface, and a memory. The processor, the memory, and the communication interface communicate with each other via the bus.
[0080] The memory may be used to store software codes related to the test data processing method, the processor may execute the steps of the chip test data processing method, and may also schedule other units to implement corresponding functions.
[0081] The following is a detailed description of the test data processing method of the embodiment of the present application with reference to the accompanying drawings.
[0082] Reference Figure 2 , Figure 2 A flow chart of a method for processing test data provided in an embodiment of the present application is shown as follows: Figure 2 As shown, a test data processing method provided in an embodiment of the present application may include S201 to S205, and these steps are described in detail below.
[0083] S201, in response to reaching a screenshot opportunity of a target test step, generating a target test screenshot.
[0084] S202, obtaining a binary bit stream of context information of the target test screenshot.
[0085] In the embodiment, the context information includes a timestamp, an environment configuration (such as an operating system version, a database type and version, a dependent library list, etc.), and a test step description.
[0086] S203, replacing, using the binary bit stream of the context information, the least significant bits of the binary pixel values of each target pixel in the target test screenshot one by one to obtain a steganographic image of the target test screenshot.
[0087] In the embodiment, the target pixel is a pixel in a preset context embedding area.
[0088] S204, in response to reaching a data tracing opportunity, extracting the least significant bits of the binary pixel values of each target pixel from the steganographic image of the target test screenshot one by one to obtain the binary bit stream of the context information of the target test screenshot.
[0089] S205, decoding the binary bit stream of the context information to obtain the context information of the target test screenshot.
[0090] As can be seen from the above technical solutions, the data processing method provided by the embodiment of the present application, in the data embedding stage, generates a target test screenshot while obtaining a binary bit stream of context information of the target test screenshot, embeds the context information into the target test screenshot by replacing, using the binary bit stream of the context information, the least significant bits of the binary pixel values of each target pixel in the target test screenshot one by one, achieves the purpose of hiding and storing the context information in the target test screenshot, and further, in the data tracing stage, extracts the context information by extracting the least significant bits of the binary pixel values of each target pixel from the steganographic image of the target test screenshot one by one, it can be seen that the present solution realizes the binding of the test screenshot and the context information, and ensures the efficient storage and security of the context information, thereby realizing the traceability and accuracy of the context information.
[0091] Based on the above embodiments, referring to Figure 3 , Figure 3 is a specific implementation flow diagram of the data processing method provided by the embodiment of the present application, which shows the specific implementation flow of the test data processing method in the data embedding stage, as shown in Figure 3 , the method specifically includes S301~ S306, which will be described in detail below.
[0092] S301, in response to reaching a screenshot opportunity of a target test step, generating a target test screenshot.
[0093] In this embodiment, the target test step is any one of the test steps in the test flow, and the reaching of the screenshot opportunity includes the end of the test step, the generation of a test result, or the reaching of a key node.
[0094] It should be noted that the screenshot opportunity of each test step can be pre-set.
[0095] S302, obtaining context information of the target test screenshot.
[0096] In this embodiment, the context information includes a timestamp, environment configuration (such as operating system version, database type and version, dependent library list, etc.), and test step description.
[0097] In this embodiment, while performing the screenshot operation to generate the target test screenshot, the context information of the target test screenshot is collected through a system command or a script interface. Alternatively, the timestamp can be obtained through a system time interface, accurate to milliseconds, the operating system version can be extracted through the uname -a (Linux) or systeminfo (Windows) command, and each test step description can be manually entered through a script. The test step description of the target test step is recorded in the log before the target test screenshot is generated, and the test step description of the target test step is extracted from the log when the target test screenshot is generated.
[0098] In this embodiment, the context information of the test screenshot can be stored in a structured format corresponding to the file identifier of the test screenshot.
[0099] In this embodiment, the screenshot and the synchronous collection of the context information can be efficiently realized in the automated test process. Through automated integration, manual intervention is reduced, and through information binding, the traceability of the test process is improved, which has high flexibility and scalability, supports multiple operating systems and test scenarios, and can extend the fields in the context information according to the requirements.
[0100] S303, binary encoding the context information to obtain an original binary bit stream of the context information.
[0101] In an optional embodiment, each character in the context information is efficiently converted into binary data using the general character encoding method UTF-8. Specifically, the length of the binary bit stream of a character after UTF-8 encoding is from 8 to 32. With a maximum length of 32, a 1000-character test information after encoding has a length of 32000 bits.
[0102] It should be noted that the context information is saved in a structured format, and the essence is a string. Since the encryption algorithm AES cannot directly encrypt characters, the structured context information is converted into a binary bit stream, thereby standardizing the storage format of the context information. In order to further improve the storage efficiency and reduce the image capacity requirement, a lossless compression algorithm can be used to compress the binary context information. The lossless compression algorithm significantly reduces the data amount by eliminating the redundant information in the data, while ensuring that the original information can be completely restored after decompression.
[0103] S304, encrypting the original binary bit stream based on a preset encryption algorithm to obtain a ciphertext binary bit stream of the context information.
[0104] In an optional embodiment, the binary context information is encrypted using the AES-256 encryption algorithm. Specifically, the binary context information is encrypted using a randomly generated initialization vector IV (16 bytes) and a preset key. The encryption mode is the cipher block chain CBC mode, that is, the previous ciphertext block is XORed with the current plaintext block, thereby enhancing the randomness and security of the encryption.
[0105] For example, the binary context information is 120 bytes, which is filled to 128 bytes, and then divided into 8 blocks of 16 bytes. Each block is XORed with the previous ciphertext block during encryption to ensure the randomness of the ciphertext. The encrypted data is spliced with the IV to form a final 144-byte ciphertext byte sequence. The ciphertext byte sequence is converted into a binary bit stream to obtain the ciphertext binary bit stream of the context information.
[0106] S305, according to a preset order, each binary bit stream of the attribute information of the target test screenshot is used to replace the least significant bits of the binary pixel values of each attribute pixel.
[0107] In this embodiment, the attribute pixel is a pixel in the preset attribute embedding area. Optionally, the attribute embedding area of the target test screenshot is the first row of pixels. The first row of pixels of the target test screenshot is reserved for embedding attribute information to ensure accurate extraction of the context information. The binary bit stream of the attribute information is obtained by binary conversion of the attribute information. The attribute information at least includes the length of the context information.
[0108] S306, each ciphertext binary bit stream of the context information is used to replace the least significant bits of the binary pixel values of each target pixel in the target test screenshot to obtain a stego image of the target test screenshot.
[0109] In this embodiment, the target pixel is a pixel in the context embedding area, and the context embedding area is an image area other than the attribute embedding area. The target pixel can be determined in the preset context embedding area based on the pixel complexity.
[0110] From the above technical solution, the present scheme converts the context information into a binary bit stream by encoding, and encrypts the context information by an encryption algorithm, ensuring efficient data storage and security. Specifically, the collected context information is converted into a binary bit stream suitable for embedding, and its confidentiality is protected by encryption technology. Through AES encryption, the test information has been converted into ciphertext before embedding the image. Even if an attacker obtains the steganographic image, he cannot directly analyze the content therein. Only authorized personnel holding the key can decrypt and restore the original information, ensuring the confidentiality and integrity of the data. Unauthorized access or tampering is prevented.
[0111] Further, the role of IV is to ensure that the same plaintext generates different ciphertext after encryption, further improving data security. Even if the same context information is encrypted twice, due to the different IVs, the generated ciphertext will be completely different, reducing the risk of attackers guessing the original information from the ciphertext.
[0112] Referring to Figure 4 , Figure 4 A flowchart of a context information embedding method provided by an embodiment of the present application is shown in Figure 4 S306 shows a specific implementation method of embedding the ciphertext binary bit stream of the context information into the least significant bits of the binary pixel values of each target pixel in the context embedding area of the target test screenshot to obtain a steganographic image of the target test screenshot, as shown in Figure 4 The method specifically includes S401-S406, as follows:
[0113] S401, divide the ciphertext binary bit stream of the context information into a first ciphertext bit stream and a second ciphertext bit stream.
[0114] S402, according to a preset division rule, divide the pixels in the context embedding area of the target test screenshot into first-type pixels and second-type pixels.
[0115] In this embodiment, the first-type pixels and the second-type pixels satisfy: the adjacent pixels of one first-type pixel include multiple second-type pixels, and the adjacent pixels of one second-type pixel include multiple first-type pixels. Figure 5 A pixel division diagram of a context embedding area provided by an embodiment of the present application is shown in Figure 5 The white rectangle represents the first-type pixels, and the shaded rectangle represents the second-type pixels. The adjacent pixels of the first-type pixels are all second-type pixels, and the adjacent pixels of the second-type pixels are all first-type pixels.
[0116] S403, based on the adjacent pixels, calculate the texture complexity of each first-type pixel.
[0117] In this embodiment, for each first-type pixel, the texture complexity of the first-type pixel is calculated based on each second-type pixel adjacent to the first-type pixel.
[0118] In this embodiment, the texture complexity is positively correlated with the variance of the adjacent pixels. Specifically, taking a first-type pixel as an example, assuming that the pixel values of the adjacent pixels in the up, down, left and right directions (all of which are second-type pixels) are A, B, C and D respectively, the texture complexity of the first-type pixel is calculated as follows:
[0119]
[0120] S404, replace the least significant bits of the binary pixel values of the first-type pixels with the first ciphertext bit stream in the order of the texture complexity from high to low.
[0121] In this embodiment, after arranging the first-type pixels in the order of the texture complexity from high to low, the least significant bits of the binary pixel values of the first-type pixels are replaced with the first ciphertext bit stream in sequence. The specific steps are as follows:
[0122] A1, convert the pixel values of the first-type pixels into binary form to obtain the binary pixel values of the first-type pixels. For an 8-bit image, the converted binary form has 8 bits.
[0123] A2, replace the least significant bits of the binary pixel values of the first-type pixels with the bits of the first ciphertext bit stream in the order of the texture complexity from high to low. For example, if the information bit to be embedded is 0, replace the least significant bit of the binary pixel value with 0, and if the information bit to be embedded is 1, replace the least significant bit of the binary pixel value with 1.
[0124] A3, convert the modified binary pixel values of the first-type pixels into decimal values to obtain the new pixel values of the first-type pixels.
[0125] For example, if the original pixel value of a first-type pixel is 150, the binary value is 10010110, and if the bit to be embedded is 1, the replaced binary value is 10010111. After converting it back to decimal, the new pixel value is 151, so the essence of embedding information is the change of pixel value.
[0126] Since each pixel only changes the least significant bit of the binary pixel value, the change of each pixel value is at most 1. Assuming that an 8-bit color image with a resolution of 1920*1090 changes each pixel value by 1 after embedding information, the PSNR of the image after embedding information is about 48.13 dB, and the difference between the embedded information image and the original image is almost invisible to the human eye and does not affect the use of the image.
[0127] S405, based on the adjacent pixels, calculate the texture complexity of each second type of pixel.
[0128] In this embodiment, for each second type of pixel, the texture complexity of the second type of pixel is calculated based on each first type of pixel adjacent to the second type of pixel, and the texture complexity is positively correlated with the variance of the adjacent pixels.
[0129] It should be noted that after using the first ciphertext bit stream to replace the least significant bit of the binary pixel value of each first type of target pixel one by one, the texture complexity of each second type of pixel is calculated based on the updated pixel value of the first type of target pixel.
[0130] S406, according to the order of texture complexity from high to low, replace the least significant bit of the binary pixel value of each second type of pixel with the second ciphertext bit stream one by one.
[0131] As can be seen from the above technical solutions, the present scheme preferentially selects a complex texture area for information embedding, thereby improving the image quality and visual effect of the stego image of the target test screenshot. Further, the target test screenshot is divided into first type of pixels and second type of pixels in a uniform checkerboard manner, the texture complexity of the first type of pixels is calculated using the second type of pixels in the first layer embedding, and the first ciphertext bit stream is embedded in the first type of pixels in the order of texture complexity. In the second layer embedding, the texture complexity of the second type of pixels is calculated using the first type of pixels, and the second ciphertext bit stream is embedded in the second type of pixels in the order of texture complexity. Since the information embedding of the first type of pixels and the second type of pixels is independent of each other, after embedding, the change of the first type of pixels has no effect on the texture complexity sorting of the second type of pixels, thereby ensuring that when extracting the context information from the second type of pixels or the first type of pixels, the embedding order can be extracted, thereby improving the extraction accuracy of the test data.
[0132] Based on the above various embodiments, refer to Figure 6 , Figure 6 Another flowchart of a test data processing method provided by the embodiments of the present application is shown, which shows the specific implementation process of the test data processing method in the data traceability stage, as shown in Figure 6As shown, the test data processing method provided by the embodiment of the application can include S601 to S609, which are described in detail as follows.
[0133] S601, in response to reaching a data tracing opportunity, extracting the least significant bits of the binary pixel values of each pixel in the steganographic image attribute embedding region of the target test screenshot according to a preset order to obtain attribute information.
[0134] In this embodiment, the attribute information includes a ciphertext binary bit stream of the context information, that is, the length N of the embedded information.
[0135] In this embodiment, the data tracing opportunity includes receiving a preset tracing instruction or receiving a test exception prompt.
[0136] S602, dividing the pixels in the context embedding region of the target test screenshot into first-type pixels and second-type pixels according to a preset division rule.
[0137] In this embodiment, the division rule of S602 is consistent with that of S402, so as to ensure that the first-type pixels and the second-type pixels obtained by division are strictly and consistently corresponding.
[0138] S603, calculating the texture complexity of each second-type pixel based on adjacent pixels.
[0139] In this embodiment, for each second-type pixel, the texture complexity of the second-type pixel is calculated based on each first-type pixel adjacent to the second-type pixel, and the texture complexity is positively correlated with the variance of the adjacent pixels.
[0140] S604, extracting the least significant bits of the binary pixel values of a target number of second-type pixels in descending order of texture complexity to obtain a second ciphertext bit stream.
[0141] In this embodiment, the target number is N / 2, and the least significant bits of the binary pixel values of each second-type pixel are extracted in descending order of texture complexity until the number of extracted bits is N / 2, to obtain the second ciphertext bit stream.
[0142] S605, calculating the texture complexity of each first-type pixel based on adjacent pixels.
[0143] In this embodiment, for each first-type pixel, the texture complexity of the first-type pixel is calculated based on each second-type pixel adjacent to the first-type pixel, and the texture complexity is positively correlated with the variance of the adjacent pixels.
[0144] S606, extracting the least significant bits of the binary pixel values of a target number of first-type pixels in descending order of texture complexity to obtain a first ciphertext bit stream.
[0145] In this embodiment, the least significant bits of the secondary pixel values of each first type of pixel are extracted in order of texture complexity from high to low until the number of bits extracted is N / 2, obtaining a first ciphertext bit stream.
[0146] S607, sequentially splice the first ciphertext bit stream and the second ciphertext bit stream to obtain a ciphertext binary bit stream.
[0147] S608, decrypt the ciphertext binary bit stream using the key to obtain an original binary bit stream.
[0148] In this embodiment, through the user differentiation scheme, the role definition, key management and access control mechanism ensure that different users can only access the data within their scope of responsibility in the test process, preventing unauthorized operations and information leakage.
[0149] Specifically, the system assigns differentiated permissions according to user roles: test phase automatically generates screenshots and embeds encrypted test information, which does not require user operation and is automatically executed by the automated test script; test analysis personnel have decryption keys and can extract and decrypt embedded information to analyze the root cause of the problem, but have no right to modify or delete original data; system administrators have master keys and global permissions, responsible for key distribution, user permission configuration and system security audit.
[0150] S609, binary decode the original binary bit stream to obtain context information.
[0151] As can be seen from the above technical solution, when test data tracing is needed, the embedded ciphertext binary bit stream is extracted from the steganographic image of the target test screenshot, and the context information is obtained by decoding. Since a double-layer embedding mechanism is used in the embedding stage of the context information, that is, the first ciphertext bit stream is embedded in the first type of pixel in reverse order of texture complexity, and the second ciphertext bit stream is embedded in the second type of pixel in reverse order of texture complexity, the texture complexity of the pixel points is consistent with that during embedding, so the second ciphertext bit stream embedded in the second type of pixel is extracted first, and then the first ciphertext bit stream embedded in the first type of pixel is extracted, thereby ensuring the accuracy of the context information and improving the test data tracing credibility of the automated test.
[0152] Further, the present scheme takes into account the efficiency of automated testing and the strict security management requirements through refined permission control.
[0153] In summary, the test data processing method provided by the embodiments of the present application embeds context information into test screenshots through image information hiding technology while ensuring the image quality of test screenshots, and supports efficient acquisition and security verification.
[0154] Specifically, the context information is encoded and encrypted by an adaptive information hiding algorithm and embedded into the complex texture area of the corresponding test screenshot, realizing end-to-end binding of the context information, eliminating the dependence on external logs or databases, improving data security and ensuring that the image quality is not affected. Further, in the test data traceability stage, the ciphertext data of the embedded context information is extracted from the stego image, and the context information is restored by decryption and decoding.
[0155] Through closed-loop design, the test execution, information embedding and problem diagnosis are seamlessly connected, realizing automatic, secure storage and efficient extraction of test information, without relying on external logs or manual recording, improving the result traceability, efficiency and data security of automated testing.
[0156] As can be seen, the test data processing method provided by the embodiments of the present application solves the core contradiction of the prior art in information capacity, security and compliance.
[0157] In the prior art, the scheme based on metadata annotation is limited by storage capacity (usually ≤64KB) and cannot carry complete test context information, forcing the information to be stored in an external database, resulting in complex system architecture and low query efficiency. For example, when associating screenshots and logs across systems, a mapping relationship needs to be established through a hash value or a unique identifier, increasing the synchronization and maintenance cost. The present scheme directly embeds test information into images through an adaptive image information hiding algorithm, breaking through the metadata capacity limit, deeply binding information and images, and completely eliminating the dependence on external databases. This design simplifies the system architecture and improves the query efficiency, and the tester can directly extract complete information from the image without cross-system operation, significantly shortening the problem positioning time.
[0158] Another defect of the prior art is weak security. The metadata field is not encrypted and stored, and attackers can easily tamper with test parameters, resulting in a decrease in the reliability of test conclusions. Visible watermarks can display information, but unencrypted content can be easily extracted or tampered with. The present scheme uses AES encryption technology to build a double protection: test information is encrypted into ciphertext before embedding, and only authorized personnel can decrypt it through the key; the information hiding algorithm disperses the information into the complex texture area of the image, making it difficult for attackers to locate or tamper with it.
[0159] In terms of compliance, visible watermarks can affect the judgment of test screenshot information by blocking interface elements, and in some cases may need to regenerate screenshots to meet requirements, resulting in increased labor costs and test cycle. The present scheme strictly controls the visual interference of embedding operation through an adaptive information hiding algorithm: the information is replaced in the complex texture area of the image, and the modification value of each pixel is at most 1, so that the peak signal-to-noise ratio (PSNR) of the stego image is ≥48dB, and the human eye cannot perceive the difference. The test screenshot can be directly submitted as a compliance report without additional processing, avoiding the waste of resources caused by repeated testing.
[0160] The present scheme seamlessly integrates the storage, security and use of test information through an end-to-end closed-loop design of "embedding-encryption-decoding". The information embedding module is linked in real time with the automated test tool to realize automatic acquisition and encrypted embedding of test parameters; the decoding module supports one-key extraction of test information, replacing manual recording and cross-system query. This process automation design significantly reduces the cost of human intervention and the error rate of operation.
[0161] In summary, the present scheme solves the core defects of existing technologies from four dimensions of information capacity breakthrough, security mechanism strengthening, compliance guarantee and process automation, and provides an efficient, secure and compliant traceability solution for automated testing.
[0162] The above introduces a test data processing method provided by the embodiments of the present application. The following will introduce a related device for executing the test data processing method.
[0163] Please refer to Figure 7 , Figure 7 FIG. 1 is a structural schematic diagram of a test data processing device provided by an embodiment of the present application. As shown in the figure, the test data processing device 700 includes: Figure 7
[0164] A screenshot unit 701 is configured to generate a target test screenshot in response to a screenshot opportunity of reaching a target test step.
[0165] An information generation unit 702 is configured to obtain a binary bit stream of context information of the target test screenshot.
[0166] An information embedding unit 703 is configured to replace the least significant bits of the binary pixel values of each target pixel in the target test screenshot with the binary bit stream of the context information one by one to obtain a stego image of the target test screenshot, the target pixel being a pixel in a preset context embedding area.
[0167] In a possible implementation, when the information generation unit is configured to obtain the binary bit stream of the context information of the target test screenshot, it is specifically configured to:
[0168] obtaining context information of the target test screenshot;
[0169] binary-encoding the context information to obtain a raw binary bit stream of the context information;
[0170] encrypting the raw binary bit stream based on a preset encryption algorithm to obtain a ciphertext binary bit stream of the context information, the binary bit stream of the context information comprising the ciphertext binary bit stream of the context information.
[0171] In a possible implementation, the information embedding unit is configured to replace the least significant bits of the binary pixel values of each target pixel in the target test screenshot with the binary bit stream of the context information to obtain a stego image of the target test screenshot, and specifically configured to:
[0172] divide the ciphertext binary bit stream of the context information into a first ciphertext bit stream and a second ciphertext bit stream;
[0173] divide the pixels in the context embedding region into first-type pixels and second-type pixels according to a preset division rule, wherein the neighboring pixels of one first-type pixel comprise a plurality of second-type pixels, and the neighboring pixels of one second-type pixel comprise a plurality of first-type pixels;
[0174] calculate the texture complexity of each first-type pixel based on the neighboring pixels, wherein the texture complexity is positively correlated with the variance of the pixel values of the neighboring pixels;
[0175] replace the least significant bits of the binary pixel values of each first-type pixel with the first ciphertext bit stream in the order from high to low according to the texture complexity;
[0176] calculate the texture complexity of each second-type pixel based on the neighboring pixels;
[0177] replace the least significant bits of the binary pixel values of each second-type pixel with the second ciphertext bit stream in the order from high to low according to the texture complexity.
[0178] In a possible implementation, the information embedding unit is further configured to:
[0179] obtain a binary bit stream of attribute information of the target test screenshot, the attribute information comprising the length of the context information;
[0180] replace the least significant bits of the binary pixel values of each attribute pixel with the binary bit stream of the attribute information in the preset order, the attribute pixel being a pixel in a preset attribute embedding region.
[0181] For details, please refer to Figure 8, Figure 8 A structural schematic diagram of a test data processing apparatus is provided for an embodiment of the present application. As shown in the figure, the test data processing apparatus 800 comprises: Figure 8
[0182] An information extraction unit 801 is configured to, in response to reaching a data tracing opportunity, extract the least significant bits of the binary pixel values of each target pixel from the stego image of a target test screenshot, to obtain a binary bit stream of context information of the target test screenshot, the target pixel being a pixel in a preset context embedding region.
[0183] An information analysis unit 802 is configured to obtain the context information of the target test screenshot based on the binary bit stream of context information.
[0184] In a possible implementation, the information extraction unit is further configured to:
[0185] extract the least significant bits of the binary pixel values of each attribute pixel in an attribute embedding region of the stego image of the target test screenshot in a preset order, to obtain attribute information, the attribute information comprising the length of the context information.
[0186] In a possible implementation, when the information extraction unit is configured to extract the least significant bits of the binary pixel values of each target pixel from the stego image of a target test screenshot, to obtain a binary bit stream of context information of the target test screenshot, the information extraction unit is specifically configured to:
[0187] divide the pixels in the context embedding region into first-type pixels and second-type pixels according to a preset division rule;
[0188] calculate the texture complexity of each second-type pixel based on adjacent pixels, the texture complexity being positively correlated with the pixel value variance of adjacent pixels;
[0189] extract the least significant bits of the binary pixel values of a target number of second-type pixels in order of texture complexity from high to low, to obtain a second bit stream, wherein the target number is 1 / 2 of the length of the context information;
[0190] calculate the texture complexity of each first-type pixel based on adjacent pixels;
[0191] extract the least significant bits of the binary pixel values of the target number of first-type pixels in order of texture complexity from high to low, to obtain the first bit stream;
[0192] concatenate the first bit stream and the second bit stream in sequence, to obtain the binary bit stream of context information of the target test screenshot.
[0193] In a possible implementation, when the information parsing unit is configured to obtain the context information of the target test screenshot based on the binary bit stream of the context information, it is specifically configured to:
[0194] If the binary bit stream is a ciphertext binary bit stream, decrypting the ciphertext binary bit stream to obtain an original binary bit stream;
[0195] The original binary bit stream is binary-decoded to obtain context information of the target test screenshot.
[0196] An electronic device is also provided in an embodiment of the present application. Figure 9 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 9 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0197] like Figure 9 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 902 or programs loaded from a storage device 908 into a random access memory (RAM) 903. When the electronic device is powered on, the RAM 903 also stores various programs and data required for the operation of the electronic device. The processing device 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0198] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a memory card, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 9 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0199] The embodiment of the present application further provides a computer program product comprising computer readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the test data processing methods provided by the embodiments of the present application.
[0200] The embodiment of the present application further provides a computer readable storage medium, which carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement any of the test data processing methods provided by the embodiments of the present application.
[0201] In addition, it should be noted that the above-described apparatus embodiments are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. In addition, in the apparatus embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.
[0202] Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software and necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure for implementing the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better embodiment. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including a plurality of instructions to make a computer device (which can be a personal computer, training device, or network device, etc.) execute the methods described in various embodiments of the present application.
[0203] In the above embodiments, all or part can be realized by software, hardware, firmware or any combination thereof. When realized by software, it can be realized in the form of a computer program product in whole or in part.
[0204] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be stored by the computer or a data storage device such as a training device, a data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
Claims
1. A method of processing test data, characterized by, The method comprises the following steps: in response to reaching a screenshot opportunity of a target test step, generating a target test screenshot; obtaining a binary bit stream of context information of the target test screenshot; using the binary bit stream of the context information to replace the least significant bits of the binary pixel values of each target pixel in the target test screenshot one by one, to obtain a steganographic image of the target test screenshot, the target pixel being a pixel in a preset context embedding area.
2. The method of processing test data according to claim 1, wherein, The method of obtaining the binary bit stream of the context information of the target test screenshot comprises: obtaining context information of the target test screenshot; binary encoding the context information to obtain an original binary bit stream of the context information; encrypting the original binary bit stream based on a preset encryption algorithm to obtain a ciphertext binary bit stream of the context information, the binary bit stream of the context information comprising the ciphertext binary bit stream of the context information.
3. The method of processing test data according to claim 2, wherein, The method of using the binary bit stream of the context information to replace the least significant bits of the binary pixel values of each target pixel in the target test screenshot one by one to obtain a steganographic image of the target test screenshot comprises: dividing the ciphertext binary bit stream of the context information into a first ciphertext bit stream and a second ciphertext bit stream; dividing the pixels in the context embedding area into first-type pixels and second-type pixels according to a preset division rule, the neighboring pixels of one first-type pixel comprising multiple second-type pixels, and the neighboring pixels of one second-type pixel comprising multiple first-type pixels; calculating the texture complexity of each first-type pixel based on the neighboring pixels, the texture complexity being positively correlated with the pixel value variance of the neighboring pixels; replacing the least significant bits of the binary pixel values of each first-type pixel one by one using the first ciphertext bit stream in the order of the texture complexity from high to low; calculating the texture complexity of each second-type pixel based on the neighboring pixels; replacing the least significant bits of the binary pixel values of each second-type pixel one by one using the second ciphertext bit stream in the order of the texture complexity from high to low.
4. The method of claim 1, wherein, The method further comprises: obtaining a binary bit stream of attribute information of the target test screenshot, the attribute information comprising the length of the context information; replacing the least significant bits of the binary pixel values of each attribute pixel one by one using the binary bit stream of the attribute information in a preset order, the attribute pixel being a pixel in a preset attribute embedding area.
5. A method of processing test data, characterized by, The method comprises the following steps: in response to reaching a data tracing opportunity, extracting the least significant bits of the binary pixel values of each target pixel one by one from the steganographic image of the target test screenshot to obtain a binary bit stream of context information of the target test screenshot, the target pixel being a pixel in a preset context embedding area; obtaining the context information of the target test screenshot based on the binary bit stream of the context information.
6. The method of processing test data according to claim 5, wherein, The method further comprises: extracting the least significant bits of the binary pixel values of each attribute pixel in the attribute embedding area of the steganographic image of the target test screenshot in a preset order to obtain attribute information, the attribute information comprising the length of the context information.
7. The method of claim 5, wherein, The least significant bits of the binary pixel values of the target pixels in the stego image of the target test screenshot are extracted one by one to obtain a binary bit stream of the context information of the target test screenshot, including: According to a preset division rule, the pixels in the context embedding area are divided into first-type pixels and second-type pixels; Based on the adjacent pixels, the texture complexity of each second-type pixel is calculated, and the texture complexity is positively correlated with the pixel value variance of the adjacent pixels; According to the order from high to low of the texture complexity, the least significant bits of the binary pixel values of the target number of second-type pixels are extracted to obtain a second bit stream, wherein the target number is 1 / 2 of the length of the context information; Based on the adjacent pixels, the texture complexity of each first-type pixel is calculated; According to the order from high to low of the texture complexity, the least significant bits of the binary pixel values of the target number of first-type pixels are extracted to obtain the first bit stream; The first bit stream and the second bit stream are spliced in sequence to obtain the binary bit stream of the context information of the target test screenshot.
8. The method of processing test data according to claim 7, wherein, The binary bit stream of the context information is used to obtain the context information of the target test screenshot, including: If the binary bit stream is a ciphertext binary bit stream, the original binary bit stream is obtained by decrypting the ciphertext binary bit stream; The original binary bit stream is binary decoded to obtain the context information of the target test screenshot.
9. A processing device of test data, characterized by, It includes: A screenshot unit is configured to generate a target test screenshot in response to a screenshot opportunity of reaching a target test step; An information generation unit is configured to obtain a binary bit stream of context information of the target test screenshot; An information embedding unit is configured to replace the least significant bits of the binary pixel values of each target pixel in the target test screenshot with the binary bit stream of the context information one by one to obtain a stego image of the target test screenshot, the target pixel being a pixel in a preset context embedding area.
10. A processing device of test data, characterized by, It includes: An information extraction unit is configured to extract the least significant bits of the binary pixel values of each target pixel from a stego image of a target test screenshot one by one in response to a data tracing opportunity to obtain a binary bit stream of context information of the target test screenshot, the target pixel being a pixel in a preset context embedding area; An information analysis unit is configured to obtain the context information of the target test screenshot based on the binary bit stream of the context information.