CN104536887B - communication data detection method and device - Google Patents

communication data detection method and device Download PDF

Info

Publication number
CN104536887B
CN104536887B CN201410809804.6A CN201410809804A CN104536887B CN 104536887 B CN104536887 B CN 104536887B CN 201410809804 A CN201410809804 A CN 201410809804A CN 104536887 B CN104536887 B CN 104536887B
Authority
CN
China
Prior art keywords
key
name
calculation
communication data
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410809804.6A
Other languages
Chinese (zh)
Other versions
CN104536887A (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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN201410809804.6A priority Critical patent/CN104536887B/en
Publication of CN104536887A publication Critical patent/CN104536887A/en
Application granted granted Critical
Publication of CN104536887B publication Critical patent/CN104536887B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of communication data detection method and device.Wherein, the communication data detection method includes:Obtain the communication data using communications protocol to be measured transmission;Configuration file corresponding to communications protocol to be measured is called, wherein, configuration file is the file according to preset format data storage that is pre-configured with for communications protocol to be measured, the preset format form intrinsic for configuration file;And the communication data of acquisition is detected using configuration file.By the present invention, solve the problems, such as that communications protocol different in the prior art needs to write different inspection software programs, reached the effect for using identical inspection software to be detected the communication data of different communications protocol transmission.

Description

Communication data detection method and device
Technical field
The present invention relates to communication field, in particular to a kind of communication data detection method and device.
Background technology
With the development of mechanics of communication, communications protocol and communication modes show diversification, and are applied to people's life Various aspects, such as in air-conditioner controller software systems.For communications protocol itself, different product types uses Communications protocol is also otherwise varied, and data type complexity is various, communication data whether accurate transmission, determine equipment It is whether normal.Therefore, any mistake can not occur in communication data, so the detection of communication data is extremely important.
However, due to different product, there is difference in its communications protocol applied, this brings phase to the detection of communication data When big difficulty.The form of data type is limited to, current inspection software is built in inspection software using by communications protocol more In.This make it that code structure is relatively simple, is easy to write, but there are the following problems:Developer is needed often to update, agreement has During change, software must just update;It is required for writing corresponding program per a agreement, written in code repeatability is high;It is similar soft Part is more, and user easily obscures error, causes more serious quality results.
The problem of needing to write different inspection software programs for communications protocol different in the prior art, at present not yet It is proposed effective solution.
The content of the invention
It is a primary object of the present invention to provide a kind of communication data detection method and device, to solve in the prior art not The problem of same communications protocol needs to write different inspection software programs.
To achieve these goals, a kind of one side according to embodiments of the present invention, there is provided communication data detection side Method.Included according to the communication data detection method of the present invention:Obtain the communication data using communications protocol to be measured transmission;Call institute Configuration file corresponding to communications protocol to be measured is stated, wherein, the configuration file is to be pre-configured with for the communications protocol to be measured The file according to preset format data storage, the preset format form intrinsic for the configuration file;And utilize The configuration file detects to the communication data of acquisition.
Further, before the communication data using communications protocol to be measured transmission is obtained, the communication data detection side Method also includes:By according to the preset format by the information configuration of the communications protocol to be measured into the configuration file.
Further, the configuration file is initialization files, wherein, by will be described to be measured according to the preset format The information configuration of communications protocol includes to the configuration file:The title of the agreement position of the communications protocol to be measured is write into institute State the section name of initialization files;Data type corresponding to the agreement position is write into described section of key name under one's name;By the data Data address corresponding to type writes key assignments corresponding to the key name;A described section of key under one's name is selected as the agreement position Calculation key.
Further, a described section of key under one's name is selected to include as the calculation key of the agreement position:By described in Section last key under one's name as the calculation key, wherein, the key name of the calculation key is fixed key name, described Key assignments uses the calculation code of numeric class.
Further, carrying out detection to the communication data of acquisition using the configuration file includes:Obtained according to described section of name Take the title of the agreement position of the communication data;Obtained according to the key name in the communication data under the agreement position of acquisition Data type and data address;Mesh under the agreement position of the acquisition is obtained based on the data type and the data address Mark data;Calculation key based on described section under one's name calls the calculation code of the agreement position;And pass through the meter Calculation mode code is calculated the target data, obtains result of calculation.
Further, before being detected using the configuration file to the communication data of acquisition, communication data detection Method also includes:Obtain all calculation codes of the communications protocol to be measured;It will obtain corresponding to calculation code and count Calculation mode combines storage into Excel file with the form of cell, and the calculation key based on described section under one's name calls The calculation code of the agreement position includes:Calculation key based on described section under one's name calls from the Excel file The calculation code of the agreement position.
To achieve these goals, a kind of another aspect according to embodiments of the present invention, there is provided communication data detection dress Put.Included according to the communication data detection means of the present invention:First acquisition unit, transmitted for obtaining using communications protocol to be measured Communication data;Call unit, for calling configuration file corresponding to the communications protocol to be measured, wherein, the configuration file For the file according to preset format data storage being pre-configured with for the communications protocol to be measured, the preset format is described The intrinsic form of configuration file;And detection unit, for being examined using the configuration file to the communication data of acquisition Survey.
Further, the communication data detection means also includes:Dispensing unit, for being assisted in acquisition using communication to be measured Before the communication data for discussing transmission, by the way that the information configuration of the communications protocol to be measured is matched somebody with somebody described according to the preset format Put in file.
Further, the configuration file is initialization files, wherein, the dispensing unit includes:First writing module, For the title of the agreement position of the communications protocol to be measured to be write to the section name of the initialization files;Second writing module, use In data type corresponding to the agreement position is write into described section of key name under one's name;3rd writing module, for by the data Data address corresponding to type writes key assignments corresponding to the key name;Selecting module, for selecting a described section of key under one's name Calculation key as the agreement position.
Further, the selecting module includes:Select submodule, for using described section of last key under one's name as The calculation key, wherein, the key name of the calculation key is fixed key name, and the key assignments uses the calculating side of numeric class Formula code.
Further, the detection unit includes:First acquisition module, for obtaining the communication number according to described section of name According to agreement position title;Second acquisition module, for being obtained according to the key name in the communication data in the agreement of acquisition Data type and data address under position;3rd acquisition module, for based on the data type and data address acquisition Target data under the agreement position of the acquisition;Calling module, for calling institute based on described section of calculation key under one's name State the calculation code of agreement position;And computing module, for being entered by the calculation code to the target data Row calculates, and obtains result of calculation.
Further, communication data detection means also includes:Second acquisition unit, for utilizing the configuration file pair Before the communication data of acquisition is detected, all calculation codes of the communications protocol to be measured are obtained;Memory cell, use Storage is combined into Excel file with the form of cell in calculation corresponding to calculation code will be obtained, institute State the meter that calling module is additionally operable to call the agreement position from the Excel file based on described section of calculation key under one's name Calculation mode code.
According to inventive embodiments, by obtaining the communication data transmitted using communications protocol to be measured;Call communication association to be measured Configuration file corresponding to view, wherein, configuration file is to store number according to preset format for what communications protocol to be measured was pre-configured with According to file, the preset format form intrinsic for configuration file;And the communication data of acquisition is carried out using configuration file Detection, solves the problems, such as that communications protocol different in the prior art needs to write different inspection software programs, has reached pair The communication data of different communications protocol transmission uses the effect that identical inspection software is detected.
Brief description of the drawings
The accompanying drawing for forming the part of the application is used for providing a further understanding of the present invention, schematic reality of the invention Apply example and its illustrate to be used to explain the present invention, do not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of communication data detection method according to embodiments of the present invention;
Fig. 2 is the flow chart of preferable communication data detection method according to embodiments of the present invention;And
Fig. 3 is the schematic diagram of communication data detection means according to embodiments of the present invention.
Embodiment
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the application can phase Mutually combination.Describe the present invention in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under the premise of creative work is not made, it should all belong to the model that the present invention protects Enclose.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, " Two " etc. be for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so use Data can exchange in the appropriate case, so as to embodiments of the invention described herein.In addition, term " comprising " and " tool Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing series of steps or unit Process, method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include without clear It is listing to Chu or for the intrinsic other steps of these processes, method, product or equipment or unit.
The embodiments of the invention provide a kind of communication data detection method.This method can be by computer equipment come real It is existing.
Fig. 1 is the flow chart of communication data detection method according to embodiments of the present invention.As shown in figure 1, the communication data It is as follows that detection method includes step:
Step S102, obtain the communication data using communications protocol to be measured transmission.
Communications protocol to be measured can be any one communications protocol for needing to carry out communication data detection.
Step S104, configuration file corresponding to communications protocol to be measured is called, wherein, configuration file is to be assisted for communication to be measured Discuss the file according to preset format data storage being pre-configured with, the preset format form intrinsic for configuration file.
Configuration file can be configured according to communications protocol to be measured, specifically, can be intrinsic according to configuration file institute Data format targetedly communications protocol to be measured is configured, when communications protocol changes, then again for change after Communications protocol is configured to configuration file, and it is called when being detected for communication data.The configuration file can use Initialization files or Excel file, wherein, Excel file can be realized using the cell mode of fixation.
Step S106, the communication data of acquisition is detected using configuration file.
After configuration file is called, communication data is detected using the configuration file.Because configuration file has There is fixed data memory format, the communication data of different communications protocol transmission is entered using identical form to configuration file Row configuration.When being detected using the configuration file to communication data, can be checked quickly soon according to the intrinsic form of configuration file Data are looked for and read, without being reprogramed to inspection software program, only need to reconfigure or change above-mentioned configuration file i.e. Can, reduce staff and repeat to write the workload of program, solving communications protocol different in the prior art needs to write The problem of different inspection software program, reached to the communication data of different communications protocol transmission detected using identical it is soft The effect that part is detected.
On the other hand, due to detecting communication data by way of calling configuration file, when communications protocol is changed, only Configuration file need to be reconfigured or changed, without being updated to inspection software, decreases the version updating of inspection software, Avoid because inspection software is too much so that user produces the problem of obscuring.
Preferably, before the communication data using communications protocol to be measured transmission is obtained, communication data detection method is also wrapped Include:By according to preset format by the information configuration of communications protocol to be measured into configuration file.
Specifically, the original document of configuration file is first generated, then according to the intrinsic form of the configuration file, communication is assisted The relevant information of view is configured in original configuration file, is generated configuration file corresponding with communications protocol to be measured, so, is being obtained After taking the communication data based on communications protocol to be measured transmission, configuration file corresponding to the communications protocol to be measured can be called to carry out Communication data detects.
Further, configuration file is initialization files, wherein, by according to preset format by the letter of communications protocol to be measured Breath, which is configured to configuration file, to be included:The title of the agreement position of communications protocol to be measured is write to the section name of initialization files;Will association Discuss the key name of data type write-in section under one's name corresponding to position;By key corresponding to data address write-in key name corresponding to data type Value;Select calculation key of the key as agreement position of section under one's name.
Configuration file uses initialization files (ini file), because the form of ini file data storage is fixed as:Section Name, key name, key assignments.The advantages of form is fixed is exactly to be easy to read when accessing.
Agreement position refers to the element for forming a communications protocol.There are hundreds of agreement positions in general communications protocol, each There is different titles agreement position.In the present embodiment, the title of agreement position is put into the section name of ini file, the number under the agreement position According to data type be written to key name, its corresponding data address then writes corresponding key assignments, in order to be read by ini file The title and its data of each agreement position.Because every a communications protocol is made up of multiple agreement positions, these numerous agreement positions In, the calculation that different agreement positions uses can be different.Can generally exist in a communications protocol it is several not Same calculation.Select calculation of the key as agreement position in the present embodiment under one's name from this section according to unalterable rules Key, the calculation key are used for the calculation for calling the data of the agreement position.After configuring configuration file in the manner described above, The communication data of communications protocol to be measured can be detected with realization.
In the embodiment of the present invention, by using ini file characteristic, a kind of inspection software is realized to different communications protocol Communication data is detected.
Further, the key of section under one's name is selected to include as the calculation key of agreement position:By section under one's name last One key as calculation key, wherein, the key name of calculation key is fixed key name, and key assignments uses the calculation of numeric class Code.
Specifically, the present embodiment mainly includes to the processing procedure of configuration file:Preliminary ini file is first generated, then Ini file is configured for communications protocol to be measured.Wherein, concrete configuration process includes as follows:
(1) title of each agreement position is put into section name;
(2) particular content of each agreement position is edited:Data type is put into key name, data address is put into key assignments.By It in the agreement position of more bit or more byte connections, may disperse to intersect in different byte and address, there is noncontinuity, only Having could be complete by the agreement position information storage using multiple keys.Therefore, if more bit or more byte connections, then establish more Individual key, such as:1. bit.0=P11.0, bit.1=P11.1, bit.2=P12.7, realize the same agreement in the multiple addresses of bit types The connection of position;2. byte.0=P18, byte.1=P19, realize the connection of the same agreement position in the multiple addresses of byte types;
(3) the data calculation of each agreement position is edited:Each section last key is arranged to calculation Key, key name take fixed key name (such as Cal), and key assignments can use the calculation code of numeric class.
Preferably, carrying out detection to the communication data of acquisition using configuration file includes:Communication data is obtained according to section name Agreement position title;Data type and data address in communication data under the agreement position of acquisition is obtained according to key name;Base In the target data of data type and data address acquisition under the agreement position of acquisition;Calculation key based on section under one's name calls The calculation code of agreement position;And target data is calculated by calculation code, obtain result of calculation.
Target data is the partial data got from communication data, referred to the communication data of some agreement position.By , it is necessary to parse one by one for each agreement position when communication data is detected, therefore need to extract the data of each agreement position, It is calculated by its corresponding calculation to complete the detection of the agreement position.
The data of each agreement position are calculated using aforesaid way, finally can be by result of calculation and its corresponding association The title of view position is output to UI interfaces.
In the embodiment of the present invention, by using ini file characteristic, a kind of inspection software is realized to different communications protocol Communication data is detected.
Preferably, before being detected using configuration file to the communication data of acquisition, communication data detection method is also Including:Obtain all calculation codes of communications protocol to be measured;It is single that calculation corresponding to calculation code will be obtained The form of first lattice combines storage into Excel file, the calculating side of the calculation key invocation protocol position based on section under one's name Formula code includes:The calculation code of calculation key invocation protocol position from Excel file based on section under one's name.
In the present embodiment, using excel file formats, by calculation unit corresponding to each calculation code The mode of lattice combines, and this document covers all calculations, can directly invoke.
A kind of preferred embodiment of the embodiment of the present invention is described with reference to Fig. 2.As shown in Fig. 2 the communication Data detection method includes:
Step S202, obtain the complete communication data of a frame.
Step S204, call ini file.
Step S206, read all agreement positions.The title of agreement position is read from the section name of ini file.
Step S208, read the data type of agreement position.Data type is read from the key name of ini file.
Step S210, data are read according to data address.Data address is obtained by reading key assignments, then according to the address Read target data.
Step S212, read calculation code.
Step S214, calculation is read according to calculation code.The calculation is facilitated the use to target data Calculated.
Step S216, calculated according to the data of reading and calculation.It that is to say using calculation to reading Data are calculated, and obtain result of calculation.
Step S218, agreement position and result of calculation are output to user interface.Specifically, by the title of agreement position and its right The result of calculation output answered.
Visible by foregoing description, the embodiment of the present invention can reach following effect:
(1) the communication data inspection software according to corresponding to being developed per a communications protocol and update is that Software Testing Tool is opened The work that hair personnel most often do;After the scheme of the embodiment of the present invention, it can be that developer removes this part workload from, be it Put forward effect more than 30%.
(2) tester uses a software, avoids because software is various, the complicated appearance of version uses faulty software or old edition The work replication problem that this software is brought, effect more than 20% is put forward for it.
The embodiment of the present invention additionally provides a kind of communication data detection means.The device can be realized by computer equipment Its function.It should be noted that the communication data detection means of the embodiment of the present invention can be used for performing institute of the embodiment of the present invention The communication data detection method of offer, the communication data detection method of the embodiment of the present invention can also pass through institute of the embodiment of the present invention The communication data detection means of offer performs.
Fig. 3 is the schematic diagram of communication data detection means according to embodiments of the present invention.As shown in figure 3, the communication data Detection means includes:First acquisition unit 10, call unit 20 and detection unit 30.
First acquisition unit 10 is used to obtain the communication data using communications protocol to be measured transmission.
Communications protocol to be measured can be any one communications protocol for needing to carry out communication data detection.
Call unit 20 is used to call configuration file corresponding to communications protocol to be measured, wherein, configuration file is for be measured The file according to preset format data storage that communications protocol is pre-configured with, the preset format form intrinsic for configuration file.
Configuration file can be configured according to communications protocol to be measured, specifically, can be intrinsic according to configuration file institute Data format targetedly communications protocol to be measured is configured, when communications protocol changes, then again for change after Communications protocol is configured to configuration file, and it is called when being detected for communication data.The configuration file can use Initialization files or Excel file, wherein, Excel file can be realized using the cell mode of fixation.
Detection unit 30 is used to detect the communication data of acquisition using configuration file.
After configuration file is called, communication data is detected using the configuration file.Because configuration file has There is fixed data memory format, the communication data of different communications protocol transmission is entered using identical form to configuration file Row configuration.When being detected using the configuration file to communication data, can be checked quickly soon according to the intrinsic form of configuration file Data are looked for and read, without being reprogramed to inspection software program, only need to reconfigure or change above-mentioned configuration file i.e. Can, reduce staff and repeat to write the workload of program, solving communications protocol different in the prior art needs to write The problem of different inspection software program, reached to the communication data of different communications protocol transmission detected using identical it is soft The effect that part is detected.
On the other hand, due to detecting communication data by way of calling configuration file, when communications protocol is changed, only Configuration file need to be reconfigured or changed, without being updated to inspection software, decreases the version updating of inspection software, Avoid because inspection software is too much so that user produces the problem of obscuring.
Preferably, communication data detection means also includes:Dispensing unit, for being transmitted in acquisition using communications protocol to be measured Communication data before, by according to preset format by the information configuration of communications protocol to be measured into configuration file.
Specifically, the original document of configuration file is first generated, then according to the intrinsic form of the configuration file, communication is assisted The relevant information of view is configured in original configuration file, is generated configuration file corresponding with communications protocol to be measured, so, is being obtained After taking the communication data based on communications protocol to be measured transmission, configuration file corresponding to the communications protocol to be measured can be called to carry out Communication data detects.
Further, configuration file is initialization files, wherein, dispensing unit includes:First writing module, for that will treat Survey the section name of the title write-in initialization files of the agreement position of communications protocol;Second writing module, for by corresponding to agreement position The key name of data type write-in section under one's name;3rd writing module, for data address corresponding to data type to be write into key name pair The key assignments answered;Selecting module, for selecting calculation key of the key as agreement position of section under one's name.
Configuration file uses initialization files (ini file), because the form of ini file data storage is fixed as:Section Name, key name, key assignments.The advantages of form is fixed is exactly to be easy to read when accessing.
Agreement position refers to the element for forming a communications protocol.There are hundreds of agreement positions in general communications protocol, each There is different titles agreement position.In the present embodiment, the title of agreement position is put into the section name of ini file, the number under the agreement position According to data type be written to key name, its corresponding data address then writes corresponding key assignments, in order to be read by ini file The title and its data of each agreement position.Because every a communications protocol is made up of multiple agreement positions, these numerous agreement positions In, the calculation that different agreement positions uses can be different.Can generally exist in a communications protocol it is several not Same calculation.Select calculation of the key as agreement position in the present embodiment under one's name from this section according to unalterable rules Key, the calculation key are used for the calculation for calling the data of the agreement position.After configuring configuration file in the manner described above, The communication data of communications protocol to be measured can be detected with realization.
In the embodiment of the present invention, by using ini file characteristic, a kind of inspection software is realized to different communications protocol Communication data is detected.
Further, selecting module includes:Submodule is selected, for using section last key under one's name as calculation Key, wherein, the key name of calculation key is fixed key name, and key assignments uses the calculation code of numeric class.
Specifically, the present embodiment mainly includes to the processing procedure of configuration file:Preliminary ini file is first generated, then Ini file is configured for communications protocol to be measured.Wherein, concrete configuration process includes as follows:
(1) title of each agreement position is put into section name;
(2) particular content of each agreement position is edited:Data type is put into key name, data address is put into key assignments.By It in the agreement position of more bit or more byte connections, may disperse to intersect in different byte and address, there is noncontinuity, only Having could be complete by the agreement position information storage using multiple keys.Therefore, if more bit or more byte connections, then establish more Individual key, such as:1. bit.0=P11.0, bit.1=P11.1, bit.2=P12.7, realize the same agreement in the multiple addresses of bit types The connection of position;2. byte.0=P18, byte.1=P19, realize the connection of the same agreement position in the multiple addresses of byte types;
(3) the data calculation of each agreement position is edited:Each section last key is arranged to calculation Key, key name take fixed key name (such as Cal), and key assignments can use the calculation code of numeric class.
Preferably, detection unit includes:First acquisition module, the name of the agreement position for obtaining communication data according to section name Claim;Second acquisition module, for obtaining data type and data in communication data under the agreement position of acquisition according to key name Location;3rd acquisition module, for the target data based on data type and data address acquisition under the agreement position of acquisition;Call Module, the calculation code for the calculation key invocation protocol position based on section under one's name;And computing module, for passing through Calculation code is calculated target data, obtains result of calculation.
Target data is the partial data got from communication data, referred to the communication data of some agreement position.By , it is necessary to parse one by one for each agreement position when communication data is detected, therefore need to extract the data of each agreement position, It is calculated by its corresponding calculation to complete the detection of the agreement position.
The data of each agreement position are calculated using aforesaid way, finally can be by result of calculation and its corresponding association The title of view position is output to UI interfaces.
In the embodiment of the present invention, by using ini file characteristic, a kind of inspection software is realized to different communications protocol Communication data is detected.
Preferably, communication data detection means also includes:Second acquisition unit, for utilizing configuration file to acquisition Before communication data is detected, all calculation codes of communications protocol to be measured are obtained;Memory cell, based on it will obtain Calculation corresponding to calculation mode code combines storage into Excel file with the form of cell, and calling module is also used Calculation code in calculation key invocation protocol position from Excel file based on section under one's name.
In the present embodiment, using excel file formats, by calculation unit corresponding to each calculation code The mode of lattice combines, and this document covers all calculations, can directly invoke.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because According to the present invention, some steps can use other orders or carry out simultaneously.Secondly, those skilled in the art should also know Know, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention It is necessary.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed device, can be by another way Realize.For example, device embodiment described above is only schematical, such as the division of the unit, it is only one kind Division of logic function, can there is an other dividing mode when actually realizing, such as multiple units or component can combine or can To be integrated into another system, or some features can be ignored, or not perform.Another, shown or discussed is mutual Coupling direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit, Can be electrical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially The part to be contributed in other words to prior art or all or part of the technical scheme can be in the form of software products Embody, the computer software product is stored in a storage medium, including some instructions are causing a computer Equipment (can be personal computer, mobile terminal, server or network equipment etc.) performs side described in each embodiment of the present invention The all or part of step of method.And foregoing storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory), Random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various to be stored The medium of program code.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should be included in the scope of the protection.

Claims (12)

  1. A kind of 1. communication data detection method, it is characterised in that including:
    Obtain the communication data using communications protocol to be measured transmission;
    Configuration file corresponding to the communications protocol to be measured is called, wherein, the configuration file is to be assisted for the communication to be measured Discuss the file according to preset format data storage being pre-configured with, the preset format lattice intrinsic for the configuration file Formula;And
    The communication data of acquisition is detected using the configuration file;
    Wherein, the intrinsic form of the configuration file is:Section name, key name, key assignments, wherein, described section of name is described for writing The title of the agreement position of communications protocol to be measured, the key name are used to write data type corresponding to the agreement position, the key assignments For writing data address corresponding to the data type, wherein, described section has meter of the key as the agreement position under one's name Calculation mode key, the calculation key are used for the calculation for calling the data of the agreement position.
  2. 2. communication data detection method according to claim 1, it is characterised in that passed obtaining using communications protocol to be measured Before defeated communication data, the communication data detection method also includes:
    By according to the preset format by the information configuration of the communications protocol to be measured into the configuration file.
  3. 3. communication data detection method according to claim 2, it is characterised in that the configuration file is initialization text Part, wherein, by the way that the information configuration of the communications protocol to be measured is included to the configuration file according to the preset format:
    The title of the agreement position of the communications protocol to be measured is write to the section name of the initialization files;
    Data type corresponding to the agreement position is write into described section of key name under one's name;
    Data address corresponding to the data type is write into key assignments corresponding to the key name;
    Select described section of calculation key of the key as the agreement position under one's name.
  4. 4. communication data detection method according to claim 3, it is characterised in that the key of described section of selection under one's name is made Calculation key for the agreement position includes:
    Using described section of last key under one's name as the calculation key, wherein, the key name of the calculation key is solid Determine key name, the key assignments uses the calculation code of numeric class.
  5. 5. communication data detection method according to claim 4, it is characterised in that using the configuration file to acquisition Communication data, which carries out detection, to be included:
    The title of the agreement position of the communication data is obtained according to described section of name;
    Data type and data address in the communication data under the agreement position of acquisition is obtained according to the key name;
    Target data under the agreement position of the acquisition is obtained based on the data type and the data address;
    Calculation key based on described section under one's name calls the calculation code of the agreement position;And
    The target data is calculated by the calculation code, obtains result of calculation.
  6. 6. communication data detection method according to claim 5, it is characterised in that
    Before being detected using the configuration file to the communication data of acquisition, communication data detection method also includes:Obtain Take all calculation codes of the communications protocol to be measured;Calculation cell corresponding to calculation code will be obtained Form combine storage into Excel file,
    Calculation key based on described section under one's name calls the calculation code of the agreement position to include:Based on described section under one's name Calculation key the calculation code of the agreement position is called from the Excel file.
  7. A kind of 7. communication data detection means, it is characterised in that including:
    First acquisition unit, for obtaining the communication data using communications protocol to be measured transmission;
    Call unit, for calling configuration file corresponding to the communications protocol to be measured, wherein, the configuration file is for institute The file according to preset format data storage that communications protocol to be measured is pre-configured with is stated, the preset format is the configuration file Intrinsic form;And
    Detection unit, for being detected using the configuration file to the communication data of acquisition;
    Wherein, the intrinsic form of the configuration file is:Section name, key name, key assignments, wherein, described section of name is described for writing The title of the agreement position of communications protocol to be measured, the key name are used to write data type corresponding to the agreement position, the key assignments For writing data address corresponding to the data type, wherein, described section has meter of the key as the agreement position under one's name Calculation mode key, the calculation key are used for the calculation for calling the data of the agreement position.
  8. 8. communication data detection means according to claim 7, it is characterised in that the communication data detection means is also wrapped Include:
    Dispensing unit, for obtain using communications protocol to be measured transmission communication data before, by according to the default lattice Formula is by the information configuration of the communications protocol to be measured into the configuration file.
  9. 9. communication data detection means according to claim 8, it is characterised in that the configuration file is initialization text Part, wherein, the dispensing unit includes:
    First writing module, for the title of the agreement position of the communications protocol to be measured to be write to the section of the initialization files Name;
    Second writing module, for data type corresponding to the agreement position to be write into described section of key name under one's name;
    3rd writing module, for data address corresponding to the data type to be write into key assignments corresponding to the key name;
    Selecting module, for selecting described section of calculation key of the key as the agreement position under one's name.
  10. 10. communication data detection means according to claim 9, it is characterised in that the selecting module includes:
    Submodule is selected, for using described section of last key under one's name as the calculation key, wherein, the calculating side The key name of formula key is fixed key name, and the key assignments uses the calculation code of numeric class.
  11. 11. communication data detection means according to claim 10, it is characterised in that the detection unit includes:
    First acquisition module, the title of the agreement position for obtaining the communication data according to described section of name;
    Second acquisition module, for obtaining the data type in the communication data under the agreement position of acquisition according to the key name And data address;
    3rd acquisition module, for being obtained based on the data type and the data address under the agreement position of the acquisition Target data;
    Calling module, for calling the calculation code of the agreement position based on described section of calculation key under one's name;And
    Computing module, for being calculated by the calculation code the target data, obtain result of calculation.
  12. 12. communication data detection means according to claim 11, it is characterised in that
    The communication data detection means also includes:Second acquisition unit, for leading to using the configuration file to acquisition Before news data are detected, all calculation codes of the communications protocol to be measured are obtained;Memory cell, for that will obtain Calculation corresponding to calculation code combines storage into Excel file with the form of cell,
    The calling module is additionally operable to call the agreement from the Excel file based on described section of calculation key under one's name The calculation code of position.
CN201410809804.6A 2014-12-18 2014-12-18 communication data detection method and device Active CN104536887B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410809804.6A CN104536887B (en) 2014-12-18 2014-12-18 communication data detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410809804.6A CN104536887B (en) 2014-12-18 2014-12-18 communication data detection method and device

Publications (2)

Publication Number Publication Date
CN104536887A CN104536887A (en) 2015-04-22
CN104536887B true CN104536887B (en) 2017-11-14

Family

ID=52852417

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410809804.6A Active CN104536887B (en) 2014-12-18 2014-12-18 communication data detection method and device

Country Status (1)

Country Link
CN (1) CN104536887B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612919B (en) * 2017-09-29 2020-05-08 交控科技股份有限公司 Protocol configuration method and device
CN111200612B (en) * 2020-01-06 2022-04-19 山东电工电气集团新能科技有限公司 Distribution network downlink equipment management device
CN112948194B (en) * 2021-03-15 2023-08-15 中国联合网络通信集团有限公司 Communication protocol testing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102142923A (en) * 2010-01-28 2011-08-03 宏碁股份有限公司 Multi-communication protocol data transmission method and device thereof
CN102508661A (en) * 2011-10-28 2012-06-20 航天科工深圳(集团)有限公司 Method and device of communication module development and configuration

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050166072A1 (en) * 2002-12-31 2005-07-28 Converse Vikki K. Method and system for wireless morphing honeypot
CN103378994A (en) * 2012-04-19 2013-10-30 北京动力源科技股份有限公司 Method and terminal for testing communication equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102142923A (en) * 2010-01-28 2011-08-03 宏碁股份有限公司 Multi-communication protocol data transmission method and device thereof
CN102508661A (en) * 2011-10-28 2012-06-20 航天科工深圳(集团)有限公司 Method and device of communication module development and configuration

Also Published As

Publication number Publication date
CN104536887A (en) 2015-04-22

Similar Documents

Publication Publication Date Title
CN107688618B (en) Data comparison method, apparatus, computer equipment and storage medium
CN104899016B (en) Allocating stack Relation acquisition method and device
CN106681903B (en) Method and device for generating test case
CN106201757A (en) A kind of abnormality eliminating method and device
CN108388515A (en) Test data generating method, device, equipment and computer readable storage medium
CN108183838B (en) Method and device for testing source NAT function
US20080189639A1 (en) Dynamically detecting exceptions based on data changes
CN109522228A (en) Interface automatic test data configuration method, apparatus, platform and storage medium
CN104536887B (en) communication data detection method and device
CN108572918A (en) Performance test methods, device, computer equipment and storage medium
CN107908657A (en) Querying method, device, computer equipment and the storage medium of bordereau
CN109272402A (en) Modeling method, device, computer equipment and the storage medium of scorecard
CN108776587A (en) Data capture method, device, computer equipment and storage medium
CN107169668A (en) A kind of data processing method, apparatus and system
CN108897592A (en) A kind of software methods of exhibiting and relevant device
CN105302556B (en) Realize the method and system and server unit calculated
CN108733557A (en) A kind of test point generation method and device
CN107506494A (en) Document handling method, mobile terminal and computer-readable recording medium
CN107436846A (en) Method of testing, device, calculate readable storage medium storing program for executing and computing device
CN110399309A (en) A kind of test data generating method and device
CN106802865A (en) For the response analogue means and method of software test
CN108023905A (en) Internet of things application system and method
CN109684517A (en) A kind of historical data storage method, reading/writing method, storage device and equipment
CN105550250B (en) A kind of processing method and processing device of access log
CN110516258B (en) Data verification method and device, storage medium and electronic device

Legal Events

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