Qt-based test data universal shunt platform
Patent Information
- Application Number
- CN202610755033.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-28
- Publication Date
- 2026-09-29
AI Technical Summary
[0005]为解决以上现有技术不具备跨平台性和通用性,以及扩展性差和维护成本高的技术问题,本发明提供了一种基于Qt的测试数据通用分路平台,包括:用户界面层、业务逻辑层、数据处理层和数据存储层;
[0015]本发明的有益效果:本发明通过基于Qt架构开发,实现跨平台运行,既可以单独执行,也可以被其他软件调用执行,通过外置分路配置文件,提高分路平台的兼容性、通用性和扩展性,对于不同的测试数据不需要再单独开发测试数据分路工具,仅修改外置的分路配置文件即可,能够快速实现软件参数修改和软件部署,实现成百上千个测试参数的提取、变换和计算,明显降低软件维护难度,提高工作效率。
Smart Images

Figure CN122838263A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically to a general test data splitting platform based on Qt. Background Technology
[0002] Test data serves as a crucial basis for experimental verification and monitoring of the test object's status. The accuracy of the test data is essential for determining whether the test object's performance is intact. When testing a test object, the test data needs to be split and stored to facilitate subsequent data processing and analysis.
[0003] Traditional test data routing software platforms are custom-developed, lacking cross-platform compatibility and versatility. They require separate development of software for different test objects, with test parameters hard-coded into the software. This limits data routing to specific types of test objects, making them incompatible with test data from different types of test objects, resulting in poor versatility. When test parameters change, the source code of the routing software needs to be modified, leading to poor scalability and high software maintenance costs.
[0004] Therefore, it is necessary to propose a test data splitting technology solution that is cross-platform, universal, and scalable to overcome the shortcomings of existing technologies. Summary of the Invention
[0005] To address the technical problems of existing technologies lacking cross-platform compatibility and versatility, as well as poor scalability and high maintenance costs, this invention provides a Qt-based universal test data splitting platform, comprising: a user interface layer, a business logic layer, a data processing layer, and a data storage layer. The user interface layer is used to interact with the user and display operation results, and to obtain user operation requests, test raw data, configuration files and routing conditions and send them to the business logic layer. The business logic layer is used to respond to the user operation request, call the interface of the data processing layer, transmit the test raw data, configuration file and splitting condition transmission, receive the split data returned by the data processing layer, send it to the user interface layer, call the interface of the data storage layer, and transmit the split data. The data processing layer is used to execute the user operation request, read the test raw data, configuration file and routing conditions, perform routing processing on the test raw data, and send the routed data back to the business logic layer. The data storage layer is used to receive the split data and store the split data.
[0006] Furthermore, the configuration file is a test parameter table, and the format of the test parameter table is as follows: the first column is the parameter name, the second column is the quantization unit at the end, the third column is the number of bytes, the fourth column is the sign of the number of bytes, and the fifth column is the cumulative number of bytes.
[0007] Furthermore, the splitting conditions include: Specify the data type; the data type includes text type and binary type; When the data type is text, determine whether the original test data is divided into lines; if not, obtain the number of bytes per frame. When the data type is binary, obtain the number of bytes per frame.
[0008] Furthermore, before performing the splitting process at the data processing layer, it is determined whether the original test data is consistent with the splitting conditions; if the determination result is consistent, the splitting process is performed; if the determination result is inconsistent, an error message is issued and the current splitting operation is terminated.
[0009] Furthermore, the splitting process includes: Read the configuration file and the raw test data for each frame; According to the configuration file, determine whether the frame length, frame header, and checksum of each frame of test raw data are correct; if they are not correct, read the next frame of test raw data until they are correct, then extract the test raw data of the current frame. Determine the number of bytes in the test raw data of the current frame, determine the number of symbols in the test raw data of the current frame, and based on the determination result, call the corresponding splitting rule to perform physical quantity conversion, complete the splitting processing of the current frame, and send the splitting data of the current frame back to the business logic layer to continue the splitting processing of the test raw data of the next frame.
[0010] Furthermore, the judgment result includes signed and unsigned numbers; the physical quantity conversion refers to converting the original test data into the corresponding quantization unit according to the requirements of the configuration file.
[0011] Furthermore, the routing rules include: Read the raw test data of each frame, convert the raw test data of each frame into decimal data according to the configuration file, and then multiply it by the corresponding quantization unit to obtain the split data.
[0012] Furthermore, the routing rules are invoked based on whether the number of signs is signed or unsigned, specifically including: When the original test data is an unsigned number, the splitting rule expression is: ; When the original test data is a signed number, distinguish between signed positive numbers and signed negative numbers; if it is a signed positive number, the splitting rule expression is: If the number is a signed negative number, the splitting rule expression is: ; Where n is the number of hexadecimal digits, d i It is the decimal value corresponding to the i-th digit of the hexadecimal number.
[0013] Furthermore, when the original test data is a signed negative number, first obtain the binary number of the absolute value of the original test data, add 1, and then call the corresponding routing rule.
[0014] Furthermore, when reading the configuration file, after reading the information from the test parameter table into an array, the first number in the array is deleted; the first number in the array is the comment of the first line of the configuration file.
[0015] The beneficial effects of this invention are as follows: This invention, developed based on the Qt architecture, achieves cross-platform operation. It can be executed independently or called by other software. Through an external splitting configuration file, the compatibility, universality, and scalability of the splitting platform are improved. For different test data, there is no need to develop separate test data splitting tools; only the external splitting configuration file needs to be modified. This enables rapid modification of software parameters and software deployment, and allows for the extraction, transformation, and calculation of hundreds or thousands of test parameters, significantly reducing the difficulty of software maintenance and improving work efficiency. Attached Figure Description
[0016] Figure 1 This is a structural diagram of the Qt-based universal test data splitting platform provided by the present invention; Figure 2 This is a flowchart of the logic for judging the original test data and splitting conditions before splitting processing provided by the present invention; Figure 3 This is a logic flowchart of the branching process provided by the present invention. Detailed Implementation
[0017] The technical solution of the present invention is further described below, but the scope of protection is not limited to what is described.
[0018] This invention provides a general test data splitting platform based on Qt, such as... Figure 1 As shown, it includes: user interface layer C100, business logic layer C200, data processing layer C300 and data storage layer C400; The user interface layer C100 is used to interact with the user and display operation results, and to obtain user operation requests, test raw data, configuration files and routing conditions and send them to the business logic layer; the test raw data is a composite data stream of multiple signals; The configuration file is a test parameter table, and the format of the test parameter table is as follows: the first column is the parameter name, the second column is the quantization unit at the end, the third column is the number of bytes, the fourth column is the sign (signed or unsigned) flag, and the fifth column is the cumulative number of bytes. The test parameter table is shown in Table 1. Table 1 Test Parameter Table
[0019] The splitting conditions include: Specify the data type; the data type includes text type and binary type; When the data type is text (.txt format), determine whether the original test data is line-broken; if not, obtain the number of bytes per frame. When the data type is binary (.bin format), obtain the number of bytes per frame.
[0020] The user interface layer C100 is the human-computer interaction interface, designed to enable interaction with the user. It is designed using QtDesigner, where controls such as buttons, labels, and input boxes are dragged and dropped to build the interface. The completed interface is saved as a .ui file, an XML-based file that records all interface information in detail. The .ui file can be integrated with C++ code, achieving separation of the interface and logic. The human-computer interaction interface consists of a left panel and a right panel. The left panel is used to set the test data splitting requirements, including whether the original data is split into lines, the original data format, the configuration file selection, the test original data selection, and the display of the storage location of the split data. The right panel is used to display the contents of the parameter configuration file. The right panel only has viewing permissions and does not have modification permissions. The purpose is to prevent accidental modification, which would lead to incorrect test data routing results.
[0021] Qt is a cross-platform C++ application and user interface framework that enables "write once, run anywhere," meaning that you can write code once and run it on multiple different operating systems such as Windows, Linux, and Kylin. It has good compatibility, can significantly reduce development costs and improve development efficiency, and cross-platform development also facilitates unified maintenance and updates of software, improving software stability and security.
[0022] The test data general-purpose splitting platform provided by this invention is developed based on the Qt framework and has good cross-platform compatibility.
[0023] The business logic layer C200 is used to respond to the user operation request, call the interface of the data processing layer, and transmit the test raw data, configuration file and splitting conditions; receive the split data returned by the data processing layer, send it to the user interface layer, call the interface of the data storage layer, and transmit the split data; and coordinate the data exchange between the layers.
[0024] The data processing layer C300 is used to execute the user operation request, read the test raw data, configuration file and splitting conditions, split the test raw data, and send the split data back to the business logic layer. Before the data processing layer performs splitting, it determines whether the original test data is consistent with the splitting conditions. If the result is consistent, splitting is performed; if the result is inconsistent, an error message is issued and the splitting operation ends. The judgment logic flow is as follows: Figure 2 As shown; The logic flow of the de-routing process is as follows: Figure 3 As shown, it includes: Read the configuration file and the raw test data for each frame; According to the configuration file, determine whether the frame length, frame header, and checksum of each frame of test raw data are correct; if they are not correct, read the next frame of test raw data until they are correct, then extract the test raw data of the current frame. Determine the number of bytes in the test raw data of the current frame, determine the number of symbols in the test raw data of the current frame, and based on the determination result, call the corresponding splitting rule to perform physical quantity conversion, complete the splitting processing of the current frame, and send the splitting data of the current frame back to the business logic layer to continue the splitting processing of the test raw data of the next frame.
[0025] The judgment result includes signed and unsigned numbers; the physical quantity conversion refers to converting the raw test data into the corresponding quantization unit according to the requirements of the configuration file.
[0026] The routing rules include: Read the raw test data of each frame, convert the raw test data of each frame into decimal data according to the configuration file, and then multiply it by the corresponding quantization unit to obtain the split data.
[0027] The routing rules are invoked based on whether the number is signed or unsigned, specifically including: When the original test data is an unsigned number, the splitting rule expression is: (1) Taking parameter 1 (parameter 1 is an unsigned number) as an example, assuming that the hexadecimal of parameter 1 in the original test data is 0xAB30, it is converted according to formula (1), and the decimal result is 43824 (D=(A×163+B×162+3×161+0×160)×1=(10×163+11×162+3×161+0×160)×1=43824).
[0028] When the original test data is signed numbers, distinguish between signed positive numbers and signed negative numbers; If the number is a signed positive number, the splitting rule expression is: (2) If the number is a signed negative number, the splitting rule expression is: (3) Where n is the number of hexadecimal digits, d i It is the decimal value corresponding to the i-th digit of the hexadecimal number.
[0029] When the original test data is a signed negative number, first obtain the binary number of the absolute value of the original test data, add 1, and then call the corresponding routing rule.
[0030] Taking the conversion parameter 4 (parameter 4 is a signed number) as an example, assuming that the hexadecimal of parameter 4 in the original test data is 0x5A, 0x5A is converted to binary as 01011010, the highest bit is 0, so it is a positive number. According to formula (2), the conversion is performed and the decimal result is 90 (D=(0×20+1×21+0×22+1×23+1×24+0×25+1×26)×1=90). Assuming the hexadecimal representation of parameter 4 in the original test data is 0xA2, 0xA2 is converted to binary as 10100010, the highest bit is 1, so it is a negative number. The binary is inverted to 01011101, and then 1 is added to get 01011110. According to formula (3), the decimal representation is -94 (D=-(0×20+1×21+1×22+1×23+1×24+0×25+1×26)×1=-94).
[0031] When reading the configuration file, after reading the information from the test parameter table into an array, the first number in the array is deleted; the first number in the array is the comment of the first line of the configuration file.
[0032] The data storage layer C400 is used to receive the split data and store it. The storage file type is text (.txt), and the file name format is year-month-day-hour-minute-second-output.txt, such as 2026-03-18-10-12-36-output.txt. The split file can be opened with a text editor, Excel, UltraEdit, or other similar tools.
[0033] The Qt-based universal test data splitting platform provided by this invention can split data for two types of test data. The first data type: test data is saved as a text file (.txt type). When the test data is not split into lines, the number of bytes per frame needs to be entered in the user interface layer. The second data type: test data is saved as a binary file (.bin type). The number of bytes per frame needs to be entered in the user interface layer.
[0034] The above-disclosed embodiments are merely specific examples of the present invention. However, the present invention is not limited thereto, and any variations that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. A general test data splitting platform based on Qt, characterized in that, include: User interface layer, business logic layer, data processing layer, and data storage layer; The user interface layer is used to interact with the user and display operation results, and to obtain user operation requests, test raw data, configuration files and routing conditions and send them to the business logic layer. The business logic layer is used to respond to the user operation request, call the interface of the data processing layer, transmit the test raw data, configuration file and splitting condition transmission, receive the split data returned by the data processing layer, send it to the user interface layer, call the interface of the data storage layer, and transmit the split data. The data processing layer is used to execute the user operation request, read the test raw data, configuration file and routing conditions, perform routing processing on the test raw data, and send the routed data back to the business logic layer. The data storage layer is used to receive the split data and store the split data.
2. The Qt-based universal test data splitting platform as described in claim 1, characterized in that, The configuration file is a test parameter table, and the format of the test parameter table is as follows: the first column is the parameter name, the second column is the quantization unit at the end, the third column is the number of bytes, the fourth column is the sign of the number of bytes, and the fifth column is the cumulative number of bytes.
3. The Qt-based universal test data splitting platform as described in claim 1, characterized in that, The splitting conditions include: Specify the data type; the data type includes text type and binary type; When the data type is text, determine whether the original test data is divided into lines; if not, obtain the number of bytes per frame. When the data type is binary, obtain the number of bytes per frame.
4. The Qt-based universal test data splitting platform as described in claim 3, characterized in that, Before performing splitting processing in the data processing layer, it is determined whether the original test data is consistent with the splitting conditions; if the result is consistent, splitting processing is performed; if the result is inconsistent, an error message is issued and the current splitting operation is terminated.
5. The Qt-based universal test data splitting platform as described in claim 2, characterized in that, The splitting process includes: Read the configuration file and the raw test data for each frame; According to the configuration file, determine whether the frame length, frame header, and checksum of each frame of test raw data are correct; if they are not correct, read the next frame of test raw data until they are correct, then extract the test raw data of the current frame. Determine the number of bytes in the test raw data of the current frame, determine the number of symbols in the test raw data of the current frame, and based on the determination result, call the corresponding splitting rule to perform physical quantity conversion, complete the splitting processing of the current frame, and send the splitting data of the current frame back to the business logic layer to continue the splitting processing of the test raw data of the next frame.
6. The Qt-based universal test data splitting platform as described in claim 5, characterized in that, The judgment result includes signed and unsigned numbers; the physical quantity conversion refers to converting the raw test data into the corresponding quantization unit according to the requirements of the configuration file.
7. The Qt-based universal test data splitting platform as described in claim 6, characterized in that, The routing rules include: Read the raw test data for each frame, convert the raw test data for each frame into decimal data according to the configuration file, and then multiply it by the corresponding quantization unit to obtain the split data.
8. The Qt-based universal test data splitting platform as described in claim 7, characterized in that, The routing rules are invoked based on whether the number is signed or unsigned, specifically including: When the original test data is an unsigned number, the splitting rule expression is: ; When the original test data is a signed number, distinguish between signed positive numbers and signed negative numbers; if it is a signed positive number, the splitting rule expression is: If the number is a signed negative number, the splitting rule expression is: ; Where n is the number of hexadecimal digits, d i It is the decimal value corresponding to the i-th digit of the hexadecimal number.
9. The Qt-based universal test data splitting platform as described in claim 8, characterized in that, When the original test data is a signed negative number, first obtain the binary number of the absolute value of the original test data, add 1, and then call the corresponding routing rule.
10. The Qt-based universal test data splitting platform as described in claim 5, characterized in that, When reading the configuration file, after reading the information from the test parameter table into an array, the first number in the array is deleted; the first number in the array is the comment of the first line of the configuration file.