Method and apparatus for generating task test data
By automating the generation of task test data, the problems of cumbersome and error-prone cross-platform operations have been solved, enabling efficient and accurate test data creation and ensuring the quality of the test environment and the online environment.
Patent Information
- Application Number
- CN202210254001.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-03-15
AI Technical Summary
During project testing on internet live streaming platforms and task platforms, creating task test data requires crossing multiple platforms, which is cumbersome, prone to errors, time-consuming, inefficient, and has poor test effectiveness.
By generating task test data automatically, configuring task type parameters, and calling the task interface of a third-party platform, the system can automatically connect material data, ensuring data accuracy and improving testing efficiency and effectiveness.
By automating the process to generate task test data, human error is reduced, the test cycle is shortened, the test efficiency and effectiveness are improved, and the product quality in the test environment and the online environment is guaranteed.
Smart Images

Figure CN114625649B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for generating task test data. Background Art
[0002] During project testing on internet live streaming platforms and task platforms, creating usable task test data relies on third-party platforms. Different task types depend on different base data from these third-party platforms. Because the uniqueness of the base data needs to be verified within the task system, a large amount of base data needs to be created during the testing cycle. Each piece of base data must undergo creation, review, and verification steps before it can be used in the live streaming and content task system to achieve usability.
[0003] In the process of realizing this invention, the inventors discovered at least the following problems in the prior art:
[0004] As the project develops, the number of task types will increase frequently. When creating test data based on different task types, it is necessary to cross multiple platforms, which is cumbersome and prone to errors. At the same time, creating test data during the testing cycle is time-consuming and costly, resulting in low testing efficiency and effectiveness. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a method and apparatus for generating task test data, which can generate task test data automatically. By configuring task types, parameters are made configurable, improving scalability and alleviating testing pressure in environments with a high frequency of increasing task types. By calling the task interface of a third-party platform to generate material data, the correctness of the generated material data can be guaranteed. Interconnection is achieved at the interface level, automatically connecting multiple system platforms and solving the problem of a large amount of erroneous data caused by human operation. The automated process improves testing efficiency and effectiveness, shortens the testing cycle, and ensures the product quality in both the testing environment and the online environment.
[0006] To achieve the above objectives, according to one aspect of the present invention, a method for generating task test data is provided, comprising:
[0007] Material data environment variables are obtained by processing the basic material data;
[0008] The material data environment variables are used as interface parameters to generate material data by calling the task interface of a third-party platform, and the data identifier of the material data is generated according to the task type of the task interface.
[0009] Based on the task type of the task test data to be generated and the data identifier of the material data, select the corresponding material data from the material data;
[0010] Generate task test data based on the selected material data.
[0011] Optionally, processing the basic material data to obtain material data environment variables includes: processing the basic material data according to the data processing rules of a third-party platform to obtain material data environment variable values; and assigning values to pre-set material data environment variable parameters based on the material data environment variable values to obtain material data environment variables.
[0012] Optionally, the task interface of the third-party platform includes at least one sub-task interface; using the material data environment variable as an interface parameter, and generating material data by calling the task interface of the third-party platform, includes: using the material data environment variable as an interface parameter, and calling the task interface of the third-party platform to sequentially process data and generate material data according to the task execution flow corresponding to the task interface, wherein the task execution flow includes the calling order of the at least one sub-task interface and the calling relationship between the at least one sub-task interface.
[0013] Optionally, after generating material data by calling the task interface of a third-party platform and generating a data identifier for the material data according to the task type of the task interface, the method further includes: establishing an association between material data environment variables and the material data and the data identifier of the material data.
[0014] Optionally, before generating task test data based on the selected material data, the method further includes: validating the selected material data for validity, uniqueness, and timeliness.
[0015] Optionally, the validity of the selected material data can be verified by querying whether the data identifier of the selected material data exists on the third-party platform; the uniqueness of the selected material data can be verified by querying whether the data identifier of the selected material data has been used; and the timeliness of the selected material data can be verified according to the validity period of the selected material data and the preset expiration verification rules.
[0016] Optionally, before generating task test data based on the selected material data, the method further includes: processing the task base data to obtain task data environment variables; generating task test data based on the selected material data includes: generating task test data based on the task data environment variables and the selected material data.
[0017] According to another aspect of the present invention, an apparatus for generating task test data is provided, comprising:
[0018] The environment variable generation module is used to process the basic material data to obtain material data environment variables;
[0019] The material data generation module is used to generate material data by calling the task interface of a third-party platform, using the material data environment variables as interface parameters, and generating the data identifier of the material data according to the task type of the task interface.
[0020] The material data selection module is used to select the corresponding material data from the material data according to the task type of the task test data to be generated and the data identifier of the material data;
[0021] The test data generation module is used to generate task test data based on the selected material data.
[0022] According to another aspect of the present invention, an electronic device for generating task test data is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating task test data provided in the embodiments of the present invention.
[0023] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method for generating task test data provided in the embodiments of the present invention.
[0024] One embodiment of the above invention has the following advantages or beneficial effects: Material data environment variables are obtained by processing basic material data; material data environment variables are used as interface parameters to generate material data by calling the task interface of a third-party platform, and a data identifier for the material data is generated according to the task type of the task interface; corresponding material data is selected from the material data based on the task type of the task test data to be generated and the data identifier of the material data; the technical solution of generating task test data based on the selected material data can realize the generation of task test data automatically, and the parameters are configurable by configuring the task type, improving scalability and alleviating the testing pressure in environments with a high frequency of increasing task types; generating material data by calling the task interface of a third-party platform ensures the correctness of the generated material data, and achieves interconnection at the interface level, automatically connecting multiple system platforms and solving the problem of a large amount of erroneous data caused by human operation; the automated process improves testing efficiency and effectiveness, shortens the testing cycle, and ensures the product quality of the testing environment and the online environment.
[0025] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0026] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0027] Figure 1 This is a schematic diagram of the main steps of a method for generating task test data according to an embodiment of the present invention;
[0028] Figure 2 This is a schematic diagram illustrating the implementation principle of one embodiment of the present invention;
[0029] Figure 3 This is a schematic diagram of the modules of a material creation system according to an embodiment of the present invention;
[0030] Figure 4 This is a schematic diagram of the material data creation process according to an embodiment of the present invention;
[0031] Figure 5 This is a schematic diagram of a task creation system according to an embodiment of the present invention;
[0032] Figure 6 This is a schematic diagram of the main modules of the apparatus for generating task test data according to an embodiment of the present invention;
[0033] Figure 7 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0034] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0035] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0036] To address the technical problems existing in the prior art, this invention provides a method for generating task test data. This method generates task test data automatically, and by configuring task types, parameters are made configurable, improving scalability and alleviating testing pressure in environments with a high frequency of increasing task types. At the interface level, it can automatically connect multiple system platforms, resolving the problem of large amounts of erroneous data caused by human operation. Automated processes improve efficiency, shorten testing cycles, and ensure product quality in both the testing and online environments.
[0037] Figure 1This is a schematic diagram illustrating the main steps of a method for generating task test data according to an embodiment of the present invention. Figure 1 As shown, the method for generating task test data in this embodiment of the invention mainly includes the following steps S101 to S104.
[0038] Step S101: Process the material base data to obtain material data environment variables. The material base data is prepared in advance. Base data can be understood as all the data that a task depends on, such as dependent material base data, task base data, etc. In the embodiments of the present invention, the material base data is not related to the task type. For example, the material base data can be an article, a video, a URL, or a webpage, etc., and different material data can be generated using the same material base data according to different task types. If the task type is a live streaming task, then material data for a live streaming task type can be generated based on the material base data; if the task type is an article task, then material data for an article task type can be generated based on the material base data, and so on.
[0039] Step S102: Using the material data environment variables as interface parameters, material data is generated by calling the task interface of a third-party platform, and a data identifier for the material data is generated according to the task type of the task interface. Material data generally refers to intermediate data or semi-finished product data. In the embodiments of the present invention, the material data is used to generate task test data and has a data identifier corresponding to the task type. The task type is, for example, a live streaming task, an article task, a course task, or other tasks, etc. When generating data identifiers according to task types, different data identifier ranges are set for different task types, or different data identifier encoding rules are set, etc. Furthermore, the association between task types and their associated data identifiers is saved.
[0040] In one embodiment of the present invention, the material data can be generated as follows: material base data is processed to obtain material data environment variables; the material data environment variables are used as interface parameters to generate material data by calling the task interface of a third-party platform, and a data identifier for the material data is generated according to the task type of the task interface. The material base data is prepared in advance. Base data can be understood as all the data required to create a task, such as dependent material base data, task base data, etc. In this embodiment of the present invention, the material base data is not related to the task type. For example, the material base data can be an article, a video, a URL, or a webpage, etc., and different material data can be generated using the same material base data according to different task types. If the task type is a live streaming task, material data for a live streaming task type can be generated based on the material base data; if the task type is an article task, material data for an article task type can be generated based on the material base data, and so on. When generating material data, it needs to be generated based on different third-party platforms, and different third-party platforms will correspond to different task types when generating material data.
[0041] According to one embodiment of the present invention, processing material basic data to obtain material data environment variables may specifically include: processing the material basic data according to the data processing rules of a third-party platform to obtain material data environment variable values; and assigning values to pre-set material data environment variable parameters based on the material data environment variable values to obtain material data environment variables. When generating material data environment variables, the environment variables to be generated can be pre-set. Environment variables refer to variables set in the environment of the entire system, such as variables configured in the [Test Environment] in a test environment. Generally, environment variables can be divided into general parameters (variables that can be used and are effective in [Environment 1], [Environment 2], and [Environment N], such as username, password, token, etc.), quantitative parameters (values that do not change in the environment, such as gender), and variable parameters (values that change in the environment, such as the playback time of live material data, etc.). For different environments and different third-party platforms, environment variable configuration can be flexibly defined. In the embodiments of the present invention, when defining environment variables, not only material data environment variables but also task data environment variables need to be defined for use in generating task basic data and during task creation. Then, values can be assigned to the predefined and configured environment variable parameters to generate material data environment variables and task data environment variables.
[0042] According to the technical solution of the present invention, when assigning values to environmental variable parameters, the material basic data can be processed according to the data processing rules of a third-party platform to obtain material data environmental variable values; then, the material data environmental variable parameters are assigned values according to the material data environmental variable values to obtain material data environmental variables. Correspondingly, the method for generating task data environmental variables is the same as the method for generating material data environmental variables. When processing the material basic data, corresponding general parameters and quantitative parameters can be extracted from the material basic data. Then, a random algorithm can be used to process the material basic data to randomly generate different data content as variable parameters so that it can pass the deduplication check. For example, for an article, a random algorithm can be used to generate a title for the article to differentiate it from previous article titles. In one embodiment of the present invention, assuming the material basic data is an article, the material basic data can include content title, content subtitle, channel source, cover, specific text content, etc.; quantitative parameters, such as channel source, cover, etc., can be extracted from the material basic data; then, after processing the material data using a random algorithm, the generated article title is, for example, "Abdominal Pain Treatment Theory" (different from previous article titles).
[0043] After generating the material data environment variable, it can be used as an interface parameter to generate material data by calling the task interface of a third-party platform. A data identifier for the material data is then generated based on the task type of the task interface. Different third-party platforms will generate different data identifiers for the material data, and the same material data environment variable can be used on multiple different third-party platforms to generate different material data. In other words, there is a one-to-many relationship between the material data environment variable, the material data, and its data identifier.
[0044] According to one embodiment of the present invention, the task interface of the third-party platform includes at least one sub-task interface. Furthermore, using material data environment variables as interface parameters, the material data is generated by calling the task interface of the third-party platform. Specifically, this may include: using material data environment variables as interface parameters, calling the task interface of the third-party platform, and sequentially calling the at least one sub-task interface to process data and generate material data according to the task execution flow corresponding to the task interface. The task execution flow includes the calling order of the at least one sub-task interface and the calling relationship between the at least one sub-task interface.
[0045] When generating material data, the material data environment variables can be used as interface parameters to call the task interface of a third-party platform. Each third-party platform has its own task execution flow. When the task interface of a third-party platform is called, the corresponding sub-task interfaces will be called according to the multiple sub-tasks included in the task execution flow, thereby achieving automated creation of material data. For example, when an article platform executes an article publishing task, the task execution flow may include sub-flows such as category creation, article creation, article publishing, submission for review, and review. Each sub-flow corresponds to a different sub-task interface. The interface parameters required by each sub-task interface can be extracted from the material data environment variables, thus enabling the generation of material data through a third-party platform. This ensures the authenticity of the generated material data and avoids testing errors. After generating the material data, data identifiers can also be generated according to the task type corresponding to the task interface.
[0046] According to one embodiment of the present invention, after generating material data by calling the task interface of a third-party platform and generating a data identifier for the material data according to the task type of the task interface, the method further includes: establishing an association between material data environment variables and the material data and the data identifier of the material data. After generating the material data and its data identifier, the data identifier is extracted, and an association is established between the data identifier, the material data, and the material data environment variables, and saved to a database for use when generating task test data. In addition, in embodiments of the present invention, an association can also be established between task data environment variables, material data environment variables, material data, and their data identifiers. Specifically, there is a one-to-one relationship between task data environment variables and material data environment variables, a one-to-one relationship between material data and its data identifier, and a one-to-many relationship between task data environment variables and material data environment variables and material data and its data identifier.
[0047] Step S103: Based on the task type of the task test data to be generated and the data identifier of the material data, select the corresponding material data from the material data. When generating task test data, it is necessary to filter the material data by combining the task type of the task test data to be generated and the data identifier of the material data to determine the corresponding material data, and the task type parameter can be carried over to subsequent processes.
[0048] Step S104: Generate task test data based on the selected material data. According to the technical solution of the present invention, before generating task test data based on the selected material data, the method further includes processing the task basic data to obtain task data environment variables. The method for generating the task data environment variables is the same as the aforementioned method for generating material data environment variables, and will not be repeated here. Specifically, when generating task test data based on the selected material data, the task test data is generated based on the task data environment variables and the selected material data.
[0049] According to one embodiment of the present invention, before generating task test data based on the selected material data, the method further includes: verifying the validity, uniqueness, and timeliness of the selected material data. After filtering out the material data corresponding to the task to be created, the selected material data can also be verified to ensure that the validity, uniqueness, and timeliness of the material data meet the requirements, thereby further improving the success rate of task creation. Specifically, in this embodiment of the present invention, the validity of the selected material data is verified by querying whether the data identifier of the selected material data exists on a third-party platform; the uniqueness of the selected material data is verified by querying whether the data identifier of the selected material data has already been used; and the timeliness of the selected material data is verified according to its validity period and preset expiration verification rules. When the data identifier of a material data exists on a third-party platform, it indicates that the material data is valid, not invalid. When the data identifier of a material data has not been used, it indicates that the material data is unique and has not been used by other tasks, thus passing the deduplication check. When the material data is still within its validity period, it indicates that the material data is still within its time limit. Generally, task test data created from material data that has exceeded its validity period will not be effective for testing (for example, if the material data for a live streaming task has exceeded the live streaming time range, then using it to create task test data is meaningless). Therefore, by verifying the timeliness of the material data, the success rate and effectiveness of task test data creation can be guaranteed.
[0050] Figure 2 This is a schematic diagram illustrating the implementation principle of one embodiment of the present invention. For example... Figure 2As shown, the method for generating task test data according to the present invention mainly involves a material creation system, a material data identifier transmission system, and a task creation system. The material creation system enables third-party platforms (e.g., live streaming platforms, article platforms, content platforms, teaching platforms, new user platforms, etc.) to automatically create materials and generates and stores corresponding material data identifiers for different task types. The material data identifier transmission system transmits the generated material data identifiers to the task creation system for filtering and use according to task type. The task creation system extracts the material data identifiers and obtains the material data based on the created task type, and generates task test data based on the material data. Finally, after generating the task test data, the corresponding task can be displayed on the front end so that users can claim the task, execute it, and receive rewards to complete the task test.
[0051] Figure 3 This is a schematic diagram of the modules of a material creation system according to an embodiment of the present invention. Figure 3 As shown in the embodiments of the present invention, the material creation system includes an environment variable configuration module, a material data creation module, and an environment variable update module. The environment variable configuration module is used to set environment variables, including material data environment variables and task data environment variables; the material data creation module is used to create material data based on the material data environment variables and generate data identifiers for the material data; the environment variable update module is used to establish an association between the material data and its data identifiers and the environment variables, and then save the data.
[0052] Figure 4 This is a schematic diagram illustrating the material data creation process according to an embodiment of the present invention. Figure 4 As shown, after generating the material data environment variables, these variables are used as interface parameters to call the third-party platform's task interface. This allows the third-party platform's task interface to sequentially call various sub-task interfaces according to the task execution flow to complete the material data creation. The interface parameters of each sub-task interface are extracted from the material data environment variables. The various sub-processes in the task execution flow may execute in parallel, sequentially, or a combination of both. Figure 4 In this example, taking the parallel execution of various sub-processes as an example, each sub-task interface selects the required interface parameters from the material data environment variables in parallel to create material data.
[0053] Figure 5 This is a schematic diagram of the modules of a task creation system according to an embodiment of the present invention. Figure 5As shown in the embodiments of the present invention, the task creation system includes a task type filtering module, a material data verification module, and an automatic task creation module. The task type filtering module is mainly used to filter corresponding material data from the material data based on the task type of the task test data to be generated; the material data verification module is used to verify the validity, uniqueness, and timeliness of the filtered material data; and the automatic task creation module is used to automatically complete task creation and generate task test data based on task data environment variables and material data.
[0054] Figure 6 This is a schematic diagram of the main modules of an apparatus for generating task test data according to an embodiment of the present invention. Figure 6 As shown, the apparatus 600 for generating task test data in this embodiment of the invention mainly includes an environmental variable generation module 601, a material data generation module 602, a material data selection module 603, and a test data generation module 604.
[0055] The environment variable generation module 601 is used to process the basic material data to obtain material data environment variables;
[0056] The material data generation module 602 is used to generate material data by calling the task interface of a third-party platform, using the material data environment variable as an interface parameter, and generating a data identifier for the material data according to the task type of the task interface.
[0057] The material data selection module 603 is used to select the corresponding material data from the material data according to the task type of the task test data to be generated and the data identifier of the material data;
[0058] The test data generation module 604 is used to generate task test data based on the selected material data.
[0059] According to an embodiment of the present invention, the environmental variable generation module 601 can also be used to: process the material basic data according to the data processing rules of a third-party platform to obtain material data environmental variable values; and assign values to pre-set material data environmental variable parameters according to the material data environmental variable values to obtain material data environmental variables.
[0060] According to another embodiment of the present invention, the task interface of the third-party platform includes at least one sub-task interface; the material data generation module 602 can also be used to: take the material data environment variable as an interface parameter, and call the task interface of the third-party platform to call the at least one sub-task interface sequentially to process data and generate material data according to the task execution flow corresponding to the task interface, wherein the task execution flow includes the calling order of the at least one sub-task interface and the calling relationship between the at least one sub-task interface.
[0061] According to another embodiment of the present invention, the material data generation module 602 can also be used to: after generating material data by calling the task interface of a third-party platform and generating the data identifier of the material data according to the task type of the task interface, establish the association between the material data environment variable and the material data and the data identifier of the material data.
[0062] According to another embodiment of the present invention, the apparatus 600 for generating task test data may further include a material data verification module (not shown in the figure) for verifying the validity, uniqueness and timeliness of the selected material data before generating task test data based on the selected material data.
[0063] According to another embodiment of the present invention, the validity of the selected material data is verified by querying whether the data identifier of the selected material data exists on the third-party platform; the uniqueness of the selected material data is verified by querying whether the data identifier of the selected material data has been used; and the timeliness of the selected material data is verified according to the validity period of the selected material data and the preset expiration verification rules.
[0064] According to another embodiment of the present invention, the apparatus 600 for generating task test data may further include a task environment variable generation module (not shown in the figure), which is used to: process the task basic data to obtain task data environment variables before generating task test data based on the selected material data; and the test data generation module 604 may also be used to: generate task test data based on the task data environment variables and the selected material data.
[0065] According to the technical solution of this invention, material data environment variables are obtained by processing basic material data; material data environment variables are used as interface parameters to generate material data by calling the task interface of a third-party platform, and data identifiers of the material data are generated according to the task type of the task interface; corresponding material data is selected from the material data according to the task type of the task test data to be generated and the data identifiers of the material data; the technical solution of generating task test data according to the selected material data can realize the generation of task test data in an automated manner. By configuring the task type, the parameters are configurable, improving scalability and alleviating the testing pressure in an environment with a high frequency of increasing task types; by calling the task interface of a third-party platform to generate material data, the correctness of the generated material data can be guaranteed, and the interface level is connected to automatically connect multiple system platforms, solving the problem of a large amount of erroneous data caused by human operation; the automated process improves testing efficiency and effectiveness, shortens the testing cycle, and ensures the product quality of the testing environment and the online environment.
[0066] Figure 7 An exemplary system architecture 700 is shown, which can be applied to a method or apparatus for generating task test data according to embodiments of the present invention.
[0067] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, and 703, a network 704, and a server 705. Network 704 serves as the medium for providing communication links between terminal devices 701, 702, and 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0068] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as data testing applications, live streaming platform applications, document reading applications, social media platform software, etc. (for example only).
[0069] Terminal devices 701, 702, and 703 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0070] Server 705 can be a server providing various services, such as a backend management server supporting shopping websites browsed by users using terminal devices 701, 702, and 703 (for example only). The backend management server can process received task test data generation requests and other data to obtain material data environment variables from the basic material data; use these material data environment variables as interface parameters to generate material data by calling the task interface of a third-party platform, and generate a data identifier for the material data based on the task type of the task interface; select the corresponding material data from the material data according to the task type of the task test data to be generated and the data identifier of the material data; generate task test data based on the selected material data, and feed back the processing results (e.g., the generated task test data – for example only) to the terminal device.
[0071] It should be noted that the method for generating task test data provided in the embodiments of the present invention is generally executed by server 705, and correspondingly, the device for generating task test data is generally located in server 705.
[0072] It should be understood that Figure 7 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0073] The following is for reference. Figure 8 It shows a schematic diagram of the structure of a computer system 800 suitable for implementing terminal devices or servers of the present invention. Figure 8 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0074] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the system 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0075] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0076] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the functions defined above in the system of this invention.
[0077] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0079] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including an environment variable generation module, a material data generation module, a material data selection module, and a test data generation module. The names of these units or modules do not necessarily limit the specific unit or module itself; for example, the environment variable generation module can also be described as "a module for processing basic material data to obtain material data environment variables."
[0080] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: processing material basic data to obtain material data environment variables; using the material data environment variables as interface parameters to generate material data by calling a task interface of a third-party platform, and generating a data identifier for the material data according to the task type of the task interface; selecting corresponding material data from the material data according to the task type of the task test data to be generated and the data identifier of the material data; and generating task test data based on the selected material data.
[0081] According to the technical solution of this invention, material data environment variables are obtained by processing basic material data; material data environment variables are used as interface parameters to generate material data by calling the task interface of a third-party platform, and data identifiers of the material data are generated according to the task type of the task interface; corresponding material data is selected from the material data according to the task type of the task test data to be generated and the data identifiers of the material data; the technical solution of generating task test data according to the selected material data can realize the generation of task test data in an automated manner. By configuring the task type, the parameters are configurable, improving scalability and alleviating the testing pressure in an environment with a high frequency of increasing task types; by calling the task interface of a third-party platform to generate material data, the correctness of the generated material data can be guaranteed, and the interface level is connected to automatically connect multiple system platforms, solving the problem of a large amount of erroneous data caused by human operation; the automated process improves testing efficiency and effectiveness, shortens the testing cycle, and ensures the product quality of the testing environment and the online environment.
[0082] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for generating task test data, characterized in that, include: Based on the data processing rules of the third-party platform, the material basic data is processed to obtain the material data environment variable values; The material data environment variables are obtained by assigning values to the pre-set material data environment variable parameters based on the material data environment variable values. The material data environment variables are used as interface parameters to generate material data by calling the task interface of a third-party platform, and a data identifier for the material data is generated according to the task type of the task interface; the task interface of the third-party platform includes at least one sub-task interface; Based on the task type of the task test data to be generated and the data identifier of the material data, select the corresponding material data from the material data; Generate task test data based on the selected material data; The method of using the material data environment variables as interface parameters to generate material data by calling the task interface of a third-party platform includes: using the material data environment variables as interface parameters to call the task interface of a third-party platform, and calling at least one sub-task interface in sequence to process data and generate material data according to the task execution flow corresponding to the task interface. The task execution flow includes the calling order of the at least one sub-task interface and the calling relationship between the at least one sub-task interface.
2. The method according to claim 1, characterized in that, After generating material data by calling the task interface of a third-party platform and generating a data identifier for the material data according to the task type of the task interface, the method further includes: Establish the association between the material data environment variables and the material data and the data identifier of the material data.
3. The method according to claim 1, characterized in that, Before generating task test data based on the selected material data, the following steps are also included: The selected material data is validated for validity, uniqueness, and timeliness.
4. The method according to claim 3, characterized in that, The validity of the selected material data is verified by querying whether the data identifier of the selected material data exists on the third-party platform; The uniqueness of the selected material data is verified by checking whether the data identifier of the selected material data has already been used. The timeliness of the selected material data is verified based on the validity period of the selected material data and the preset expiration verification rules.
5. The method according to claim 1, characterized in that, Before generating task test data based on the selected material data, the following steps are also included: The task's basic data is processed to obtain the task data environment variables; Generate task test data based on the selected material data, including: Task test data is generated based on the task data environment variables and the selected material data.
6. An apparatus for generating task test data, characterized in that, include: The environment variable generation module is used to process the basic material data according to the data processing rules of the third-party platform to obtain the material data environment variable values; The material data environment variables are obtained by assigning values to the pre-set material data environment variable parameters based on the material data environment variable values. The material data generation module is used to generate material data by calling the task interface of a third-party platform, using the material data environment variables as interface parameters, and generating a data identifier for the material data according to the task type of the task interface; the task interface of the third-party platform includes at least one sub-task interface; The material data generation module is also used to: take the material data environment variable as an interface parameter, call the task interface of a third-party platform, and in accordance with the task execution flow corresponding to the task interface, call the not less than one sub-task interface to process the data sequentially and generate material data. The task execution flow includes the calling order of the not less than one sub-task interface and the calling relationship between the not less than one sub-task interface. The material data selection module is used to select the corresponding material data from the material data according to the task type of the task test data to be generated and the data identifier of the material data; The test data generation module is used to generate task test data based on the selected material data.
7. An electronic device for generating task test data, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Software testing method and device
CN113760714A
Service calling method and device, storage medium and electronic equipment
CN113806037A