CN-122019390-A - Test document data generation method, computer device and storage medium
Abstract
The application relates to a test document data generation method, computer equipment and storage medium. The method comprises the steps of obtaining service attribute information sets corresponding to all service fields in a target service bill and associated fields in associated bills corresponding to the target service bill, determining field mapping relations between the service fields and the corresponding associated fields based on associated field identifiers in the service attribute information sets corresponding to the service fields, determining field value construction modes of the service fields based on field tags in the service attribute information sets corresponding to the service fields, determining field value sets corresponding to the service fields based on the field value construction modes of the service fields, and determining test bill data corresponding to the target service bill based on the field value sets and the field mapping relations corresponding to the service fields. The method can improve the flexibility of testing the bill data.
Inventors
- LU JIA
- LIAO SHANGYING
- HUANG JIAJUN
- HUANG YUMEI
Assignees
- 金蝶软件(中国)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260206
Claims (11)
- 1. A method of generating test document data, the method comprising: Acquiring a service attribute information set corresponding to each service field in a target service bill and an associated field in an associated bill corresponding to the target service bill; determining a field mapping relation between the service field and the corresponding associated field based on the associated field identification in the service attribute information set corresponding to the service field; determining a field value construction mode of the service field based on a field label in the service attribute information set corresponding to the service field; determining a field value set corresponding to the service field based on a field value construction mode of the service field; and determining the test bill data corresponding to the target business bill based on the field value set and the field mapping relation corresponding to each business field.
- 2. The method of claim 1, further comprising, prior to said determining a set of field values corresponding to said service field based on a manner in which field values for said service field are structured: acquiring the number of documents and the number of entries corresponding to the target business documents; The determining the field value set corresponding to the service field based on the field value construction mode of the service field includes: Determining the total number of constructions based on the number of documents and the number of entries; Determining the field value of the total construction number based on the field value construction mode of the service field; And determining a field value set corresponding to the service field based on the field value of the construction total number.
- 3. The method according to claim 1, wherein the determining the set of field values corresponding to the service field based on the field value construction manner of the service field includes: under the condition that the field value construction mode of the service field is direct construction, randomly generating a field value corresponding to the service field; And generating a field value set corresponding to the service field based on the field value corresponding to the service field.
- 4. The method according to claim 1, wherein the determining the set of field values corresponding to the service field based on the field value construction manner of the service field includes: under the condition that the field value construction mode of the service field is a secondary analysis construction, determining a field type corresponding to the service field based on a field label corresponding to the service field; determining a field value corresponding to the service field based on a field type corresponding to the service field and target metadata corresponding to the target service document; And generating a field value set corresponding to the service field based on the field value corresponding to the service field.
- 5. The method of claim 4, wherein the determining the field value corresponding to the service field based on the field type corresponding to the service field and the target metadata corresponding to the target service document comprises: acquiring an enumeration value set of the service field from target metadata corresponding to the target service bill under the condition that the field label of the service field is of an enumeration type; generating a field value corresponding to the service field based on the enumeration value set of the service field, wherein the field value corresponding to the service field is an enumeration value in the enumeration value set.
- 6. The method of claim 4, wherein the determining the field value corresponding to the service field based on the field type corresponding to the service field and the target metadata corresponding to the target service document comprises: Under the condition that the field type of the service field is the basic data type, acquiring a basic data identifier corresponding to the service field from target metadata corresponding to the target service bill; acquiring basic data metadata corresponding to the basic data identifier; And acquiring a basic data document corresponding to the basic data metadata, and generating a field value corresponding to the service field based on the basic value in the basic data document, wherein the field value corresponding to the service field is the basic value.
- 7. The method of claim 4, wherein the determining the field value corresponding to the service field based on the field type corresponding to the service field and the target metadata corresponding to the target service document comprises: Acquiring description information of the service field from target metadata corresponding to the target service bill under the condition that the field type of the service field is other types, and generating field information corresponding to the service field based on the description information, wherein the other types are types of removing enumeration types and basic material types, and the corresponding construction mode is a type of secondary analysis construction; saving the field information in a storage database to obtain a storage address of the field information in the storage database; and determining the storage address as a field value of the service field.
- 8. The method of claim 1, wherein the determining the test document data corresponding to the target business document based on the set of field values corresponding to the respective business fields and the field mapping relationship comprises: Determining a test service receipt corresponding to the target service receipt based on a field value set corresponding to the service field and the field mapping relation; generating an insertion statement corresponding to the test business bill based on the test business bill; And based on the inserted statement, saving the field value in the test business document in a test database to obtain test document data in the test database.
- 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 8 when the computer program is executed.
- 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 8.
- 11. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 8.
Description
Test document data generation method, computer device and storage medium Technical Field The present application relates to the field of computer technology, and in particular, to a test document data generating method, apparatus, computer device, storage medium, and computer program product. Background With the development of computer technology, the business system is widely applied to various enterprise management scenes, and business documents with different forms and contents are usually presented in pages of the business system. In order to test the functions and service logic of a service system, corresponding document data is generally required to be constructed for service documents in the service system, and is used as basic data of a subsequent test process. In the conventional technology, corresponding value contents are predefined for different fields based on a field set of a service bill, a field value set template is formed, and bill data corresponding to the service bill is generated according to the value set template. However, since the field value set template corresponding to each business document is usually a fixed template, when the business document structure or business rule changes, the value set template needs to be manually maintained again, which results in lower flexibility of document data generation. Disclosure of Invention In view of the foregoing, it is desirable to provide a test document data generating method, apparatus, computer device, computer readable storage medium, and computer program product that can improve flexibility of test document data. In a first aspect, the present application provides a method for generating test document data. The method comprises the following steps: Acquiring a service attribute information set corresponding to each service field in a target service bill and an associated field in an associated bill corresponding to the target service bill; determining a field mapping relation between the service field and the corresponding associated field based on the associated field identification in the service attribute information set corresponding to the service field; determining a field value construction mode of the service field based on a field label in the service attribute information set corresponding to the service field; determining a field value set corresponding to the service field based on a field value construction mode of the service field; and determining the test bill data corresponding to the target business bill based on the field value set and the field mapping relation corresponding to each business field. In a second aspect, the application further provides a device for testing bill data. The device comprises: The acquisition module is used for acquiring a service attribute information set corresponding to each service field in the target service bill and an associated field in an associated bill corresponding to the target service bill; The mapping relation determining module is used for determining a field mapping relation between the service field and the corresponding association field based on the association field identification in the service attribute information set corresponding to the service field; The construction mode determining module is used for determining a field value construction mode of the service field based on a field label in the service attribute information set corresponding to the service field; The set determining module is used for determining a field value set corresponding to the service field based on a field value construction mode of the service field; And the test receipt data generation module is used for determining the test receipt data corresponding to the target service receipt based on the field value sets and the field mapping relations corresponding to the service fields. In a third aspect, the present application also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the method of any one of the first aspects when the computer program is executed by the processor. In a fourth aspect, the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the first aspects. In a fifth aspect, the application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method of any of the first aspects. The test receipt data generation method, device, computer equipment, storage medium and computer program product acquire service attribute information sets corresponding to all service fields in a target service receipt and associated fields in associated receipts corresponding to the target service receipt, determine field mapping relations between the service fields and the corresponding associated fields based on