CN110083524A - Upload data test method, apparatus, computer equipment and storage medium - Google Patents

Upload data test method, apparatus, computer equipment and storage medium Download PDF

Info

Publication number
CN110083524A
CN110083524A CN201910198337.0A CN201910198337A CN110083524A CN 110083524 A CN110083524 A CN 110083524A CN 201910198337 A CN201910198337 A CN 201910198337A CN 110083524 A CN110083524 A CN 110083524A
Authority
CN
China
Prior art keywords
test
upload
file
interface
data
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.)
Pending
Application number
CN201910198337.0A
Other languages
Chinese (zh)
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.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology 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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201910198337.0A priority Critical patent/CN110083524A/en
Publication of CN110083524A publication Critical patent/CN110083524A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a kind of upload data test method, apparatus, computer equipment and storage mediums, comprising: obtains the test parameter of upload interface to be tested;Material file composition test file is extracted in preset test database according to the test parameter, wherein the test file includes multiple material files;Multiple upload requests are sent to the upload interface, the quantity of the upload request is identical as the quantity of the material file, and each upload request includes the material file.Test file is made of multiple material files, for the upload scene of concurrent type frog in simulation actual use, multiple upload requests are generated according to the quantity of material file is corresponding, i.e. each corresponding upload request of material file, upload interface is set to receive multiple upload requests simultaneously, the process for simulating that concurrent type frog uploads in true usage scenario is realized, most can really obtain test data, and improve the reference value of test data.

Description

Upload data test method, apparatus, computer equipment and storage medium
Technical field
The present embodiments relate to data test field, especially a kind of upload data test method, apparatus, computer are set Standby and storage medium.
Background technique
Data upload refers to the process of data from a terminal transmission to another terminal or database side.With information The arriving in change epoch, the interaction of data and shared increasingly closer, an incident problem is: scale of construction when data are transmitted Increasing, rate request when transmitting for data is higher and higher.
In the prior art, it when carrying out daily maintenance to the database for needing to receive large data files, needs on file The interface of biography is detected, and the mode of detection is the upload that artificial one interface of selection carries out verifying file, in upload procedure The parameter for recording the data uploaded generates test file.
The inventor of the invention has found that file uploads the detection of interface dependent on artificial in the prior art under study for action Carry out, the efficiency of assessment is lower, and think test can not the state that really uses of analog network, therefore, obtained testing number According to the real work state that can not directly reflect upload interface, the assessment data reference detected is low.
Summary of the invention
The embodiment of the present invention provides a kind of upload data test method, dress that concurrent type frog test can be carried out to upload interface It sets, computer equipment and storage medium.
In order to solve the above technical problems, the technical solution that the embodiment of the invention uses is: providing in one kind Pass data test method, comprising:
Obtain the test parameter of upload interface to be tested;
Material file composition test file is extracted in preset test database according to the test parameter, wherein institute Stating test file includes multiple material files;
Multiple upload requests are sent to the upload interface, wherein the quantity of the upload request and the material file Quantity it is identical, and each upload request includes the material file.
Optionally, the test database is distributed data base, includes that multiple processing save in the distributed data base Point, the material file composition test file that extracted in preset test database according to the test parameter include:
Obtain at least two targets processing node for meeting preset first transmission conditions in the distributed data base;
Node allocation for test task is handled at least two target according to the test parameter;
The material file is extracted respectively according to each target processing node of the test assignment, in the distributed number According to the composition of cross-region in the library test file.
Optionally, described more to upload interface transmission at the beginning of including test assignment in the test assignment A upload request includes:
The each target processing node with receive between the time point of the test assignment and the time started when Between difference be delay time establish delay task;
When the delayed tasks are reached, each target processing node sends the upload to the upload interface Request.
Optionally, after multiple upload requests to upload interface transmission, comprising:
Obtain the response time that the upload interface responds each upload request;
The response time is compared with preset first time threshold;
When the response time being greater than the first time threshold, the upload interface is labeled as problem interface.
Optionally, it is described obtain it is described upload interface and respond response time of each upload request include:
Obtain the first time stamp in the upload request;
It obtains the upload interface and replys the second timestamp in the return information of the upload request;
The time difference between first time stamp and second timestamp is calculated, and it is described for defining the time difference Response time.
It optionally, include test label in the test file, it is described to send multiple upload requests to the upload interface Later, comprising:
Read the resolution file after being resolved in the test file;
Judge that test label described in the resolution file whether there is;
When in the resolution file including the test label, confirm that the test file uploads successfully.
Optionally, described when in the resolution file including the test label, confirm the test file upload at After function, comprising:
Judge whether the test label has uniqueness in the resolution file, wherein the test label is used for Test the similar terms pooling function of database corresponding with the upload interface;
When the test label has uniqueness in the resolution file, confirm that the similar terms of the database merge Function is normal.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of upload data test device, comprising:
Module is obtained, for obtaining the test parameter of upload interface to be tested;
Processing module, for extracting material file composition test in preset test database according to the test parameter File, wherein the test file includes multiple material files;
Execution module, for sending multiple upload requests to the uploads interface, wherein the quantity of the upload request and The quantity of the material file is identical, and each upload request includes the material file.
Optionally, the test database is distributed data base, includes that multiple processing save in the distributed data base Point, the upload data test device further include:
First acquisition submodule meets preset first transmission conditions at least for obtaining in the distributed data base Two targets handle node;
First processing submodule, for handling node allocation for test at least two target according to the test parameter Task;
First implementation sub-module, for extracting the material text respectively according to each target processing node of the test assignment Part, in the distributed data base cross-region form the test file.
Optionally, at the beginning of including test assignment in the test assignment, the upload data test device is also wrapped It includes:
Second processing submodule receives time point and the institute of the test assignment for each target processing node Stating the time difference between the time started is delay time establish delay task;
Second implementation sub-module, for when the delayed tasks are reached, each target to handle the equal Xiang Suoshu of node It uploads interface and sends the upload request.
Optionally, the upload data test device further include:
Second acquisition submodule responds the response time of each upload request for obtaining the upload interface;
First compares submodule, for the response time to be compared with preset first time threshold;
Third implementation sub-module, for when the response time being greater than the first time threshold, the upload to be connect Mouth is labeled as problem interface.
Optionally, the upload data test device further include:
Third acquisition submodule, for obtaining the stamp of the first time in the upload request;
4th acquisition submodule, for obtain it is described upload interface reply in the return information of the upload request second Timestamp;
First computational submodule, for calculating the time difference between the first time stamp and second timestamp, and Defining the time difference is the response time.
It optionally, include test label, the upload data test device in the test file further include:
First reading submodule, for reading the resolution file after being resolved in the test file;
Third handles submodule, for judging that test label described in the resolution file whether there is;
4th implementation sub-module, for when in the resolution file including the test label, confirming the test text Part uploads successfully.
Optionally, the upload data test device further include:
Fourth process submodule, for judging whether the test label has uniqueness in the resolution file, In, the test label is used to test the similar terms pooling function of database corresponding with the upload interface;
5th implementation sub-module, for confirming institute when the test label has uniqueness in the resolution file The similar terms pooling function for stating database is normal.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of computer equipment, including memory and processing Device is stored with computer-readable instruction in the memory, when the computer-readable instruction is executed by the processor, so that The processor executes the step of upload data test method described above.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of storage Jie for being stored with computer-readable instruction Matter, when the computer-readable instruction is executed by one or more processors, so that one or more processors execute above-mentioned institute State the step of uploading data test method.
The beneficial effect of the embodiment of the present invention is: when testing, obtaining user and the test of the upload interface is joined It counts, includes the data capacity of test file in the test parameter, it is automatic in preset test database according to the test parameter Test request is sent to upload interface after calling corresponding material file composition test file, test file to generate.Test file Be made of multiple material files, for simulation actual use in concurrent type frog upload scene, according to the quantity pair of material file The multiple upload requests of the generation answered, i.e., each corresponding upload request of material file, enable upload interface to receive simultaneously Multiple upload requests realize the process for simulating that concurrent type frog uploads in true usage scenario, most can really obtain test number According to, and improve the reference value of test data.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is the basic procedure schematic diagram that the embodiment of the present invention uploads data test method;
Fig. 2 is the flow diagram that distributed data base of the embodiment of the present invention forms test file;
Fig. 3 is that the embodiment of the present invention passes through the synchronous flow diagram for executing test assignment of delayed tasks;
Fig. 4 is the flow diagram that the time evaluates upload interface according to response of the embodiment of the present invention;
Fig. 5 is the flow diagram that the embodiment of the present invention calculates the response time;
Fig. 6 is that the embodiment of the present invention detects whether upper transmitting file uploads successful flow diagram;
Fig. 7 is similar terms pooling function whether normal flow diagram when Test database of the embodiment of the present invention parses;
Fig. 8 is that the embodiment of the present invention uploads data test device basic structure schematic diagram;
Fig. 9 is computer equipment of embodiment of the present invention basic structure block diagram.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described.
In some processes of the description in description and claims of this specification and above-mentioned attached drawing, contain according to Multiple operations that particular order occurs, but it should be clearly understood that these operations can not be what appears in this article suitable according to its Sequence is executed or is executed parallel, and serial number of operation such as 101,102 etc. is only used for distinguishing each different operation, serial number It itself does not represent and any executes sequence.In addition, these processes may include more or fewer operations, and these operations can To execute or execute parallel in order.It should be noted that the description such as " first " herein, " second ", is for distinguishing not Same message, equipment, module etc., does not represent sequencing, does not also limit " first " and " second " and be different type.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those skilled in the art's every other implementation obtained without creative efforts Example, shall fall within the protection scope of the present invention.
Those skilled in the art of the present technique are appreciated that " terminal " used herein above, " terminal device " both include wireless communication The equipment of number receiver, only has the equipment of the wireless signal receiver of non-emissive ability, and including receiving and emitting hardware Equipment, have on bidirectional communication link, can execute two-way communication reception and emit hardware equipment.This equipment It may include: honeycomb or other communication equipments, shown with single line display or multi-line display or without multi-line The honeycomb of device or other communication equipments;PCS (Personal Communications Service, PCS Personal Communications System), can With combine voice, data processing, fax and/or communication ability;PDA (Personal Digital Assistant, it is personal Digital assistants), it may include radio frequency receiver, pager, the Internet/intranet access, web browser, notepad, day It goes through and/or GPS (Global Positioning System, global positioning system) receiver;Conventional laptop and/or palm Type computer or other equipment, have and/or the conventional laptop including radio frequency receiver and/or palmtop computer or its His equipment." terminal " used herein above, " terminal device " can be it is portable, can transport, be mounted on the vehicles (aviation, Sea-freight and/or land) in, or be suitable for and/or be configured in local runtime, and/or with distribution form, operate in the earth And/or any other position operation in space." terminal " used herein above, " terminal device " can also be communication terminal, on Network termination, music/video playback terminal, such as can be PDA, MID (Mobile Internet Device, mobile Internet Equipment) and/or mobile phone with music/video playing function, it is also possible to the equipment such as smart television, set-top box.
It is the basic procedure schematic diagram that the present embodiment uploads data test method referring specifically to Fig. 1, Fig. 1.
As shown in Figure 1, a kind of upload data test method, comprising:
S1100, the test parameter for obtaining upload interface to be tested;
Interface refers to entity a kind of extraneous abstract compound (can be another entity) oneself is supplied to, to by inside External communication method is isolated in operation, the mode that can be interacted by internal modification without influencing other extraneous entities.? In computer, interface is the Border that two independent components carry out information exchange in computer system.This exchange can be with Occur between computer soft and hardware, external equipment or the people operated, is also possible to their combination.
Interface is uploaded according to above-mentioned definition, in present embodiment to refer to: uploading the company that database side is supplied to terminal device Mode is connect, uploads interface by calling, terminal can establish data connection channel with uploading database side.
Upload interface in this present embodiment is artificially selected upload interface in need of test, and test parameter is Refer to the capacity for the test file that user specifies.Such as test parameter is uploaded for user is selected with the test file of 10G capacity Test.But test parameter is not limited to this, according to the difference of concrete application scene, in some embodiments, test parameter It can be (being not limited to): form the quantity of the material file of test file or the format of material file.Wherein, the lattice of material file Formula refers to the data type of the material file of composition test file, including but not limited to: the number such as text, picture, audio or video According to type.In some embodiments, the format of material file can also be refined further, such as different text formattings: PDF, doc or XLS etc..
S1200, material file composition test file is extracted in preset test database according to the test parameter, In, the test file includes multiple material files;
After the test parameter for obtaining user's input, correspondence is extracted in preset test database according to the test parameter Material file form test file.In present embodiment, test database is for the carry out classification storage to material file Database.Material file is the basic document for forming test file, and the format of material file has diversification, including (unlimited In): the data types such as text, picture, audio or video.
In some embodiments, material file can be the identical data packet of capacity, but the group of material file shapes Formula is not limited to this, and according to the difference of concrete application scene, in some embodiments, material file can be for data capacity not The different data packet in identical or part.
Test file is made of multiple material file files, the building form of test file are as follows: according to test parameter Capacity parameter and material file number parameter, eligible material file composition test text is chosen in test database Part.For example, specifying 10G capacity in the test parameter of user setting and being made of 10 material files, then in test database The material file of 10 1G is selected to form test file.Therefore, the amount of capacity of material file file depends in test parameter The quantity of the amount of capacity of test file and specified material file.
In some embodiments, the composition of test file is the sum of adding up for data capacity level, preferably In, test database is distributed data base, and in distributed data base system system, each database or data-base cluster are equal For the processing node of distributed data base system.In each processing node in addition to part management node (such as smart allocation node) Other nodes all have identical job function, but each processing Node distribution is in different regions.Each processing node Between be able to carry out data transmission, it is each processing node it is adjacent thereto one or more processing node between pass through chain Road connection.
When test database is distributed data base, each processing node in branch's formula database can become group The main body for building test file divides smart allocation node to each or part processing section after test file sets capacity data Point distribution task, test file are the material file that the extraction of processing node of the secondary test assignment is participated in distributed data base The sum of.It 10G capacity and is made of 10 material files for example, being specified in the test parameter of user setting, then smart allocation node In distributed data base, 10 processing nodes are selected, each processing node distributes the upload of the material file of a preparation 1G Task, and test file is the sum of the material file that 10 processing nodes prepare.
S1300, multiple upload requests are sent to the upload interface, wherein the quantity of the upload request and the element The quantity of material file is identical, and each upload request includes the material file.
After test file is ready, the terminal for participating in test calls the upload at pre-stored upload server end to connect Mouthful, and multiple upload requests are sent to interface is uploaded.Wherein, the quantity of upload request and the quantity of material file are identical, i.e., often It include a material file in a upload request.Upload request refers to the uploading instructions including material file, upload server end After receiving the upload request, the material file in the upload request is received.
In some embodiments, the true usage scenario of file function is uploaded for simulation, terminal passes through virtual terminal IP address, Xiang Shangchuan server end send upload request, since IP address is different, and the upload request is defaulted at upload server end It is the upload request being sent to it by multiple terminals of different location, therefore, can really simulates actual use scene.
In some embodiments, test database is distributed data base, when carrying out test file upload, Ge Gecan Pass through with the processing node of test and upload interface and send upload request, due to, processing node all have different IP address with And therefore geographical location can more really restore actual use scene.
Above embodiment when testing, obtains test parameter of the user for the upload interface, the test parameter In include test file data capacity, corresponding material is called according to the test parameter automatically in preset test database File forms test file, sends test request to upload interface after test file generation.Test file is by multiple material texts Part composition, for the upload scene of concurrent type frog in simulation actual use, generated on multiple according to the quantity of material file is corresponding Request is passed, i.e., each corresponding upload request of material file enables upload interface to receive multiple upload requests simultaneously, real Show the process that concurrent type frog uploads in the true usage scenario of simulation, most can really obtain test data, and improve test The reference value of data.
In some embodiments, test database is distributed data base, when forming test file, needs to screen symbol The processing node of conjunction condition participates in.Referring to Fig. 2, the process that Fig. 2 is the present embodiment distributed data base composition test file is shown It is intended to.
As shown in Fig. 2, S1200 step shown in FIG. 1 includes:
S1211, at least two targets processing for meeting preset first transmission conditions in the distributed data base is obtained Node;
In present embodiment in distributed data base system system, each database or data-base cluster are distribution The processing node of Database Systems.In each processing node in addition to part management node (such as smart allocation node) other nodes Identical job function is all had, but each processing Node distribution is in different regions.It can between each processing node Carry out data transmission, is connected between each processing node one or more processing node adjacent thereto by transmission link.
Smart allocation node plans as a whole the task distribution of each processing node, after getting the test parameter that user specifies, The screening of smart allocation node executes the processing node of test assignment.The mode of screening are as follows: meet in screening distributed data base pre- If the first transmission conditions target handle node, the first transmission conditions be processing node response test task response time, Smart allocation node sieves in distributed data base according to the average response time of each processing node historical responses test assignment Response speed is selected to be greater than the processing node of the first transmission conditions, for example, the first transmission conditions are 90ms, but the first transmission conditions Value it is not limited to this, according to the difference of concrete application scene, the value of the first transmission conditions can be larger or smaller.? In some embodiments, the first transmission conditions be it is dynamic, when the non-treated node of basic screening conditions of setting can reach, lead to It crosses and adds incremental value in basic screening conditions, meet the first transmission conditions extremely until can filter out to relax screening conditions Few two targets handle node.
In some embodiments, the first transmission conditions are sequence screening, are joined for example, user is specified by 10 processing nodes With test, then the processing node that average response duration is filtered out from distributed data base positioned at preceding 10 is that target handles node.
S1212, node allocation for test task is handled at least two target according to the test parameter;
Smart allocation node is after filtering out sufficient amount of target processing node, to the target processing for participating in test assignment Node allocation for test task, the method for salary distribution of test assignment are to send test request to each target processing node, which asks The processing node needs at the beginning of asking the information for including but not limited to uploading interface, test assignment and in test assignment Capacity, format or the quantity of the material file of biography.
S1213, the material file is extracted according to each target processing node of the test assignment respectively, at described point The composition of the cross-region test file in cloth database.
After each target processing received test assignment of node, according to the capacity, format of material file in the test assignment Or the parameters such as quantity, each target processing node extracts corresponding material file in respective database respectively, to be distributed Test file is formed in formula database.The composition of test file is each processing node of data capacity level in present embodiment Material file capacity it is the sum of cumulative.
The processing node of screening high-quality participates in test assignment in distributed data base, and test assignment can be made to complete more Increase effect, meanwhile, actual use scene also most can be really simulated, the reliability of test data is improved.
In some embodiments, the test assignment of each processing node carries out simultaneously, therefore, each destination node When executing test assignment, need to be timed task transmission.It is held referring to Fig. 3, Fig. 3 is synchronized for the present embodiment by delayed tasks The flow diagram of row test assignment.
As shown in figure 3, S1300 step shown in FIG. 1 includes:
S1311, each target processing node with receive the test assignment time point and the time started it Between time difference be delay time establish delay task;
It includes that test is opened that smart allocation node, which is distributed in the test assignment of each target processing node, in present embodiment At the beginning of beginning, for each target processing node when receiving test assignment, record receives the temporal information of the test assignment, Then at the beginning of read test task, due to the time started always receive test assignment time point after, use Time started, which subtracts, to be received time point of test assignment and can obtain the delay time of each target processing node, at each target Node is managed with the delay time establish delay task, is unified again in delayed tasks zero literary to server end transmission material is uploaded Part, to guarantee multiple target processors while upload the purpose of material file.
S1312, when the delayed tasks are reached, each target processing node is to uploads interface transmission institute State upload request.
When the delayed tasks of each target processing node test task are reached, i.e., delayed tasks are zeroed, at each target Node is managed to interface transmission upload request is uploaded, and achievees the purpose that be performed simultaneously transmitting file.
So that each target is handled node by the foundation of delayed tasks in distributed data base and synchronizes execution test times Business can be such that test assignment completes more efficient, meanwhile, actual use scene also most can be really simulated, test is improved The reliability of data.
In some embodiments, the performance that interface is uploaded for detection, when to the response for uploading interface response upload request Between counted and compared, to carry out performance evaluation to uploading interface.Referring to Fig. 4, Fig. 4 is the present embodiment time according to response The flow diagram that upload interface is evaluated.
As shown in figure 4, after S1300 step shown in FIG. 1, comprising:
S1410, the response time for uploading interface and responding each upload request is obtained;
The response time for uploading interface response upload request is obtained, since transmitting terminal can be at this when sending for upload request The write time stabs in upload request, and upload server end is understood after the upload request is disposed at transmitting terminal or target Reason node sends return information, the timestamp of the generation time of record return information in the return information, between two timestamps Difference be to upload interface to respond response time of each upload request.
S1420, the response time is compared with preset first time threshold;
Response time is compared with first time threshold, wherein first time threshold is to measure to upload interface response Time time value whether up to standard.For example, first time threshold is 100ms, still, the value of first time threshold is not limited to In this, according to the difference of concrete application scene, in some embodiments, the value of first time threshold can more greatly or more It is small.In some embodiments, first time threshold is a dynamic variable, and the value of first time threshold is asked with upload Ask the amount of capacity of middle material file related, according to the average uplink time that history is uploaded with capacity material file, on this is average Passing the time is the corresponding first time threshold of the amount of capacity, and when being compared, material is literary in acquisition upload request first Then the amount of capacity of part obtains the corresponding value of first time threshold according to the amount of capacity.
S1430, when the response time be greater than the first time threshold when, the upload interface is labeled as problem and is connect Mouthful.
By compare when the response time be greater than first time threshold when, by upload interface be labeled as problem interface, need into Capable further optimization processing, to improve response speed;When the response time being less than or equal to first time threshold, then surface is on this The response speed for passing interface has reached evaluation standard, which is qualified interface.
By being counted and being compared to the response time, the performance of the upload interface can be quickly determined, it should for optimization It uploads interface and provides foundation.
In some embodiments, the calculating of response time need by the timestamp of upload request and return information when Between stab and calculated, referring to Fig. 5, Fig. 5 is the flow diagram that the present embodiment calculates the response time.
As shown in figure 5, S1410 step shown in Fig. 4 includes:
S1411, the first time obtained in the upload request stab;
The response time for uploading interface response upload request is obtained, since transmitting terminal can be at this when sending for upload request The write time stabs in upload request, which is designated as stabbing at the first time, therefore, reads the timestamp information in upload request It can obtain stabbing at the first time.
S1412, the acquisition upload interface reply the second timestamp in the return information of the upload request;
Upload server end can send back letter in reply to transmitting terminal or target processing node after the upload request is disposed It ceases, the timestamp of the generation time of return information is recorded in the return information, which is designated as the second timestamp.It reads back Timestamp in multiple message, it will be able to obtain the second timestamp.
Time difference between S1413, the calculating first time stamp and second timestamp, and define the time difference For the response time.
The time difference at the first time between stamp and the second timestamp is calculated, and determines that the time is the response time.Pass through reading The timestamp of upload request and return information is taken, the response time for uploading interface can quickly be calculated.
In some embodiments, forming includes document files in the material file of test file, is written in document files Test label, the test label are the text information for being recorded in one or more specific fields of File designated position, It whether there is above-mentioned test label by detecting in upper transmitting file, determine whether the file for being uploaded to upload server end occurs mistake Accidentally.Referring to Fig. 6, Fig. 6 is to detect whether upper transmitting file uploads successful flow diagram.
As shown in fig. 6, after S1300 step shown in FIG. 1, comprising:
S1511, the resolution file after being resolved in the test file is read;
When test file is uploaded to upload server end, upload server end parses the test file.Due to, In transmission link, the material file in test file is transmitted in a link in the form of data packet, upload server end It after receiving data packet, needs to parse data packet, data packet is converted to the mistake of material file original format by parsing Journey.After the material file parsing of all upload requests, the resolution file of test file is generated.
S1512, judge that test label described in the resolution file whether there is;
Judge that, with the presence or absence of test label in resolution file, the mode judged is as the literal field characterized with test label Search criterion carries out traversal lookup in the text document of resolution file, after resolution file finds corresponding literal field, really Recognize in resolution file that there are test labels, otherwise, then confirms that there is no test labels in resolution file.
S1513, when in the resolution file include the test label when, confirm that the test file uploads successfully.
When confirming in resolution file includes test label, exact p-value file is uploaded successfully;When resolution file is not present When test label, mistake occurs in upload procedure for exact p-value file, needs to uploading interface or upload server end Parsing function optimizes.By the setting of test pen label, quickly success, Er Qieneng whether can be uploaded by exact p-value file Whether enough deeper exact p-value files occur mistake in upload procedure, can quickly optimize and upload interface and upload Server end.
In some embodiments, material file can be list document, for example, Excel document.It is every in list document One row-column list or each column list represent a serial data.In using the data of a specific character field as material file A serial data, and defining the serial data is test label, and identical multiple tests are written in the same material file and mark Label.Whether the similar terms pooling function that multiple test label is used to test upload server client database is normal.Please refer to figure 7, Fig. 7 be similar terms pooling function whether normal flow diagram when the present embodiment Test database parses.
As shown in fig. 7, after S1513 step shown in fig. 6, comprising:
S1521, judge whether the test label has uniqueness in the resolution file, wherein the test mark Label are for testing the similar terms pooling function of database corresponding with the upload interface;
Judge whether the test label has uniqueness, the mode of judgement are as follows: with test label table in resolution file The literal field of sign is search criterion, traversal lookup is carried out in the text document of resolution file, when same in resolution file The literal field of test label occurs more than twice, then showing upload server client database in parsing, similar terms close And function does not play due effect.When the literal field of test label same in resolution file is primary and if only if occurring When, then show that the similar terms pooling function of upload server client database is normal.
S1522, when the test label in the resolution file have uniqueness when, confirm the similar of the database Item pooling function is normal.
When the literal field of test label same in resolution file is and if only if appearance one time, then show upload service The similar terms pooling function of device client database is normal.By similar terms merge function, facilitate optimize data it is lengthy and jumbled, save number According to the capacity resource in library.And can quickly determine that database similar terms pooling function is normal by the way that multiple test labels are arranged, have Conducive to this function at optimization upload server end.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of upload data test device.
It is that the present embodiment uploads data test device basic structure schematic diagram referring specifically to Fig. 8, Fig. 8.
As shown in figure 8, a kind of upload data test device, comprising: obtain module 2100, processing module 2200 and execute mould Block 2300.Wherein, the test parameter that module 2100 is used to obtain upload interface to be tested is obtained;Processing module 2200 is used for root Material file composition test file is extracted in preset test database according to test parameter, wherein test file includes multiple Material file;Execution module 2300 is used to send multiple upload requests to upload interface, wherein the quantity and material of upload request The quantity of file is identical, and each upload request includes a material file.
It uploads data test device when testing, obtains test parameter of the user for the upload interface, the test Include the data capacity of test file in parameter, is called automatically in preset test database according to the test parameter corresponding Material file forms test file, sends test request to upload interface after test file generation.Test file is by multiple elements Material file composition, it is more according to the corresponding generation of the quantity of material file for the upload scene of concurrent type frog in simulation actual use A upload request, i.e., each corresponding upload request of material file, enables upload interface to receive multiple uploads simultaneously and asks It asks, realizes the process for simulating that concurrent type frog uploads in true usage scenario, most can really obtain test data, and improve The reference value of test data.
In some embodiments, test database is distributed data base, includes multiple processing in distributed data base Node uploads data test device further include: the first acquisition submodule, the first processing submodule and the first implementation sub-module.Its In, the first acquisition submodule is for obtaining at least two targets for meeting preset first transmission conditions in distributed data base Manage node;First processing submodule is used to handle node allocation for test task at least two targets according to test parameter;First Implementation sub-module is used to extract material file respectively according to each target processing node of test assignment, in distributed data base The composition test file of cross-region.
In some embodiments, at the beginning of including test assignment in test assignment, data test device is uploaded also It include: second processing submodule and the second implementation sub-module.Wherein, second processing submodule for each target processing node with Receiving the time difference between the time point and time started of test assignment is delay time establish delay task;Second executes son Module is used for when delayed tasks are reached, and each target processing node sends upload request to upload interface.
In some embodiments, data test device is uploaded further include: the second acquisition submodule, first compare submodule With third implementation sub-module.Wherein, when the second acquisition submodule responds the response of each upload request for obtaining upload interface Between;First comparison submodule is for the response time to be compared with preset first time threshold;Third implementation sub-module is used When being greater than first time threshold when the response time, interface will be uploaded and be labeled as problem interface.
In some embodiments, data test device is uploaded further include: third acquisition submodule, the 4th acquisition submodule With the first computational submodule.Wherein, third acquisition submodule is used to obtain the first time stamp in upload request;4th obtains son Module is used to obtain the second timestamp in the return information for uploading interface reply upload request;First computational submodule is based on The time difference at the first time between stamp and the second timestamp is calculated, and defines the time difference as the response time.
In some embodiments, include test label in test file, upload data test device further include: first reads Take submodule, third processing submodule and the 4th implementation sub-module.Wherein, the first reading submodule is in read test file Resolution file after resolved;Third processing submodule is for judging that test label whether there is in resolution file;4th executes Submodule is used for when in resolution file including test label, and exact p-value file uploads successfully.
In some embodiments, data test device is uploaded further include: fourth process submodule and the 5th executes submodule Block.Wherein, fourth process submodule is for judging whether test label has uniqueness in resolution file, wherein test mark Sign the similar terms pooling function for testing database corresponding with interface is uploaded;5th implementation sub-module is for working as test label When there is uniqueness in resolution file, confirm that the similar terms pooling function of database is normal.
In order to solve the above technical problems, the embodiment of the present invention also provides computer equipment.It is this referring specifically to Fig. 9, Fig. 9 Embodiment computer equipment basic structure block diagram.
As shown in figure 9, the schematic diagram of internal structure of computer equipment.The computer equipment includes being connected by system bus Processor, non-volatile memory medium, memory and network interface.Wherein, the non-volatile memories of the computer equipment are situated between Matter is stored with operating system, database and computer-readable instruction, can be stored with control information sequence in database, the computer When readable instruction is executed by processor, processor may make to realize a kind of upload data test method.The place of the computer equipment Device is managed for providing calculating and control ability, supports the operation of entire computer equipment.It can in the memory of the computer equipment It is stored with computer-readable instruction, when which is executed by processor, processor may make to execute a kind of upload Data test method.The network interface of the computer equipment is used for and terminal connection communication.It will be understood by those skilled in the art that Structure shown in Fig. 9, only the block diagram of part-structure relevant to application scheme, is not constituted to application scheme institute The restriction for the computer equipment being applied thereon, specific computer equipment may include than more or fewer portions as shown in the figure Part perhaps combines certain components or with different component layouts.
Processor obtains module 2100, processing module 2200 and execution module for executing in present embodiment in Fig. 8 2300 concrete function, program code and Various types of data needed for memory is stored with the above-mentioned module of execution.Network interface is used for To the data transmission between user terminal or server.Memory in present embodiment is stored with facial image critical point detection Program code needed for executing all submodules in device and data, server are capable of the program code and data of invoking server Execute the function of all submodules.
Computer equipment when testing, obtains user for the test parameter of the upload interface, in the test parameter Data capacity including test file calls corresponding material text according to the test parameter automatically in preset test database Part forms test file, sends test request to upload interface after test file generation.Test file is by multiple material files Composition, for the upload scene of concurrent type frog in simulation actual use, multiple uploads are generated according to the quantity of material file is corresponding Request, i.e., each corresponding upload request of material file, enables upload interface to receive multiple upload requests simultaneously, realizes The process that concurrent type frog uploads in the true usage scenario of simulation, most can really obtain test data, and improve test number According to reference value.
The present invention also provides a kind of storage medium for being stored with computer-readable instruction, computer-readable instruction by one or When multiple processors execute, so that one or more processors execute the step that any of the above-described embodiment uploads data test method Suddenly.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, which can be stored in a computer-readable storage and be situated between In matter, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium above-mentioned can be The non-volatile memory mediums such as magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random storage note Recall body (Random Access Memory, RAM) etc..
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other At least part of the sub-step or stage of step or other steps executes in turn or alternately.

Claims (10)

1. a kind of upload data test method characterized by comprising
Obtain the test parameter of upload interface to be tested;
Material file composition test file is extracted in preset test database according to the test parameter, wherein the survey Trying file includes multiple material files;
Multiple upload requests are sent to the upload interface, wherein the number of the quantity of the upload request and the material file Measure identical, and each upload request includes the material file.
2. upload data test method according to claim 1, which is characterized in that the test database is distributed number According to library, in the distributed data base include multiple processing nodes, it is described according to the test parameter in preset test data Material file composition test file is extracted in library includes:
Obtain at least two targets processing node for meeting preset first transmission conditions in the distributed data base;
Node allocation for test task is handled at least two target according to the test parameter;
The material file is extracted respectively according to each target processing node of the test assignment, in the distributed data base The composition of the middle cross-region test file.
3. upload data test method according to claim 2, which is characterized in that include that test is appointed in the test assignment It is described to include: to the multiple upload requests of upload interface transmission at the beginning of business
Each target processing node is to receive the time difference between the time point of the test assignment and the time started Value is delay time establish delay task;
When the delayed tasks are reached, each target processing node, which sends the upload to the upload interface, is asked It asks.
4. upload data test method according to claim 1, which is characterized in that described more to upload interface transmission After a upload request, comprising:
Obtain the response time that the upload interface responds each upload request;
The response time is compared with preset first time threshold;
When the response time being greater than the first time threshold, the upload interface is labeled as problem interface.
5. upload data test method according to claim 4, which is characterized in that described to obtain the upload interface response The response time of each upload request includes:
Obtain the first time stamp in the upload request;
It obtains the upload interface and replys the second timestamp in the return information of the upload request;
The time difference between the first time stamp and second timestamp is calculated, and defines the time difference as the response Time.
6. upload data test method according to claim 1, which is characterized in that include test mark in the test file It signs, after multiple upload requests to upload interface transmission, comprising:
Read the resolution file after being resolved in the test file;
Judge that test label described in the resolution file whether there is;
When in the resolution file including the test label, confirm that the test file uploads successfully.
7. upload data test method according to claim 6, which is characterized in that described to include in the resolution file When the test label, after confirming that the test file uploads successfully, comprising:
Judge whether the test label has uniqueness in the resolution file, wherein the test label is for testing The similar terms pooling function of database corresponding with the upload interface;
When the test label has uniqueness in the resolution file, the similar terms pooling function of the database is confirmed Normally.
8. a kind of upload data test device characterized by comprising
Module is obtained, for obtaining the test parameter of upload interface to be tested;
Processing module, for extracting material file composition test text in preset test database according to the test parameter Part, wherein the test file includes multiple material files;
Execution module, for the multiple upload requests of uploads interface transmission, wherein the quantity of the upload request with it is described The quantity of material file is identical, and each upload request includes the material file.
9. a kind of computer equipment, including memory and processor, it is stored with computer-readable instruction in the memory, it is described When computer-readable instruction is executed by the processor, so that the processor executes such as any one of claims 1 to 7 right It is required that the step of upload data test method.
10. a kind of storage medium for being stored with computer-readable instruction, the computer-readable instruction is handled by one or more When device executes, so that one or more processors are executed uploads data survey as described in any one of claims 1 to 7 claim The step of method for testing.
CN201910198337.0A 2019-03-15 2019-03-15 Upload data test method, apparatus, computer equipment and storage medium Pending CN110083524A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910198337.0A CN110083524A (en) 2019-03-15 2019-03-15 Upload data test method, apparatus, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910198337.0A CN110083524A (en) 2019-03-15 2019-03-15 Upload data test method, apparatus, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110083524A true CN110083524A (en) 2019-08-02

Family

ID=67412533

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910198337.0A Pending CN110083524A (en) 2019-03-15 2019-03-15 Upload data test method, apparatus, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110083524A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110808877A (en) * 2019-10-30 2020-02-18 深圳前海环融联易信息科技服务有限公司 Statistical analysis method and device based on interface response duration and computer equipment
CN112799969A (en) * 2021-04-08 2021-05-14 蚂蚁金服(杭州)网络技术有限公司 Testing method, device and system of distributed file system
CN113032211A (en) * 2021-03-19 2021-06-25 深圳市新威尔电子有限公司 Data security monitoring method
CN113485941A (en) * 2021-07-27 2021-10-08 山石网科通信技术股份有限公司 System pressure testing method and device, readable storage medium and processor
CN113805937A (en) * 2021-09-22 2021-12-17 深圳市绿联科技股份有限公司 File generation method and device, electronic equipment and storage medium
CN113821800A (en) * 2021-09-29 2021-12-21 重庆紫光华山智安科技有限公司 Data uploading interface test method and system, electronic equipment and readable storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840353A (en) * 2010-05-14 2010-09-22 陈冬岩 Dynamic timing method for real-time embedded operating system
US20130219226A1 (en) * 2012-02-20 2013-08-22 Microsoft Corporation Distributed testing within a serial testing infrastructure
US20140052825A1 (en) * 2012-08-19 2014-02-20 Box, Inc. Enhancement of upload and/or download performance based on client and/or server feedback information
WO2014031141A1 (en) * 2012-08-24 2014-02-27 Kraft Sheldon Methods and apparatus for creating and using a business video press release
CN104616235A (en) * 2015-03-06 2015-05-13 湖北中医药大学 Physical examination and health consultation system and method in traditional Chinese medicine
US20180060460A1 (en) * 2016-09-01 2018-03-01 Paypal, Inc. Simulating a Production Environment Using Distributed Computing Technologies
CN107832287A (en) * 2017-09-26 2018-03-23 晶赞广告(上海)有限公司 A kind of label identification method and device, storage medium, terminal
CN108156456A (en) * 2017-12-25 2018-06-12 深圳创维-Rgb电子有限公司 A kind of TV performance test methods, device and storage medium
CN109088907A (en) * 2017-06-14 2018-12-25 北京京东尚科信息技术有限公司 File delivery method and its equipment
CN109412896A (en) * 2018-11-14 2019-03-01 中国平安人寿保险股份有限公司 Test method, device, computer equipment and the storage medium of upload function
CN109408370A (en) * 2018-09-18 2019-03-01 深圳壹账通智能科技有限公司 Interface testing document generating method, device, computer equipment and storage medium
CN109446065A (en) * 2018-09-18 2019-03-08 深圳壹账通智能科技有限公司 User tag test method, device, computer equipment and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840353A (en) * 2010-05-14 2010-09-22 陈冬岩 Dynamic timing method for real-time embedded operating system
US20130219226A1 (en) * 2012-02-20 2013-08-22 Microsoft Corporation Distributed testing within a serial testing infrastructure
US20140052825A1 (en) * 2012-08-19 2014-02-20 Box, Inc. Enhancement of upload and/or download performance based on client and/or server feedback information
WO2014031141A1 (en) * 2012-08-24 2014-02-27 Kraft Sheldon Methods and apparatus for creating and using a business video press release
CN104616235A (en) * 2015-03-06 2015-05-13 湖北中医药大学 Physical examination and health consultation system and method in traditional Chinese medicine
US20180060460A1 (en) * 2016-09-01 2018-03-01 Paypal, Inc. Simulating a Production Environment Using Distributed Computing Technologies
CN109088907A (en) * 2017-06-14 2018-12-25 北京京东尚科信息技术有限公司 File delivery method and its equipment
CN107832287A (en) * 2017-09-26 2018-03-23 晶赞广告(上海)有限公司 A kind of label identification method and device, storage medium, terminal
CN108156456A (en) * 2017-12-25 2018-06-12 深圳创维-Rgb电子有限公司 A kind of TV performance test methods, device and storage medium
CN109408370A (en) * 2018-09-18 2019-03-01 深圳壹账通智能科技有限公司 Interface testing document generating method, device, computer equipment and storage medium
CN109446065A (en) * 2018-09-18 2019-03-08 深圳壹账通智能科技有限公司 User tag test method, device, computer equipment and storage medium
CN109412896A (en) * 2018-11-14 2019-03-01 中国平安人寿保险股份有限公司 Test method, device, computer equipment and the storage medium of upload function

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邹鹤敏;黄海于;: "大文件分块上传和下载软件的设计与实现", 电子技术应用, no. 08, 6 August 2013 (2013-08-06) *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110808877A (en) * 2019-10-30 2020-02-18 深圳前海环融联易信息科技服务有限公司 Statistical analysis method and device based on interface response duration and computer equipment
CN113032211A (en) * 2021-03-19 2021-06-25 深圳市新威尔电子有限公司 Data security monitoring method
CN112799969A (en) * 2021-04-08 2021-05-14 蚂蚁金服(杭州)网络技术有限公司 Testing method, device and system of distributed file system
CN113485941A (en) * 2021-07-27 2021-10-08 山石网科通信技术股份有限公司 System pressure testing method and device, readable storage medium and processor
CN113805937A (en) * 2021-09-22 2021-12-17 深圳市绿联科技股份有限公司 File generation method and device, electronic equipment and storage medium
CN113821800A (en) * 2021-09-29 2021-12-21 重庆紫光华山智安科技有限公司 Data uploading interface test method and system, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN110083524A (en) Upload data test method, apparatus, computer equipment and storage medium
US11218366B1 (en) Automatic generation of template for provisioning services in a hosted computing environment
US9832614B2 (en) Method, server and terminal for information interaction
EP2260398B1 (en) N-way multimedia collaboration system
CN104348859B (en) File synchronisation method, device, server, terminal and system
CN107888666A (en) A kind of cross-region data-storage system and method for data synchronization and device
CN106375458A (en) Service call system, method and device
CN110162512A (en) A kind of log searching method, apparatus and storage medium
CN111177292A (en) WebGIS collaborative plotting method and system for emergency incident
CN110765025A (en) Test method, test device, computer equipment and storage medium
CN105260447A (en) Webpage data analysis method and system
CN109697020A (en) A kind of date storage method, server and system
CN106354387A (en) Input method-based practical cloud clipboard
CN108243025A (en) A kind of network test server-side, network test terminal and test method
CN109451029A (en) Data caching method, device, equipment and medium for distributed object storage
CN105009115A (en) Method and apparatus for obtaining network resources
CN111209938A (en) Automatic progress monitoring method, electronic equipment and storage medium
CN110659006A (en) Cross-screen display method and device, electronic equipment and readable storage medium
Mrówczyński et al. Benchmarking and monitoring framework for interconnected file synchronization and sharing services
CN113407491B (en) Data processing method and device
CN103236954A (en) Web service evaluation system in mobile network
CN104113509A (en) Media file push method and server
CN103226594B (en) The method and system in path, fastopen place during a kind of shared file
CN104881411B (en) The processing method and processing device of file between storage system
Wang et al. [Retracted] Information Steganography Technology of Optical Communication Sensor Network Based on Virtual Reality Technology

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