CN105099833A - Business test method , device and system - Google Patents

Business test method , device and system Download PDF

Info

Publication number
CN105099833A
CN105099833A CN201510584051.8A CN201510584051A CN105099833A CN 105099833 A CN105099833 A CN 105099833A CN 201510584051 A CN201510584051 A CN 201510584051A CN 105099833 A CN105099833 A CN 105099833A
Authority
CN
China
Prior art keywords
message
file
test
network
information
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
CN201510584051.8A
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.)
Beijing Fusionskye Technology Co Ltd
Original Assignee
Beijing Fusionskye 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 Beijing Fusionskye Technology Co Ltd filed Critical Beijing Fusionskye Technology Co Ltd
Priority to CN201510584051.8A priority Critical patent/CN105099833A/en
Publication of CN105099833A publication Critical patent/CN105099833A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the network communication technology field and particularly relates to the business test method, a device and a system. The method comprises steps that, network messages of users accessing to a network application are acquired; user request time of the network messages is acquired, and message information is parsed from each network message; acquisition time displacement is added to message information of each network message according to the user request time; message information of the network messages acquired within preset time length is sequentially recombined according to a preset data storage format and a file organization method to form multiple message files which are then stored; when a test instruction is received, the message file in matching with the test instruction are combined according to the test instruction to generate a test file; and the message information in the test file is recombined to form a test message to carry out a playback test. The method is a test method based on real playback environment network data messages, user operation in a real environment can be reduced, and problems are more accurately queried and discovered.

Description

A kind of service test method, device and system
Technical field
The present invention relates to network communication technology field, in particular to a kind of service test method, device and system.
Background technology
Network application needs the Concurrency Access supporting a large number of users, and in order to meet the various demands of user, the software and hardware product that network application is provided by different supplier usually builds.And along with using the increasing of user of network application, network environment also becomes increasingly complex variation, thus network application also needs to deal with the user load being difficult to predict.And once user load is too much, be then easy to occur that network application response speed is excessively slow, the problems such as system crash.
In order to the stable of network application can be guaranteed, avoid due to the excessive and produced problem of user load, current solution carries out Real-Time Monitoring to network application, by the operation behavior of analog subscriber, the concurrent load of network application and real-time performance are tested simultaneously, namely operational trials is carried out to network application.But when carrying out operational trials, owing to being undertaken testing by the operation behavior of analog subscriber, can have some limitations, the operation behavior simulated not necessarily meets the user behavior under true environment, the user operation of simulation all cannot the user operation of true rediscover environment at the frequency, action type, operative combination, Annual distribution etc., there will be very large error, and then cause operational trials cannot really reach the object of searching and pinpointing the problems.
Summary of the invention
In view of this, the object of the embodiment of the present invention is to provide a kind of service test method, device and system, the method is the method for testing of carrying out based on playback true environment network data message, can the user operation of rediscover environment, makes to search and pinpoint the problems more accurate.
First aspect, embodiments provides a kind of service test method, comprising:
Obtain network message during customer access network application;
Obtain user's request time of described network message, and from network message described in every bar analytic message information; Described message information comprises: message loaded length, object IP address, destination interface, message payload content;
Acquisition time displacement is added according to the message information that described user's request time is each described network message;
Successively the described message information of the described network message obtained in predetermined time period is reassembled into multiple message file according to the data memory format preset and file organization method and stores;
When receiving test instruction, according to described test instruction, the message file mated with described test instruction being merged, generating test file;
Message information in described test file is reassembled as test packet, carries out playback test.
In conjunction with first aspect, embodiments provide the first possible execution mode of first aspect, described successively by the described message information of the described network message obtained in predetermined time period according to preset data memory format and file organization method reassemble into multiple message file and store specifically comprise:
When the network message quantity received in predetermined time period is non-vanishing,
By the described message information of network message described in every bar of receiving in predetermined time period successively according to preset order stored in same document, and add at the end of all described message informations and terminate mark;
Wherein, described end mark has and only has one; Described acquisition time displacement comprises: the difference of user's request time of current network message and user's request time of last bar network message; Described preset order is the storage order of payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message;
Using described document as message file, and according to the rule preset, identification marking is added to described message file;
When the network message quantity received in predetermined time period is zero,
Generate blank document, and in described blank document, add end mark;
Using described blank document as message file, and according to the rule preset, identification marking is added to described message file;
Wherein, described blank document generates when generating the next document containing message information.
In conjunction with first aspect, embodiments provide the execution mode that the second of first aspect is possible, described test instruction comprises: retrieving information; Described retrieving information can mate with the identification marking of described message file;
According to described test instruction, the message file mated with described test instruction is merged, generates test file, specifically comprise:
Retrieve according to the retrieving information in described test instruction, obtain the message file that identification marking mates with described retrieving information;
Message information in the message file obtained after retrieval is merged, and generates test file.
In conjunction with first aspect, embodiments provide the third possible execution mode of first aspect, the message information in described test file be reassembled as test packet and specifically comprise:
Read from described test file and the message information corresponding to each network message successively;
According to the described message information of each described network message, using the message loaded length in described message information as the loaded length of test packet, using the IP address in described message information as the IP address of test packet, using the destination interface in message information as the destination interface of test packet, using the message payload content in described message information as the message payload content of test packet, and with described acquisition time displacement for sending the time interval of test packet, described message information is reassembled as test packet.
In conjunction with first aspect, embodiments provide the 4th kind of possible execution mode of first aspect, described network message comprises at least one packet;
Described user's request time is the time receiving last packet;
Described message payload content comprises the data load in all packets of network message;
And/or,
Message information in the message file obtained after retrieval is closed, and generates test file, and specifically comprise:
According to the time order and function order of message file generated, the message file obtained after retrieval successively, read described message information;
By the described message information sequential concatenation read;
Be zero by the acquisition time modification of displacement of the Article 1 message information in spliced message information, and generate test file.
Second aspect, the embodiment of the present invention also provides a kind of operational trials device, and it is at least comprising in the system of server and client side, and is arranged at described server end, comprising:
Network message acquisition module, for obtaining network message during customer access network application;
Network message parsing module, for obtaining user's request time of described network message, and from network message described in every bar analytic message information; Described message information comprises: message loaded length, object IP address, destination interface, message payload content;
Module is added in acquisition time displacement, for according to described user's request time being the message information interpolation acquisition time displacement of each described network message;
Message file generating module, for reassembling into multiple message file by the described message information of the described network message obtained in predetermined time period according to the file organization method preset and store successively;
Test file generation module, for when receiving test instruction, according to described test instruction, merges the message file mated with described test instruction, generates test file;
Playback test module, for the message information in described test file is reassembled as test packet, carries out playback test.
In conjunction with second aspect, embodiments provide the first possible execution mode of second aspect, described message file generating module specifically comprises:
Message file organization unit, when network message quantity for receiving in predetermined time period is non-vanishing, by the described message information of network message described in every bar of receiving in predetermined time period successively according to preset order stored in same document, and add at the end of all described message informations and terminate mark;
Wherein, described end mark has and only has one; Described acquisition time displacement comprises: the difference of user's request time of current network message and user's request time of last bar network message; Described preset order is the storage order of payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message;
Identification marking adding device, for using described document as message file, and according to the rule preset, identification marking is added to described message file;
Described message file organization unit, when the network message quantity also for receiving in predetermined time period is zero, generates blank document, and in described blank document, add end mark;
Described identification marking adding device, also for using described blank document as message file, and according to the rule preset, identification marking is added to described message file;
Wherein, described blank document generates when generating the next document containing message information.
In conjunction with second aspect, embodiments provide the execution mode that the second of second aspect is possible, described test instruction comprises: retrieving information; Described retrieving information can mate with the identification marking of described message file;
Described test file generation module specifically comprises:
Retrieval unit, for retrieving according to the retrieving information in described test instruction, obtains the message file that identification marking mates with described retrieving information;
Test file generation unit, for being merged by the message information in the message file obtained after retrieval, and generates test file.
In conjunction with second aspect, embodiments provide the third possible execution mode of second aspect, described playback test module comprises:
Message information reading unit, for reading and the message information corresponding to each network message successively from described test file;
Test packet generation unit, for the described message information according to each described network message, using the message loaded length in described message information as the loaded length of test packet, using the IP address in described message information as the IP address of test packet, using the destination interface in message information as the destination interface of test packet, using the message payload content in described message information as the message payload content of test packet, and with described acquisition time displacement for sending the time interval of test packet, described message information is reassembled as test packet.
The third aspect, the embodiment of the present invention also provides a kind of operational trials system, comprises client and server, and described client is also connected with the operational trials device described in above-mentioned second aspect any one.
The service test method that the embodiment of the present invention provides, device and system, first network message during customer access network application is obtained, and from network message analytic message information, then for each message information adds acquisition time displacement, and message information is reassembled into multiple message file according to the data format preset and file organization method and stores, when needs carry out operational trials time, according to the test instruction received, the association message file matched with test instruction is selected from the message file preserved, and these message files are carried out merging generation test file, then by test file is reassembled as test packet, the network message sent during the application of reappearing user accesses network, playback test is carried out by the method for this True Data playback, because the method itself is the method for testing of carrying out based on true environment network data message, the mode of simulation is not adopted to launch test, and adopt the mode of data readback Network Based.Test the real user data from true environment used, accurately can reflect that network application is at the load of real world, interaction scenario, completes test by the mode of emulation, the accuracy of the raising test of maximum possible.
For making above-mentioned purpose of the present invention, feature and advantage become apparent, preferred embodiment cited below particularly, and coordinate appended accompanying drawing, be described in detail below.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment below, be to be understood that, the following drawings illustrate only some embodiment of the present invention, therefore the restriction to scope should be counted as, for those of ordinary skill in the art, under the prerequisite not paying creative work, other relevant accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 shows the flow chart of a kind of service test method that the embodiment of the present invention provides;
Fig. 2 shows in the service test method that the embodiment of the present invention provides, the flow chart of the concrete grammar of message file generated;
Fig. 3 shows in the service test method that the embodiment of the present invention provides, a kind of structure chart of data memory format;
Fig. 4 shows in the service test method that the embodiment of the present invention provides, and according to described test instruction, the message file mated is merged with described test instruction, generates the flow chart of the concrete grammar of test file;
Fig. 5 shows in the service test method that the embodiment of the present invention provides, and is closed by the message information in the message file obtained, and generate the flow chart of the concrete grammar of test file after retrieval;
Fig. 6 shows in the service test method that the embodiment of the present invention provides, the flow chart of an example of the generative process of test file;
Fig. 7 shows in the service test method that the embodiment of the present invention provides, and the data obtaining the real user accesses network application in certain time range by WEB, carry out returns visit and test, the structure chart of the concrete data format of the test file of derivation;
Fig. 8 shows the structural representation of a kind of operational trials device that the embodiment of the present invention provides;
Fig. 9 shows in the operational trials device that the embodiment of the present invention provides, the structural representation of message file generating module;
Figure 10 shows in the operational trials device that the embodiment of the present invention provides, the structural representation of test file generation module;
Figure 11 shows in the operational trials device that the embodiment of the present invention provides, the structural representation of playback test module;
Figure 12 shows the structural representation of a kind of operational trials system that the embodiment of the present invention provides.
Embodiment
Below in conjunction with accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.The assembly of the embodiment of the present invention describing and illustrate in usual accompanying drawing herein can be arranged with various different configuration and design.Therefore, below to the detailed description of the embodiments of the invention provided in the accompanying drawings and the claimed scope of the present invention of not intended to be limiting, but selected embodiment of the present invention is only represented.Based on embodiments of the invention, the every other embodiment that those skilled in the art obtain under the prerequisite not making creative work, all belongs to the scope of protection of the invention.
Consider that network of relation application testing technology realizes based on analog subscriber operation usually; the user operation of simulation all cannot the user operation of rediscover environment in the operation frequency, action type, operative combination, operating time distribution etc.; the error that easy appearance is very large; and then cause network application testing reliability poor, cannot be real reach the object of searching and pinpointing the problems.Based on this, the embodiment of the present invention provides a kind of service test method, device and system, and it, mainly based on the network data message in playback true environment, is tested this network data message, makes to search and pinpoint the problems more accurate.Method provided by the present invention, device and system can be applied in the system of client and/or server, are not limited to concrete network application.
For ease of understanding the present embodiment, first a kind of service test method disclosed in the embodiment of the present invention is described in detail, it should be noted that, the service test method that the embodiment of the present invention provides comprises two parts: message generates and message derives transmission.Wherein following S101 ~ S104 is message generating portion, and S105 ~ S106 is the part that message derives transmission.
In the process that message generates, shown in Figure 1, the service test method that the embodiment of the present invention provides comprises the following steps:
S101: obtain network message during customer access network application.
When specific implementation, the service request that user sends from client can form corresponding network message in client, and usually, network message can be encapsulated as at least one Packet Generation to server according to the communication protocol that bottom is relevant.The network message of indication of the present invention, refers to all packets of a complete service request packaged one-tenth when sending.Each packet contains the content such as payload length, segment message payload content, timestamp, identification of data packets mark of source IP address, object IP address, source port, destination interface, network message.And in client, network message is sent in the process of server, by switch bypass mirror-image fashion before client obtains network message, network message can be obtained; In addition, can also be that server forwards after receiving network message, obtain the mode of the network message that server forwards.Usually, select and obtain network message, to alleviate the operating pressure of server by switch bypass mirror-image fashion.Which lays switch at server end, monitored the data flow on switch by SPAN technology.Utilize SPAN technology by the data flow replication of the port of connection server on switch portion, the relevant device be connected on policing port can be sent to.And the time that the time of relevant device acquisition related data flow and server end obtain related data flow is consistent substantially.
S102: the user's request time obtaining described network message, and from network message described in every bar analytic message information; Described message information comprises: message loaded length, object IP address, destination interface, message payload content;
When specific implementation, due to a service request of each network message respective user, and each network message is made up of at least one packet, because packet itself separately sends, thus the time that different packets arrives is inconsistent, and therefore user's request time should be receive the time organizing a rear packet.Therefore the time of last packet will can be received as user's request time.And user's request time obtains when being and receiving last packet immediately from system.In addition, owing to all including identical timestamp information in the packet of each network message, also can timestamp information as user's request time.It should be noted that the time therefore receiving last packet may lag behind the time of timestamp owing to need certain hour during data transmission in a network.And due to the complexity of network environment, when using timestamp information as user's request time time, may occur that the solicited message of client sends already, and received server-side is to free delayed of solicited message, may exist larger error the time, therefore, generally, to be subject to the time of last packet as user's request time, temporal accuracy rate is higher, and error is less.And in each packet of network message, all contain the content such as payload length, segment message payload content, timestamp, identification of data packets mark of source IP address, object IP address, source port, destination interface, network message, and when follow-up operational trials, can carry out playback according to real network data, object IP address, destination interface are for helping the transmission object of locator data bag; Message payload content is provided for server and normally runs; The loaded length of user's request time, network message, acquisition time displacement are used for auxiliary transmitter and formulate sending strategy, determine transmission behavior.Therefore the object IP address of network message, destination interface, message loaded length, message payload content is needed to parse from packet.Usually, message payload content should comprise the payload content in all packets.
S103: add acquisition time displacement according to the message information that described user's request time is each described network message;
When specific implementation, because each service request is when sending, the time is inconsistent, and client is also inconsistent in the time of the network message receiving correspondence with it, and centre has the regular hour poor.And according to real situation, network message is carried out playback completely in order to follow-up, then need the difference of the user's request time paid close attention between network message and network message, i.e. acquisition time displacement.This acquisition time displacement can deduct user's request time acquisition of last bar network message by user's request time of current network message.Calculate after obtaining and it is added in message information.
S104: successively the described message information of the described network message obtained in predetermined time period is reassembled into multiple message file according to the data memory format preset and file organization method and stores;
When specific implementation, preset a time span, this time span the time span of non-acquisition network message, network message receives after corresponding network message obtains instruction and just can obtain always, in the process obtaining network message, can be divided into the time interval one by one the time, the time span namely preset.Message information in the network message obtained within this time span can reassemble into a message file according to the file organization method preset, message information in the network message obtained within next time span can reassemble into another message file according to the file organization method preset, repetition like this, the multiple message file of final generation, and according to the volume data memory format preset, message file is stored.Such as certain is when acquisition network message, from certain time point, time span is preset as one minute.So from time point, each minute generates a message file, obtains the time remaining 5 hours of network message, so finally just should generate 300 message files.
S105: when receiving test instruction, according to described test instruction, merges the message file mated with described test instruction, generates test file;
S106: the message information in described test file is reassembled as test packet, carries out playback test.
When specific implementation, owing to message information being reassembled into multiple message file and stores according to the file organization method preset, therefore when receiving test instruction, according to test instruction, the message file mated in test instruction is merged, generates test file.Then the message information in test file is reassembled as test packet, carries out return visit test.Concrete process with reference to the description of the embodiment corresponding to following Fig. 4, Fig. 5 and Fig. 6, can not repeat them here.
Business back method provided by the present invention, first network message during customer access network application is obtained, and from network message analytic message information, then for each message information adds acquisition time displacement, and message information is reassembled into multiple message file according to the data format preset and file organization method and stores, when needs carry out operational trials time, according to the test instruction received, the association message file matched with test instruction is selected from the message file preserved, and these message files are carried out merging generation test file, then by test file is reassembled as test packet, the network message sent during the application of reappearing user accesses network, playback test is carried out by the method for this True Data playback, because the method itself is the method for testing of carrying out based on true environment network data message, the mode of simulation is not adopted to launch test, and adopt the mode of data readback Network Based.Test the real user data from true environment used, accurately can reflect that network application is at the load of real world, interaction scenario, completes test by the mode of emulation, the accuracy of the raising test of maximum possible.
Shown in Figure 2, the embodiment of the present invention also provides a kind of and successively the described message information of the described network message obtained in predetermined time period is reassembled into multiple message file according to the data memory format preset and file organization method and the concrete grammar stored, and comprising:
S201: when the network message quantity received in predetermined time period is non-vanishing, by the described message information of network message described in every bar of receiving in predetermined time period successively according to preset order stored in same document, and add at the end of all described message informations and terminate mark;
Wherein, described end mark has and only has one; Described acquisition time displacement comprises: the difference of user's request time of current network message and user's request time of last bar network message; Described preset order is the storage order of payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message;
When specific implementation, if the network message quantity received in predetermined time period is non-vanishing, namely in certain predetermined time period, useful user orientation server have sent service request, create corresponding network message, by the message information of every bar network message that receives in this time span successively according to preset order stored in same document, and add at the end of all message informations and terminate mark.By every bar network message information according to preset order stored in same document, refer in every bar network message, the order of message information, i.e. the order of the payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message.Successively stored in being then sequencing according to user's request time, the network message first received first is deposited, after deposit after the network message that receives, until current time span terminates, in the end (after the message information of the last item network message) adds and terminates mark.The storage format of the message information of above-mentioned network message, is default data memory format.
Such as, shown in Figure 3, provide a kind of data memory format: the data memory format of the message information of wall scroll network message is followed successively by: the payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message.Wherein, acquisition time displacement also known as the time difference, i.e. the difference (unit: delicate) of user's request time of this network message and user's request time of a upper network message, 8 byte signless integers.All fields adopt all fields to adopt bigendian, are equal to network bytes sequence.Wherein, bigendian, also known as large end, refers to the tissue of byte in internal memory.What IP address field adopted is that the mode of the inet_addr of standard unixc is expressed, 4 bytes.Standard C function inet_aton () and inet_ntoa () can be adopted to change.In addition, message information can also be stored with other data memory format.Such as can change the order etc. of payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message.
In addition, owing to being that the message information of all network messages received in predetermined time period is all stored in same message file, therefore need to add at the end of document to terminate mark, to represent that the document completes.When with the addition of for document terminate accordingly mark after, document will be stored as message file.Terminate mark to define according to actual conditions, but due in the present invention, the particularity of message file data storage format, can using the character string of a specified byte length as end mark.Such as, can think when the message end of file, the last item network message received is 0, and all fields are all the record of 0, so just by 0 byte of fixed byte length, as end mark.
S202: using described document as message file, and according to the rule preset, identification marking is added to described message file;
When specific implementation, identification marking is add in the title of message file actually.This identification marking is then that the message file in order to each time period being generated differentiates.And follow-up carry out playback test in, need to choose satisfactory message file from these message files, also choose according to identification marking.
Wherein, adding identification marking according to the rule preset to message file has multiple adding method, comprising:
1, time shaft additive process, adds in title by the concrete time corresponding to message file, and such as during 25 days 17 January in 2015, the title of the message file that 27 points generate can be: 201510251727.
2, the form increased progressively according to sequence number is added, such as generate a message file every preset time period, be 0000000000 by first name nominating of message file generated, and the name nominating of second message file generated is 0000000001, along with increasing of message file, this sequence number is unidirectional to be increased progressively gradually, and each sequence number is not reused; In this case, a meta file can also be generated under the storage directory corresponding with message file, file name is meta, content is current generation and the rise time of user's request time+last message file of the filename of last available text (above-mentioned character string)+the last item network message, and this meta file is in order to mark and the rise time of this meta file with the message file under catalogue.It should be noted that each message file all to there being a meta file.
S203: when the network message quantity received in predetermined time period is zero, generates blank document, and in described blank document, add end mark;
S204: using described blank document as message file, and according to the rule preset, identification marking is added to described message file.
When specific implementation, when the network message quantity received in certain time period is zero time, namely in this time period, when server does not receive any service request of user.Now need equally to generate message file.Message file is now blank document, and in blank document, add end mark, and using with the addition of the blank document of end mark as message file, then according to the rule preset in S202, to message file interpolation identification marking.
It should be noted that blank document generates when generating the next document containing message information.Such as, first time period, the network message quantity received is non-vanishing, then when first time period terminates, generate first message file, and second time period to the network message quantity that the 5th time period receives is zero, the 6th message amount that the time period receives is non-vanishing, when generating the 6th message file, just can generate four blank document of second time period to the 5th time period.
It should be noted that the mode of above-mentioned generation message file is then the organizational form (also known as generation type) of message file.
Shown in Figure 4, another embodiment of the present invention also provides a kind of and is merged by the message file mated with described test instruction according to described test instruction, and generate the concrete grammar of test file, the method specifically comprises:
S301: retrieve according to the retrieving information in described test instruction, obtains the message file that identification marking mates with described retrieving information;
When specific implementation, test instruction comprises retrieving information, and described retrieving information can mate with the identification marking of described message file; The organization regulation of retrieving information is relevant to the organization regulation of the identification marking of message file, and according to retrieving information, can retrieve the concrete message file of wanting to carry out playback from the identification marking of message file.Such as, retrieving information can be the temporal information of the message file needing playback when carrying out operational trials, and this temporal information is a time period, this time period to equal or be longer than a generation message file preset time period.
S302: the message information in the message file obtained after retrieval is merged, and generates test file.
Shown in Figure 5, another embodiment of the present invention also provides a kind of and is closed by message information in the message file obtained after retrieval, and generates the concrete grammar of test file, comprising:
S401: according to the time order and function order of message file generated, read described message information the message file obtained after retrieval successively;
S402: by the described message information sequential concatenation read;
S403: be zero by the acquisition time modification of displacement of the Article 1 message information in spliced message information, and generate test file.
When specific implementation, obtain retrieving information in S301 after, can carry out inquiring about or calculating according to retrieving information, find the title of test initial time and test end time each self-corresponding message file, and the message information read from the message file corresponding to test initial time corresponding to Article 1 network message, and by the acquisition time displacement initialization (changing to 0 by it) in this message information, then the message information in message file is read successively according to the order of message file generated, and the message information in all message files be retrieved is merged, this merging is spliced by the message information starting most in the message information of the last item in previous message file and current message file, final generation one contains the test file of message information in all message files retrieved.
Such as: using the time of input as the retrieving information in test instruction, the time of this input comprises time started and deadline, the name of the message file mated with retrieving information is called inputA, the test file name of final formation is called outputExcel, also comprise intermediate output file outputB, wherein outputB is the output stream of gz compression, and the generative process of concrete test file is shown in Figure 6, comprising:
S501: according to the time of input, obtains the filename inputA of first message file;
S502: according to the time of input, calculates the outputB.gz exported, opens outputB file;
S503: search for the message information that first user's request time is greater than the time started from inputA, and the acquisition time displacement of this message information is initialized as 0, and this collection bit time displacement is decided to be fiducial time, output in outputB file;
S504: read next message information from inputA;
S505: judge whether this message information is terminate mark;
S506: if then open next message file to inputA, and return S405;
S507: if not, then judge whether user's request time is less than deadline;
S508: if not, then generate test file outputB and terminate, close outputB, close outputExcel file;
S509: if the amendment delta time is (user's request time-fiducial time), outputs in outputB file;
S510: overview input outputExcel file will be recorded, return S404.
In addition, message information in described test file is reassembled as test packet specifically comprise: according to the described message information of each described network message, using the message loaded length in described message information as the loaded length of test packet, using the IP address in described message information as the IP address of test packet, using the destination interface in message information as the destination interface of test packet, using the message payload content in described message information as the message payload content of test packet, and with described acquisition time displacement for sending the time interval of test packet, described message information is reassembled as test packet.
When specific implementation, owing to being will test based on the playback of live network data, the True Data truly receiving service request according to server is therefore needed to carry out playback.Therefore the message information of obtained network message to be sent to server according to original mode, therefore will with the object IP address in message information, destination interface is object IP address and the destination interface of test packet, using the message loaded length in message information as the loaded length of test packet, using the message payload content in message information as the message payload content of test packet, acquisition time displacement is the difference of the user's request time between this message information and a upper message information, what can be similar to thinks that user sends the time difference of service request, therefore will using acquisition time displacement as the transmission time interval between this message information and a upper message information, message information is reassembled as test packet, and this test packet is sent to server and carries out playback test.
In addition, shown in Figure 7, the present invention also provides a kind of data obtaining the real user accesses network application in certain time range by WEB, carries out return visit test, the concrete data format of the test file of derivation: comprising:
Message loaded length: be the length of single business transaction payload packet, block length unit is byte; It should be noted that loaded length is here payload length, namely do not comprise other as object IP address, the business information length of the contents such as destination interface, acquisition time displacement.
Object IP address, destination interface: be IP and the port numbers of received server-side;
Acquisition time displacement: in the stream file gathered, with the time of first traffic packets for starting point, other messages are relative to the traffic packets time shifting of its previous collection, and unit is microsecond; This field of first traffic packets gathered is zero; Syllable sequence adopts Big-endian.
It is 0 that the last item of file is recorded as size, and all fields are all the record of 0, identify as the end of file.
Further embodiment of this invention also provides a kind of operational trials device, shown in Figure 8, and the operational trials device that the embodiment of the present invention provides comprises:
Network message acquisition module 10, for obtaining network message during customer access network application;
Network message parsing module 20, for obtaining user's request time of described network message, and from network message described in every bar analytic message information; Described message information comprises: message loaded length, object IP address, destination interface, message payload content;
Module 30 is added in acquisition time displacement, for according to described user's request time being the message information interpolation acquisition time displacement of each described network message;
Message file generating module 40, for reassembling into multiple message file by the described message information of the described network message obtained in predetermined time period according to the file organization method preset and store successively;
Test file generation module 50, for when receiving test instruction, according to described test instruction, merges the message file mated with described test instruction, generates test file;
Playback test module 60, for the message information in described test file is reassembled as test packet, carries out playback test.
In the present embodiment, network message acquisition module 10, network message parsing module 20, acquisition time displacement add concrete function and the interactive mode of module 30, message file generating module 40, test file generation module 50 and playback test module 60, see the record of embodiment corresponding to Fig. 1, can not repeat them here.
The face identification device that the embodiment of the present invention provides, first network message when customer access network is applied is obtained by network message acquisition module 10, again by network message parsing module and from network message analytic message information, then module 30 is added for the displacement of each message information interpolation acquisition time by acquisition time displacement, and by message file generating module 40, message information is reassembled into multiple message file according to the data format preset and file organization method and stores, when needs carry out operational trials time, test file generation module 50 is according to the test instruction received, the association message file matched with test instruction is selected from the message file preserved, and these message files are carried out merging generation test file, then by test file is reassembled as test packet, the network message sent when being applied by playback test module 60 reappearing user accesses network again, playback test is carried out by the method for this True Data playback, because the method itself is the method for testing of carrying out based on true environment network data message, the mode of simulation is not adopted to launch test, and adopt the mode of data readback Network Based.Test the real user data from true environment used, accurately can reflect that network application is at the load of real world, interaction scenario, completes test by the mode of emulation, the accuracy of the raising test of maximum possible.
Further embodiment of this invention also provides the concrete device of message file generating module, shown in Figure 9, and described message file generating module 40 specifically comprises:
Message file organization unit 41, when network message quantity for receiving in predetermined time period is non-vanishing, by the described message information of network message described in every bar of receiving in predetermined time period successively according to preset order stored in same document, and add at the end of all described message informations and terminate mark;
Wherein, described end mark has and only has one; Described acquisition time displacement comprises: the difference of user's request time of current network message and user's request time of last bar network message; Described preset order is the storage order of payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message;
Identification marking adding device 42, for using described document as message file, and according to the rule preset, identification marking is added to described message file;
Described message file organization unit 41, when the network message quantity also for receiving in predetermined time period is zero, generates blank document, and in described blank document, add end mark;
Described identification marking adding device 42, also for using described blank document as message file, and according to the rule preset, identification marking is added to described message file;
Wherein, described blank document generates when generating the next document containing message information.
In the present embodiment, the concrete function of message file organization unit 41, identification marking adding device 42 and interactive mode, see the record of embodiment corresponding to Fig. 2 and Fig. 3, can not repeat them here.
Further embodiment of this invention also provides the concrete structure of test file generation module 50, shown in Figure 10, and described test instruction comprises: retrieving information; Described retrieving information can mate with the identification marking of described message file;
Described test file generation module 50 specifically comprises:
Retrieval unit 51, for retrieving according to the retrieving information in described test instruction, obtains the message file that identification marking mates with described retrieving information;
Test file generation unit 52, for being merged by the message information in the message file obtained after retrieval, and generates test file.
In the present embodiment, the concrete function of retrieval unit 51, test file generation unit 52 and interactive mode, see the record of embodiment corresponding to Fig. 4, can not repeat them here.
Further embodiment of this invention also provides a kind of concrete structure of playback test module, shown in Figure 11, and described playback test module 60 comprises:
Message information reading unit 61, for reading and the message information corresponding to each network message successively from described test file;
Test packet generation unit 62, for the described message information according to each described network message, using the message loaded length in described message information as the loaded length of test packet, using the IP address in described message information as the IP address of test packet, using the destination interface in message information as the destination interface of test packet, using the message payload content in described message information as the message payload content of test packet, and with described acquisition time displacement for sending the time interval of test packet, described message information is reassembled as test packet.In the present embodiment, the concrete function of message information reading unit 61, test packet generation unit 62 and interactive mode, see the record of embodiment corresponding to Fig. 5, can not repeat them here.
Further embodiment of this invention additionally provides a kind of operational trials system, shown in Figure 12,
Comprise client 100 and server 200, described client is also connected with the operational trials device 300 described in above-mentioned Fig. 8 to Figure 11.
The computer program of the service test method that the embodiment of the present invention provides, device and system, comprise the computer-readable recording medium storing program code, the instruction that described program code comprises can be used for performing the method described in previous methods embodiment, specific implementation see embodiment of the method, can not repeat them here.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description and the specific works process of device, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
If described function using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part of the part that technical scheme of the present invention contributes to prior art in essence in other words or this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, read-only memory (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc. various can be program code stored medium.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection range of claim.

Claims (10)

1. a service test method, is characterized in that, comprising:
Obtain network message during customer access network application;
Obtain user's request time of described network message, and from network message described in every bar analytic message information; Described message information comprises: message loaded length, object IP address, destination interface, message payload content;
Acquisition time displacement is added according to the message information that described user's request time is each described network message;
Successively the described message information of the described network message obtained in predetermined time period is reassembled into multiple message file according to the data memory format preset and file organization method and stores;
When receiving test instruction, according to described test instruction, the message file mated with described test instruction being merged, generating test file;
Message information in described test file is reassembled as test packet, carries out playback test.
2. method according to claim 1, it is characterized in that, described successively by the described message information of the described network message obtained in predetermined time period according to preset data memory format and file organization method reassemble into multiple message file and store specifically comprise:
When the network message quantity received in predetermined time period is non-vanishing,
By the described message information of network message described in every bar of receiving in predetermined time period successively according to preset order stored in same document, and add at the end of all described message informations and terminate mark;
Wherein, described end mark has and only has one; Described acquisition time displacement comprises: the difference of user's request time of current network message and user's request time of last bar network message; Described preset order is the storage order of payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message;
Using described document as message file, and according to the rule preset, identification marking is added to described message file;
When the network message quantity received in predetermined time period is zero,
Generate blank document, and in described blank document, add end mark;
Using described blank document as message file, and according to the rule preset, identification marking is added to described message file;
Wherein, described blank document generates when generating the next document containing message information.
3. method according to claim 2, is characterized in that, described test instruction comprises: retrieving information; Described retrieving information can mate with the identification marking of described message file;
According to described test instruction, the message file mated with described test instruction is merged, generates test file, specifically comprise:
Retrieve according to the retrieving information in described test instruction, obtain the message file that identification marking mates with described retrieving information;
Message information in the message file obtained after retrieval is merged, and generates test file.
4. method according to claim 3, is characterized in that, the message information in described test file is reassembled as test packet and specifically comprises:
Read from described test file and the message information corresponding to each network message successively;
According to the described message information of each described network message, using the message loaded length in described message information as the loaded length of test packet, using the IP address in described message information as the IP address of test packet, using the destination interface in message information as the destination interface of test packet, using the message payload content in described message information as the message payload content of test packet, and with described acquisition time displacement for sending the time interval of test packet, described message information is reassembled as test packet.
5. method according to claim 4, is characterized in that, described network message comprises at least one packet;
Described user's request time is the time receiving last packet;
Described message payload content comprises the data load in all packets of network message;
And/or,
Message information in the message file obtained after retrieval is closed, and generates test file, and specifically comprise:
According to the time order and function order of message file generated, the message file obtained after retrieval successively, read described message information;
By the described message information sequential concatenation read;
Be zero by the acquisition time modification of displacement of the Article 1 message information in spliced message information, and generate test file.
6. an operational trials device, it is at least comprising in the system of server and client side, and is arranged at described server end, it is characterized in that, comprising:
Network message acquisition module, for obtaining network message during customer access network application;
Network message parsing module, for obtaining user's request time of described network message, and from network message described in every bar analytic message information; Described message information comprises: message loaded length, object IP address, destination interface, message payload content;
Module is added in acquisition time displacement, for according to described user's request time being the message information interpolation acquisition time displacement of each described network message;
Message file generating module, for reassembling into multiple message file by the described message information of the described network message obtained in predetermined time period according to the file organization method preset and store successively;
Test file generation module, for when receiving test instruction, according to described test instruction, merges the message file mated with described test instruction, generates test file;
Playback test module, for the message information in described test file is reassembled as test packet, carries out playback test.
7. device according to claim 6, is characterized in that, described message file generating module specifically comprises:
Message file organization unit, when network message quantity for receiving in predetermined time period is non-vanishing, by the described message information of network message described in every bar of receiving in predetermined time period successively according to preset order stored in same document, and add at the end of all described message informations and terminate mark;
Wherein, described end mark has and only has one; Described acquisition time displacement comprises: the difference of user's request time of current network message and user's request time of last bar network message; Described preset order is the storage order of payload content of the loaded length of message, object IP address, destination interface, acquisition time displacement, message;
Identification marking adding device, for using described document as message file, and according to the rule preset, identification marking is added to described message file;
Described message file organization unit, when the network message quantity also for receiving in predetermined time period is zero, generates blank document, and in described blank document, add end mark;
Described identification marking adding device, also for using described blank document as message file, and according to the rule preset, identification marking is added to described message file;
Wherein, described blank document generates when generating the next document containing message information.
8. device according to claim 7, is characterized in that, described test instruction comprises: retrieving information; Described retrieving information can mate with the identification marking of described message file;
Described test file generation module specifically comprises:
Retrieval unit, for retrieving according to the retrieving information in described test instruction, obtains the message file that identification marking mates with described retrieving information;
Test file generation unit, for being merged by the message information in the message file obtained after retrieval, and generates test file.
9. device according to claim 8, is characterized in that, described playback test module comprises:
Message information reading unit, for reading and the message information corresponding to each network message successively from described test file;
Test packet generation unit, for the described message information according to each described network message, using the message loaded length in described message information as the loaded length of test packet, using the IP address in described message information as the IP address of test packet, using the destination interface in message information as the destination interface of test packet, using the message payload content in described message information as the message payload content of test packet, and with described acquisition time displacement for sending the time interval of test packet, described message information is reassembled as test packet.
10. an operational trials system, comprises client and server, it is characterized in that, described client is also connected with the operational trials device described in the claims 6-9 any one.
CN201510584051.8A 2015-09-14 2015-09-14 Business test method , device and system Pending CN105099833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510584051.8A CN105099833A (en) 2015-09-14 2015-09-14 Business test method , device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510584051.8A CN105099833A (en) 2015-09-14 2015-09-14 Business test method , device and system

Publications (1)

Publication Number Publication Date
CN105099833A true CN105099833A (en) 2015-11-25

Family

ID=54579444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510584051.8A Pending CN105099833A (en) 2015-09-14 2015-09-14 Business test method , device and system

Country Status (1)

Country Link
CN (1) CN105099833A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105337810A (en) * 2015-12-01 2016-02-17 上海斐讯数据通信技术有限公司 Method and system for constructing network testing data
CN106200576A (en) * 2016-07-08 2016-12-07 福建龙净环保股份有限公司 A kind of collecting method and device
CN107704375A (en) * 2016-08-09 2018-02-16 厦门雅迅网络股份有限公司 A kind of system and method recorded and play back network port upstream data
CN110928785A (en) * 2019-11-21 2020-03-27 中国银行股份有限公司 Preferential payment testing method and device
CN111061631A (en) * 2019-11-29 2020-04-24 珠海金山网络游戏科技有限公司 Mobile terminal game retest method and system
CN111385164A (en) * 2018-12-29 2020-07-07 江苏迪纳数字科技股份有限公司 Communication protocol gateway function test method for actively reporting multi-protocol free combination message
CN112433948A (en) * 2020-11-30 2021-03-02 上海天旦网络科技发展有限公司 Simulation test system and method based on network data analysis
CN112433947A (en) * 2020-11-30 2021-03-02 上海天旦网络科技发展有限公司 Chaos engineering method and system based on network data
CN112491571A (en) * 2019-09-11 2021-03-12 比亚迪股份有限公司 Network data debugging method and device and storage medium
CN112953810A (en) * 2019-12-10 2021-06-11 北京沃东天骏信息技术有限公司 Network request processing method and device
CN113608774A (en) * 2021-06-30 2021-11-05 济南浪潮数据技术有限公司 Demonstration data dynamic generation method and system
CN113872810A (en) * 2021-09-29 2021-12-31 中国建设银行股份有限公司 Service simulation method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070006153A1 (en) * 2005-05-25 2007-01-04 Microsoft Corporation Extensible testing framework
CN101304341A (en) * 2008-06-05 2008-11-12 西安交通大学 Method for testing TCP network flow playback based on receiving-transmitting balance
CN101841441A (en) * 2010-05-05 2010-09-22 北京星网锐捷网络技术有限公司 Test method and system for flow control device and data stream playback device
CN103326900A (en) * 2013-06-24 2013-09-25 中国科学院信息工程研究所 Traffic playback method and system for virtual network
CN103580945A (en) * 2012-08-07 2014-02-12 百度在线网络技术(北京)有限公司 Method and device for generating testing data for complex service system
CN103986624A (en) * 2014-05-28 2014-08-13 西安交通大学 Network traffic restoring and playback method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070006153A1 (en) * 2005-05-25 2007-01-04 Microsoft Corporation Extensible testing framework
CN101304341A (en) * 2008-06-05 2008-11-12 西安交通大学 Method for testing TCP network flow playback based on receiving-transmitting balance
CN101841441A (en) * 2010-05-05 2010-09-22 北京星网锐捷网络技术有限公司 Test method and system for flow control device and data stream playback device
CN103580945A (en) * 2012-08-07 2014-02-12 百度在线网络技术(北京)有限公司 Method and device for generating testing data for complex service system
CN103326900A (en) * 2013-06-24 2013-09-25 中国科学院信息工程研究所 Traffic playback method and system for virtual network
CN103986624A (en) * 2014-05-28 2014-08-13 西安交通大学 Network traffic restoring and playback method

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105337810A (en) * 2015-12-01 2016-02-17 上海斐讯数据通信技术有限公司 Method and system for constructing network testing data
CN106200576A (en) * 2016-07-08 2016-12-07 福建龙净环保股份有限公司 A kind of collecting method and device
CN106200576B (en) * 2016-07-08 2018-10-19 福建龙净环保股份有限公司 A kind of collecting method and device
CN107704375A (en) * 2016-08-09 2018-02-16 厦门雅迅网络股份有限公司 A kind of system and method recorded and play back network port upstream data
CN111385164A (en) * 2018-12-29 2020-07-07 江苏迪纳数字科技股份有限公司 Communication protocol gateway function test method for actively reporting multi-protocol free combination message
CN111385164B (en) * 2018-12-29 2021-11-30 江苏迪纳数字科技股份有限公司 Communication protocol gateway testing method for actively reporting multi-protocol free combination message
CN112491571A (en) * 2019-09-11 2021-03-12 比亚迪股份有限公司 Network data debugging method and device and storage medium
CN110928785A (en) * 2019-11-21 2020-03-27 中国银行股份有限公司 Preferential payment testing method and device
CN110928785B (en) * 2019-11-21 2023-11-21 中国银行股份有限公司 Method and device for testing preferential payment
CN111061631A (en) * 2019-11-29 2020-04-24 珠海金山网络游戏科技有限公司 Mobile terminal game retest method and system
CN112953810A (en) * 2019-12-10 2021-06-11 北京沃东天骏信息技术有限公司 Network request processing method and device
CN112433948A (en) * 2020-11-30 2021-03-02 上海天旦网络科技发展有限公司 Simulation test system and method based on network data analysis
CN112433947A (en) * 2020-11-30 2021-03-02 上海天旦网络科技发展有限公司 Chaos engineering method and system based on network data
CN113608774A (en) * 2021-06-30 2021-11-05 济南浪潮数据技术有限公司 Demonstration data dynamic generation method and system
CN113872810A (en) * 2021-09-29 2021-12-31 中国建设银行股份有限公司 Service simulation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105099833A (en) Business test method , device and system
CN101232501A (en) System and method for improving multi-file dispatch
CN105573667A (en) Data reading method and storage server
CN104881481A (en) Method and device for accessing mass time sequence data
CN104967862A (en) Video storage method and device, and video searching method and device
CN108205577A (en) A kind of array structure, the method, apparatus and electronic equipment of array inquiry
CN106649627A (en) Log searching method and device
CN110347679B (en) Data storage method, device and equipment based on receipt
CN109670081A (en) The method and device of service request processing
CN108241676A (en) Realize the method and apparatus that data synchronize
CN108334622A (en) A method of it obtains and formats complex data
CN107241231B (en) Rapid and accurate positioning method for original network data packet
CN104765792B (en) A kind of method, apparatus and system of dimension data storage
CN114328566A (en) Relationship graph updating method, device, medium, equipment and generating method
CN104615459B (en) A kind of MoCA device parameters collocation method and device
US9389880B2 (en) Method, server, mobile terminal and system for program execution
CN104978325B (en) A kind of web page processing method, device and user terminal
CN110019363A (en) A kind of method and apparatus verifying data
CN110059088A (en) Data attribute identification method, device and equipment in a kind of piece of chain type account book
CN110083501A (en) Interface calls method of counting and device
CN115840788B (en) Method, device, terminal and storage medium for synchronizing MySql data to ES
KR101611433B1 (en) Performance testing method, performance testing apparatus performing the same and storage media sotring the same
CN112000628A (en) Multi-channel laser radar data storage method and device and electronic equipment
US20060248443A1 (en) System and method for exporting spreadsheet data
CN111427845A (en) Interactive modeling analysis operator data exchange method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151125

RJ01 Rejection of invention patent application after publication