CN107508729A - Data send method of testing and data receiver method of testing - Google Patents

Data send method of testing and data receiver method of testing Download PDF

Info

Publication number
CN107508729A
CN107508729A CN201710880675.3A CN201710880675A CN107508729A CN 107508729 A CN107508729 A CN 107508729A CN 201710880675 A CN201710880675 A CN 201710880675A CN 107508729 A CN107508729 A CN 107508729A
Authority
CN
China
Prior art keywords
character string
sent
character
data
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710880675.3A
Other languages
Chinese (zh)
Other versions
CN107508729B (en
Inventor
董时舫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PAX Computer Technology Shenzhen Co Ltd
PAX Tech Ltd
Original Assignee
PAX Computer Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN201710880675.3A priority Critical patent/CN107508729B/en
Publication of CN107508729A publication Critical patent/CN107508729A/en
Application granted granted Critical
Publication of CN107508729B publication Critical patent/CN107508729B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

The present invention is applied to communication technical field, there is provided and a kind of data send method of testing and data receiver method of testing, including:Equipment, which is sent, by first obtains character string to be sent according to the characteristic of default character string;The first transmission equipment is to be devices under;The character string is sent to the first receiving device, and, send next section of character string to the first receiving device;Described first character string for sending equipment and sending is received by first receiving device;First receiving device is testing service equipment trusty;The character string received is verified according to the characteristic of the default character string;If when the content of certain byte received and inconsistent default data, pause receives the character string transmitted by the first transmission equipment.The present invention is used as test data so as to directly determine sendaisle or receiving channel correctness in receiving device can by the sequence with certain characteristic.

Description

Data send method of testing and data receiver method of testing
Technical field
The invention belongs to communication technical field, more particularly to a kind of data to send method of testing and data receiver test side Method.
Background technology
With the development of mobile communication technology and network security technology, increasing communication modes (such as ether is being utilized Netcom's news, serial communication, USB communications, bluetooth communication and wireless WiFi communication etc.) when carrying out information transfer, it is necessary to verify transmission The correctness of passage and receiving channel, correctness are the most basic requirements of data transfer.During the present invention is realized, invention People has found, has the defects of certain using existing random number loopback test method.
Use the process of random number loopback test method for:Random data is produced in transmitting terminal and is sent, and opposite end receives The response of former state loopback is returned after data;Transmitting terminal receives data again, and by the data received compared with the data sent, by The correctness of this checking sendaisle or receiving channel.However, this method need simultaneously using the transmission that is devices under and Receiving channel, when there is Communication, it is difficult to it is determined that what is gone wrong is sendaisle or receiving channel.
The content of the invention
In view of this, the embodiments of the invention provide a kind of data to send method of testing and data receiver method of testing, with It is sendaisle or receiving channel produced problem to solve using the determination that is difficult to that random number loopback test method occurs.
The first aspect of the embodiment of the present invention provides a kind of data and sends method of testing, including:
Equipment, which is sent, by first obtains character string to be sent according to the characteristic of default character string;Described first Equipment is sent to be devices under;
The character string is sent to the first receiving device, and, send next section of character string to the first receiving device;
Described first character string for sending equipment and sending is received by first receiving device;Described first connects Receiving unit is testing service equipment trusty;
The character string received is verified according to the characteristic of the default character string;
If when the content of certain byte received and inconsistent default data, pause receives described first and sends equipment institute The character string of transmission.
Optionally, the characteristic according to default character string obtains character string to be sent, specifically includes:
Equipment is sent for first and distributes interim internal memory, and the size of the interim internal memory is not less than the maximum of single transmission data Number of characters M;The value S of the current initial character to be sent of the initialization and character count C1 sent;
Character number L to be sent is determined, is obtained since the initial character S to be sent according to increasing or decreasing mode The character string to be sent being made up of L character;
Initial character S to be sent is updated, for obtaining next section of character string.
Optionally, it is described to send the character string to the first receiving device, specifically include:
The correlation function that calling system provides, persistently detect whether sendaisle there are enough transmission buffering areas;
When detecting that sendaisle has the transmission buffering area not less than L byte, the transmission letter of calling system offer Number, sends the character string to be sent being made up of L character of the acquisition, and data length L is added into what is sent In character count C1.
Optionally, it is described to receive the described first character string for sending equipment transmission, specifically include:
Interim internal memory is distributed for the first receiving device, the size of the interim internal memory receives the maximum of data not less than single Number of characters N;The value R of the current initial character to be received of the initialization and character count C2 received;
The detection function that calling system provides, persistently check whether receiving channel has the arrival of data;
When detecting that receiving channel has data arrival, the receiver function of calling system offer, receive described first and send The character string being made up of L character that equipment is sent;
The character string received is stored in order caching, and data length L is added to the character meter received In number C2.
Optionally, the characteristic according to the default character string is verified to the character string of the reception, Specifically include:
When default character string is circulation increasing sequence, the character string of the reception is incrementally contrasted; When default character string is circulation descending series, the character string of the reception is contrasted in a manner of successively decreasing;
Initial character R to be received is updated, for the character string received to be compared next time.
The second aspect of the embodiment of the present invention provides a kind of data receiver method of testing, including:
Equipment, which is sent, by second obtains character string to be sent according to the characteristic of default character string;Described second Transmission equipment is testing service equipment trusty;
The character string is sent to the second receiving device, and, send next section of character string to the second receiving device;
Described second character string for sending equipment and sending is received by second receiving device;Described second connects Receiving unit is to be devices under;
The character string of the reception is verified according to the characteristic of the default character string;
If when the content of certain byte of the reception and inconsistent default data, pause receives described second and sends equipment Transmitted character string.
Optionally, the characteristic according to default character string obtains character string to be sent, specifically includes:
Equipment is sent for second and distributes interim internal memory, and the size of the interim internal memory is not less than the maximum of single transmission data Number of characters M ';The value S ' of the current initial character to be sent of the initialization and character count C1 ' sent;
Character number L ' to be sent is determined, is obtained since the initial character S ' to be sent according to increasing or decreasing mode Take the character string to be sent being made up of the individual characters of L ';
Initial character S ' to be sent is updated, for obtaining next section of character string.
Optionally, it is described to send the character string to the second receiving device, specifically include:
The correlation function that calling system provides, persistently detect whether sendaisle there are enough transmission buffering areas;
When detecting that sendaisle has the transmission buffering area not less than the individual bytes of L ', the transmission letter of calling system offer Number, sends the character string to be sent being made up of the individual characters of L ' of the acquisition, and data length L ' is added to and sent Character count C1 ' in.
Optionally, it is described to receive the described second character string for sending equipment transmission, specifically include:
Interim internal memory is distributed for the second receiving device, the size of the interim internal memory receives the maximum of data not less than single Number of characters N ';The value R ' of the current initial character to be received of the initialization and character count C2 ' received;
The detection function that calling system provides, persistently check whether receiving channel has the arrival of data;
When detecting that receiving channel has data arrival, the receiver function of calling system offer, receive described second and send The character string being made up of the individual characters of L ' that equipment is sent;
The character string received is stored in order caching, and data length L ' is added to the character meter received In number C2 '.
Optionally, the characteristic according to the default character string is verified to the character string of the reception, Specifically include:
When default character string is circulation increasing sequence, the character string of the reception is incrementally contrasted; When default character string is circulation descending series, the character string of the reception is contrasted in a manner of successively decreasing;
Initial character R ' to be received is updated, for the character string received to be compared next time.
Existing beneficial effect is the embodiment of the present invention compared with prior art:The embodiment of the present invention is by using with one The character string of characteristic is determined as test data, using testing service equipment trusty as sending equipment or receiving device, Sending equipment and send the test data, receiving device receives the test data of the transmission, and according to the characteristic of character string The character string of reception is verified, if when the content of certain byte of the reception and inconsistent default data, pause connects Receive the character string transmitted by the transmission equipment.By using the sequence with certain characteristic as test data so as to connect The checking of receiving unit can receives data correctness and then determines the correctness of sendaisle or receiving channel.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art In the required accompanying drawing used be briefly described, it should be apparent that, drawings in the following description be only the present invention some Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these Accompanying drawing obtains other accompanying drawings.
Fig. 1 is the schematic diagram that data provided in an embodiment of the present invention send method of testing;
Fig. 2 is the schematic diagram of data receiver method of testing provided in an embodiment of the present invention;
Fig. 3 is that data provided in an embodiment of the present invention send the first of the method for testing implementation process example for sending equipment Figure;
Fig. 4 is the schematic diagram provided in an embodiment of the present invention for incrementally generating character string to be sent;
Fig. 5 is the schematic diagram provided in an embodiment of the present invention that character string to be sent is generated with decreasing fashion;
Fig. 6 is the implementation process signal for the first receiving device that data provided in an embodiment of the present invention send method of testing Figure.
Embodiment
In describing below, in order to illustrate rather than in order to limit, it is proposed that such as tool of particular system structure, technology etc Body details, thoroughly to understand the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention can also be realized in the other embodiments of details.In other situations, omit to well-known system, device, electricity Road and the detailed description of method, in case unnecessary details hinders description of the invention.
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
Embodiment one
Referring to Fig. 1, there is provided the data of the embodiment of the present invention send the implementation process schematic diagram of method of testing, are described in detail such as Under:
Step S101, send equipment by first and obtain character sequence to be sent according to the characteristic of default character string Row;The first transmission equipment is to be devices under.
In order to test data sendaisle correctness, it is necessary to by send equipment be arranged to be devices under.Acquired Character string is one group of regular character string as caused by first sends equipment.
It is typically the correctness that sendaisle or receiving channel are verified using random number in the prior art, however, this One method is needed simultaneously using the sendaisle and receiving channel of equipment to be tested, with the data verified the data received with sent It is whether consistent.But when data transmission fault, due to using the sendaisle and receiving channel of equipment to be tested simultaneously, And it is sendaisle or receiving channel produced problem to be difficult to determination.And the present embodiment is then using the character with certain rule Sequence, then the data of reception need to only be verified in receiving terminal, when data transmission fault, be directly assured that it is to send Passage produced problem.
Further, send equipment by first and obtain character string to be sent according to the characteristic of default character string Process be:
Equipment is sent for first and distributes interim internal memory, and the size of the interim internal memory is not less than the maximum of single transmission data Number of characters M;The value S of the current initial character to be sent of the initialization and character count C1 sent.
Character number L to be sent is determined, is obtained since the initial character S to be sent according to increasing or decreasing mode The character string to be sent being made up of L character.
Initial character S to be sent is updated, for obtaining next section of character string.
It is readily appreciated that, in order to meet that single sends transmitted max number of characters, it is necessary to be first in whole test Send equipment and distribute enough internal memory M.For example, it is 10240 bytes that single, which sends the max number of characters for needing to test, then distribute The datarams of 10240 bytes can meet to require.Need first to open and configured PORT COM before transmitting data, make Operation must be sent can be with normal operation.Here we open and configured communication terminal by the api function of calling system offer Mouthful.Communicate malfunction when, for the ease of being united to the byte position of error, expected right value and total number of characters for having received Meter is, it is necessary to which initial character to be sent and the character count sent are zeroed out.
For the ease of being counted to received character number, it is necessary to first determine character number L to be sent, here Character number can be an a range of random number or a fixed-length value set in advance, can be with It is the length value of a progressive change., can be with for example, character to be sent can be the fixed value that length is all 1 or 5 every time It is that each data length value is the character string incremented by successively of the data lengths such as 3,5,7,9.
After character number to be sent is determined, according to default generation character since initial character S to be sent Form generation character string, and the character string of generation is distributed into the internal memory of the first equipment.For example, work as default data Sample be circulation increasing sequence, then incrementally produce data, when default data sample be circulation descending series, then with The mode successively decreased produces data., wherein it is desired to the shape of the generation data of the increasing or decreasing of data sample is preset before testing Formula.
, it is necessary to update the value of initial character to be sent after one section of character string is sent, to be used to obtain next section Character string.Specifically, character string is produced by the way of incremental using circulation, then the lead-in identifier value after updating is needed than this The value more 1 of last byte of data is sent, when last byte value is 255, then the lead-in identifier value after updating is 0. Similarly, character string is produced by the way of successively decreasing using circulation, then the lead-in identifier value after updating is needed than this transmission data Last byte value few 1, when last byte value is 0, then the lead-in identifier value after updating is 255.
Step S102, the character string is sent to the first receiving device, and, send next section to the first receiving device Character string.
Further, it is to the process of the first receiving device transmission character string:
The correlation function that calling system provides, persistently detect whether sendaisle there are enough transmission buffering areas.
When detecting that sendaisle has the transmission buffering area not less than L byte, the transmission letter of calling system offer Number, sends the character string to be sent being made up of L character of the acquisition, and data length L is added into what is sent In character count C1.
It is readily appreciated that, needs first to detect whether sendaisle there are enough transmission bufferings before data to be tested are sent Area is, it is necessary to could send data to be sent in the case where there is enough buffering areas.Here enough transmissions buffering Area refers to the single data length L to be sent.
Step S103, the described first character string for sending equipment and sending is received by first receiving device; First receiving device is testing service equipment trusty.
In order to test the correctness of sendaisle, it is necessary to set a receiving device to receive and verify that sending equipment is sent out The data sent, receiving device herein is testing service equipment trusty.
Further, it is in the process of the character string of reception the first transmission equipment transmission:
Interim internal memory is distributed for the first receiving device, the size of the interim internal memory receives the maximum of data not less than single Number of characters N;The value R of the current initial character to be received of the initialization and character count C2 received.
The detection function that calling system provides, persistently check whether receiving channel has the arrival of data.
When detecting that receiving channel has data arrival, the correlation reception function of calling system offer, described first is received Send the character string being made up of L character that equipment is sent.
The character string received is stored in order caching, and data length L is added to the character meter received In number C2.
It is readily appreciated that, in order to meet that single receives transmitted max number of characters, it is necessary to be first in whole test Receiving device distributes enough internal memory N.The selection of maximum memory needs to ensure that receiving data terminal will not occur to receive overflowing for data Go out.It is also required to open and configured PORT COM before receiving the data.For the ease of statistics communication error when byte position and The total number of characters received is, it is necessary to which the value R of current initial character to be received and the counting C2 for having been received by character are zeroed out.
Before character string is received, first check whether receiving channel has the arrival of data, wherein, carried by calling system The detection function of confession detects whether receiving channel has the arrival of data.In the case where detecting that data arrive, calling system The receiver function of offer, to receive the L character string for sending equipment and sending.While in order to count of received character Number is, it is necessary to the character length received every time is added in the character count C2 received.
Step S104, the character string of the reception is verified according to the characteristic of the default character string.
Further, the process verified according to the characteristic of default character string to the character string of the reception For:
When default character string is circulation increasing sequence, the character string of the reception is incrementally contrasted; When default character string is circulation descending series, the character string of the reception is contrasted in a manner of successively decreasing.
Initial character R to be received is updated, for the character string received to be compared next time.
Specifically, it is necessary to which the byte-by-byte character string to reception is entered during the data to receiving are verified Row compares.It is compared according to the characteristic of default character string, it is necessary to update waiting after the completion of one section of character string compares The initial character of receipts, specifically, character string is produced by the way of incremental using circulation, then the lead-in identifier value after updating is needed than this The value more 1 of secondary last byte for sending data, when last byte value is 255, then the lead-in identifier value after updating is 0.Similarly, character string is produced by the way of successively decreasing using circulation, then the lead-in identifier value after updating is needed than this transmission number According to last byte value few 1, when last byte value is 0, then the lead-in identifier value after updating is 255.
Step S105, if the content of certain byte of the reception and default data are inconsistent, pause receives described the One sends the character string transmitted by equipment, and reports that described first sends equipment error.
When occurring expected character value and inconsistent actual characters value in comparison process, numeral 1 is returned, represents that comparison is obstructed Cross.Need to suspend when comparing and occurring wrong and receive transmitted character string, and report error.Meanwhile report the interior of error Appearance includes:The position of the value of the wrong data byte received, expected right value and wrong data byte, in addition, also including: Content of all data for receive the sum of character untill current, being currently received etc..
Above-mentioned data send method of testing, credible as test data, use using circulation increasing or decreasing character string The testing service equipment appointed sends equipment and sends the test data successively, receiving device receives the hair as receiving device The test data sent, and the character string of reception is verified according to the characteristic of character string, if certain byte of the reception Content and default data it is inconsistent when, pause receives the character string sent transmitted by equipment, and reports the hair Equipment is sent to malfunction.By using circulation increasing or decreasing character string as test data so as in the checking of receiving device can Receive data correctness and then determine the correctness of sendaisle.
Embodiment two
It is corresponding that the implementation process of method of testing is sent with data, the present embodiment provides a kind of data receiver test side Method.Referring to Fig. 2, for the implementation process schematic diagram of the data receiver method of testing of the embodiment of the present invention, details are as follows:
Step S201, send equipment by second and obtain character sequence to be sent according to the characteristic of default character string Row;The second transmission equipment is testing service equipment trusty.
Further, character string to be sent is obtained according to the characteristic of default character string, specifically included:
Equipment is sent for second and distributes interim internal memory, and the size of the interim internal memory is not less than the maximum of single transmission data Number of characters M ', the character count C1 ' for initializing the value S ' of current initial character to be sent and having sent.
Character number L ' to be sent is determined, is obtained since the initial character S ' to be sent according to increasing or decreasing mode Take the character string to be sent being made up of the individual characters of L '.
Initial character S ' to be sent is updated, for obtaining next section of character string.
Step S202, the character string is sent to the second receiving device, and, send next section to the second receiving device Character string.
Further, it is described to send the character string to the second receiving device, specifically include:
The correlation function that calling system provides, persistently detect whether sendaisle there are enough transmission buffering areas.
When detecting that sendaisle has the transmission buffering area not less than the individual bytes of L ', the transmission letter of calling system offer Number, sends the character string to be sent being made up of the individual characters of L ' of the acquisition, and data length L ' is added to and sent Character count C1 ' in.
Step S203, the described second character string for sending equipment and sending is received by second receiving device; Second receiving device is to be devices under.
Further, it is described to receive the described second character string for sending equipment transmission, specifically include:
Interim internal memory is distributed for the second receiving device, the size of the interim internal memory receives the maximum of data not less than single Number of characters N ';The value R ' of the current initial character to be received of the initialization and character count C2 ' received.
The detection function that calling system provides, persistently check whether receiving channel has the arrival of data.
When detecting that receiving channel has data arrival, the receiver function of calling system offer, receive described second and send The character string being made up of the individual characters of L ' that equipment is sent.
The character string received is stored in order caching, and data length L ' is added to the character meter received In number C2 '.
Step S204, the character string of the reception is verified according to the characteristic of the default character string.
Further, the characteristic according to default character string is verified to the character string of the reception, tool Body includes:
When default character string is circulation increasing sequence, the character string of the reception is incrementally contrasted; When default character string is circulation descending series, the character string of the reception is contrasted in a manner of successively decreasing.
Initial character R ' to be received is updated, for the character string received to be compared next time.
Step S205, if the content of certain byte of the reception and default data are inconsistent, pause receives described the Two send the character string transmitted by equipment.
It is basically identical in data receiver test process and data transmission test process, simply in data receiver test process In, transmission equipment is test equipment trusty, and in data send test process, receiving device sets for test trusty It is standby.Therefore, the specific work process in data receiver test is repeated no more here.
It should be understood that the size of the sequence number of each step is not meant to the priority of execution sequence, each process in above-described embodiment Execution sequence should determine that the implementation process without tackling the embodiment of the present invention forms any limit with its function and internal logic It is fixed.
Above-mentioned data receiver method of testing, it is credible as test data, use using circulation increasing or decreasing character string The testing service equipment appointed sends equipment and sends the test data successively, receiving device receives the hair as equipment is sent The test data sent, and the character string of reception is verified according to the characteristic of character string, if certain byte of the reception Content and default data it is inconsistent when, pause receives the character string sent transmitted by equipment, and reports the hair Equipment is sent to malfunction.By using circulation increasing or decreasing character string as test data so as in the checking of receiving device can Receive data correctness and then determine the correctness of receiving channel.
Embodiment three
Fig. 3 shows that data send the first of the method for testing implementation process schematic diagram for sending equipment.It is described to be sent out first The method of testing of equipment is sent to comprise the following steps:
Step S301:For the transmission caching that the first transmission equipment partition capacity is M byte.
Step S302:The related api function that calling system provides, opens and has configured PORT COM.
Step S303:The value S of initial character to be sent and the current character count C1 sent are reset.
Step S304:It is determined that current number of characters L to be sent.
Step S305:Since the value S of initial character to be sent, number to be sent is generated in the way of increasing or decreasing According to deposit sends caching.
Step S306:Update the value S of initial character to be sent.
Step S307:Judge idle send buffers whether be more than or equal to currently transmitted number of characters L, buffering is sent when the free time During more than currently transmitted number of characters L, then step S308 is performed;Otherwise, step S307 is performed, until the idle buffering that sends is more than Equal to currently transmitted number of characters L.
Step S308:The data sent in caching will be stored in send, update and sent character count C1, make C1= C1+L。
Step S309:Judge whether test assignment is completed or whether the first transmission equipment receives termination test command, works as survey After termination test command is completed or received in trial business, step S310 is performed;Otherwise, step S306 is performed.
Step S310:Closed communication port, stop testing process.
Step S311:Terminate the test process of the first transmission equipment.
Wherein, the process that data to be sent are generated in a manner of increasing or decreasing that step S305 is mentioned is as follows.Specifically , it is the schematic diagram provided in an embodiment of the present invention for incrementally generating character string to be sent referring to Fig. 4.With incremental The process that mode generates data to be sent is:
Step S401:I is initialized as 0, S and is arranged to current lead-in identifier value to be sent.
Step S402:Judge whether i is less than designated length L, when i is less than designated length L, perform step S403;As i etc. When designated length, step S405 is performed.
Step S403:When i is less than designated length, i-th of byte of this data to be sent can be expressed as tx_ Pool [i]=(S+i)s &0xff.
Step S404:I value is added 1, points to next byte of data to be sent.
Step S405:Terminate the flow that generation is incremented by character string.
Similar, referring to Fig. 5, for the signal provided in an embodiment of the present invention that character string to be sent is generated with decreasing fashion Figure.The process that data to be sent are generated in a manner of successively decreasing is:
Step S501:I is initialized as 0, S and is arranged to current lead-in identifier value to be sent.
Step S502:Judge whether i is less than designated length L, when i is less than designated length L, perform step S503;As i etc. When designated length, step S505 is performed.
Step S503:When i is less than designated length, i-th of byte of this data to be sent can be expressed as tx_ Pool [i]=(S-i)s &0xff.
Step S504:I value is added 1, points to next byte of data to be sent.
Step S505:End generates the flow for character string of successively decreasing.
It is readily appreciated that, for sending equipment, to have a receiving device corresponding, and Fig. 6 shows that data send test The implementation process schematic diagram of first receiving device of method.The method of testing in the first receiving device comprises the following steps:
Step S601:For the order caching that the first receiving device partition capacity is N byte.
Step S602:The related api function that calling system provides, opens and has configured PORT COM.
Step S603:The value R of initial character to be received and current paid-in character count C2 are reset.
Step S604:Whether the detection function that calling system provides, detection receiving channel have the arrivals of data, when detecting When receiving channel there are data, step S605 is performed;Otherwise step S604 is performed, until detecting that receiving channel has arriving for data Come.
Step S605:Data are received from receiving channel, order caching is stored in, updates the counting C2 of paid-in character, make Obtaining C2=C2+, this receives data length.
Step S606:Since the value R of initial character to be received, paid-in number is compared in the way of increasing or decreasing According to.
Step S607:When comparison passes through, that is, certain byte content of the character string received and the expected byte When content is consistent, step S608 is performed;When compare not by, that is, certain byte content of the character string received with it is expected should When the content of byte is inconsistent, step S610 is performed.
Step S608:The value R of initial character to be received is updated, data are compared during data to receive next time.
Step S609:Judge whether test assignment is completed or whether the first receiving device receives termination test command, works as survey After termination test command is completed or received in trial business, step S611 is performed;Otherwise, step S604 is performed.
Step S610:Report error situation.
Step S611:Closed communication port, stop testing process.
Step S612:Terminate the test process of first receiving device.
The implementation process of equipment is sent for second in data receiver method of testing and above-mentioned data send method of testing In first send equipment implementation process it is essentially identical, send and survey for implementation process and the above-mentioned data of the second receiving device The implementation process of the first receiving device in method for testing is essentially identical.Difference part is the difference of equipment to be tested, in data It is the first transmission equipment to send equipment to be tested in method of testing, and tape test equipment connects for second in data receiver method of testing Receiving unit, therefore, repeated no more herein for the second transmission equipment and the second receiving device test process.
The embodiment of the present invention is relative to beneficial effect possessed by prior art:The embodiment of the present invention is incremented by using circulation Or character string of successively decreasing, using testing service equipment trusty as equipment or receiving device is sent, is sent out as test data Equipment is sent to send the test data successively, receiving device receives the test data of the transmission, and according to the spy of character string Property the character string of reception is verified, if when the content of certain byte of the reception and inconsistent default data, pause The character string transmitted by the transmission equipment is received, and reports the transmission equipment error.It is incremented by or passs by using circulation Subtract character string as test data so as to verify reception data correctness in receiving device can and then determine that transmission is logical The correctness in road or receiving channel.
Those of ordinary skill in the art are it is to be appreciated that the calculation of each example described with reference to the embodiments described herein Method step, it can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually with hardware Or software mode performs, application-specific and design constraint depending on technical scheme.Professional and technical personnel can be right Described function is realized in each specific application using distinct methods, but this is realized it is not considered that beyond the present invention Scope.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to foregoing reality Example is applied the present invention is described in detail, it will be understood by those within the art that:It still can be to foregoing each Technical scheme described in embodiment is modified, or carries out equivalent substitution to which part technical characteristic;And these are changed Or replace, the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme, all should Within protection scope of the present invention.

Claims (10)

1. a kind of data send method of testing, it is characterised in that methods described includes:
Equipment, which is sent, by first obtains character string to be sent according to the characteristic of default character string;Described first sends Equipment is to be devices under;
The character string is sent to the first receiving device, and, send next section of character string to the first receiving device;
Described first character string for sending equipment and sending is received by first receiving device;First reception is set Standby is testing service equipment trusty;
The character string received is verified according to the characteristic of the default character string;
If when the content of certain byte received and inconsistent default data, pause receives described first and sent transmitted by equipment Character string.
2. data as claimed in claim 1 send method of testing, it is characterised in that the spy according to default character string Property obtain character string to be sent, specifically include:
Equipment is sent for first and distributes interim internal memory, and the size of the interim internal memory is not less than the maximum character of single transmission data Number M;The value S of the current initial character to be sent of the initialization and character count C1 sent;
Character number L to be sent is determined, is obtained since the initial character S to be sent according to increasing or decreasing mode by L The character string to be sent of individual character composition;
Initial character S to be sent is updated, for obtaining next section of character string.
3. data as claimed in claim 2 send method of testing, it is characterised in that described to described in the transmission of the first receiving device Character string, specifically include:
The correlation function that calling system provides, persistently detect whether sendaisle there are enough transmission buffering areas;
When detecting that sendaisle has the transmission buffering area not less than L byte, transmission function that calling system provides is sent out The character string to be sent being made up of L character of the acquisition is sent, and data length L is added to the character meter sent In number C1.
4. data as claimed in claim 1 send method of testing, it is characterised in that described to receive the first transmission equipment hair The character string sent, is specifically included:
Interim internal memory is distributed for the first receiving device, the size of the interim internal memory receives the maximum character of data not less than single Number N;The value R of the current initial character to be received of the initialization and character count C2 received;
The detection function that calling system provides, persistently check whether receiving channel has the arrival of data;
When detecting that receiving channel has data arrival, the receiver function of calling system offer, receive described first and send equipment The character string being made up of L character sent;
The character string received is stored in order caching, and data length L is added to the character count C2 received In.
5. data as claimed in claim 4 send method of testing, it is characterised in that described according to the default character string Characteristic the character string of the reception is verified, specifically include:
When default character string is circulation increasing sequence, the character string of the reception is incrementally contrasted;When pre- If character string when being circulation descending series, the character string of the reception is contrasted in a manner of successively decreasing;
Initial character R to be received is updated, for the character string received to be compared next time.
6. a kind of data receiver method of testing, it is characterised in that methods described includes:
Equipment, which is sent, by second obtains character string to be sent according to the characteristic of default character string;Described second sends Equipment is testing service equipment trusty;
The character string is sent to the second receiving device, and, send next section of character string to the second receiving device;
Described second character string for sending equipment and sending is received by second receiving device;Second reception is set Standby is to be devices under;
The character string of the reception is verified according to the characteristic of the default character string;
If when the content of certain byte of the reception and inconsistent default data, pause receives the second transmission equipment and sent out The character string sent.
7. data receiver method of testing as claimed in claim 6, it is characterised in that the spy according to default character string Property obtain character string to be sent, specifically include:
Equipment is sent for second and distributes interim internal memory, and the size of the interim internal memory is not less than the maximum character of single transmission data Number M ';The value S ' of the current initial character to be sent of the initialization and character count C1 ' sent;
Determine character number L ' to be sent, since the initial character S ' to be sent according to increasing or decreasing mode obtain by The character string to be sent of the individual character compositions of L ';
Initial character S ' to be sent is updated, for obtaining next section of character string.
8. data receiver method of testing as claimed in claim 7, it is characterised in that described to described in the transmission of the second receiving device Character string, specifically include:
The correlation function that calling system provides, persistently detect whether sendaisle there are enough transmission buffering areas;
When detecting that sendaisle has the transmission buffering area not less than the individual bytes of L ', the transmission function of calling system offer, The character string to be sent being made up of the individual characters of L ' of the acquisition is sent, and data length L ' is added to the word sent Symbol is counted in C1 '.
9. data receiver method of testing as claimed in claim 6, it is characterised in that described to receive the second transmission equipment hair The character string sent, is specifically included:
Interim internal memory is distributed for the second receiving device, the size of the interim internal memory receives the maximum character of data not less than single Number N ';The value R ' of the current initial character to be received of the initialization and character count C2 ' received;
The detection function that calling system provides, persistently check whether receiving channel has the arrival of data;
When detecting that receiving channel has data arrival, the receiver function of calling system offer, receive described second and send equipment The character string being made up of the individual characters of L ' sent;
The character string received is stored in order caching, and data length L ' is added to the character count received In C2 '.
10. data receiver method of testing as claimed in claim 9, it is characterised in that described according to the default character sequence The characteristic of row is verified to the character string of the reception, is specifically included:
When default character string is circulation increasing sequence, the character string of the reception is incrementally contrasted;When pre- If character string when being circulation descending series, the character string of the reception is contrasted in a manner of successively decreasing;
Initial character R ' to be received is updated, for the character string received to be compared next time.
CN201710880675.3A 2017-09-26 2017-09-26 Data transmission test method and data reception test method Active CN107508729B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710880675.3A CN107508729B (en) 2017-09-26 2017-09-26 Data transmission test method and data reception test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710880675.3A CN107508729B (en) 2017-09-26 2017-09-26 Data transmission test method and data reception test method

Publications (2)

Publication Number Publication Date
CN107508729A true CN107508729A (en) 2017-12-22
CN107508729B CN107508729B (en) 2020-06-02

Family

ID=60699531

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710880675.3A Active CN107508729B (en) 2017-09-26 2017-09-26 Data transmission test method and data reception test method

Country Status (1)

Country Link
CN (1) CN107508729B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111786831A (en) * 2020-06-30 2020-10-16 周雪东 Communication system and method for optimizing communication session in real time

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286997A (en) * 2008-06-05 2008-10-15 北京中星微电子有限公司 Data reliability verifying method, system, transmitting device and receiving device
CN104734900A (en) * 2013-12-21 2015-06-24 昊宏广泰(北京)科技有限公司 Sending control method for communication protocol testing
CN104883359A (en) * 2015-05-05 2015-09-02 西安交通大学 Physical layer safety information transmission method based on coherent coding and ARQ combined coding
US20160066213A1 (en) * 2014-09-01 2016-03-03 Spreadtrum Communications (Shanghai) Co., Ltd. System and method for identifying data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286997A (en) * 2008-06-05 2008-10-15 北京中星微电子有限公司 Data reliability verifying method, system, transmitting device and receiving device
CN104734900A (en) * 2013-12-21 2015-06-24 昊宏广泰(北京)科技有限公司 Sending control method for communication protocol testing
US20160066213A1 (en) * 2014-09-01 2016-03-03 Spreadtrum Communications (Shanghai) Co., Ltd. System and method for identifying data
CN105450613A (en) * 2014-09-01 2016-03-30 展讯通信(上海)有限公司 Data identification system and method
CN104883359A (en) * 2015-05-05 2015-09-02 西安交通大学 Physical layer safety information transmission method based on coherent coding and ARQ combined coding

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111786831A (en) * 2020-06-30 2020-10-16 周雪东 Communication system and method for optimizing communication session in real time

Also Published As

Publication number Publication date
CN107508729B (en) 2020-06-02

Similar Documents

Publication Publication Date Title
CN101262304B (en) A data stream parsing method based on universal communication data format
CN104750588A (en) Serial port communication based pressure testing method
CN102984035A (en) Loopback test method and system of packet loss probability of network data
CN101527932A (en) Method for performing buffer status reporting and communication apparatus thereof
CN106375014A (en) BBU-RRU time-delay setting method and apparatus
CN107508729A (en) Data send method of testing and data receiver method of testing
CN110636522B (en) Method and device for determining coverage quality of communication network
CN103997433A (en) Packet loss rate measuring method, device and system
CN100566275C (en) ATM switch business intercommunication test method and device
US9727509B2 (en) GPIB bus to ZigBee interconnection
CN103178936A (en) Method, device and system for testing reception bit error rates of digital interphones
CN105868982A (en) Improved mobile Internet payment system and control method thereof
CN100490400C (en) Access error detection method and network device
CN100486187C (en) A test method and system for L2TP tunnel specification
CN106851814A (en) A kind of frame synchronization detection method and device
CN100373870C (en) Statistic method for packet dropping number of communication device
CN102404151A (en) Network card device supporting complex flow statistics and related complex flow statistics method
CN203027289U (en) System for realizing serial communication among computer, host computer and slave computer
CN100450043C (en) Device for testing radio transmission performance and method for implementing same
CN101997738B (en) Test method and system of multiple paths of E1 ports for realizing STM-1 interface
CN100512506C (en) Method for transferring status report
CN106878155A (en) The method of short message delay notification, system and its mobile terminal
CN104994532B (en) The acquisition methods and device of base station utilization rate
CN110336697A (en) A kind of DMR hand platform eats dishes without rice or wine to write the method and system of frequency
CN217087909U (en) Simulation long distance communication transmission line circuit

Legal Events

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