Method, device, equipment and medium for measuring data transmission duration of communication system
By using a microcontroller in the communication system to send the input pulse signal and determine the parameters of the output pulse signal to determine the high-level transmission duration, the problems of high cost and poor adaptability of traditional measurement methods are solved, and accurate and economical measurement of high-speed communication systems is achieved. Measurement of data transmission duration.
Patent Information
- Application Number
- CN202410913305.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-09
AI Technical Summary
Traditional data transmission duration measurement methods are expensive and complex to operate, making it difficult to adapt to high-speed or complex communication systems.
Use a microcontroller to measure the data transmission duration. By sending the input pulse signal and judging whether the parameters of the output pulse signal meet the jump determination conditions, determine the high-level transmission duration as the data transmission duration, and use the preset adjustment mode and time base to adjust the duty cycle. to satisfy the judgment conditions.
It reduces the measurement cost, realizes accurate data transmission duration measurement of high-speed communication systems, meets the needs of industrial communication, and is cheaper than traditional methods.
Smart Images

Figure CN118473552B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of communication testing, and in particular to a method, device, equipment and medium for measuring data transmission duration of a communication system. Background Art
[0002] In communication systems, data transmission duration is one of the key indicators for evaluating system performance. It directly reflects the time required for data to travel from the sender to the receiver, and is essential for ensuring communication quality and optimizing system design. Therefore, accurately measuring data transmission duration is not only an important step in the system development and debugging process, but also the basis for ensuring efficient operation of the communication system.
[0003] Traditional methods for measuring data transmission duration include using professional instruments such as oscilloscopes or logic analyzers to directly observe the transmission of signals. Although these methods can provide certain measurement results, they have some obvious disadvantages. First, these professional instruments are usually expensive and complex to operate, requiring professional personnel to operate and maintain. Second, these methods may be limited by the performance of the instrument, such as sampling rate and bandwidth, and are difficult to adapt to high-speed or complex communication systems. Based on this, how to reduce the measurement cost of measuring the data transmission duration of the communication system is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device and medium for measuring the data transmission duration of a communication system, which can achieve the beneficial effect of reducing the measurement cost of measuring the data transmission duration of the communication system.
[0005] The first aspect of the present application provides a method for measuring the data transmission duration of a communication system: a method for measuring the data transmission duration of a communication system, applied to a system to be tested, wherein the system to be tested is a communication system provided with a data buffer module, and the method comprises:
[0006] Acquire a preset adjustment mode and a jump determination condition corresponding to the preset adjustment mode;
[0007] According to the preset adjustment mode, an input pulse signal is sent to the system under test with a first parameter, and an output pulse signal is obtained;
[0008] Determining whether the parameter corresponding to the output pulse signal and the first parameter satisfy the transition determination condition;
[0009] If the parameter corresponding to the output pulse signal and the first parameter meet the jump determination condition, the PWM square wave corresponding to the first parameter is determined to be a jump square wave, and the high-level transmission duration corresponding to the jump square wave is determined to be the data transmission duration of the system under test.
[0010] By adopting the above technical scheme, the preset adjustment mode includes but is not limited to the starting parameter and the jump determination condition. In the present embodiment, there are two ways to adjust the level duration from high to low and from low to high. Taking the adjustment from high to low as an example, the jump determination condition is that the second parameter corresponding to the output pulse signal does not match the first parameter, that is, the input end pulse corresponding parameter does not match the output end pulse corresponding parameter. In this case, the input end pulse is determined to be a jump square wave, and the data transmission duration of the system to be tested is determined according to the high level transmission duration corresponding to the jump square wave. In this scheme, a single-chip microcomputer is used for testing. Under normal circumstances, the data transmission duration is in the millisecond level. The processing speed of the single-chip microcomputer can reach the microsecond level, which can meet the needs of industrial communication. At the same time, compared with other measurement methods (such as oscilloscopes), the cost of the single-chip microcomputer is lower. Based on this, the beneficial effect of reducing the measurement cost of measuring the data transmission duration of the communication system can be achieved.
[0011] Optionally, the method further includes:
[0012] If the parameter corresponding to the output pulse signal and the first parameter do not satisfy the jump judgment condition, then according to the preset time base and the preset adjustment mode, the first parameter is adjusted to the second parameter until the parameter corresponding to the output pulse signal and the first parameter satisfy the jump judgment condition, and the preset time base is the minimum time base of the microcontroller.
[0013] By adopting the above technical solution, if the jump judgment condition is not met, adjustment is performed according to the preset adjustment mode and the preset time base, wherein the preset time base is the minimum time base corresponding to the adopted single-chip microcomputer, and the first parameter and the second parameter are used as the duty cycle as an example. If the jump judgment condition is not met, then on the basis of the first parameter, the duty cycle is adjusted by increasing the time length of a minimum time base to obtain the second parameter, and then the second parameter is used as input until the input pulse and the output pulse meet the jump judgment condition.
[0014] Optionally, the method further includes:
[0015] The high level transmission duration corresponding to the transition square wave is determined by the following formula:
[0016] T=t=[(1÷f)×1000]×duty;
[0017] Among them, T is the data transmission duration of the system to be tested, t is the high-level transmission duration corresponding to the transition square wave, f is the frequency corresponding to the transition square wave, and duty is the duty cycle corresponding to the transition square wave.
[0018] By adopting the above technical solution, when it is determined that the input pulse is a jumping square wave, the frequency and duty cycle corresponding to the jumping square wave are calculated to obtain the high level duration corresponding to the jumping square wave, and it is determined as the data transmission duration of the communication system to be tested.
[0019] Optionally, sending an input pulse signal to the system under test with a first parameter according to the preset adjustment mode, and acquiring an output pulse signal includes:
[0020] Determining whether the number of cycles of the output pulse signal reaches a preset cycle threshold;
[0021] If the number of cycles of the output pulse signal reaches the preset cycle threshold, the parameters corresponding to the output pulse signal are obtained.
[0022] By adopting the above technical solution, it is determined whether the output pulse signal received by the single-chip microcomputer reaches the preset number of cycles. If so, it can be determined that the output pulse signal completely corresponds to the input pulse signal. In this case, the parameters corresponding to the output pulse signal are obtained. If they are not fully obtained, the acquisition of parameters such as duty cycle may be misjudged.
[0023] Optionally, the method further includes:
[0024] If the preset adjustment mode is the first parameter adjustment mode, determining the jump determination condition as that the parameter corresponding to the output pulse signal does not match the first parameter, and determining a first starting parameter;
[0025] The first starting parameter is continuously adjusted with the preset time base as a unit until the parameter corresponding to the output pulse signal does not match the first parameter.
[0026] By adopting the above technical solution, in the first parameter adjustment mode, the jump judgment condition is that the parameter corresponding to the output pulse signal does not match the first parameter, that is, the input pulse and the output pulse change from being the same to being different. In the first parameter adjustment mode, the high level duration corresponding to the first starting parameter is relatively high. For example, the duty cycle can be gradually adjusted down by 100% until the duty cycle corresponding to the first parameter is different from the duty cycle corresponding to the output pulse signal.
[0027] Optionally, the method further includes:
[0028] If the preset adjustment mode is the second parameter adjustment mode, determining the jump determination condition as that the parameter corresponding to the output pulse signal matches the first parameter, and determining a second starting parameter;
[0029] The second starting parameter is continuously adjusted with the preset time base as a unit until the parameter corresponding to the output pulse signal matches the first parameter.
[0030] By adopting the above technical solution, in the second parameter adjustment mode, the jump judgment condition is that the parameter corresponding to the output pulse signal matches the first parameter, that is, the input pulse and the output pulse change from being different to being the same. In the second parameter adjustment mode, the high level duration corresponding to the second starting parameter is relatively low. For example, the duty cycle can be gradually adjusted upward with a duty cycle of 0% until the duty cycle corresponding to the first parameter is the same as the duty cycle corresponding to the output pulse signal.
[0031] A second aspect of the present application provides a data transmission duration measurement device for a communication system, comprising:
[0032] A preset mode acquisition module, used to acquire a preset adjustment mode and a jump determination condition corresponding to the preset adjustment mode; an output and sampling module, used to send an input pulse signal to the system under test with a first parameter according to the preset adjustment mode, and acquire an output pulse signal;
[0033] A transition determination module, used to determine whether the second parameter corresponding to the output pulse signal and the first parameter meet the transition determination condition;
[0034] A transmission duration determination module is used to determine that the PWM square wave corresponding to the first parameter is a transition square wave if the parameter corresponding to the output pulse signal and the first parameter meet the transition judgment condition, and to determine that the high-level transmission duration corresponding to the transition square wave is the data transmission duration of the system under test.
[0035] Optionally, the output and sampling module includes a single chip microcomputer;
[0036] The input end of the single-chip microcomputer is connected to the output end of the system under test for obtaining the output pulse signal, and the output end of the single-chip microcomputer is connected to the input end of the system under test for sending the input pulse signal to the system under test with the first parameter according to the preset adjustment mode.
[0037] According to a third aspect of the present application, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the above-mentioned method for measuring the data transmission duration of the communication system.
[0038] A fourth aspect of the present application provides a storage medium storing a computer program that can be loaded by a processor and execute the above-mentioned method for measuring the data transmission duration of the communication system.
[0039] In summary, the present application includes at least one of the following beneficial effects:
[0040] 1. The preset adjustment mode includes but is not limited to the starting parameters and the jump judgment condition. In this embodiment, there are two ways to adjust the level duration from high to low and from low to high. Taking the adjustment from high to low as an example, the jump judgment condition is that the second parameter corresponding to the output pulse signal does not match the first parameter, that is, the input end pulse corresponding parameter does not match the output end pulse corresponding parameter. In this case, the input pulse is determined to be a jump square wave, and the high level transmission duration corresponding to the jump square wave is the data transmission duration of the system to be tested. In this scheme, a single-chip microcomputer is used for testing. Under normal circumstances, the data transmission duration is in the millisecond level. The processing speed of the single-chip microcomputer can reach the microsecond level, which can meet the needs of industrial communication. At the same time, compared with other measurement methods (such as oscilloscopes), the cost of the single-chip microcomputer is lower. Based on this, the beneficial effect of reducing the measurement cost of measuring the data transmission duration of the communication system can be achieved.
[0041] 2. If the jump judgment condition is not met, the adjustment is performed according to the preset adjustment mode and the preset time base, wherein the preset time base is the minimum time base corresponding to the adopted single chip microcomputer. Taking the first parameter and the second parameter as the duty cycle as an example, if the jump judgment condition is not met, the duty cycle is adjusted by increasing the time length of a minimum time base on the basis of the first parameter to obtain the second parameter, and then the second parameter is used as input until the input pulse and the output pulse meet the jump judgment condition.
[0042] 3. When it is determined that the input pulse is a jumping square wave, the frequency and duty cycle corresponding to the jumping square wave are calculated to obtain the high level duration corresponding to the jumping square wave, and it is determined as the data transmission duration of the communication system to be tested. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of a method for measuring the data transmission duration of a communication system provided in an embodiment of the present application;
[0044] Figure 2 It is a virtual structural diagram of a data transmission duration measurement device of a communication system provided by the present application;
[0045] Figure 3 It is a structural diagram of the output and sampling module in the data transmission duration measurement device provided in this application. DETAILED DESCRIPTION
[0046] The following examples will help those skilled in the art to further understand the effects of the present application, but are not intended to limit the present application in any form. It should be noted that, for those of ordinary skill in the art, several modifications and improvements may be made without departing from the concept of the present application. These all fall within the scope of protection of the present application.
[0047] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0048] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0049] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0050] As used in the specification of this application and the appended claims, the term "if" can be interpreted as "when..." or "once" or "in response to determination" or "in response to detection" depending on the context. Similarly, the phrase "if it is determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once it is determined" or "in response to determination" or "once [the described condition or event] is detected" or "in response to detection [the described condition or event]" depending on the context. 1] The reference to "one embodiment" or "some embodiments" described in the specification of this application means that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the sentences "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0051] In order to make the purpose, technical solutions and advantages of the present application clearer, the data transmission duration measurement method of the communication system of the present application is described below from the perspective of the data transmission duration measurement device of the communication system. The data transmission duration measurement device of the communication system can be an electronic device, which can be, for example, a mobile phone terminal, a computer terminal and other devices.
[0052] The present application is further described in detail below in conjunction with the accompanying drawings.
[0053] Reference Figure 1 , is a flow chart of a method for measuring the data transmission duration of a communication system provided in an embodiment of the present application, the method comprising the following steps, each of which is described in detail below:
[0054] In step S1, a preset adjustment mode and a jump determination condition corresponding to the preset adjustment mode are obtained.
[0055] Specifically, the preset adjustment mode can be adjusted or controlled by relevant personnel through buttons, audio, communication with associated communication equipment, etc. The preset parameters in the mode include but are not limited to adjustable parameters (such as input duty cycle and / or frequency), adjustment method and starting parameters (for example, the adjustment parameter is the duty cycle, the adjustment method is to gradually reduce the duty cycle from high to low, and the starting parameter value at the start of the measurement), a preset time base, and a jump judgment condition corresponding to the mode, etc., wherein the preset time base can be the minimum time base of the microcontroller used to measure the system under test.
[0056] More specifically, the preset adjustment mode includes a first adjustment mode and a second adjustment mode. In the first adjustment mode, the duration of the high level of the input pulse signal is gradually reduced, and correspondingly in the second adjustment mode, the duration of the high level of the input pulse signal is gradually increased. The first adjustment mode and the second adjustment mode are specifically described below: If the preset adjustment mode is the first parameter adjustment mode, the jump judgment condition is determined to be that the parameter corresponding to the output pulse signal does not match the first parameter, and the first starting parameter is determined; the first starting parameter is continuously adjusted in units of the preset time base until the parameter corresponding to the output pulse signal does not match the first parameter.
[0057] Specifically, if the preset adjustment mode is the first parameter adjustment mode, then the relevant parameters corresponding to the first parameter adjustment mode are obtained, including the parameter adjustment data used. In this embodiment, it includes adjusting the frequency only with a fixed duty cycle, adjusting the duty cycle only with a fixed frequency, adjusting the frequency or the duty cycle at the same time, etc. By adjusting the parameter adjustment data used, the duration of the high level is gradually adjusted until the parameter corresponding to the output pulse signal does not match the first parameter. For example, if the adjustment is performed in a manner of adjusting the duty cycle only with a fixed frequency, the corresponding starting duty cycle, i.e., the first starting parameter, can be determined, wherein the first starting parameter can be preset by relevant personnel, or can be matched and preset according to the communication protocol conversion type corresponding to the system to be tested. For example, the starting duty cycle can be 80%. If the duty cycle of the corresponding output pulse signal is also 80%, the duty cycle of the input pulse signal is adjusted downward with the following preset time base until the duty cycle of the input pulse signal does not match the duty cycle of the output pulse signal.
[0058] If the preset adjustment mode is the second parameter adjustment mode, the jump judgment condition is determined to be that the parameter corresponding to the output pulse signal matches the first parameter, and the second starting parameter is determined; the second starting parameter is continuously adjusted in units of the preset time base until the parameter corresponding to the output pulse signal matches the first parameter.
[0059] Specifically, the relevant parameters corresponding to the second parameter adjustment mode corresponding to the above-mentioned first parameter adjustment mode include the parameter adjustment data used. In this embodiment, it includes only adjusting the frequency with a fixed duty cycle, only adjusting the duty cycle with a fixed frequency, and adjusting the frequency or the duty cycle at the same time. By adjusting the parameter adjustment data used, the high level duration is gradually adjusted until the parameter corresponding to the output pulse signal does not match the first parameter. For example, if the adjustment is performed by adjusting the duty cycle with a fixed frequency, the corresponding starting duty cycle, that is, the second starting parameter, can be determined. Under normal circumstances, the high level duration obtained by the second starting parameter should be lower than the low level duration obtained by the first starting parameter. For example, the starting duty cycle can be 1%. If the duty cycle of the corresponding output pulse signal is 0%, that is, the two parameters do not match, the duty cycle of the input pulse signal is adjusted down with a preset time base until the duty cycle of the input pulse signal matches the duty cycle of the output pulse signal.
[0060] More specifically, assuming that a pulse signal corresponding to a duty cycle of 30% is used as a jumping square wave, when the input duty cycle is 30%, the output is a continuous low level (i.e., a duty cycle of 0%). When the duty cycle is increased according to the minimum time base of the microcontroller, the duty cycles corresponding to the input and output pulses are the same, then it is determined that the PWM square wave corresponding to the duty cycle of 30% is a jumping square wave.
[0061] In step S2, according to the preset adjustment mode, an input pulse signal is sent to the system under test with a first parameter, and an output pulse signal is acquired.
[0062] Specifically, the first parameter is the PWM parameter corresponding to the input pulse signal at the current moment. The first parameter can be adjusted with the above-mentioned first starting parameter or the second starting parameter as the starting point according to the adjustment method corresponding to the above-mentioned preset adjustment mode. In layman's terms, taking the second parameter adjustment mode as an example, first output an input pulse signal with a short duration of high level, and obtain the output pulse signal obtained at the output end of the system to be tested. If it is a low level (that is, the duty cycle is 0%), then adjust the first parameter according to the preset time base (in this embodiment, the minimum time base of the single-chip microcomputer) to obtain a new first parameter. Send an output pulse signal corresponding to the new first parameter, and obtain the corresponding output pulse signal until the corresponding jump judgment condition is met.
[0063] More specifically, the step of sending an input pulse signal to the system under test with a first parameter according to the preset adjustment mode and obtaining an output pulse signal also includes: determining whether the number of cycles of the output pulse signal reaches a preset cycle threshold; if the number of cycles of the output pulse signal reaches the preset cycle threshold, obtaining the parameters corresponding to the output pulse signal.
[0064] Specifically, this step is performed by a single-chip microcomputer connected in parallel to both ends of the system to be tested, the input end of the single-chip microcomputer is connected to the output end of the system to be tested, and is used to obtain the output pulse signal, and the output end of the single-chip microcomputer is connected to the input end of the system to be tested, and is used to send the input pulse signal to the system to be tested with the first parameter according to the preset adjustment mode. In addition, the output pulse signal obtained needs to satisfy a complete cycle, otherwise the actual duty cycle may not be measured. For example, a complete pulse signal includes 1sda000 cycles. Only when the output pulse signal obtained by the single-chip microcomputer includes a PWM square wave signal of 1000 cycles, the parameters corresponding to the output pulse signal are obtained.
[0065] In step S3, it is determined whether the second parameter corresponding to the output pulse signal and the first parameter satisfy the transition determination condition.
[0066] Specifically, after the above steps determine that the complete output pulse signal is received, the parameters corresponding to the acquired pulse signal will be obtained, including its corresponding frequency and duty cycle, and the obtained parameters will be compared with the parameters corresponding to the input pulse signal input into the communication system to be tested to determine whether they match or do not match. The specific judgment is adjusted according to the preset adjustment mode adopted. You can refer to the above description of the first parameter adjustment mode and the second parameter adjustment mode, which will not be repeated here.
[0067] In step S4, if the parameter corresponding to the output pulse signal and the first parameter meet the jump judgment condition, the PWM square wave corresponding to the first parameter is determined to be a jump square wave, and the high-level transmission duration corresponding to the jump square wave is determined to be the data transmission duration of the system under test.
[0068] Specifically, if the judgment result of step S3 determines that the matching relationship between the parameter corresponding to the output pulse signal and the first parameter meets the preset jump judgment condition, the pulse signal adjusted according to the preset time base last time is determined to be a jump square wave, and the data transmission duration of the system to be tested is determined according to the jump square wave and its corresponding frequency and duty cycle. The data transmission duration of the system to be tested is determined using the following formula:
[0069] Among them, is the data transmission duration of the system to be tested, is the high-level transmission duration corresponding to the transition square wave, is the frequency corresponding to the transition square wave, and is the duty cycle corresponding to the transition square wave.
[0070] More specifically, the principle adopted by the present application is that, since the communication system needs to deal with speed matching, data temporary storage, and protocol conversion during data transmission, a data buffer is included, and the time required to transmit "1" from the input end to the output end of the communication system to be tested is set to T, and the high-level transmission duration output by one cycle of the input pulse signal is t. When t is greater than T, the buffer in the communication system will not be covered by the data buffer module, that is, there is a pulse output, and it corresponds to the parameters of the input pulse signal; when t is less than or equal to T, the buffer in the communication system will be covered by "0", that is, the low level is continuously output, which can also be understood as no pulse output.
[0071] The second aspect of the present application provides a data transmission duration measurement device for a communication system. Figure 2 , Figure 2 It is a virtual structural diagram of a data transmission duration measurement device of a communication system provided in the present application, and the data transmission duration measurement device of the communication system includes: a preset mode acquisition module 100, used to obtain a preset adjustment mode and a jump determination condition corresponding to the preset adjustment mode; an output and sampling module 200, used to send an input pulse signal to the system to be tested with a first parameter according to the preset adjustment mode, and obtain an output pulse signal; a jump determination module 300, used to determine whether a second parameter corresponding to the output pulse signal and the first parameter meet the jump determination condition; a transmission duration determination module 400, used to determine that the PWM square wave corresponding to the first parameter is a jump square wave if the parameter corresponding to the output pulse signal and the first parameter meet the jump determination condition, and determine that the high-level transmission duration corresponding to the jump square wave is the data transmission duration of the system to be tested.
[0072] Specifically, refer to Figure 3 , Figure 3 It is a structural schematic diagram of the output and sampling module in the data transmission duration measurement device provided in the present application, and the output and sampling module includes a single-chip microcomputer; the input end of the single-chip microcomputer is connected to the output end of the system to be tested, and is used to obtain the output pulse signal; the output end of the single-chip microcomputer is connected to the input end of the system to be tested, and is used to send the input pulse signal to the system to be tested with the first parameter according to the preset adjustment mode.
[0073] For the specific definition of the data transmission duration measurement device of the communication system, please refer to the definition of the data transmission duration measurement method of the communication system mentioned above, which will not be repeated here. Each module in the data transmission duration measurement device of the above communication system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0074] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0075] The data transmission duration measurement method of a communication system provided in an embodiment of the present application can be applied to terminal devices such as electronic devices, computers, wearable devices, vehicle-mounted devices, tablet computers, laptops, netbooks, personal digital assistants (PDA), augmented reality (AR) / virtual reality (VR) devices, mobile phones, etc. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.
[0076] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each embodiment of the above method can be implemented.
[0077] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in each embodiment of the above method when executing the computer program product.
[0078] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera device / terminal device, a recording medium, a computer memory, a read-only memory (ROM, ReadOnlyMemory), a random access memory (RAM, RandomAccessMemory), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0079] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0080] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0081] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0082] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0083] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for measuring data transmission duration in a communication system, characterized in that: Applied to a system to be tested, the system to be tested is a communication system provided with a data buffer module, the method comprises: Acquire a preset adjustment mode and a jump determination condition corresponding to the preset adjustment mode; According to the preset adjustment mode, an input pulse signal is sent to the system under test with a first parameter, and an output pulse signal is obtained; Determining whether the parameter corresponding to the output pulse signal and the first parameter satisfy the transition determination condition; If the parameter corresponding to the output pulse signal and the first parameter meet the jump determination condition, the PWM square wave corresponding to the first parameter is determined to be a jump square wave, and the high-level transmission duration corresponding to the jump square wave is determined to be the data transmission duration of the system under test.
2. The method for measuring the data transmission duration of a communication system according to claim 1, characterized in that: The method further comprises: If the parameter corresponding to the output pulse signal and the first parameter do not satisfy the jump judgment condition, then according to the preset time base and the preset adjustment mode, the first parameter is adjusted to the second parameter until the parameter corresponding to the output pulse signal and the first parameter satisfy the jump judgment condition, and the preset time base is the minimum time base of the microcontroller.
3. The method for measuring the data transmission duration of a communication system according to claim 1, characterized in that: The method further comprises: The high level transmission duration corresponding to the transition square wave is determined by the following formula: T=t=[(1÷f)×1000]×duty Among them, T is the data transmission duration of the system to be tested, t is the high-level transmission duration corresponding to the transition square wave, f is the frequency corresponding to the transition square wave, and duty is the duty cycle corresponding to the transition square wave.
4. The method for measuring the data transmission duration of a communication system according to claim 1, characterized in that: The step of sending an input pulse signal to the system under test with a first parameter according to the preset adjustment mode and acquiring an output pulse signal comprises: Determining whether the number of cycles of the output pulse signal reaches a preset cycle threshold; If the number of cycles of the output pulse signal reaches the preset cycle threshold, the parameters corresponding to the output pulse signal are obtained.
5. The method for measuring the data transmission duration of a communication system according to claim 2, characterized in that: The method further comprises: If the preset adjustment mode is the first parameter adjustment mode, determining the jump determination condition as that the parameter corresponding to the output pulse signal does not match the first parameter, and determining a first starting parameter; The first starting parameter is continuously adjusted with the preset time base as a unit until the parameter corresponding to the output pulse signal does not match the first parameter.
6. The method for measuring the data transmission duration of a communication system according to claim 2, characterized in that: The method further comprises: If the preset adjustment mode is the second parameter adjustment mode, determining the jump determination condition as that the parameter corresponding to the output pulse signal matches the first parameter, and determining a second starting parameter; The second starting parameter is continuously adjusted with the preset time base as a unit until the parameter corresponding to the output pulse signal matches the first parameter.
7. A data transmission duration measurement device for a communication system, characterized in that: Applied to a system to be tested, the system to be tested is a communication system provided with a data buffer module, and the device comprises: A preset mode acquisition module, used to acquire a preset adjustment mode and a jump determination condition corresponding to the preset adjustment mode; An output and sampling module, used to send an input pulse signal to the system under test with a first parameter according to the preset adjustment mode, and obtain an output pulse signal; A transition determination module, used to determine whether the second parameter corresponding to the output pulse signal and the first parameter meet the transition determination condition; A transmission duration determination module is used to determine that the PWM square wave corresponding to the first parameter is a transition square wave if the parameter corresponding to the output pulse signal and the first parameter meet the transition judgment condition, and to determine that the high-level transmission duration corresponding to the transition square wave is the data transmission duration of the system under test.
8. The data transmission duration measuring device of the communication system according to claim 7, characterized in that: The output and sampling module includes a single chip microcomputer; The input end of the single-chip microcomputer is connected to the output end of the system under test for obtaining the output pulse signal, and the output end of the single-chip microcomputer is connected to the input end of the system under test for sending the input pulse signal to the system under test with the first parameter according to the preset adjustment mode.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executes the method for measuring the data transmission duration of a communication system as claimed in any one of claims 1 to 6.
10. A storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method for measuring the data transmission duration of a communication system as claimed in any one of claims 1 to 6.
