Automatic testing method, system and equipment based on protocol configuration table and medium
By adopting an automated testing method based on protocol configuration tables, the adaptation problem of automated testing in the game industry is solved, achieving accurate and efficient game problem detection and root cause localization, improving testing quality and efficiency, adapting to the complex and ever-changing protocol structure of games, dynamically adjusting the test order to discover high-risk paths, and optimizing test path selection.
Patent Information
- Application Number
- CN202511218707.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-12-05
AI Technical Summary
Existing automated testing technologies lack deep adaptation in the gaming industry, making it difficult to capture anomalies in games, resulting in poor testing performance, high development costs, and impacting development progress and testing quality.
An automated testing method based on protocol configuration tables captures communication data packets between the game client and the server, uses a Hidden Markov Model to parse the protocol format, builds an automated testing robot, integrates OpenCV and PaddleOCR for image and text recognition, and combines intelligent decision-making algorithms to optimize the test order and locate the root cause of problems.
It achieves accurate and efficient detection throughout the entire automated game testing process, reducing the cost and error of manual testing, improving testing quality and efficiency, accurately parsing game communication protocols, fully covering user operation processes, improving the quality of interface and text content, dynamically adjusting the test order to discover potential problems, and quickly locating and fixing them.
Smart Images

Figure CN121077947A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of game testing, and in particular to an automatic testing method and system based on a protocol configuration table, a device and a medium. BACKGROUND
[0002] In the game development process, function optimization and adjustment are frequent and necessary links. In order to ensure the stability and reliability of game functions, comprehensive regression testing is required after each function update. However, the current game industry faces many challenges in automated testing.
[0003] The existing automatic testing technical solution has obvious limitations. On the one hand, most automatic testing technologies are mainly for the IT industry, and lack of depth adaptation to the characteristics of the game industry. Games have unique interaction logic, complex interface elements, and real-time communication mechanisms with high requirements. The automatic testing solution of the IT industry cannot be directly applied to the game testing scenario, and cannot effectively capture various abnormal situations in the game, such as skill icon display abnormalities, task text typos, etc., resulting in poor testing results and difficulty in meeting the precise needs of game testing.
[0004] On the other hand, the current development mode of automatic testing cases has significant drawbacks. If the programmer completes the development of the test case based on the automatic testing framework, although it is technically feasible, it will increase the development workload of the research and development side. The research and development personnel need to invest a lot of time and effort in test case writing, which undoubtedly disperses their focus on the development of the core functions of the game, affecting the overall development progress. If the test case development is completed by the test personnel, due to the uneven technical ability of the test personnel and the high overall technical requirements, the development cost will increase significantly. At the same time, due to technical limitations, test personnel may not be able to develop efficient and comprehensive test cases, further affecting the quality of testing. SUMMARY
[0005] The present application relates to the technical field of game testing, and in particular to an automatic testing method and system based on a protocol configuration table, a device and a medium.
[0006] In the first aspect, the present application provides an automatic testing method based on a protocol configuration table, which specifically comprises: grabbing communication data packets between a game client and a game server; using a protocol format reasoning algorithm based on a hidden Markov model to analyze the communication data packets, identify the meaning of the protocol field, and automatically generate a protocol configuration table; An automated testing robot is constructed to perform protocol-level testing based on a protocol configuration table simulating player behavior; During the process of the automated testing robot performing protocol-level testing, OpenCV is integrated for image matching to detect abnormal display of skill icons, and PaddleOCR is used for Chinese text recognition to detect errors in task text, thereby obtaining multi-modal detection results; Based on the protocol configuration table and the execution state of the testing robot, in the copy test, an intelligent decision algorithm is used to preferentially explore high-risk branch paths and dynamically adjust the test order; According to the results of the protocol-level test and the multi-modal detection results, a defect root cause analysis engine is constructed, and in combination with protocol data, game state data and system logs, the root cause of the problem is automatically located and output.
[0007] In a second aspect, the present application provides an automated testing system based on a protocol configuration table, which specifically comprises: A first testing module is used to capture communication data packets between a game client and a game server; A second testing module is used to use a protocol format reasoning algorithm based on a hidden Markov model to analyze the communication data packets, identify the meanings of the protocol fields, and automatically generate a protocol configuration table; A third testing module is used to construct an automated testing robot to perform protocol-level testing based on the protocol configuration table simulating player behavior; A fourth testing module is used to integrate OpenCV for image matching to detect abnormal display of skill icons and use PaddleOCR for Chinese text recognition to detect errors in task text during the process of the automated testing robot performing protocol-level testing, thereby obtaining multi-modal detection results; A fifth testing module is used to use an intelligent decision algorithm to preferentially explore high-risk branch paths and dynamically adjust the test order in the copy test based on the protocol configuration table and the execution state of the testing robot; A sixth testing module is used to construct a defect root cause analysis engine according to the results of the protocol-level test and the multi-modal detection results, and in combination with protocol data, game state data and system logs, the root cause of the problem is automatically located and output.
[0008] In a third aspect, the present application provides a computer device, which comprises a memory and a processor and a computer program stored in the memory, when the computer program is executed on the processor, the protocol configuration table-based automated testing method is realized as described in any one of the above methods.
[0009] In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the protocol configuration table based automatic testing method according to any one of the above methods.
[0010] Compared with the prior art, the present application has at least one of the following technical effects: 1. The present application realizes the whole process of automatic game testing, accurately and efficiently detects game problems and locates the root cause, reduces the cost and error of manual testing, and improves the quality and efficiency of game testing.
[0011] 2. The present application accurately analyzes the game communication protocol, automatically generates a protocol configuration table, and provides an accurate basis for subsequent automatic testing, which adapts to the complex and variable protocol structure of the game.
[0012] 3. The present application simulates player behavior to perform protocol level testing, completely covers user operation flow, and accurately verifies the processing logic of the game server for various protocol messages.
[0013] 4. The present application integrates image matching and text recognition technology, comprehensively detects game skill icon display and task text errors, and improves the quality of game interface and text content.
[0014] 5. The present application dynamically adjusts the test order in the copy test, preferentially explores high-risk paths, improves the test efficiency, and more effectively discovers potential problems.
[0015] 6. The present application accurately calculates the expected value of test actions by considering multiple factors, provides a reliable basis for intelligent decision-making, and optimizes the selection of test paths.
[0016] 7. The present application automatically locates the root cause of the problem in combination with multiple source data and outputs a structured report, which helps developers quickly understand and solve problems, and shortens the problem repair cycle. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0018] Figure 1 is a flowchart of a protocol configuration table based automatic testing method provided by an embodiment of the present application; Figure 2 is a structural schematic diagram of a protocol configuration table based automatic testing system provided by an embodiment of the present application; Figure 3is a structural schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0019] In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular sequences of steps, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, devices, circuits, and
[0020] It is to be understood that the terminology "includes", "has", "holds", "contains" or "comprises", "comprising", or "including" when used in this specification and in the following claims, specifies the presence of stated features, integers, steps, operations, elements, or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof.
[0021] It is also to be understood that the terminology "and / or" when used in this specification and in the following claims, refers to at least one of the items, or any combination of the items, or all of the items listed together.
[0022] As used in this specification and in the claims, the terms "if" and "when" can each be interpreted to mean "upon" or "in response to a determination" or "in response to a detection" depending on the context. Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can each be interpreted to mean "upon determining" or "in response to a determination" or "upon detecting [the described condition or event]" or "in response to a detection [of the described condition or event]" depending on the context.
[0023] In addition, the terms "first", "second", "third", etc. in the description of the present application and the following claims are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.
[0024] Reference in the specification to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in one embodiment" or "in some embodiments" in various places in the specification are not necessarily all referring to the same embodiment, although it can. The terms "comprise", "comprising", "have", "having", "include", "including", and "contain", "containing" or variants thereof, mean "including but not limited to", unless otherwise indicated by the context.
[0025] In the embodiments of the present application, the execution subject of the flow includes a terminal device. The terminal device includes but is not limited to a server, a computer, a smart phone, a tablet computer and other devices capable of executing the method disclosed in the present application. Figure 1 The flowchart of the protocol configuration table-based automatic test method disclosed in an embodiment of the present application is shown, and the details are as follows: S101, capturing communication data packets between the game client and the game server.
[0026] In the present embodiment, the packet capturing tool is installed on a device in the same network environment as the game client and the game server. The device can be a separate test server or a local computer with sufficient performance. After installation, the packet capturing tool is configured as necessary, and the filtering rules are set to accurately capture the game-related communication data packets. Specifically, according to the network protocol type (such as TCP, UDP, etc.) and communication port number used by the game client and server, the corresponding filtering conditions are configured in the packet capturing tool to ensure that only the data packets closely related to game interaction are captured, avoiding capturing a large amount of irrelevant network data, thereby improving the efficiency of subsequent processing and analysis.
[0027] Start the packet capturing tool and put it in a listening state. At the same time, perform a series of preset game operations on the game client. These operations should cover various common function scenarios in the game, such as character movement, skill release, task interaction, item transaction, etc. During the execution of operations on the game client, the packet capturing tool will capture the data packets transmitted between the client and the server in real time. These data packets contain various information triggered by game operations, such as operation instructions, state feedback, data updates, etc. The packet capturing tool will store the captured data packets in chronological order, usually in a specific file format (such as pcap format) saved to the local disk for subsequent detailed analysis and processing.
[0028] In order to ensure that the captured data packets are complete and accurate, the running state of the packet capturing tool needs to be closely monitored during the entire packet capturing process. Check if there is any data packet loss. If data packet loss is found, analyze the possible reasons, such as network congestion, improper configuration of the packet capturing tool, etc., and adjust and optimize in time. For example, if network congestion is suspected to cause data packet loss, you can try to adjust the network bandwidth settings or optimize the network topology; if it is a configuration problem of the packet capturing tool, recheck and correct the filtering rules and other configuration parameters.
[0029] In addition, in order to further improve the accuracy and comprehensiveness of data packet capture, multiple packet capturing methods can be used. In different time periods and different network environments, the above game operations are repeatedly performed and data packets are captured. By comparing and analyzing the multiple captured data packets, some abnormal situations or special data that may be missed in a single packet capturing process can be found, so that the communication mode and data characteristics between the game client and the server can be more comprehensively understood.
[0030] In S102, a protocol format inference algorithm based on a hidden Markov model is used to analyze the communication data packets, identify the meanings of the protocol fields, and automatically generate a protocol configuration table.
[0031] In this embodiment, representative data packet samples are selected from the previously captured communication data packet set between the game client and the game server. These samples cover the communication conditions of the game in different functional scenarios, such as character login, skill release, item transaction, task interaction, etc., to ensure that the characteristics of the game communication protocol can be comprehensively analyzed.
[0032] An initial hidden Markov model is constructed. In this model, a set of hidden states is defined, which represent different types or states of protocol fields, such as start, middle, and end states of fields, or different data type field states (such as integer type, string type, etc.). The number and type of specific hidden states can be set according to preliminary analysis of the game protocol and experience. A set of observations is determined, which are information that can be directly observed from the data packets, usually in the form of bytes or byte combinations. For example, the value of each byte can be taken as an observation, or a specific pattern composed of several consecutive bytes can be taken as an observation. The parameters of the model are initialized, including the initial state probability distribution, the state transition probability matrix, and the observation probability matrix. The initial state probability distribution represents the probability of the model being in each hidden state at the beginning; the state transition probability matrix describes the probability of transitioning from one hidden state to another; and the observation probability matrix represents the probability of observing a specific observation in a certain hidden state. The initial values of these parameters can be set according to some general probability distribution assumptions, such as uniform distribution, which will be optimized and adjusted through training data later.
[0033] The initial hidden Markov model is trained using the preprocessed packet samples. Classic hidden Markov model training methods such as the forward-backward algorithm or the Baum-Welch algorithm are used to iteratively optimize the model's parameters. During training, the observation value sequences in the packet samples are input into the model, the probability of the model generating these observation value sequences is calculated, and the model's parameters are adjusted according to the maximum likelihood estimation principle to maximize the probability of the model generating a given observation value sequence. After multiple iterations of training, the model's parameters converge or reach a preset number of iterations, resulting in a hidden Markov model that can better fit the characteristics of the game protocol data. To evaluate the performance of the trained model, a portion of independent packet samples can be used as a test set. Calculate the log-likelihood value and other indicators of the model on the test set. If the log-likelihood value is high, it means that the model fits the test data well and the model's performance is better; on the contrary, if the log-likelihood value is low, the model's parameters may need to be further adjusted or the number of training data increased, and the training optimization needs to be re-performed.
[0034] The trained hidden Markov model is used to analyze the preprocessed communication packets. Starting from the beginning of the packet, an initial hidden state is selected according to the initial state probability distribution of the model, and then the most likely hidden state at each position in the packet is inferred step by step according to the state transition probability matrix and the observation probability matrix. When the hidden state representing the start of a field is recognized, the relevant information of the field is recorded. With the analysis of the subsequent bytes, the middle and end parts of the field are determined according to the change of the hidden state. During the analysis process, the value of the field is decoded and processed according to the field type represented by the hidden state. For example, if the hidden state indicates that the field is an integer type, the corresponding byte sequence is converted according to the encoding rules of the integer to obtain the actual integer value; if the hidden state indicates that the field is a string type, the byte sequence is converted into a string according to a specific character encoding (such as UTF-8). In this way, each protocol field in the packet is parsed in turn, and the position, type, and value of each field are recorded.
[0035] After the analysis of the communication data packet and the identification of the protocol field, a protocol configuration table is automatically generated according to the parsed information. The protocol configuration table can be organized in the form of a table, where each row represents a protocol field and each column records the relevant attributes of the field, such as field name, field type, field length, field offset in the data packet, field value range, etc. The field name can be named according to the design specification of the game protocol or the actual business meaning, so as to facilitate subsequent understanding and use. The field type and length are filled in according to the field type determined in the parsing process and the actual number of bytes occupied. The field offset in the data packet records the byte offset of the field relative to the starting position of the data packet, which facilitates quick positioning and access to the field in subsequent testing. The field value range can be set according to the analysis of the game protocol and the statistics of the actual data, which is used to verify the legality of the field value. Fill all the protocol field information obtained by parsing into the protocol configuration table according to the above rules, and arrange and check the configuration table to ensure that the information in the table is accurate, complete and consistent. The finally generated protocol configuration table will provide an important basis and reference for the subsequent automatic test robot to simulate player behavior and perform protocol-level testing.
[0036] In this embodiment, the protocol format reasoning algorithm based on hidden Markov model can effectively analyze the communication data packet between the game client and the server, identify the protocol field meaning, and automatically generate accurate and detailed protocol configuration table, providing strong support for game automation testing.
[0037] S103, an automatic test robot is constructed, which simulates player behavior based on the protocol configuration table to perform protocol-level testing.
[0038] In this embodiment, the overall architecture of the automatic test robot is determined. A layered architecture design is adopted, which divides the robot into interface layer, logic processing layer and execution layer. The interface layer is responsible for communication with the game client and the server, realizing the functions of sending and receiving data. It needs to be able to simulate the game client to send various protocol requests to the server, receive the response data returned by the server, and pass these data to the logic processing layer. The logic processing layer is the core part of the robot, which generates specific test instructions and parameters according to the protocol configuration table and the preset test strategy. This layer needs to parse the protocol configuration table, understand the meaning and value range of each protocol field, so as to be able to reasonably construct test data. The execution layer is responsible for converting the test instructions generated by the logic processing layer into actual network communication operations, interacting with the game server through the interface layer, simulating various behaviors of the player.
[0039] Integrate the protocol configuration table into the automated test robot. The protocol configuration table is stored in a specific data format, such as JSON, XML, or CSV. When the robot starts, read the protocol configuration table file and load it into memory to build a data structure that is convenient to query and use. For example, you can use a dictionary or hash table to store the information of the protocol fields, using the field name as the key and the detailed properties of the field (such as type, length, value range, etc.) as the value. Verify the validity of the protocol configuration table. Check whether the field information in the protocol configuration table is complete and accurate, and whether the logical relationship between fields is correct. For example, verify whether the value range of a certain protocol field meets the actual needs of the game business, and whether the dependency relationship between fields is correctly reflected in the configuration table. If there are problems with the protocol configuration table, correct or regenerate it in a timely manner to ensure that the robot can test based on correct protocol information.
[0040] According to the functions and business logic of the game, design a comprehensive player behavior simulation strategy. Player behavior can be divided into basic behavior and complex behavior. Basic behavior includes character login, logout, movement, attack, use of items, etc. These behaviors are the most common operations in the game. Complex behavior is composed of multiple basic behaviors, such as completing a task that requires the character to move to a specified location, talk to NPCs, accept tasks, collect items, return to hand in tasks, etc.
[0041] Define detailed operation steps and parameters for each player behavior. For example, for the character login behavior, you need to specify the login account, password, server address, etc. For the movement behavior, you need to determine the target coordinates and movement speed, etc. At the same time, consider the randomness and diversity of player behavior, and introduce certain random factors in the simulation process to make the test more close to the real player's operation habits. For example, when the character moves, you can randomly change the direction and speed of movement to increase the coverage of the test.
[0042] Based on the protocol configuration table and player behavior simulation strategy, specific test instructions are generated in the logical processing layer. For each player behavior, the protocol request and corresponding protocol field values that need to be sent are determined according to the protocol configuration table. For example, when simulating the login behavior of a role, the relevant information of the login protocol is found in the protocol configuration table, including the format of the protocol, the field name and meaning, etc. Then, according to the login account, password and other parameters defined in the player behavior simulation strategy, the login protocol is filled into each field to generate a complete login protocol request data. The legality of the generated test instructions is checked. Check if the values of the protocol fields are within the specified value range, and if the logical relationship between the fields is correct. For example, if a protocol field represents the level of a role, its value range should be 1-100, so when generating test instructions, it is necessary to ensure that the value of this field is within this range. If there is a problem with the test instructions, adjust and correct them in time to avoid sending invalid or incorrect requests to the server.
[0043] The execution layer sends the test instructions generated by the logical processing layer to the game server through the interface layer. When sending the request, the test instructions are encapsulated and encoded according to the requirements of the game communication protocol to ensure that the server can correctly parse and process them. At the same time, the sending time and related parameters of each request are recorded to facilitate subsequent analysis of test results and problem positioning.
[0044] The response data returned by the game server is received and passed to the logical processing layer. The logical processing layer parses the response data and extracts key information such as whether the operation was successful, the error code returned, the game resources obtained, etc. according to the protocol configuration table. The parsed response data is compared with the expected results to determine whether the test passed. If the test does not pass, detailed error information is recorded, including request parameters, response data, error causes, etc., to provide a basis for subsequent defect analysis and repair.
[0045] During the execution of the protocol-level test by the automated test robot, the test process is monitored in real time. The monitoring indicators include the execution time of the test instructions, the response time of the server, the test pass rate, etc. Through real-time monitoring, abnormal situations that occur during the test process, such as test instruction execution timeout, server non-response, etc. are discovered in time, and appropriate measures are taken to handle them, such as resending the request or terminating the test. Detailed test logs are recorded, including test start time, end time, execution of each test instruction, server response data, test results, etc. Test logs can be stored in the form of text files or databases, facilitating subsequent queries and analysis. Through analysis of the test logs, the coverage of the test can be understood, potential problems and trends can be discovered, and references for the optimization and adjustment of game functions can be provided.
[0046] In this embodiment, the automated testing robot can be successfully constructed, and the protocol level test can be performed based on the protocol configuration table and the simulation of player behavior, thereby effectively improving the efficiency and accuracy of game testing, and ensuring the stability and reliability of game functions.
[0047] In S104, during the execution of the protocol level test by the automated testing robot, OpenCV is integrated for image matching to detect abnormal display of skill icons, and PaddleOCR is used for Chinese text recognition to detect errors in task text, thereby obtaining multi-modal detection results.
[0048] In this embodiment, OpenCV and PaddleOCR related software libraries are installed in the server or local testing environment where the automated testing robot runs.
[0049] Collect standard image samples of all skill icons in the game, and store these samples in a specific folder to provide a reference for subsequent image matching. At the same time, organize common task text content in the game to build a text corpus for training the recognition model of PaddleOCR, and place the related model files and configuration files in the appropriate path for easy calling by the robot during runtime.
[0050] During the execution of the protocol level test by the automated testing robot, when skill-related operations (such as releasing skills, viewing skill panels, etc.) are involved, the robot uses the interactive interface with the game client to trigger the screenshot function of the game client, or directly accesses the rendering buffer of the game client to obtain the image data of the current game interface. Save the captured image in a specified format (such as PNG, JPEG, etc.), and record the time of the screenshot and the corresponding skill operation information for subsequent tracing and analysis. Preprocess the captured game interface image to improve the accuracy of image matching. Use the image processing functions provided by OpenCV to perform grayscale processing on the image, convert the color image to a grayscale image, and reduce the color information interference. Then, perform denoising on the grayscale image using methods such as Gaussian filtering or median filtering to remove noise points in the image and make the image smoother. Next, according to the position and size characteristics of the skill icons in the game interface, perform cropping and scaling operations on the image to extract the region containing the skill icons and adjust them to a uniform size for matching with the standard skill icon samples.
[0051] Load the prepared standard skill icon samples, use feature extraction algorithms in OpenCV (such as SIFT, SURF or ORB, etc.) to extract the feature points of the standard icons and the skill icons in the image to be detected. Then, use feature matching algorithms (such as FLANN or BFMatcher, etc.) to match the extracted feature points, calculate the number of matched feature points and the matching degree. According to the preset matching threshold, determine whether the skill icon in the image to be detected matches the standard icon. If the matching degree is lower than the threshold, it is considered that the skill icon display is abnormal, and the abnormal information is recorded, including the name, location, screenshot time and matching degree of the abnormal icon and other detailed data.
[0052] In the captured game interface image, according to the display characteristics of the task text (such as fixed position, specific font and color, etc.), use OpenCV image processing technology to locate the area where the task text is located. The text area can be separated from the background image by color threshold segmentation, edge detection, etc. Then, perform morphological processing (such as dilation, erosion, etc.) on the separated text area to optimize the shape and boundary of the text area, making it more regular and clear. The located task text area image is input into PaddleOCR for Chinese text recognition. PaddleOCR will detect and recognize the text in the image and output the recognition result. During the recognition process, PaddleOCR will use its pre-trained model to extract and classify the features of the text, converting the text in the image into a computer-processed string. In order to improve the accuracy of recognition, the recognition parameters of PaddleOCR can be adjusted according to the characteristics of the game task text, such as setting the recognition language to Chinese, adjusting the recognition threshold, etc. Compare the task text recognized by PaddleOCR with the pre-processed task text corpus. Use string matching algorithms (such as Levenshtein distance algorithm) to calculate the similarity between the recognized text and the standard text in the corpus. According to the preset similarity threshold, determine whether there are errors in the recognized text. If the similarity is lower than the threshold, it is considered that there may be errors in the recognized text, and further analysis and judgment are made on the difference part to determine whether it is a real error. Record the detected error information, including the task name, location, recognized text, standard text and similarity of the error, and other detailed data.
[0053] Integrate the skill icon display abnormal information detected by image matching and the task text error information detected by Chinese text recognition. Assign a unique identifier to each detected abnormality, associate the related abnormal information (such as abnormal type, detailed description, screenshot or text area image, occurrence time, etc.) to form a complete abnormal report.
[0054] In this embodiment, during the execution of the protocol-level test by the automated test robot, OpenCV can be effectively integrated for image matching detection skill icon display abnormalities, and PaddleOCR can be used for Chinese text recognition detection task text errors, to obtain accurate multi-modal detection results, providing strong support for game function testing and quality assurance.
[0055] S105, based on the protocol configuration table and the execution state of the test robot, in the copy test, the high-risk branch path is preferentially explored by intelligent decision algorithm, and the test order is dynamically adjusted.
[0056] In this embodiment, the protocol configuration table contains various protocol field information for communication between the game client and the server, which reflects the interaction logic of the game in different states. According to past test experience, game design documents and common problem statistics, each protocol path in the protocol configuration table is risk assessed and labeled. For example, some protocol paths related to key game mechanisms (such as character leveling, equipment strengthening) or complex interactions (such as team cooperation in multi-player copies, monster skill release and player response) are labeled as high-risk paths due to their complexity and importance; while some simple interface operations (such as opening the backpack, viewing the task list) related protocol paths are labeled as low-risk paths. The labeling results are recorded in the extended fields of the protocol configuration table in a specific format for subsequent intelligent decision algorithm calls.
[0057] A state monitoring module is built in the automated test robot. This module is responsible for collecting various state information of the test robot during the execution of the copy test, including but not limited to the current executed protocol path, the number of executed test steps, the test time consumption, resource occupation (such as memory, CPU usage), network delay, etc. Through the establishment of a special communication interface between the game client and the test robot, or the use of hook functions provided by the test framework, these state data are obtained in real time and stored in the test robot's memory database or temporary files, ensuring the timeliness and accuracy of the data.
[0058] The current copy test involves all protocol paths and their corresponding risk levels are read from the protocol configuration table, and the current test execution state data is obtained from the state monitoring module of the test robot. These data are preprocessed, such as converting the risk level to a numerical form (e.g. high risk is 3, medium risk is 2, and low risk is 1), and normalizing the test time consumption, resource occupation and other data to be within a unified numerical range, so as to facilitate subsequent algorithm calculation and analysis. Based on the integrated and preprocessed data, a risk assessment model is constructed. The model considers the inherent risk level of the protocol path and the real-time execution state of the test robot, and dynamically assesses the risk of each unexecuted protocol path. For example, if the current test robot has high resource occupation (such as memory close to full load), and the protocol path being executed is associated with a high-risk path, the dynamic risk score of the high-risk path will be further increased. Conversely, if the test robot has low network delay and has successfully executed multiple related protocol paths, the dynamic risk score of some originally labeled high-risk paths may be appropriately reduced. In this way, the risk assessment model can more accurately reflect the actual risk level of each protocol path in the current test environment. According to the dynamic risk score of each unexecuted protocol path calculated by the risk assessment model, all unexecuted protocol paths are prioritized. In descending order, the protocol path with the highest dynamic risk score is placed at the front as the target path for priority exploration. In this way, the test robot can prioritize high-risk branch paths for testing, discover potential problems as soon as possible, and improve test efficiency and problem discovery rate.
[0059] After each test step is executed, the intelligent decision algorithm updates the test plan of the test robot in real time according to the current protocol path priority ranking result. The test plan contains the originally preset test path order and steps, which are compared and adjusted with the new priority ranking result to insert high-priority protocol paths into the appropriate position of the current test plan, ensuring that the test robot can execute the test according to the new order. At the same time, the related dependencies and prerequisites in the test plan are checked and adjusted to avoid the test from not being able to proceed normally due to changes in the test order.
[0060] The test robot continues to perform the copy test according to the updated test plan. During the test execution, the state monitoring module continuously collects the state information of the test robot and feeds it back to the intelligent decision algorithm. The intelligent decision algorithm re-evaluates the risk level of the unexecuted protocol path based on the real-time feedback of the state information, and dynamically adjusts the path priority ranking and the test plan. For example, if it is found during the test that a path originally marked as medium risk actually has a higher risk due to special circumstances of the current test environment (such as specific network fluctuations, specific role state combinations), the intelligent decision algorithm will promptly raise its priority and adjust the test plan to make it be executed as soon as possible. Through this dynamic adjustment mechanism, it ensures that the test process is always focused on high-risk branch paths, improving the relevance and effectiveness of the test.
[0061] After the copy test is completed, all data during the test process are recorded in detail, including the execution of each protocol path (success, failure, exception type, etc.), the adjustment record of the test order, the state change of the test robot, etc. Analyze these recorded data to summarize the problem distribution in the test process, the actual problem occurrence rate of high-risk paths, etc. According to the analysis results, further optimize the risk annotation of the protocol configuration table, the parameters and logic of the intelligent decision algorithm, and provide more accurate decision basis for subsequent copy tests, and continuously improve the quality and efficiency of automated testing.
[0062] In this embodiment, based on the protocol configuration table and the execution state of the test robot, the implementation scheme of dynamically adjusting the test order by exploring high-risk branch paths through the intelligent decision algorithm in the copy test can effectively improve the efficiency and problem discovery ability of game copy testing, and provide strong guarantee for the stability and reliability of game functions.
[0063] S106, according to the results of the protocol-level test and the multi-modal detection results, a defect root cause analysis engine is constructed, which automatically locates and outputs the root cause of the problem in combination with protocol data, game state data and system logs.
[0064] In this embodiment, after the automated test robot completes the protocol-level test, it will generate a detailed test result report. This report covers the interaction of each protocol field, including the data content sent and received, whether the data format meets the expectations, whether the protocol execution process is correct, etc. For example, in the role login protocol test, it will record the authentication information such as username and password sent by the client, as well as the status code and related information returned by the server indicating login success or failure. At the same time, it will also record the timestamps during the protocol execution process to analyze the timeliness of the protocol execution. These test result data will be stored in a special database to provide basic data support for defect root cause analysis.
[0065] During the execution of protocol-level test processes by automated testing robots, the integrated OpenCV image matching and PaddleOCR Chinese text recognition tools perform real-time skill icon display anomaly detection and task text error detection, and generate corresponding detection result reports. The image matching results record the position, size, color, and other characteristic information of the skill icon, as well as the similarity comparison data with the expected icon. If the similarity is lower than the preset threshold, it is determined that the skill icon display is abnormal, and the specific type of the anomaly is recorded, such as icon missing, icon misplacement, icon blur, etc. The text recognition results record the content of the task text and compare it with the preset correct text, marking the existing errors, syntax errors, etc. The error text is also recorded in the task scenario and location information. These multi-modal detection results are also stored in the database and integrated with the protocol-level test results.
[0066] Data collection modules are deployed on both the game client and server to collect game state data and system logs in real time. Game state data includes character attribute information (such as level, health, mana, etc.), game scene information (such as the current map, instance, etc.), item information (such as equipment and props owned, etc.). System logs record various event information during game operation, such as system error prompts, network connection state changes, resource loading, etc. These data are collected through specific interfaces or log files and sorted and stored in chronological order for time alignment and analysis with protocol-level test results and multi-modal detection results.
[0067] In the defect root cause analysis engine, first, the association between protocol-level test results, multi-modal detection results, game state data, and system logs is established. Through time stamps as key indexes, relevant data occurring at the same time point or within a similar time range are associated. For example, when protocol-level test results show that an anomaly occurs after a specific protocol interaction, look for multi-modal detection results near that time point to see if there are skill icon display anomalies or task text errors, etc. At the same time, combined with game state data, analyze whether the character's attributes, scene, etc. at that time are related to the abnormal situation; then check the system logs to see if there are system error prompts or network problems, etc. recorded at that time point. Through this data association and mapping, a complete abnormal event data chain is formed, providing a comprehensive data perspective for subsequent root cause analysis.
[0068] According to the design logic of the game, common problem patterns and historical defect data, a defect root cause analysis rule library is established. The rule library contains various possible defect scenarios and their corresponding root cause judgment rules. For example, if the protocol-level test result shows that the character upgrade protocol execution fails, the multi-modal detection finds that there is a typo in the description of the upgrade conditions in the task text, and the game state data shows that the character's current experience value has met the upgrade requirements, and there is no related error record in the system log, then according to the rules in the rule library, it can be preliminarily judged that the root cause of the defect may be that the typo in the task text leads to the player's misunderstanding of the upgrade conditions, which in turn affects the normal execution of the character upgrade protocol. The rules in the rule library will be continuously updated and optimized according to new test data and actual defect conditions to improve the accuracy and comprehensiveness of root cause analysis.
[0069] An intelligent analysis algorithm based on machine learning and data mining is used to conduct in-depth analysis on the integrated data and rule library. The intelligent analysis algorithm will learn from a large amount of historical test data and known defect data, extract feature patterns and correlation relationships in the data, and build a defect root cause prediction model. When facing new test results and detection data, the algorithm will evaluate and sort the possible defect root causes according to the prediction model and the rules in the rule library. For example, for a complex skill release abnormal problem, the intelligent analysis algorithm will consider the execution of the skill release protocol in the protocol-level test, the display of the skill icon and special effects in the multi-modal detection, the skill level and cooling time of the character in the game state data, and the related records in the system log, and calculate the probability scores of different possible root causes, and the root cause with the highest probability score is considered as the most possible defect root cause. After the intelligent analysis algorithm obtains the possible defect root cause, root cause verification and confirmation are needed. Defect scenarios can be reproduced manually, and targeted inspection and debugging can be carried out according to the analyzed root cause. For example, if the algorithm judges that the root cause of the skill icon display abnormality is image resource loading error, then the test personnel can check the storage path, file format and integrity of the related image resources in the game client to confirm whether there is a loading problem. At the same time, the game developers' professional knowledge and experience can be combined to evaluate and confirm the root cause analysis results, ensuring that the located root cause is accurate and correct.
[0070] The confirmed defect root causes are output and displayed in a clear and understandable manner. The defect root cause analysis results can be integrated into the test report by a dedicated test report generation tool, and the report describes the phenomenon of the defect, the discovery time, the involved protocols and functional modules, the possible root causes, and the verification process and conclusions. At the same time, the defect root cause analysis results can be displayed visually, such as through charts, flowcharts, etc. to intuitively present the causes and impact paths of the defects, facilitating game developers and testers to quickly understand and handle defect problems. In addition, the defect root cause analysis results are synchronized to the game development management system, so that project team members can track the processing progress and status of the defects in real time, and improve the collaborative efficiency of the entire development process.
[0071] In this embodiment, the accuracy and efficiency of game defect root cause analysis can be effectively improved, helping the game development team to quickly find and solve problems, and improving the quality and stability of the game.
[0072] In some embodiments, in the step S102, the protocol format inference algorithm based on the hidden Markov model is used to parse the communication data packet, identify the protocol field meaning, and automatically generate a protocol configuration table, which specifically includes: The communication data packet is preprocessed to strip the network protocol header information of each layer and extract the application layer load byte sequence; The protocol field type is defined as a hidden state, and the actual byte value in the application layer load is defined as an observation state to construct a hidden Markov model; The hidden Markov model is trained using the application layer load byte sequence to obtain state transition probability and observation probability parameters describing the protocol structure; Based on the state transition probability and observation probability parameters, the hidden state sequence is decoded by a dynamic programming algorithm to achieve field type division and semantic annotation of the protocol message, and a semantic annotation result is obtained; Based on the semantic annotation result, and by comprehensively analyzing multiple message samples, a structured configuration table describing the protocol structure is generated.
[0073] In this embodiment, the communication data packet is preprocessed to extract the application layer load byte sequence. Since network communication usually adopts a layered protocol architecture, the data packet contains the header information of each layer network protocol, such as Ethernet header, IP header, TCP or UDP header, etc. By analyzing these header information, according to the format and length specified by the protocol, the network protocol header of each layer is stripped off in turn. For example, for an Ethernet frame, the target MAC address of the first 6 bytes and the source MAC address of the 6 bytes, and the frame type field of 2 bytes are read, and after determining the upper layer protocol type, the 14 bytes of Ethernet header are stripped off; for IP data packet, according to the version, header length and other field information in the IP header, the IP header is accurately calculated and stripped off; for TCP or UDP data segment, the corresponding header is stripped off according to its header field (such as TCP's source port, destination port, sequence number, acknowledgement number, etc., UDP's source port, destination port, length, etc.). After layer-by-layer stripping, the application layer load byte sequence is finally obtained, which contains the actual transmitted service data in game communication and is the basis for subsequent protocol format reasoning.
[0074] When building the hidden Markov model, the protocol field type is defined as the hidden state. Game communication protocol usually contains various types of fields, such as message type field, player ID field, operation instruction field, data length field, data content field, etc. Each type of field has its specific semantics and value range, but in the actual application layer load byte sequence, these field types are hidden and cannot be directly observed from the byte sequence. For example, a byte sequence "01020304" may contain message type, player ID and other different fields, but from the four bytes themselves, it is impossible to determine which field type each byte belongs to, so they are defined as hidden states.
[0075] The actual byte value in the application layer load is defined as the observation state. Each byte in the application layer load byte sequence has a specific numerical value, usually ranging from 0 to 255. These byte values can be directly observed, and they are the specific manifestations of protocol fields in the transmission process. For example, "01", "02", "03", "04" in the above byte sequence "01020304" are four observation states. By defining the protocol field type as the hidden state and the actual byte value as the observation state, the basic framework of the hidden Markov model is built, laying the foundation for subsequent model training and protocol field recognition.
[0076] A large amount of game communication application layer load byte sequences are collected as training data. These training data should cover various business scenarios and communication situations of the game to ensure that the model can learn the overall characteristics of the protocol. Application layer load byte sequences can be extracted from communication data packets captured during actual game running, or simulated load byte sequences can be generated according to the protocol specification and known communication mode of the game. In order to improve the accuracy and generalization ability of the model, the number of training data should be sufficient, and the diversity and representativeness of the data should be guaranteed. Before starting to train the hidden Markov model, the state transition probability and observation probability parameters of the model need to be initialized. The state transition probability represents the probability of transitioning from one hidden state (protocol field type) to another hidden state, and the observation probability represents the probability of observing a certain observation state (actual byte value) in a certain hidden state. A random initialization method can be used to assign a small random value to each state transition probability and observation probability, but it is necessary to ensure that the sum of all possible state transition probabilities is 1, and the sum of all possible observation probabilities is also 1. Initialization can also be based on some prior knowledge or experience, for example, if it is known that there is a strong association between certain protocol field types, the initial value of the state transition probability between them can be appropriately increased. The prepared training data is used to train the hidden Markov model. The purpose of training is to continuously adjust the state transition probability and observation probability parameters so that the model can better fit the training data, that is, the probability of the model generating the observation state sequence is maximized. In the training process, an iterative algorithm (such as the forward-backward algorithm or the Baum-Welch algorithm) is used to update the model parameters. In each iteration, the probability of each observation state sequence in the training data is calculated based on the current model parameters, and then the state transition probability and observation probability parameters are adjusted based on the calculation results so that the probability of the model generating the observation state sequence increases in the next iteration. After several iterations, the model parameters gradually converge, and the state transition probability and observation probability parameters that describe the protocol structure are obtained. These parameters reflect the transition rules between protocol field types and the distribution of byte values under each field type.
[0077] Based on the trained state transition probability and observation probability parameters, a dynamic programming algorithm (such as the Viterbi algorithm) is used to decode the application layer load byte sequence to determine the most likely hidden state sequence. The dynamic programming algorithm calculates the maximum probability path of each position in different hidden states by constructing a dynamic programming table. Starting from the beginning of the byte sequence, the probability of each hidden state at the current position is calculated according to the state transition probability and observation probability, and the previous hidden state reaching this state is recorded. Each byte in the byte sequence is processed in turn until the end of the sequence is reached. Finally, by backtracking the information recorded in the dynamic programming table, the most likely hidden state sequence is obtained, which corresponds to the field type division of the protocol message. After obtaining the hidden state sequence, the protocol message is semantically annotated. According to the pre-defined correspondence between protocol field types and semantics, each field type is assigned a corresponding semantic label. For example, the message type field is labeled as "Message_Type", the player ID field is labeled as "Player_ID", and the operation command field is labeled as "Operation_Command". Through semantic annotation, the protocol message originally represented by the byte sequence is converted into a field sequence with clear semantics, making the structure and meaning of the protocol more clear and understandable, providing a basis for subsequent generation of protocol configuration tables.
[0078] In order to generate accurate and comprehensive protocol configuration tables, the semantic annotation results of multiple message samples are compared and analyzed. Since the game communication protocol may have different message formats and field combinations in different business scenarios, by collecting multiple message samples of different types, the structure and variation rules of the protocol can be more comprehensively understood. In the process of comparative analysis, the same and different field types in each message sample are found out, and it is determined which fields are fixed fields in the protocol and which fields are optional fields or fields that change according to different situations. For example, some messages may contain player coordinate fields, while other messages may not need this field. Through comparative analysis, the existence conditions and value ranges of these fields can be determined.
[0079] Based on the semantic annotation results and comparative analysis of multiple message samples, a structured configuration table is generated to describe the protocol structure. The configuration table can be in the form of a table, containing columns such as field name, field type, field length, field value range, and field semantic description. The field name corresponds to the label in the semantic annotation, the field type is determined according to the actual data type (such as integer, string, byte array, etc.), the field length can be determined according to the protocol specification or actual data statistics, the field value range is determined according to the business logic and actual observed data, and the field semantic description describes the meaning and purpose of the field in detail. By generating a structured configuration table, the format and semantic information of the protocol are presented in a clear and standardized manner, making it easy for game developers, testers, and other relevant personnel to understand and use the protocol, and also providing an important reference for subsequent automated testing, protocol compatibility verification, and other work.
[0080] In some embodiments, in step S103, the automated testing robot is constructed to perform protocol-level testing based on the protocol configuration table, specifically including: According to the field definitions in the protocol configuration table, a plurality of protocol messages containing specific test data are instantiated; The instantiated plurality of protocol messages are combined in a predetermined business logic order to form a test sequence, and a test process for simulating complete user operations is constructed; The automated testing robot is controlled to establish a network connection with the game server, and each protocol message is sequentially serialized into a binary data stream according to the test process and sent to the game server; The response message returned by the game server is received and parsed, and the response message is parsed into structured data according to the protocol configuration table; The parsed response data is automatically compared with the pre-stored expected results in the test case, a test result report is generated, and it is determined whether the test passes.
[0081] In this embodiment, the protocol configuration table defines the name, type, length, value range, and semantic description of each field in the game communication protocol in detail. For example, for the "player login" protocol message, the protocol configuration table may explicitly indicate that it contains a "username" field (string type, maximum length 20 bytes), a "password" field (string type, maximum length 20 bytes), a "login device type" field (integer type, value range 1-5 representing different devices), etc. The tester needs to fully understand the meaning and constraints of each field to lay the foundation for generating reasonable test data later.
[0082] According to the definition of each field in the protocol configuration table, multiple protocol messages containing specific test data are instantiated and generated using various test data generation strategies. For string type fields, normal strings (such as usernames that meet length and character requirements), boundary value strings (such as strings with a length just reaching the maximum value, empty strings), and illegal strings (such as strings containing special characters or exceeding the length) can be generated. For integer type fields, normal values within the range, boundary values (minimum and maximum values), and illegal values outside the range can be generated. Taking the "player purchases props" protocol message as an example, for the "prop ID" field (integer type), normal prop ID values, boundary values (such as the minimum and maximum prop IDs in the database), and non-existent prop ID values can be generated to comprehensively cover various possible input situations. The generated specific test data is encapsulated according to the field order and format specified in the protocol configuration table to form a complete protocol message. For example, if the protocol specifies that the message uses a specific byte as the starting and ending marker, and there is a fixed separation method or length identifier between fields, the encapsulation must strictly follow these rules to ensure that the generated protocol message meets the format requirements that can be correctly parsed by the game server.
[0083] The business rules and player operation processes of the game are studied, and the operation sequence and dependency relationship under different business scenarios are sorted out. For example, in a role-playing game, players usually need to complete registration and login first, then enter the game main interface, and then perform a series of operations such as character creation, task receiving, and prop purchasing. Clarifying these business logic is the key to building a reasonable test sequence. According to the sorted business logic sequence, the instantiated multiple protocol messages are combined to build a test process that simulates complete user operations. For example, simulating the complete process of a player from registration and login to entering the game, performing a simple battle, purchasing props, and exiting, the corresponding "player registration" "player login" "character creation" "task receiving" "battle start" "battle end" "prop purchase" "player exit" protocol messages are arranged in order according to the business logic sequence to form an ordered test sequence. At the same time, considering the switching and interaction between different business scenarios, the test sequence can comprehensively cover various functions of the game.
[0084] The parameters required for the network connection between the automated test robot and the game server are controlled, including the IP address of the server, the port number, the type of communication protocol (such as TCP or UDP), and so on. Ensure that these parameters are accurate so that the test robot can successfully connect to the game server. According to the configured network parameters, use the corresponding network programming interface (such as Socket programming) to establish a stable network connection between the automated test robot and the game server. During the connection establishment process, handle possible network exceptions such as connection timeout, connection rejection, and so on, and implement appropriate error handling and retry mechanisms to ensure that the connection can be successfully established. According to the order of the test process, serialize each protocol message into a binary data stream in turn. The serialization process needs to strictly follow the format specified by the protocol, convert each field in the protocol message to binary form, and add the necessary protocol header and protocol tail information. For example, if the protocol specifies that the message starts with a 4-byte length field followed by the actual message content, the length of the message content needs to be accurately calculated and filled into the length field during serialization. Send the serialized binary data stream to the game server through the network connection to simulate the process of players sending operation requests to the server.
[0085] After the game server processes the protocol message sent by the test robot, it will return the corresponding response message. The automated test robot needs to listen to the network connection in real time and receive the response message returned by the game server in a timely manner. Set appropriate receive buffer size and timeout time to ensure that the response message can be completely received, while avoiding the test process from being blocked due to excessive waiting time. According to the protocol configuration table, parse the received response message into structured data. The parsing process is the opposite of the encapsulation process of the protocol message, according to the format specified by the protocol, extract the values of each field from the binary data stream, and convert them to the corresponding data type. For example, extract the status code field (integer type) representing the operation result and the returned prompt information field (string type) from the response message, so as to compare them with the expected results later.
[0086] Automatically compare the parsed response data with the pre-stored expected results in the test case. The expected results are pre-set according to the game business logic and normal operation process, and are used to judge whether the response returned by the server meets the expectations. For example, for the "player login" protocol message, if the correct username and password are sent, the expected result may be a status code of 0 (indicating login success) and some basic information of the player returned; if an incorrect password is sent, the expected result may be a non-zero status code (indicating login failure) and the corresponding error prompt information returned. By comparing the response data and the expected results field by field, determine whether the server processing is correct.
[0087] According to the comparison result, a detailed test result report is generated. The report content should include the name of the test case, the test steps, the content of the sent protocol message, the content of the received response message, the comparison result (pass or fail), the failure reason (if any), and other information. The test result report is presented in a clear and easy-to-read format, making it easy for testers and developers to quickly understand the test situation and locate the problem.
[0088] According to the comparison result in the test result report, it is determined whether the entire test process passes. If the response data of all test steps is consistent with the expected result, the test is determined to pass; if the response data of any test step is inconsistent with the expected result, the test is determined to fail, and the failed test step and the reason are explicitly indicated in the report, providing a basis for subsequent problem repair and optimization.
[0089] In some embodiments, in step S104, the integrated OpenCV performs image matching to detect skill icon display abnormalities, and PaddleOCR is used for Chinese text recognition to detect task text errors. Specifically, it includes: In response to the interface update event triggered by the protocol test robot, the current screen image of the game client is captured; From the pre-set standard UI element library, load the standard skill icon image and standard task text associated with the current test case context; Use the OpenCV image processing library to perform template matching between the current screen image and the standard skill icon image to obtain the matching result; According to the size relationship between the similarity of the matching result and the preset similarity threshold, it is determined whether the skill icon is displayed abnormally; Use the PaddleOCR optical character recognition engine to recognize the text area in the current screen image and extract the recognized actual task text; According to the consistency degree of the comparison between the actual task text and the standard task text, it is determined whether there are errors in the task text.
[0090] In this embodiment, a set of efficient event listening mechanism is built for protocol testing robots in the game testing environment. This mechanism continuously monitors various state changes and message passing within the game client, especially focusing on key events that may trigger interface updates, such as character skill release, task prompt pop-up, etc. By establishing a specific communication interface between the game client and the testing robot or using the event callback function in the game's development toolkit (SDK), the testing robot can capture interface update events in real time and accurately. When the protocol testing robot successfully captures the interface update event, it immediately triggers the screen image capture function. Using the graphics capture interface provided by the operating system, such as GDI+ or DirectX capture function under Windows system, or cross-platform image capture library (such as OpenCV's VideoCapture class under certain platform), the current display interface of the game client is captured in full screen or specific area. During the capture process, ensure that the resolution, color mode and other parameters of the captured image are consistent with the actual display settings of the game client to ensure the accuracy of subsequent image processing and analysis. At the same time, add metadata such as timestamp and event identification to the captured image to facilitate subsequent tracing and problem positioning.
[0091] In the early stage of game testing, a comprehensive and detailed standard UI element library is built. This library is organized according to the game's modules, functions and interface types, containing various standard skill icon images and standard task texts. For skill icon images, collect all skill icons of the game in different states and levels, and ensure that each icon has clear boundaries, accurate colors and standard sizes. For task texts, organize all task descriptions, prompt information and other text content in the game, and perform standardization processing to remove unnecessary spaces, special symbols, etc., and unify the text encoding format (such as UTF-8).
[0092] According to the context information of the current test case, the standard skill icon images and standard task texts related to this test are accurately loaded from the pre-set standard UI element library. The context information of the test case can be obtained by recording the test steps, character state, task progress and other data during the execution of the test by the protocol testing robot. For example, if the current test case is to test the skill release effect of a specific character, load all skill icon images corresponding to this character from the standard UI element library; if the current test case is to verify the text display of a task, load the standard task text of the task. In this way, the loaded standard UI elements are highly matched with the current test scene, improving the accuracy of subsequent detection.
[0093] The captured current screen image is matched with the loaded standard skill icon image using the powerful template matching function in the OpenCV image processing library. In the matching process, the current screen image and the standard skill icon image are first preprocessed, including image graying, denoising, edge enhancement and other operations, to improve the accuracy and efficiency of the matching. Then, select the appropriate template matching algorithm, such as the square difference matching method, the normalized square difference matching method, the correlation matching method, etc., and optimize the selection according to the actual image characteristics and test requirements. By traversing each position of the current screen image, the similarity between the standard skill icon image and the local region of the screen image is calculated, and the matching result matrix is obtained. According to the matching result matrix, the matching position with the highest similarity and the corresponding similarity value are extracted. The similarity value is compared with the preset similarity threshold value. The preset similarity threshold value is obtained through a large number of experiments and test data statistical analysis, considering the characteristics of different skill icons, image quality, test environment and other factors. If the similarity value is greater than or equal to the preset similarity threshold value, it is determined that the skill icon is displayed normally; if the similarity value is less than the preset similarity threshold value, it is determined that the skill icon is displayed abnormally, which may exist icon missing, misplacement, deformation and other problems. At the same time, record the position, name and other related information of the abnormal skill icon, so as to analyze and repair the problem in the future.
[0094] The PaddleOCR optical character recognition engine is used to accurately recognize the text area in the current screen image. First, image processing techniques such as edge detection, connected region analysis, etc. are used to locate the text area in the screen image, remove irrelevant image parts, and reduce recognition interference. Then, the located text area image is input into the PaddleOCR engine for recognition processing. The PaddleOCR engine uses deep learning algorithms and is trained on a large amount of Chinese text data, enabling accurate recognition of Chinese text in various fonts, sizes, and colors. During the recognition process, the engine performs feature extraction, character classification, and other operations on the text image, and finally outputs the recognized actual task text. The recognized actual task text is compared and analyzed with the loaded standard task text. String exact matching or semantic-based fuzzy matching algorithms are used, and the appropriate comparison method is selected according to actual needs. If string exact matching is used, the actual task text and the standard task text are compared character by character, and the number and location of unmatched characters are counted; if semantic-based fuzzy matching is used, the semantic similarity of the text is considered, and reasonable judgments are made for some homophonic characters, synonyms, etc. According to the consistency degree of the comparison result, it is determined whether there are errors in the task text. If the actual task text is completely consistent with the standard task text or the similarity is within the pre-set reasonable range, it is determined that there are no errors in the task text; if there is obvious inconsistency or the similarity is lower than the pre-set threshold, it is determined that there are errors in the task text, and the position, error content, etc. of the errors are recorded, providing a basis for text correction and optimization of the game.
[0095] In this embodiment, the integration of OpenCV for image matching detection and the use of PaddleOCR for Chinese text recognition to detect errors in task text can effectively improve the efficiency and accuracy of game testing, timely identify various abnormal problems in the game interface, and ensure the quality and user experience of the game.
[0096] In some embodiments, in step S105, based on the protocol configuration table and the execution state of the test robot, in the replica test, the high-risk branch path is preferentially explored through an intelligent decision algorithm, and the test order is dynamically adjusted, specifically including: A replica state machine model is constructed based on the protocol configuration table, which is used to define replica states, state transition conditions, and corresponding protocol messages; An initial risk weight is assigned to the state transition path in the replica state machine model, indicating the potential risk level of each path; During the execution of the replica test, the protocol execution state of the test robot and the replica game state are monitored in real time; The potential risk level of each path, the protocol execution status, and the copy game state are input into a reinforcement learning model to calculate the expected value of all executable test actions. The test action with the highest expected value is selected and executed by the test robot, dynamically guiding the exploration of high-risk and high-value branch paths.
[0097] In this embodiment, the protocol configuration table contains various protocol information involved in the copy test, such as the types, formats, sending and receiving conditions of different protocol messages, etc. Through special parsing tools or custom parsing logic, key information related to copy state definition and state transition is extracted. For example, identify which protocol messages will trigger a change in copy state, and the specific conditions and rules for state change. Based on the parsed protocol information, a copy state machine model is constructed. This model clearly defines various states of the copy, such as the initial state, battle state, reward state, and end state. At the same time, it defines the transition conditions between states in detail, for example, when the test robot receives a specific attack protocol message, the copy state transitions from the initial state to the battle state; when all battle objectives are completed and a victory protocol message is received, the state transitions from the battle state to the reward state. In addition, each state transition is associated with the corresponding protocol message to ensure that the state machine runs closely with the actual protocol interaction, accurately simulating various situations in the copy test.
[0098] Based on the design characteristics of the copy, historical test data, and common problem types, a comprehensive risk assessment index is determined. These indicators cover multiple aspects, such as the impact of copy difficulty on state transition, the risk of error handling for key protocol messages, and the risk of resource consumption in different states. For example, for some protocol messages involving complex calculations or critical data transmission, the corresponding path may have a higher risk level. According to the determined risk assessment indicators, each state transition path in the copy state machine model is assigned an initial risk weight. Expert scoring or statistical analysis based on historical data can be used for assignment. Subjective evaluation and scoring are performed on each path according to the risk assessment indicators; statistical analysis based on historical data finds the rules related to state transition paths by analyzing the problems that occurred in past copy tests, and assigns appropriate initial risk weights to the paths. The initial risk weight is used to identify the potential risk level of each path, providing a reference for subsequent intelligent decision-making.
[0099] During the execution of the copy test, a real-time monitoring system is set up to comprehensively track the protocol execution status of the test robot. Through the communication interface with the test robot, the system obtains real-time information such as the content of the protocol messages sent and received by the test robot, timestamps, message processing status, etc. For example, it monitors whether the test robot has successfully sent an attack protocol message and whether it has timely received a response message from the copy server. At the same time, it records abnormal situations during protocol execution, such as message loss, timeout, error parsing, etc., to promptly identify problems in protocol interaction. In addition to protocol execution status, real-time monitoring of copy game status is also required. Using state query interfaces provided by the game client or through image recognition, data scraping, etc. techniques, the current state information of the copy is obtained, such as character health, magic, copy progress, enemy status, etc. For example, image recognition technology is used to monitor the changes in the character's health bar to determine whether the character is in danger; data scraping is used to obtain the current level information of the copy to understand the progress of the test. The protocol execution status and copy game status information are integrated to provide comprehensive real-time data support for intelligent decision-making.
[0100] A reinforcement learning model suitable for copy test scenarios is constructed, such as a Deep Q Network (DQN) model. The model takes the potential risk level of each path, protocol execution status, and copy game status as input features, and through multiple layers of neural network calculation and processing, it outputs the expected value of all executable test actions. During model training, historical copy test data or a large number of training samples generated through simulation testing are used to repeatedly train and optimize the model, enabling it to accurately learn the expected value of each test action under different input states. During the execution of the copy test, the real-time monitoring of the potential risk level of each path, protocol execution status, and copy game status information is input into the trained reinforcement learning model. The model quickly calculates the expected value of all executable test actions under the current state based on the input information. For example, in the current copy state, there may be multiple executable attack actions or movement actions, and the reinforcement learning model will calculate an expected value for each action, which reflects the potential test benefits and risks after executing the action.
[0101] According to the expected values of all executable test actions calculated by the reinforcement learning model, a comprehensive evaluation and comparison are made. The test action with the highest expected value is selected as the next execution action. In the selection process, not only the size of the expected value is considered, but also some other constraints such as test resource limitations, test time requirements, etc. For example, if an action with a high expected value requires a large amount of test resources, but the current resources are limited, then other suitable actions need to be considered.
[0102] The selected test actions are executed by the test robot. According to the received action instructions, the test robot completes corresponding test operations according to the predetermined protocol rules and operation processes, such as sending specific protocol messages, performing specific game operations, etc. By dynamically guiding the test robot to preferentially explore high-risk and high-value branch paths, the efficiency and pertinence of the copy test can be improved, and potential problems existing in the copy can be found in time, thereby providing strong support for the optimization and improvement of the game.
[0103] Further, the potential risk level of each path, the protocol execution state and the copy game state are input into the reinforcement learning model, and the expected value of all executable test actions is calculated, specifically including: The potential risk level of each path, the protocol execution state and the copy game state are fused and encoded to generate a composite state vector representing the current game environment; The composite state vector is input into the reinforcement learning model to query the pre-set state-action value table to obtain the initial value estimate of all executable test actions; The immediate reward signal of each executable test action is calculated by a reward function, which is used to comprehensively consider the risk level of the associated path of the executable test action, the novelty of the state coverage and whether an abnormal response is triggered; Based on the immediate reward signal, the initial value estimate is comprehensively calculated to output the expected value of each executable test action.
[0104] In this embodiment, the potential risk level of each path, the protocol execution state and the copy game state are preprocessed. For the potential risk level, since it is usually represented by a numerical value or a discrete level identifier, its original form can be directly retained or subjected to simple normalization processing to adapt its numerical range to the subsequent fusion encoding operation. The protocol execution state contains rich information, such as the types of protocol messages sent and received, timestamps, message processing results, etc. These information is filtered and sorted to extract key features, such as encoding the types of protocol messages sent and received in the recent period of time, and converting the message processing results into binary identifiers (1 for success and 0 for failure). The copy game state covers character attributes (such as health, magic, attack power, etc.), copy progress (such as current level, number of remaining tasks, etc.), enemy state (such as number of enemies, enemy health, etc.), and other information. Similarly, these information is feature extracted, such as discretely encoding the character health according to certain intervals, and converting the copy progress into a percentage form.
[0105] The three types of preprocessed data are integrated into a composite state vector representing the current game environment by using appropriate fusion encoding methods. One feasible method is to use concatenation encoding, which concatenates the numerical value of the potential risk level, the feature encoding of the protocol execution state, and the feature encoding of the replica game state in a certain order to form a long vector. For example, the numerical value of the potential risk level is placed first, followed by the encoding of each key feature in the protocol execution state, and finally the feature encoding of the replica game state. Another method is to use weighted fusion, which assigns a weight coefficient to the potential risk level, the protocol execution state, and the replica game state according to their importance in replica testing. Multiply each type of data by its corresponding weight coefficient and add them together to get a comprehensive value. Then combine this comprehensive value with other necessary information to form a composite state vector. Through fusion encoding, the composite state vector can comprehensively and accurately reflect the various key information of the current game environment, providing effective input for the subsequent reinforcement learning model.
[0106] During the reinforcement learning model training phase, a state-action value table is constructed in advance. This table uses the composite state vector as the index and records the initial value estimate of all executable test actions in each possible composite state. The construction process can be implemented in various ways, such as using simulation testing to execute various test actions in different composite states, recording the long-term returns after each action is executed, and calculating the initial value estimate of each action in that state according to a certain algorithm (such as the Monte Carlo method) to fill it into the state-action value table. Expert experience can also be used to assign reasonable initial value estimates to test actions in different states based on the design rules and common problem patterns of replicas.
[0107] When the composite state vector of the current game environment is generated, it is used as an index to query the pre-set state-action value table. By matching the dimensions of the composite state vector, the corresponding state entry is found, and the initial value estimates of all executable test actions in that state are obtained. These initial value estimates are preliminary assessments based on historical data or expert experience, providing a basis for subsequent comprehensive calculations combined with immediate reward signals.
[0108] An award function is designed to consider multiple factors to calculate the immediate reward signal of each executable test action. The award function mainly considers the following three factors: (1) risk level of associated path: for test actions related to high-risk paths, give higher reward weight. Because exploring high-risk paths helps to discover potential important issues in the copy, such as protocol vulnerabilities, game logic errors, etc. For example, if a test action corresponds to a path with a high potential risk level, assign a larger positive coefficient to it in the reward function, so that it can obtain a higher immediate reward after execution. (2) novelty of state coverage: encourage test actions to cover previously unexplored or less explored game states. By recording the game states that have been visited during the historical test process, when a test action can make the game enter a new state, additional rewards are given in the reward function. For example, the concept of information entropy is used to measure the novelty of the state. The higher the information entropy of the new state, the stronger the novelty, and the higher the corresponding reward. (3) whether to trigger abnormal response: if the test action triggers an abnormal response in the copy, such as game crash, protocol error, data inconsistency, etc., give higher reward. Because triggering abnormal response means discovering problems in the copy, which is important for improving the quality and stability of the copy. For example, set a larger fixed reward value for test actions that trigger abnormal responses.
[0109] According to the designed reward function, the risk level of the associated path, the novelty of the state coverage, and whether to trigger abnormal response of each executable test action are taken as input to calculate the immediate reward signal of the action. The immediate reward signal is a numerical value that reflects the immediate benefit obtained by executing the test action at the current time. Its numerical value and positive and negative (positive reward indicates beneficial action, negative reward indicates potentially harmful action) will provide an important basis for subsequent value update.
[0110] Based on the calculated immediate reward signal, the initial value estimate obtained from the state-action value table is comprehensively calculated. Common methods such as Q-learning algorithm in time difference learning are used to update the value estimate of the current state-action pair according to the immediate reward signal and the expected value of the next state. Specifically, the expected value of the current action is equal to the immediate reward signal plus a discount factor multiplied by the expected value of the best action in the next state. The discount factor is used to balance the importance of immediate reward and future reward, and its value range is usually between 0 and 1. Through continuous iteration and update, the expected value of the action can more accurately reflect its long-term income situation.
[0111] After comprehensive calculation, the final expected value of each executable test action is obtained. These expected values are output to provide a basis for subsequent test action selection. The test system can select the test action with the highest expected value according to the expected values, and execute it by the test robot, so as to dynamically guide the exploration of high-risk and high-value branch paths, and improve the efficiency and effect of replica testing.
[0112] In some embodiments, in step S106, the defect root cause analysis engine is constructed according to the results of the protocol-level test and the multi-modal detection results, and the protocol data, game state data and system log are combined to automatically locate and output the problem root cause, specifically including: In response to the results of the protocol-level test and the multi-modal detection results, multi-source test data including protocol data, game state data and system log are collected and time-aligned; A time sequence event graph is constructed based on the multi-source test data, the nodes of the time sequence event graph are used to represent various events and states, and the edges are used to represent the association between events; Starting from the detected abnormal phenomenon, reverse graph traversal is performed in the time sequence event graph to determine the potential root cause event leading to the abnormal phenomenon, and a traceability result is obtained; The traceability result is evaluated and sorted for confidence, and a structured analysis report containing the problem root cause and evidence chain is output.
[0113] In this embodiment, when the protocol-level test is completed and the test results are generated, and the multi-modal detection module also outputs the corresponding detection results, the multi-source test data collection process is triggered. This triggering mechanism ensures the timeliness and pertinence of data collection. Only after obtaining the key test and detection information, does it begin to collect various types of data that may be related to it, avoiding unnecessary data collection and processing overhead.
[0114] According to the preset data collection rules, protocol data, game state data and system logs are collected from different data sources. Protocol data covers all protocol messages sent and received during testing, including message type, content, timestamp and other information, which can be obtained by embedding a protocol monitoring module in the test system. Game state data reflects various states of the instance or game during testing, such as character attributes, instance progress, enemy status, etc., which can be obtained from the game client or server state query interface. System logs record various events and error information during the operation of the test system, including system startup, shutdown, abnormal alarm, etc., which can be read from the system log file. Due to the differences in data generation time and recording methods of different data sources, in order to accurately analyze the correlation between data, time alignment processing is needed for the collected multi-source test data. A unified time reference is used, such as taking the startup time of the test system as zero point, and converting the timestamps of all data into time offsets relative to this reference. For data without accurate timestamps, reasonable time inference and annotation are made according to the generation order and context information of the data. Through time alignment processing, the protocol data, game state data and system logs are ensured to be consistent in the time dimension, laying a foundation for subsequent time series analysis and root cause positioning.
[0115] Based on the collected multi-source test data, nodes in the time sequence event graph are defined. Nodes are used to represent various events and states, including protocol events (such as sending a specific protocol message, receiving a protocol response), game state events (such as character health changes, instance level switching) and system state events (such as system resource usage changes, error log records). Each node contains detailed information such as event type, occurrence time, related parameters, etc., so as to accurately describe the characteristics of events or states. The association between events is determined, and the edges in the time sequence event graph are defined. Edges are used to represent the association between events, such as causal relationship, time sequence relationship, etc. For example, when an attack protocol message is sent, the character's health value changes, and there is a causal relationship between the two events. In the time sequence event graph, a directed edge connects the corresponding nodes, and the direction of the edge represents the direction of causality. By analyzing the time sequence and logical relationship in the multi-source test data, the association edges between all events are determined, and a complete time sequence event graph is constructed. This graph can intuitively show the evolution process of various events and states in the testing process and their mutual relationships.
[0116] According to the results of protocol-level testing and multi-modal detection, the detected abnormal phenomena are determined. Abnormal phenomena can be protocol interaction errors, game state abnormalities, system performance problems, etc., such as protocol message loss, abnormal decrease of character health, long system response time, etc. The abnormal phenomenon is taken as the starting point of the time sequence event graph, and the reverse graph traversal is started.
[0117] A suitable reverse graph traversal algorithm is used to start from the node corresponding to the abnormal phenomenon and traverse in the reverse direction of the edges. During the traversal process, the relevant information of each node is analyzed to determine whether it is the root cause of the abnormal phenomenon. For example, if the abnormal phenomenon is the abnormal decrease of the character's life value, during the reverse traversal process, it is checked whether there are attack protocol message sending abnormalities, enemy attack behavior abnormalities, and other events that may cause the life value to decrease. At the same time, considering the time interval and logical relationship between events, some unlikely causes are excluded. By continuously traversing upstream nodes, the range of events that may cause abnormal phenomena is gradually narrowed.
[0118] When the traversal cannot continue to trace upstream or the preset termination condition is met, the potential root cause events of the abnormal phenomenon are determined. These potential root cause events may be a single event or a combination of multiple events. For example, after reverse traversal, it is found that the abnormal decrease of the character's life value is due to the abnormal high attack power of multiple enemies at the same time, and the attack power of the enemies is abnormal due to the use of incorrect parameters by the game server when calculating the attack power. These potential root cause events are recorded as the results of the traceability.
[0119] A set of comprehensive confidence evaluation indicators are developed to evaluate the reliability of the traceability results. The evaluation indicators can include the logical closeness between events, the rationality of the time interval, the reliability of the data source, etc. For example, if there is a direct causal relationship between the potential root cause event and the abnormal phenomenon, and the time interval is short, and the data source of the event is reliable, then its confidence is high; on the contrary, if the logical relationship between events is weak, the time interval is long, and the data source is questionable, then its confidence is low. According to the determined evaluation indicators, the confidence score of each potential root cause event is calculated. A weighted scoring method can be used to assign a weight coefficient to each evaluation indicator, and the weighted score is calculated according to the performance of the event in each indicator. All potential root cause events are sorted in descending order of confidence score, and the higher the confidence score, the more likely it is the real root cause of the abnormal phenomenon.
[0120] According to the sorted traceability result, a structured analysis report containing problem root cause and evidence chain is generated. The report content is divided into several parts: first, problem description, which details the detected abnormal phenomenon; second, problem root cause, which lists the sorted potential root cause events and their confidence scores; then, evidence chain, which shows the reverse traversal process from abnormal phenomenon to potential root cause event, including the relevant information and association of each node, presenting the reasoning process in a clear way; finally, suggestion measures, which propose corresponding solutions according to the problem root cause, such as fixing protocol vulnerability, adjusting game parameters, optimizing system performance, etc. By outputting the structured analysis report, clear guidance and basis are provided for problem solving, improving the efficiency and quality of problem handling.
[0121] With reference to Figure 2 , an embodiment of the present application provides an automatic test system 2 based on a protocol configuration table, and the system 2 specifically comprises: a first test module 201 configured to capture communication data packets between a game client and a game server; a second test module 202 configured to analyze the communication data packets by using a protocol format reasoning algorithm based on a hidden Markov model, identify protocol field meanings, and automatically generate a protocol configuration table; a third test module 203 configured to build an automatic test robot, and simulate player behavior to perform protocol-level testing based on the protocol configuration table; a fourth test module 204 configured to integrate OpenCV for image matching to detect skill icon display abnormalities and PaddleOCR for Chinese text recognition to detect task text typos during the execution of the protocol-level testing by the automatic test robot, and obtain multi-modal detection results; a fifth test module 205 configured to, based on the protocol configuration table and the execution state of the test robot, preferentially explore high-risk branch paths in a copy test by using an intelligent decision algorithm, and dynamically adjust a test order; a sixth test module 206 configured to build a defect root cause analysis engine according to the results of the protocol-level testing and the multi-modal detection results, and automatically locate and output problem root causes in combination with protocol data, game state data and system logs.
[0122] It can be understood that the contents in the embodiment of the automatic test method based on the protocol configuration table as shown in Figure 1 are all applicable to the embodiment of the automatic test system based on the protocol configuration table, the embodiment of the automatic test system based on the protocol configuration table specifically realizes the same functions as the embodiment of the automatic test method based on the protocol configuration table as shown in Figure 1 , and achieves the same beneficial effects as the embodiment of the automatic test method based on the protocol configuration table as shown in Figure 1The protocol configuration table based automatic test method embodiment shown has the same beneficial effects.
[0123] It should be noted that the information interaction between the above systems, the execution process and the like, since based on the same concept as the method embodiments of the present application, the specific functions and the technical effects brought by them can be referred to the method embodiments part, and will not be repeated here.
[0124] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the system is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit or module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific name of each functional unit or module is only for easy distinction, and does not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0125] With reference to Figure 3 The embodiment of the present application also provides a computer device 3, comprising a memory 302 and a processor 301 and a computer program 303 stored in the memory 302, when the computer program 303 is executed on the processor 301, the protocol configuration table based automatic test method is realized as any one of the above methods.
[0126] The computer device 3 can be a desktop computer, a notebook computer, a palm computer and a cloud server and the like. The computer device 3 can include, but is not limited to, a processor 301, a memory 302. Those skilled in the art can understand that, Figure 3 It is only an example of the computer device 3, and does not constitute a limitation on the computer device 3, and can include more or fewer components than the illustrated, or combine certain components, or different components, for example, it can also include input and output devices, network access devices and the like.
[0127] The processor 301 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0128] The memory 302 can be an internal storage unit of the computer device 3 in some embodiments, for example, a hard disk or a memory of the computer device 3. The memory 302 can also be an external storage device of the computer device 3 in other embodiments, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 302 can include both an internal storage unit and an external storage device of the computer device 3. The memory 302 is used to store an operating system, an application program, a boot loader, data, and other programs, for example, program codes of the computer program, etc. The memory 302 can also be used to temporarily store data that has been output or is to be output.
[0129] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. When the computer program is run by a processor, the computer program implements the protocol configuration table based automatic testing method according to any one of the above methods.
[0130] In this embodiment, the integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the computer program for instructing the relevant hardware to complete all or part of the processes in the above-described embodiment methods can be stored in a computer readable storage medium. The computer program can be executed by a processor to implement the steps of the above-mentioned various method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the photographing device / terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.
[0131] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0132] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solutions. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0133] In the embodiments disclosed in the present application, it should be understood that the disclosed apparatus / terminal equipment and methods can be implemented in other ways. For example, the apparatus / terminal equipment embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0134] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
Claims
1. An automated testing method based on a protocol configuration table, characterized in that, The method specifically includes: Capture communication data packets between the game client and the game server; Using a protocol format inference algorithm based on a hidden Markov model, communication data packets are parsed, the meaning of protocol fields is identified, and a protocol configuration table is automatically generated. Build an automated testing robot to simulate player behavior and perform protocol-level tests based on the protocol configuration table; During the process of automated testing robots performing protocol-level tests, OpenCV is integrated for image matching to detect abnormal skill icon display, and PaddleOCR is used for Chinese text recognition to detect typos in the task text, thus obtaining multimodal detection results. Based on the protocol configuration table and the execution status of the test robot, in the replica test, the intelligent decision-making algorithm prioritizes the exploration of high-risk branch paths and dynamically adjusts the test order. Based on the results of protocol-level testing and multimodal detection, a defect root cause analysis engine is built. Combining protocol data, game status data, and system logs, it automatically locates and outputs the root cause of the problem.
2. The method according to claim 1, characterized in that, The method of using a protocol format inference algorithm based on a Hidden Markov Model to parse communication data packets, identify the meaning of protocol fields, and automatically generate a protocol configuration table includes: The communication data packets are preprocessed to remove the header information of each network protocol layer and extract the application layer payload byte sequence. Define the protocol field type as the hidden state and the actual byte value in the application layer payload as the observed state to construct a hidden Markov model. The Hidden Markov Model is trained using the application layer payload byte sequence to obtain the state transition probability and observation probability parameters describing the protocol structure; Based on the state transition probability and observation probability parameters, the hidden state sequence is decoded through a dynamic programming algorithm, thereby realizing the field type classification and semantic annotation of the protocol message and obtaining the semantic annotation results. Based on the semantic annotation results and by comprehensively comparing and analyzing multiple message samples, a structured configuration table is generated to describe the protocol structure.
3. The method according to claim 1, characterized in that, The construction of the automated testing robot, which simulates player behavior and performs protocol-level tests based on the protocol configuration table, specifically includes: Based on the field definitions in the protocol configuration table, instantiate and generate multiple protocol messages containing specific test data; The instantiated protocol messages are combined into a test sequence according to a preset business logic order to construct a test process for simulating complete user operations; The automated testing robot establishes a network connection with the game server and serializes each protocol message into a binary data stream according to the testing process and sends it to the game server. Receive and parse the response message returned by the game server, and parse the response message into structured data according to the protocol configuration table; The parsed response data is automatically compared with the expected results stored in the test cases to generate a test result report and determine whether the test passes.
4. The method according to claim 1, characterized in that, The integration of OpenCV for image matching to detect abnormal skill icon display and the use of PaddleOCR for Chinese text recognition to detect typos in the task text specifically include: In response to an interface update event triggered by the protocol test bot, capture the current screen image of the game client; Load the standard skill icon images and standard task text associated with the current test case context from the pre-built standard UI element library; Using the OpenCV image processing library, the current screen image is matched with standard skill icon images to obtain the matching results; Based on the relationship between the similarity of the matching results and the preset similarity threshold, it is determined whether the skill icon is displayed abnormally; Using the PaddleOCR optical character recognition engine, the text region in the current screen image is recognized, and the actual task text is extracted. Based on the degree of consistency between the actual task text and the standard task text, determine whether there are typos in the task text.
5. The method according to claim 1, characterized in that, Based on the protocol configuration table and the execution status of the test robot, in the replica test, an intelligent decision-making algorithm prioritizes exploring high-risk branch paths and dynamically adjusts the test order, specifically including: A replica state machine model is constructed based on the protocol configuration table. The replica state machine model is used to define the replica state, the transition conditions between states, and the corresponding protocol messages. Assign initial risk weights to the state transition paths in the replica state machine model and identify the potential risk level of each path; During the execution of the dungeon test, the protocol execution status of the test robot and the dungeon game status are monitored in real time; The potential risk level of each path, the protocol execution status, and the game state of the instance are input into the reinforcement learning model to calculate the expected value of all executable test actions. The test robot is assigned to perform the test actions with the highest expected value, and is dynamically guided to prioritize the exploration of high-risk and high-value branch paths.
6. The method according to claim 5, characterized in that, The process of inputting the potential risk level of each path, the protocol execution status, and the game state of the instance into the reinforcement learning model to calculate the expected value of all executable test actions specifically includes: The potential risk level, protocol execution status, and instance game status of each path are fused and encoded to generate a composite state vector representing the current game environment. The composite state vector is input into the reinforcement learning model, and the pre-set state-action value table is queried to obtain the initial value estimate of all executable test actions; The immediate reward signal for each executable test action is calculated using a reward function, which is used to comprehensively consider the risk level of the associated path of the executable test action, the novelty of the state coverage, and whether an abnormal response is triggered. Based on the immediate reward signal, the initial value estimate is comprehensively calculated, and the expected value of each executable test action is output.
7. The method according to any one of claims 1 to 6, characterized in that, Based on the results of protocol-level testing and multimodal detection, a defect root cause analysis engine is constructed. Combining protocol data, game state data, and system logs, it automatically locates and outputs the root cause of the problem, specifically including: In response to the results of protocol-level testing and multimodal detection, multi-source test data is collected and time-aligned, including protocol data, game state data, and system logs; A time-series event graph is constructed based on multi-source test data. The nodes of the time-series event graph are used to represent various events and states, and the edges are used to represent the relationships between events. Starting with the detected anomaly, perform a reverse graph traversal in the time sequence event graph to identify the potential root cause event that caused the anomaly and obtain the source tracing results. The confidence level of the tracing results is assessed and ranked, and a structured analysis report containing the root causes of the problem and the chain of evidence is output.
8. An automated testing system based on a protocol configuration table, characterized in that, The system specifically includes: The first test module is used to capture communication data packets between the game client and the game server; The second testing module is used to parse communication data packets, identify the meaning of protocol fields, and automatically generate a protocol configuration table using a protocol format inference algorithm based on a hidden Markov model. The third testing module is used to build an automated testing robot that simulates player behavior and performs protocol-level tests based on the protocol configuration table. The fourth testing module is used to integrate OpenCV for image matching to detect abnormal skill icon display during the execution of protocol-level tests by the automated testing robot, and to use PaddleOCR for Chinese text recognition to detect typos in the task text, thereby obtaining multimodal detection results. The fifth testing module is used to dynamically adjust the test order in the copy test by prioritizing the exploration of high-risk branch paths and dynamically adjusting the test order based on the protocol configuration table and the execution status of the test robot. The sixth testing module is used to build a defect root cause analysis engine based on the results of protocol-level testing and multimodal detection. It combines protocol data, game status data, and system logs to automatically locate and output the root cause of the problem.
9. A computer device, characterized in that, include: A memory and a processor, and a computer program stored in the memory, which, when executed on the processor, implements the automated testing method based on a protocol configuration table as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements an automated testing method based on a protocol configuration table as described in any one of claims 1 to 7.
Citation Information
Cited By
Digital event triggering method and system based on baseband data sequence edge detection
CN122268786A