CN109086145A - Data forge method, apparatus and computer storage medium - Google Patents

Data forge method, apparatus and computer storage medium Download PDF

Info

Publication number
CN109086145A
CN109086145A CN201810732151.4A CN201810732151A CN109086145A CN 109086145 A CN109086145 A CN 109086145A CN 201810732151 A CN201810732151 A CN 201810732151A CN 109086145 A CN109086145 A CN 109086145A
Authority
CN
China
Prior art keywords
data
type
falsification
generation module
data falsification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810732151.4A
Other languages
Chinese (zh)
Other versions
CN109086145B (en
Inventor
彭明强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810732151.4A priority Critical patent/CN109086145B/en
Priority to PCT/CN2018/111112 priority patent/WO2020006930A1/en
Publication of CN109086145A publication Critical patent/CN109086145A/en
Application granted granted Critical
Publication of CN109086145B publication Critical patent/CN109086145B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing

Abstract

The invention discloses a kind of data to forge method, apparatus and computer storage medium, is related to information technology field, and main purpose is that the generation code of data falsification can be effectively reduced, and reduces and generates code redundancy, promotes the reusability and readability for generating code.The described method includes: calling data type parsing module to parse the data type that the acquisition request corresponds to data falsification according to pre-set specifications file when receiving the data falsification acquisition request of front end transmission;Data falsification generation module corresponding with the data type is called according to the pre-set specifications file, the pre-set specifications document definition has different types of data and the corresponding data falsification generation module of the different types of data;The data falsification is generated using the data falsification generation module of calling.The present invention is forged suitable for data.

Description

Data forge method, apparatus and computer storage medium
Technical field
The present invention relates to information technology fields, forge method, apparatus more particularly, to a kind of data and computer storage is situated between Matter.
Background technique
With the continuous development of information technology, the front end and backstage of application system generally use separate mode exploitation, in order to It avoids front end that backstage is waited to complete true interface exploitation and carries out integration testing again, reduce the coupling of front end and backstage, it is false Service system occurs therewith, and false service system can forge number according to the false development interface for the interface document made an appointment According to and feed back to front end, allow front end first with production data falsification handle page presentation, without waiting for back office interface Exploitation completes feedback accurate data and carries out page presentation processing, then carries out integration testing.
Currently, false service system when carrying out data forgery, is needed for each data falsification acquisition request of front end A series of generation operation is carried out, corresponding generation code is write, the data falsification of request could be generated.However, by upper The mode of stating generates data falsification, and the generation code that will cause data falsification is more, and code is caused to expand, and reusability is poor, readable It is low.
Summary of the invention
The present invention provides a kind of data to forge method, apparatus and computer storage medium, and essentially consisting in effectively to subtract The generation code of few data falsification reduces and generates code redundancy, promotes the reusability and readability for generating code.
According to the first aspect of the invention, a kind of data forgery method is provided, false service system is applied to, comprising:
When receiving the data falsification acquisition request of front end transmission, data type parsing is called according to pre-set specifications file Module parses the data type that the acquisition request corresponds to data falsification;
Data falsification generation module corresponding with the data type is called according to the pre-set specifications file, it is described default Authority file definition has different types of data and the corresponding data falsification generation module of the different types of data;
The data falsification is generated using the data falsification generation module of calling.
According to the second aspect of the invention, a kind of data counterfeit means are provided, comprising:
Resolution unit, for when receive front end transmission data falsification acquisition request when, according to pre-set specifications file tune The data type that the acquisition request corresponds to data falsification is parsed with data type parsing module;
Call unit, for calling data falsification corresponding with the data type to generate according to the pre-set specifications file Module, the pre-set specifications document definition have different types of data and the corresponding forgery number of the different types of data According to generation module;
Generation unit, for generating the data falsification using the data falsification generation module called.
According to the third aspect of the present invention, a kind of computer readable storage medium is provided, computer journey is stored thereon with Sequence, the program perform the steps of when being executed by processor
When receiving the data falsification acquisition request of front end transmission, data type parsing is called according to pre-set specifications file Module parses the data type that the acquisition request corresponds to data falsification;
Data falsification generation module corresponding with the data type is called according to the pre-set specifications file, it is described default Authority file definition has different types of data and the corresponding data falsification generation module of the different types of data;
The data falsification is generated using the data falsification generation module of calling.
According to the fourth aspect of the present invention, a kind of computer equipment is provided, including memory, processor and is stored in On reservoir and the computer program that can run on a processor, the processor perform the steps of when executing described program
When receiving the data falsification acquisition request of front end transmission, data type parsing is called according to pre-set specifications file Module parses the data type that the acquisition request corresponds to data falsification;
Data falsification generation module corresponding with the data type is called according to the pre-set specifications file, it is described default Authority file definition has different types of data and the corresponding data falsification generation module of the different types of data;
The data falsification is generated using the data falsification generation module of calling.
A kind of data provided by the invention forge method, apparatus and computer storage medium, with current for the every of front end A data falsification acquisition request requires to carry out a series of generation operation, writes corresponding generation code and compares, the present invention exists When receiving the data falsification acquisition request of front end transmission, data type parsing module solution can be called according to pre-set specifications file Analyse the data type that the acquisition request corresponds to data falsification.At the same time, can according to the pre-set specifications file call with The corresponding data falsification generation module of the data type, the pre-set specifications document definition have different types of data, Yi Jisuo The corresponding data falsification generation module of different types of data is stated, and can be generated using the data falsification generation module called The data falsification, so as to realize false service system by the data falsification generation module of same data type to same The data falsification of data type is uniformly processed, without individually being handled for each data falsification, and then can be effective The generation code of data falsification is reduced, is reduced and is generated code redundancy, promotes the reusability and readability for generating code.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 shows a kind of data provided in an embodiment of the present invention and forges method flow diagram;
Fig. 2 shows another data provided in an embodiment of the present invention to forge method flow diagram;
Fig. 3 shows a kind of structural schematic diagram of data counterfeit means provided in an embodiment of the present invention;
Fig. 4 shows the structural schematic diagram of another data counterfeit means provided in an embodiment of the present invention;
Fig. 5 shows a kind of entity structure schematic diagram of computer equipment provided in an embodiment of the present invention.
Specific embodiment
Hereinafter, the present invention will be described in detail with reference to the accompanying drawings and in combination with Examples.It should be noted that not conflicting In the case of, the features in the embodiments and the embodiments of the present application can be combined with each other.
Such as background technique, currently, false service system is obtained when carrying out data forgery for each data falsification of front end It takes request to require to carry out a series of generation operation, writes corresponding generation code, the data falsification of request could be generated.So And data falsification is generated through the above way, the generation code that will cause data falsification is more, causes code to expand, reusability Difference is readable low.
To solve the above-mentioned problems, the embodiment of the invention provides a kind of data to forge method, is applied to false service system System, as shown in Figure 1, which comprises
101, when receiving the data falsification acquisition request of front end transmission, data type is called according to pre-set specifications file Parsing module parses the data type that the acquisition request corresponds to data falsification.
Wherein, the pre-set specifications file can be JSON Schema authority file, and JSON Schema is based on JSON Format defines the specification of JSON data structure, it is a understandable mankind and all readable document of machine, uses JSON The data object structure that the front end schema developer, that is, knowable back office interface returns, and then develop the page presentation of oneself. The pre-set specifications file can define data type parsing module, and specifically, the data type parsing module can be Technical staff, which has developed, to be predefined in the pre-set specifications file, the data class that the data type parsing module is supported Type can be enumerable, can save the data of different types of data.The data type parsing module can extract described Data type in acquisition request, the data type as the data falsification.The data type can for null character type, Boolean type, character string type, array type, object type or other customized data types.For example, the data The data type that type parsing module is extracted from the acquisition request is object type, then the puppet of front end request can be confirmed The data type for making data is object type.
It should be noted that when user triggers the operation button or key of the program displays page of front end, falseness clothes Business system can receive data falsification acquisition request, the present mode information in the available configuration file in front end, if currently Pattern information is spurious patterns, then data falsification acquisition request can be generated.
102, data falsification generation module corresponding with the data type is called according to the pre-set specifications file.
Wherein, the pre-set specifications document definition has different types of data and the different types of data to respectively correspond Data falsification generation module.Specifically, the pre-set specifications file can define sky character types and its corresponding forgery Data generation module, Boolean type and its corresponding data falsification generation module, numeric type and its corresponding data falsification are raw At module, character string type and its corresponding data falsification generation module, array type and its corresponding data falsification generate mould Block, object type and its corresponding data falsification generation module or other customized data types and its corresponding forgery Data generation module.
For example, if the data type for parsing the data falsification of front end request is null character type, it can be according to default Authority file calls the data falsification generation module of null character type, to generate a null character as data falsification.If parsing The data type of the data falsification of front end request is Boolean type out, then can call Boolean type according to pre-set specifications file Data falsification generation module, the random "true" or "false" of generating is as data falsification.If parsing the data falsification of front end request Data type be numeric type, then can according to the data falsification generation module of pre-set specifications file call number type, with A number is generated at random as data falsification.If the data type for parsing the data falsification of front end request is character string class Type can call the data falsification generation module of character string type, according to pre-set specifications file then to generate a character at random String is used as data falsification.It, can be according to default if the data type for parsing the data falsification of front end request is array type Authority file calls the data falsification generation module of array type, to generate an array as data falsification.If before parsing The data type for holding the data falsification of request is object type, then the forgery of object type can be called according to pre-set specifications file Data generation module, to generate an object as data falsification.
103, the data falsification is generated using the data falsification generation module of calling.
A kind of data provided in an embodiment of the present invention forge method, ask with each data falsification acquisition at present for front end It asks and requires to carry out a series of generation operation, write corresponding generation code and compare, the embodiment of the present invention is receiving front end When the data falsification acquisition request of transmission, data type parsing module can be called to parse the acquisition according to pre-set specifications file Request the data type of corresponding data falsification.At the same time, it can be called and the data class according to the pre-set specifications file The corresponding data falsification generation module of type, the pre-set specifications document definition have different types of data and the different data The corresponding data falsification generation module of type, and the forgery number can be generated using the data falsification generation module called According to so as to realize false service system by the data falsification generation module of same data type to same data type Data falsification is uniformly processed, and without individually being handled for each data falsification, and then can effectively reduce forgery number According to generation code, reduce generate code redundancy, promoted generate code reusability and readability.
Further, in order to better illustrate the process that above-mentioned data are forged, as the refinement and expansion to above-described embodiment Exhibition, the embodiment of the invention provides another data to forge method, as shown in Figure 2, which comprises
201, when receiving the data falsification acquisition request of front end transmission, data type is called according to pre-set specifications file Parsing module parses the data type that the acquisition request corresponds to data falsification.
It is described to call data type parsing module to parse the acquisition according to pre-set specifications file for the embodiment of the present invention The step of requesting the data type of corresponding data falsification, can specifically include: call data type solution according to pre-set specifications file Analysis module extracts the data type in the data structure that the acquisition request carries;The data type of extraction is determined as the puppet Make the data type of data.Specifically, the data type parsing module can extract the key-value pair in data structure, key-value pair Key be " type ", the value of key-value pair can be the data type extracted.
For example, if the data structure includes key-value pair: " type ": " object ", the data type parsing module " object " is determined as the data type of data falsification, the data falsification class by the value " object " that can extract key-value pair Type can be object type;If the data structure includes key-value pair: " type ": " string ", the data type parsing Module can extract the value " string " of key-value pair, and " string " is determined as to the data type of data falsification, the forgery number It can be character string type according to type.
202, data falsification generation module mark corresponding with the data type is searched from the pre-set specifications file.
Wherein, the pre-set specifications document definition has different types of data and the different types of data to respectively correspond Data falsification generation module mark.The different types of data and the corresponding forgery number of the different types of data It can be to pre-define in the authority file according to generation module mark.The corresponding forgery of the different types of data What data generation module can be developed in advance for technical staff, it specifically, can be for by writing a series of generations operations of data Corresponding generation code development.The data falsification generation module mark can be the title of data falsification generation module, such as The data falsification generation module mark of Boolean type can be with are as follows: Boolean-Generating module, the pre-set specifications text The mode of Boolean type and corresponding data falsification generation module that part defines can be with are as follows:
" Type ": Boolean;" Generatingmodule ": Boolean-Generating module.
203, data falsification corresponding with the data type is called to generate according to data falsification generation module mark Module.
For the embodiment of the present invention, in order to call data falsification generation module corresponding with the data type, the side Method can also include: the front end address information extracting the acquisition request and carrying, and call corresponding with the front end address information False service interface;It is corresponding with the data type according to pre-set specifications file calling using the false service interface Data falsification generation module, the false service interface is to be defined according to front end and the interface document made an appointment of backstage. Corresponding relationship between the front end address information and the false service interface can be predetermined.It specifically, can be with Data falsification corresponding with the data type is searched from the pre-set specifications file using the false service interface to generate Module id, to call data falsification generation module corresponding with the data type.The interface document may include preparatory The request field information of agreement returns to field information, data type field information etc..For example, the front end address information is The data type of http://abc.123.456:789/A, the data falsification of front end request are character string type, then can call False service interface 1, and searched from the pre-set specifications file and the forgery number of character string type using false service interface 1 It is identified according to generation module, to call the data falsification generation module of character string, generates the character string an of random-length as anti- It feeds the data falsification of front end.
204, the data falsification is generated using the data falsification generation module of calling.
For the embodiment of the present invention, the step 204 be can specifically include:
If 1, the data type is null character type, generated using the data falsification generation module of null character type empty Character data falsification.For example, the data type is null character type, then the data falsification generated can be " null " or be " sky ".
If 2, the data type is Boolean type, true or false is generated using the data falsification generation module of Boolean type Data falsification.For example, the data type is Boolean type, then the data falsification generated can be "true", "false", " true " Or " false ".
If 3, the data type is numeric type, it is pseudo- that number is generated using the data falsification generation module of numeric type Make data.For example, the data type is numeric type, then the data falsification generated can be " 1 " or " 2 " etc..
If 4, the data type is character string type, word is generated using the data falsification generation module of character string type Symbol string data falsification.For example, the data type is character string type, then the data falsification generated can be " randomstring ", " randstring " etc..
If 5, the data type is array type, called using the data falsification generation module of array type corresponding Data standard defined in data standard object item generates array data falsification.Specifically, the data standard object item Can be " items ":
Data standard object can be " item1 " and " item2 ", and " item1 " and " item2 " can be with call number type Data falsification generation module, it is random to generate " 1 ", " 2 ".Therefore, if the data type is numeric type, the forgery number generated According to can be " 1,2 " etc..
If 6, the data type is object type, the data falsification generation module of object type is utilized, calls and corresponds to Data standard object properties defined in data standard generate object data falsification.Specifically, the data standard object category Property can be " properties ":
Data standard object can be " status " and " complete ", and " status " can partially call character string type Data falsification generation module, random to generate " randomstring ", " complete " can partially call the forgery of Boolean type Data generation module generates " true ", and therefore, if the data type is object type, the data falsification generated can be { " status ": " randomstring ", " complete ": true } etc..
For the embodiment of the present invention, in order to complete the exploitation of application system as early as possible, deployment true test environment is avoided, And integration testing, saving human cost and time cost are carried out after the completion of waiting back office interface, and after the step 204, institute The method of stating can also include: the data falsification is sent to the front end so that the front end using the data falsification into Row test.
205, when receiving data forgery extended instruction, the data is obtained and forge the newly-increased number that extended instruction includes According to type.
206, the newly-increased data type and its corresponding data falsification generation module are defined into the pre-set specifications In file.
In actual use, some customized data types if it exists, and technical staff developed it is customized After the data falsification generation module of data type, front end can send the newly-increased data type for including to false service system Data forge extended instruction, such as newly-increased data type can be with are as follows: phone number data types.False service system can incite somebody to action Phone number data types and its corresponding data falsification generation module are defined into pre-set specifications file.For example, in extension electricity After talking about number data types, following content can be increased in pre-set specifications file:
In addition, the data type parsing module can also increase phone number data types newly, to forge receiving When data acquisition request, whether the data type that can parse data falsification is phone number data types.If parsing puppet The data type for making data is phone number data types, then the data falsification generated can be " 13888888888 ".Similarly Ground, other customized data types are expanded in the same manner in false service system.
Another kind data provided in an embodiment of the present invention forge method, obtain with each data falsification at present for front end Request requires to carry out a series of generation operation, writes corresponding generation code and compares, the embodiment of the present invention is before receiving When holding the data falsification acquisition request sent, it can be called according to pre-set specifications file and be obtained described in the parsing of data type parsing module Take the data type for requesting corresponding data falsification.At the same time, it can be called and the data according to the pre-set specifications file The corresponding data falsification generation module of type, the pre-set specifications document definition have different types of data and the different numbers According to the corresponding data falsification generation module of type, and the forgery can be generated using the data falsification generation module called Data, so as to realize false service system by the data falsification generation module of same data type to same data type Data falsification be uniformly processed, without individually being handled for each data falsification, and then forgery can be effectively reduced The generation code of data reduces and generates code redundancy, promotes the reusability and readability for generating code.
Further, as the specific implementation of Fig. 1, the embodiment of the invention provides a kind of data counterfeit means, such as Fig. 3 institute Show, described device includes: resolution unit 31, call unit 32 and generation unit 33, and described device is specifically as follows false service A part of system.
The resolution unit 31 can be used for when receiving the data falsification acquisition request of front end transmission, according to default Authority file calls data type parsing module to parse the data type that the acquisition request corresponds to data falsification.The parsing is single Member 31 is to call data class according to pre-set specifications file in the present apparatus when receiving the data falsification acquisition request of front end transmission Type parsing module parses the main functional modules that the acquisition request corresponds to the data type of data falsification.
The call unit 32 can be used for calling puppet corresponding with the data type according to the pre-set specifications file Data generation module is made, the pre-set specifications document definition has different types of data and the different types of data right respectively The data falsification generation module answered;The call unit 32 is to be called and the number in the present apparatus according to the pre-set specifications file According to the main functional modules and nucleus module of the corresponding data falsification generation module of type.
The generation unit 33 can be used for generating the data falsification using the data falsification generation module called.Institute Stating generation unit 33 is the major function mould for generating the data falsification in the present apparatus using the data falsification generation module called Block.
For the embodiment of the present invention, in order to call data falsification generation module corresponding with the data type, the tune With unit 32, it specifically can be used for searching data falsification generation corresponding with the data type from the pre-set specifications file Module id, the pre-set specifications document definition have different types of data and the corresponding puppet of the different types of data Make data generation module mark;Forgery number corresponding with the data type is called according to data falsification generation module mark According to generation module.
In addition, the call unit 32, specifically can be also used for extracting the front end address information that the acquisition request carries, And call false service interface corresponding with the front end address information;Using the false service interface according to the default rule Model essay part calls corresponding with data type data falsification generation module, the false service interface be according to front end with after What the interface document that platform is made an appointment defined.
For the embodiment of the present invention, in order to parse the data type that the acquisition request corresponds to data falsification, the parsing Unit 31 specifically can be used for calling data type parsing module to extract the number that the acquisition request carries according to pre-set specifications file According to the data type in structure;The data type of extraction is determined as to the data type of the data falsification.
In concrete application scene, the generation unit 33, if specifically can be used for the data type is null character class Type then generates null character data falsification using the data falsification generation module of null character type;If the data type is Boolean type then generates the data falsification of true or false using the data falsification generation module of Boolean type;If the data Type is numeric type, then generates digital data falsification using the data falsification generation module of numeric type;If the number It is character string type according to type, then generates character string data falsification using the data falsification generation module of character string type;Or If the data type is array type, corresponding data standard pair is called using the data falsification generation module of array type The data standard as defined in project generates array data falsification;If the data type be object type, using pair As the data falsification generation module of type, tune data standard defined in corresponding data standard object properties generates object Data falsification.
The embodiment of the present invention can also support predefined pre-set specifications file and extend the function of data falsification type, described Device further include: definition unit 34 and acquiring unit 35, as shown in Figure 4.
The definition unit 34, it is right respectively by the different types of data and the different types of data to can be used for The data falsification generation module answered is defined into the pre-set specifications file.The definition unit 34 is that general is described not in the present apparatus Same data type and the corresponding data falsification generation module of the different types of data are defined into the pre-set specifications text Main functional modules in part.
The acquiring unit 35 can be used for obtaining the data when receiving data forgery extended instruction and forging and expand The newly-increased data type that exhibition instruction includes.The acquiring unit 35 be in the present apparatus when receive data forge extended instruction When, obtain the main functional modules that the data forge the newly-increased data type that extended instruction includes.
The definition unit 34 can be also used for the newly-increased data type and its corresponding data falsification generating mould Block is defined into the pre-set specifications file.The definition unit 34 is in the present apparatus by the newly-increased data type and its right The data falsification generation module answered is defined into the main functional modules in the pre-set specifications file.
For the embodiment of the present invention, in order to complete the exploitation of application system as early as possible, deployment true test environment is avoided, And back office interface is waited to carry out integration testing after the completion, it saves human cost and time cost, described device can also include: Transmission unit 36.
The transmission unit 36 can be used for the data falsification being sent to the front end, so that the front end utilizes The data falsification is tested.The transmission unit 36 is that the data falsification is sent to the front end in the present apparatus, is made The front end is obtained to be tested using the data falsification.
It should be noted that other of each functional module involved by a kind of data counterfeit means provided in an embodiment of the present invention Corresponding description, can be with reference to the corresponding description of method shown in Fig. 1, and details are not described herein.
Based on above-mentioned method as shown in Figure 1, correspondingly, the embodiment of the invention also provides a kind of computer-readable storage mediums Matter is stored thereon with computer program, which performs the steps of when being executed by processor when the puppet for receiving front end transmission When making data acquisition request, calling data type parsing module to parse according to pre-set specifications file, the acquisition request is corresponding to be forged The data type of data;Data falsification generation module corresponding with the data type is called according to the pre-set specifications file, The pre-set specifications document definition has different types of data and the corresponding data falsification of the different types of data to generate Module;The data falsification is generated using the data falsification generation module of calling.
Embodiment based on above-mentioned method as shown in Figure 1 and data counterfeit means as shown in Figure 3, the embodiment of the present invention also mention Supplied a kind of entity structure diagram of computer equipment, as shown in figure 5, the computer equipment include: processor 41, memory 42, And it is stored in the computer program that can be run on memory 42 and on a processor, wherein memory 42 and processor 41 are respectively provided with It is performed the steps of when processor 41 described in bus 43 executes described program when the data falsification for receiving front end transmission obtains When taking request, data type parsing module is called to parse the number that the acquisition request corresponds to data falsification according to pre-set specifications file According to type;Data falsification generation module corresponding with the data type is called according to the pre-set specifications file, it is described default Authority file definition has different types of data and the corresponding data falsification generation module of the different types of data;Benefit The data falsification is generated with the data falsification generation module of calling.The computer equipment further include: bus 43 is configured as coupling Connect processor 41 and memory 42.
It according to the technical solution of the present invention, can be according to pre- when receiving the data falsification acquisition request of front end transmission If authority file calls data type parsing module to parse the data type that the acquisition request corresponds to data falsification.It is same with this When, data falsification generation module corresponding with the data type can be called according to the pre-set specifications file, it is described default Authority file definition has different types of data and the corresponding data falsification generation module of the different types of data, and The data falsification can be generated using the data falsification generation module called, so as to realize that it is same that false service system passes through The data falsification of same data type is uniformly processed in the data falsification generation module of one data type, without for each Data falsification is individually handled, and then can effectively reduce the generation code of data falsification, is reduced and is generated code redundancy, promoted Generate the reusability and readability of code.
Obviously, those skilled in the art should be understood that each module of the above invention or each step can be with general Computing device realize that they can be concentrated on a single computing device, or be distributed in multiple computing devices and formed Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored It is performed by computing device in the storage device, and in some cases, it can be to be different from shown in sequence execution herein Out or description the step of, perhaps they are fabricated to each integrated circuit modules or by them multiple modules or Step is fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and softwares to combine.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all include within protection scope of the present invention.

Claims (10)

1. a kind of data forge method, which is characterized in that be applied to false service system, comprising:
When receiving the data falsification acquisition request of front end transmission, data type parsing module is called according to pre-set specifications file Parse the data type that the acquisition request corresponds to data falsification;
Data falsification generation module corresponding with the data type, the pre-set specifications are called according to the pre-set specifications file Document definition has different types of data and the corresponding data falsification generation module of the different types of data;
The data falsification is generated using the data falsification generation module of calling.
2. the method according to claim 1, wherein described call and the number according to the pre-set specifications file According to the corresponding data falsification generation module of type, comprising:
Data falsification generation module mark corresponding with the data type is searched from the pre-set specifications file, it is described default Authority file definition has different types of data and the corresponding data falsification generation module mark of the different types of data Know;
Data falsification generation module corresponding with the data type is called according to data falsification generation module mark.
3. the method according to claim 1, wherein described call and the number according to the pre-set specifications file According to the corresponding data falsification generation module of type, comprising:
The front end address information that the acquisition request carries is extracted, and calls false service corresponding with the front end address information Interface;
Data falsification corresponding with the data type is called according to the pre-set specifications file using the false service interface Generation module, the false service interface are that the interface document made an appointment according to front end and backstage defines.
4. the method according to claim 1, wherein described call data type parsing according to pre-set specifications file Module parses the data type that the acquisition request corresponds to data falsification, comprising:
Data type parsing module is called to extract the number in the data structure that the acquisition request carries according to pre-set specifications file According to type;
The data type of extraction is determined as to the data type of the data falsification.
5. the method according to claim 1, wherein described generate institute using the data falsification generation module called State data falsification, comprising:
If the data type is null character type, it is pseudo- that null character is generated using the data falsification generation module of null character type Make data;Or
If the data type is Boolean type, the forgery of true or false is generated using the data falsification generation module of Boolean type Data;Or
If the data type is numeric type, number is generated using the data falsification generation module of numeric type and forges number According to;Or
If the data type is character string type, it is pseudo- that character string is generated using the data falsification generation module of character string type Make data;Or
If the data type is array type, corresponding data are called to advise using the data falsification generation module of array type Data standard defined in model object item generates array data falsification;Or
If the data type is object type, the data falsification generation module of object type, the corresponding number of tune are utilized Object data falsification is generated according to data standard defined in object of standardization attribute.
6. the method according to claim 1, wherein the method also includes:
The different types of data and the corresponding data falsification generation module of the different types of data are defined into institute It states in pre-set specifications file;
When receiving data forgery extended instruction, obtains the data and forge the newly-increased data type that extended instruction includes;
The newly-increased data type and its corresponding data falsification generation module are defined into the pre-set specifications file.
7. the method according to claim 1, wherein described generate institute using the data falsification generation module called After stating data falsification, the method also includes:
The data falsification is sent to the front end, so that the front end is tested using the data falsification.
8. a kind of data counterfeit means characterized by comprising
Resolution unit, for calling number according to pre-set specifications file when receiving the data falsification acquisition request of front end transmission The data type that the acquisition request corresponds to data falsification is parsed according to type parsing module;
Call unit, for calling data falsification corresponding with the data type to generate mould according to the pre-set specifications file Block, the pre-set specifications document definition have different types of data and the corresponding data falsification of the different types of data Generation module;
Generation unit, for generating the data falsification using the data falsification generation module called.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt The step of processor realizes method described in any one of claims 1 to 7 when executing.
10. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor Calculation machine program, which is characterized in that the computer program is realized described in any one of claims 1 to 7 when being executed by processor Method the step of.
CN201810732151.4A 2018-07-05 2018-07-05 Data generation method and device and computer storage medium Active CN109086145B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810732151.4A CN109086145B (en) 2018-07-05 2018-07-05 Data generation method and device and computer storage medium
PCT/CN2018/111112 WO2020006930A1 (en) 2018-07-05 2018-10-20 Data forgery method and apparatus, and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810732151.4A CN109086145B (en) 2018-07-05 2018-07-05 Data generation method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN109086145A true CN109086145A (en) 2018-12-25
CN109086145B CN109086145B (en) 2023-04-07

Family

ID=64836982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810732151.4A Active CN109086145B (en) 2018-07-05 2018-07-05 Data generation method and device and computer storage medium

Country Status (2)

Country Link
CN (1) CN109086145B (en)
WO (1) WO2020006930A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399819A (en) * 2020-03-18 2020-07-10 北京达佳互联信息技术有限公司 Data generation method and device, electronic equipment and storage medium
CN111399819B (en) * 2020-03-18 2024-04-30 北京达佳互联信息技术有限公司 Data generation method, device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631783A (en) * 2012-08-21 2014-03-12 百度在线网络技术(北京)有限公司 Method and system for generating front end page
CN107608708A (en) * 2017-08-20 2018-01-19 杭州安恒信息技术有限公司 A kind of interface data forges method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104615667B (en) * 2015-01-13 2018-01-19 联动优势电子商务有限公司 A kind of basic data generation method, test data creation method and its device
US10108535B2 (en) * 2016-07-08 2018-10-23 Accenture Global Solutions Limited Web application test script generation to test software functionality
CN106776324A (en) * 2016-12-19 2017-05-31 广州酷狗计算机科技有限公司 Interface test method and device
CN106919509B (en) * 2017-03-09 2020-11-24 腾讯科技(深圳)有限公司 Client generation method and device and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631783A (en) * 2012-08-21 2014-03-12 百度在线网络技术(北京)有限公司 Method and system for generating front end page
CN107608708A (en) * 2017-08-20 2018-01-19 杭州安恒信息技术有限公司 A kind of interface data forges method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399819A (en) * 2020-03-18 2020-07-10 北京达佳互联信息技术有限公司 Data generation method and device, electronic equipment and storage medium
CN111399819B (en) * 2020-03-18 2024-04-30 北京达佳互联信息技术有限公司 Data generation method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109086145B (en) 2023-04-07
WO2020006930A1 (en) 2020-01-09

Similar Documents

Publication Publication Date Title
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
EP3518124A1 (en) Webpage rendering method and related device
CN109784235A (en) Method for automatically inputting, device, computer equipment and the storage medium of paper form
US9582594B2 (en) Method and system for centralized issue tracking
CN111581083B (en) Interface testing method and device, electronic equipment and storage medium
CN111125254A (en) Database synchronization method and device, electronic equipment and computer readable medium
CN109165017A (en) Data verification method, device and computer storage medium
CN108984208A (en) A kind of function document generating method, apparatus and system
CN111176627A (en) Device and method for separating front end from back end based on micro-service
CN108958959A (en) The method and apparatus for detecting hive tables of data
CN109271160A (en) Active rule construction method, device and computer system, medium
JP5651050B2 (en) Data generation apparatus and data generation program
US11755631B2 (en) Workflow-based dynamic data model and application generation
CN103399776A (en) Creation method and system for reusable MOCK
CN112433753A (en) Interface document generation method, device, equipment and medium based on parameter information
CN109086145A (en) Data forge method, apparatus and computer storage medium
CN109597828A (en) A kind of off-line data checking method, device and server
CN114615336A (en) Request scheduling method and device, computer equipment and storage medium
CN115033592A (en) SQL statement processing method, device, equipment and storage medium based on database
CN111522748A (en) Automatic test case generation method and device, server and storage medium
CN112445811A (en) Data service method, device, storage medium and component based on SQL configuration
CN115543227B (en) Cross-system data migration method, system, electronic device and storage medium
CN111414198B (en) Request processing method and device
Khwaja A real-time DBMS system for the immigration processing of large Hajj crowd
CN117668564A (en) Configuration difference identification method, configuration data importing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant