Cable calibration method, apparatus and device, and computer readable storage medium
Through the automated calibration method, the spectrum analyzer data is processed using the center frequency point in the initial list, and the problems of inaccurate calibration consumes human resources and calibration in the prior art are solved, efficient and accurate Cable calibration is achieved, and user experience is improved. .
Patent Information
- Application Number
- CN202411022727.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-29
AI Technical Summary
In the prior art, Cable calibration consumes too much human resources, cumbersome testing steps, inaccurate calibration and inability to detect problems in a timely manner, which affects the stability of signal transmission and data acquisition experience.
Through automated calibration methods, the central frequency points in the initial list are used to send instructions, receive and process the data of the spectrum analyzer, build and update the list, accurately calibrate the center frequency, and improve calibration efficiency and accuracy.
It greatly improves Cable calibration efficiency, reduces signal transmission errors, improves data acquisition capabilities, and improves the performance and user experience of wired connected devices.
Smart Images

Figure CN119051769A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of cable calibration, and in particular, to a cable calibration method, apparatus, device, and computer-readable storage medium. Background Art
[0002] In recent years, with the increasing popularity of network-enabled devices, more and more families are using wireless devices. However, manual cable calibration consumes too much human resources and has cumbersome test steps.
[0003] For example, in actual use, manual cable calibration has the following problems:
[0004] 1. Excessive consumption of human resources: Professional technical personnel are required, which will consume a lot of time and manpower costs.
[0005] 2. Complicated test steps: Multiple test steps are required, the operation is cumbersome, and the fault tolerance is poor.
[0006] 3. Inaccurate calibration: Due to human factors or limitations of test equipment, manual cable calibration is prone to errors, resulting in unstable signal transmission or data collection errors.
[0007] 4. Unable to detect problems in time: Unable to detect signal transmission problems in time, affecting the user's data collection experience.
[0008] Therefore, how to fully explore the methods of cable automatic calibration to improve sensor measurement accuracy, reduce signal transmission errors and improve data acquisition capabilities, thereby further improving the performance and user experience of wired connection devices is an urgent problem that needs to be solved. Summary of the invention
[0009] According to the embodiments of the present application, a cable calibration solution is provided, which can realize automatic calibration to replace manual calibration, automatically send instructions, automatically perform difference between the returned spectrum analyzer power value and serial port data, record the inaccurate center frequency while filling in the test report, and accurately calibrate the recorded center frequency, thereby greatly improving the cable calibration efficiency.
[0010] In a first aspect of the present application, a Cable calibration method is provided. The method comprises:
[0011] Based on the central frequency point in the initial list, sending a first power instruction to the device to be measured;
[0012] Receive the device to be measured, and in response to the serial port data fed back by the first power instruction, set the measurement parameters of the spectrum analyzer corresponding to the current center frequency point; receive the first power value obtained by the spectrum analyzer through the set measurement parameters; construct a first list based on the first power value; write the first power value corresponding to the current center frequency point into the device to be measured to obtain the target device;
[0013] Through a first preset algorithm, according to a dictionary constructed by test points, span data and power bandwidth, respectively operate a spectrum analyzer and a serial port of the device under test, process the spectrum analyzer data and the serial port data, and construct a third list for storing center frequency points that do not meet preset requirements;
[0014] Based on the central frequency point in the initial list, sending a second power instruction to the target device and sending a second test instruction to the spectrum analyzer;
[0015] receiving the second serial port data fed back by the target device in response to the second power instruction; receiving the second power value fed back by the spectrum analyzer in response to the second test instruction;
[0016] constructing a second list based on the first list, the second serial port data and the second power value;
[0017] Based on the second list and the third list, updating the first list by a second preset algorithm;
[0018] The updated first list is written into the device to be measured.
[0019] Furthermore, the initial list includes:
[0020] An initial list is constructed based on a predefined configuration file; the initial list includes a central frequency point of a power value to be measured.
[0021] Furthermore, the serial port data includes the device USS power value.
[0022] Further, the first preset algorithm is used to operate the spectrum analyzer and the serial port of the device under test respectively according to the dictionary constructed by the test point, span data and power bandwidth, and the spectrum analyzer data and the serial port data are processed to construct a third list for storing center frequency points that do not meet the preset requirements, including:
[0023] Calculate the difference between the spectrum analyzer data and the device uss power value in the serial port data;
[0024] If the difference exceeds a preset threshold, the subscript of the center frequency point corresponding to the current power value is added to the third list.
[0025] Further, constructing a second list based on the first list, the second serial port data and the second power value includes:
[0026] Calculate the difference between the second power value and the device uss power value in the second serial port data;
[0027] Halving the difference to obtain a half value of the corrected deviation;
[0028] Calculate the difference between the first power value in the first list and the half value to obtain a target value;
[0029] Based on the target value, a second list is constructed.
[0030] Further, the updating of the first list by a second preset algorithm based on the second list and the third list includes:
[0031] Using the third list as index subscript;
[0032] Overwrite the values in the second list that meet the index criteria into the first list to complete the update of the first list.
[0033] Furthermore, it also includes:
[0034] Read the configuration file into a dictionary form;
[0035] The spectrum analyzer is configured with measurement parameters by reading a configuration file in a dictionary form.
[0036] In a second aspect of the present application, a Cable calibration device is provided. The device comprises:
[0037] A first transmitting module, used for sending a first power instruction to the device to be measured based on the central frequency point in the initial list;
[0038] A first receiving module is used to receive the device to be measured, and in response to the serial port data fed back by the first power instruction, set the measurement parameters of the spectrum analyzer corresponding to the current center frequency point; receive the first power value obtained by the spectrum analyzer through the set measurement parameters; and construct a first list based on the first power value; write the first power value corresponding to the current center frequency point into the device to be measured to obtain a target device;
[0039] A calculation module, used to operate the spectrum analyzer and the serial port of the device under test respectively according to a dictionary constructed by the test point, span data and power bandwidth through a first preset algorithm, process the spectrum analyzer data and the serial port data, and construct a third list for storing center frequency points that do not meet the preset requirements;
[0040] A second transmitting module is used to send a second power instruction to the target device and a second test instruction to the spectrum analyzer based on the central frequency point in the initial list;
[0041] A second receiving module is used to receive the second serial port data fed back by the target device in response to the second power instruction; and receive the second power value fed back by the spectrum analyzer in response to the second test instruction;
[0042] A construction module, configured to construct a second list based on the first list, the second serial port data and the second power value;
[0043] An updating module, configured to update the first list based on the second list and the third list by a second preset algorithm;
[0044] The input module is used to write the updated first list into the device to be measured.
[0045] In a third aspect of the present application, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0046] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present application is implemented.
[0047] The Cable calibration method provided in the embodiment of the present application sends a first power instruction to the device to be measured based on the center frequency in the initial list; receives the device to be measured, and sets the measurement parameters of the spectrum analyzer corresponding to the current center frequency in response to the serial port data fed back by the first power instruction; receives the first power value obtained by the spectrum analyzer through the set measurement parameters; constructs a first list based on the first power value; writes the first power value corresponding to the current center frequency into the device to be measured to obtain the target device; and operates the serial ports of the spectrum analyzer and the device to be measured respectively through a first preset algorithm according to a dictionary constructed by test points, span data and power bandwidth, and performs calibration on the spectrum analyzer data and The serial port data is processed to construct a third list for storing center frequency points that do not meet the preset requirements; based on the center frequency points in the initial list, a second power instruction is sent to the target device, and a second test instruction is sent to the spectrum analyzer; the target device receives the second serial port data fed back in response to the second power instruction; the spectrum analyzer receives the second power value fed back in response to the second test instruction; based on the first list, the second serial port data and the second power value, a second list is constructed; based on the second list and the third list, the first list is updated by a second preset algorithm; the updated first list is written into the device to be measured, which greatly improves the efficiency of Cable calibration.
[0048] It should be understood that the contents described in the Summary of the Invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0050] Figure 1 A diagram of the system architecture involved in the method provided in the embodiments of the present application.
[0051] Figure 2 is a flow chart of a Cable calibration method according to an embodiment of the present application;
[0052] Figure 3 is a schematic diagram of a command_hierarchy dictionary according to an embodiment of the present application;
[0053] Figure 4 is a block diagram of a Cable calibration device according to an embodiment of the present application;
[0054] Figure 5It is a schematic diagram of the structure of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0056] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0057] Figure 1 A schematic diagram of an exemplary operating environment 100 in which embodiments of the present disclosure can be implemented is shown. The operating environment 100 includes a spectrum analyzer 101, a server 102, and a test device 103.
[0058] The server 102 can be connected to the spectrum analyzer 101 via a GPIB interface and can be connected to the test equipment 103 via a serial port;
[0059] The spectrum analyzer 101 may be connected to the test equipment 103 via a cable.
[0060] Figure 2 FIG. 4 is a flow chart showing a Cable calibration method according to an embodiment of the present disclosure. The method may be performed by Figure 1 Server 102 executes in.
[0061] S210: Send a first power instruction to the device to be measured based on the central frequency point in the initial list.
[0062] In some embodiments, a dictionary is constructed based on a predefined configuration file, that is, a configuration file (.csv file) of a serial port command is constructed into a command hierarchy structure and stored in the dictionary.
[0063] Specifically, create a class named Command_init, which contains a method named get_csv_config_label. The method includes the parameter data_path, which is used to specify the path of the CSV file. The get_csv_config_label method is used to read data from the CSV file and build a command hierarchy structure based on the data. For each row, create a new dictionary containing information about the index, label, command, and next-level index, and then add the dictionary to command_hierarchy. Finally, return the constructed command_hierarchy dictionary and the next-level index next_level, refer to Figure 3 .
[0064] In the present disclosure, the thread class for receiving and caching serial port data is different from the traditional method of processing the serial port using ser.read (ser.in_waiting) to read the serial port buffer data. The received data is cached in the form of a list as a new buffer to ensure the integrity and reliability of the data. During the program running process, the data received by the serial port will be appended to a list named data_buffer, and then the index of the command_hierarchy dictionary will be obtained. The initial index is 0, and the dictionary with index 0 is found to obtain the key value of the dictionary. It is determined whether the key value is in the list of data_buffer. If it exists, the command value of the corresponding dictionary is entered, the index is incremented by 1, and then the dictionary with index 1 is executed; if the key value is not in the list of data_buffer, the enter operation is executed, and the list of data_buffer is obtained again for judgment and other operations.
[0065] Specifically, the following functions can be realized:
[0066] A. Initialize the serial port and create a log file to record the received data;
[0067] B. Loop to monitor serial port data, decode the received data and write it into the log file;
[0068] C. Add the received data to the data_buffer list;
[0069] D. When you need to stop serial port reception, close the serial port and end the program.
[0070] It can be seen that the above-mentioned method of using lists as buffers has multiple advantages. First, by storing data in lists, large amounts of data can be processed flexibly to ensure that data is not lost. Compared with traditional methods, lists can more effectively manage and store large amounts of data, ensuring data integrity and reliability.
[0071] Secondly, using the list as a buffer can facilitate further processing and analysis of the data. By storing the data received by the serial port in the list, the data can be extracted, filtered, processed, etc. when needed, which provides convenience for data analysis and application.
[0072] In addition, the thread for receiving and caching serial port data is started at the same time as the thread for processing serial port data, realizing parallel processing. Parallel processing can improve the efficiency and response speed of the system and realize fast processing and transmission of data. At the same time, before sending the serial port command, the data_buffer list is cleared by default to ensure that the received data is always the latest, thus avoiding data confusion or duplication, protecting data integrity, and providing a basis for subsequent precise calibration.
[0073] In some embodiments, the parameters such as the center frequency point for which the power value needs to be measured are stored in a list (initial list), a connection is established with the device using serial communication, and the center frequency points in the initial list are obtained in sequence, and a power instruction (first power instruction) is sent to the device.
[0074] S220, receiving the device to be measured, and setting the measurement parameters of the spectrum analyzer corresponding to the current center frequency in response to the serial port data fed back by the first power instruction; receiving the first power value obtained by the spectrum analyzer through the set measurement parameters; constructing a first list based on the first power value; writing the first power value corresponding to the current center frequency into the device to be measured to obtain the target device.
[0075] In some embodiments, communication is established with a spectrum analyzer through the PyVISA library, and measurement parameters such as the current center frequency, power bandwidth, and span (spectrum analyzer width setting) are set. The spectrum analyzer is received, and the first power value is obtained through the set measurement parameters. The first power value data obtained is stored in an Excel file and saved to a specified path for subsequent processing and analysis. After the acquisition is completed, the first power value data obtained is written to the test board in the device to be measured, that is, the device to be measured is updated (target device), the initial calibration is completed, and the calibration data is recorded in the first list (list1).
[0076] S230, through the first preset algorithm, respectively operate the spectrum analyzer and the serial port of the device under test according to the dictionary constructed by the test point, span data and power bandwidth, process the spectrum analyzer data and the serial port data, and construct a third list for saving the center frequency points that do not meet the preset requirements.
[0077] In some embodiments, the configuration file is read in a dictionary form, and the spectrum analyzer is automatically set with measurement parameters by reading the configuration file in a dictionary form.
[0078] Specifically, the configuration file with the .csv suffix is read as a dictionary d, and a method named get_csv_config_test_point is defined in a class named Command_init. This method is used to read data from the CSV file, and store its first five parameters into a tuple as the key of the d dictionary, and the last five parameters are stored as a tuple as the value of the dictionary, and the two key-value pairs are stored in the dictionary d.
[0079] By traversing the dictionary d, the power value, power bandwidth, span (spectrum analyzer width setting) and other measurement parameters corresponding to the center frequency point are obtained one by one, and the spectrum analyzer is automatically configured. In the present disclosure, after obtaining the value of the marker point of the spectrum analyzer, the power level value of the spectrum analyzer is automatically set according to the marker point, so that its waveform always remains in a fixed position. The specific implementation method is: a method named get_marker is defined, and the command: CALCulate: MARK1: STATe ON is sent to the instrument through the GPIB interface of the spectrum analyzer to turn on the marking function of the instrument; by querying the instrument, the Y value of the marker is obtained, that is, ': CALCulate: MARKer1: Y? '; the obtained Y value is converted into a floating point number and added to 20; the added value is returned, and the round function is used to round it to two decimal places; the result is returned and sent to the function of the spectrum analyzer, and the power level of the spectrum analyzer is set with this value to ensure the correctness and stability of the obtained value.
[0080] The specific steps are as follows:
[0081] A. Create an empty dictionary d;
[0082] B. For each row of data in the configuration file, use the first 5 columns as keys and the last 5 columns as values to construct a tuple containing these values;
[0083] C. Add the constructed tuple key-value pair to the dictionary d;
[0084] D. Return the dictionary d. The structure of the obtained dictionary d is as follows:
[0085] d={
[0086] ('5.8','1','8','17',1.6):(2,4,61,45,4),
[0087] ('20','5','32','23',6.4):(7,4,61,45,4),
[0088] ('38.8','3','8','17',1.6):(12,4,61,45,4)
[0089] }
[0090] E. Traverse the dictionary to read parameters and set the device and spectrum analyzer respectively;
[0091] F. Read the value of the current marker point, calculate the reference level according to the following formula and use the reference level to configure the spectrum analyzer:
[0092] Ref Level (reference level) = 20 + (± float (marker))
[0094] Specifically, during the test, the following three values are measured: A, spectrum analyzer power value; B, device USS power value; C, rate difference: spectrum analyzer power value - device USS power value. In each test, the above three values (A, B, C) are stored in the test report, and it is determined whether the difference exceeds the preset threshold (preferably ±0.6). In the calibration specification of the chip manufacturer, the difference is required to be less than ±2, but considering the different devices, copper cable length and material and other factors, the difference is set to less than 0.8 in this disclosure. This standard is more conducive to the calibration results of the equipment and can be applied to more application scenarios. In the process of automatic calibration, the selection of the 0.6 threshold is based on multiple training calculations. After multiple verifications, it is found that if the initial calibration is not compensated, the difference is generally close to 0.8, and the probability of a very small difference is relatively small. If the difference is set to 0.8, the probability of identifying the difference will be reduced, and the final calibrated value will be close to 0.8, which has little effect on reducing the difference and is not conducive to obtaining a perfect value. If the threshold is lower than 0.6, there will be multiple calculations and increase the calibration time. Therefore, the threshold can be set to 0.6. If the threshold is exceeded, the corresponding center frequency point x is appended to the dictionary (dict); an empty dictionary (dict) is used to store relevant information about inaccurate center frequency during the test.
[0095] After the test is completed, the complete (dict) dictionary is stored in a file called Deviation_Value_Dictionary.txt. At this point, the inaccurate center frequency after the initial calibration can be obtained, and preparation can be made for the next accurate calibration.
[0096] When performing precise calibration, the Deviation_Value_Dictionary.txt file can be read and the dictionary therein can be traversed. The subscript of the corresponding value can be confirmed according to the stored value, and the subscript can be stored in a list named list3 (the third list) for precise calibration. Through the above process, the accuracy and efficiency of calibration can be effectively improved.
[0097] S240: Based on the central frequency point in the initial list, a second power instruction is sent to the target device, and a second test instruction is sent to the spectrum analyzer.
[0098] In some embodiments, based on the central frequency point in the initial list, a second power instruction is sent to the target device, and a second test instruction is sent to the spectrum analyzer. The relevant steps of sending the first power instruction can be referred to above, and will not be repeated here.
[0099] S250, receiving second serial port data fed back by the target device in response to the second power instruction; receiving a second power value fed back by the spectrum analyzer in response to the second test instruction.
[0100] In some embodiments, the second serial port data fed back by the target device in response to the second power instruction is received, and the second power value fed back by the spectrum analyzer in response to the second test instruction is received. That is, calibration data is reacquired from the updated device to be measured (target device).
[0101] S260: Construct a second list based on the first list, the second serial port data, and the second power value.
[0102] In some embodiments, an empty list list2 (second list) is created to store the calibration data obtained after the precise calibration. The precise calibration value is calculated by the following formula and added to list2:
[0103] Initial calibration data - (spectrum analyzer power value - equipment uss power value) / 2) = y
[0104] That is, add y to list2.
[0105] The principle is:
[0106] By calculating the difference between the spectrum analyzer power value and the device USS power value and taking half of it, a half value of the corrected deviation can be obtained.
[0107] Subtracting half of this corrected bias from the initial calibration data yields y that is closer to the true value measured by the spectrum analyzer.
[0108] The purpose of the above formula is to reduce the gap between the device measurement value and the spectrum analyzer measurement value by adjusting the initial calibration data, thereby improving the calibration accuracy of the device. It is used to ensure that the power value of each inaccurate center frequency point is more accurate after calibration. In addition, for the originally accurate center frequency point, the deviation will become larger when using this formula. Therefore, in the present disclosure, the second preset algorithm will be used to replace the data that meets the requirements in the three lists.
[0109] S270: Based on the second list and the third list, update the first list by using a second preset algorithm.
[0110] In some embodiments, list1 is used as a reference, and according to the subscripts in the index list list3, the values of list2 that meet the requirements are used to overwrite the values of list1 with the corresponding subscripts.
[0111] Specifically, iterate over the subscript array and replace:
[0112] Use for i in list3: to traverse each subscript in the list3 array.
[0113] Inside the loop body, the replacement operation list1[int(i)]=list2[int(i)] is executed, that is, the value of the element with subscript i in the list2 array is assigned to the corresponding position in the list1 array.
[0114] The following is an example:
[0115] Assume that list1, list2, and list3 are as follows:
[0116] list1=[26.679,26.865,27.476,27.357,27.019,26.696,26.562,25.614,24.575];
[0117] list2=[26.495,26.691,26.837,26.733,26.443,26.249,25.964,24.99,24.061];
[0118] list3 = [2,3,4];
[0119] Based on the set list3 subscript array, perform the following operations:
[0120] Replace the element with subscript 2 in list1 (27.476) with the element with subscript 2 in list2 (26.837);
[0121] Replace the element with subscript 3 in list1 (27.357) with the element with subscript 3 in list2 (26.733);
[0122] Replace the element with subscript 4 in list1 (27.019) with the element with subscript 4 in list2 (26.443);
[0123] After the above replacement operation, the list1 array is:
[0124] [26.679,26.865,26.837,26.733,26.443,26.696,26.562,25.614,24.575].
[0125] Furthermore, according to the calibration file provided by the chip manufacturer, the frequency bands required for the 5-42 MHz transmission signal calibration are 5.1, 10, 15…41.9. The calibration is to read the power value corresponding to the corresponding frequency point and write it into the device.
[0126] However, if only the power at the corresponding point is read for calibration, the following two situations may occur in actual applications:
[0127] 1. Continuously reading and writing, there will be some frequency points where the difference cannot be controlled within 0.8;
[0128] Second, if only a few frequency points are inaccurate, multiple readings will waste a lot of time.
[0129] Therefore, in the present disclosure, the following methods can be adopted to perform efficient calibration:
[0130] After many experiments, it can be found that individual abnormal frequency points (inaccurate frequency points) can constitute a calibration curve. Calibration of different frequency points will affect other values on this curve. Therefore, the change of different frequency points cannot be too large to prevent the impact on other frequency points, nor can it be too small to prevent no effect (the reason why the threshold is preferably set to 0.6). During verification, if the power value of the 5.8 frequency point is found to be inaccurate, the values of 5.1 and 10 can be modified to complete the change of the 5.8 value. If there are multiple frequency points that need to be changed in this interval, the value can be changed by inserting frequency points in the interval of 5.1 and 10. Based on the above theory, each of the verified values can be placed in a corresponding interval. For example, 22 belongs to the interval of 20 and 25. If 22 is found to be inaccurate during verification, it will be matched to the subscripts of 20 and 25, and only the power value of the corresponding subscript point will be changed. Through this method, the efficiency and accuracy of calibration can be greatly improved.
[0131] S280: Write the updated first list into the device to be measured.
[0132] In some embodiments, the power values in the updated first list are written into the test board of the device to be measured (target device) to complete the precise calibration operation.
[0133] According to the embodiments of the present disclosure, the following technical effects are achieved:
[0134] When processing serial port data, a list is used as a new buffer to ensure the integrity and reliability of the data while avoiding blocking the main program and improving the concurrent performance of the program;
[0135] Through precise calibration algorithm, the difference between the calibrated spectrum analyzer and the device USS is kept below ±0.6, which greatly improves the calibration accuracy.
[0136] It solves the problems of excessive human resources consumption and complicated calibration and testing steps in the existing cable calibration technology, and greatly improves the calibration efficiency.
[0137] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0138] The above is an introduction to the method embodiment. The following is a further explanation of the scheme described in this application through an apparatus embodiment.
[0139] Figure 4 A block diagram 400 of a Cable calibration device according to an embodiment of the present application is shown. Figure 4 Shown include:
[0140] The first transmitting module 410 is used to send a first power instruction to the device to be measured based on the central frequency point in the initial list;
[0141] The first receiving module 420 is used to receive the device to be measured, and in response to the serial port data fed back by the first power instruction, set the measurement parameters of the spectrum analyzer corresponding to the current center frequency point; receive the first power value obtained by the spectrum analyzer through the set measurement parameters; and construct a first list based on the first power value; write the first power value corresponding to the current center frequency point into the device to be measured to obtain the target device;
[0142] The calculation module 430 is used to operate the spectrum analyzer and the serial port of the device under test respectively according to the dictionary constructed by the test point, span data and power bandwidth through the first preset algorithm, process the spectrum analyzer data and the serial port data, and construct a third list for storing the center frequency points that do not meet the preset requirements;
[0143] A second transmitting module 440 is used to send a second power instruction to the target device and a second test instruction to the spectrum analyzer based on the central frequency point in the initial list;
[0144] The second receiving module 450 is used to receive the second serial port data fed back by the target device in response to the second power instruction; and receive the second power value fed back by the spectrum analyzer in response to the second test instruction;
[0145] A construction module 460, configured to construct a second list based on the first list, the second serial port data and the second power value;
[0146] An updating module 470, configured to update the first list based on the second list and the third list by a second preset algorithm;
[0147] The input module 480 is configured to write the updated first list into the device to be measured.
[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0149] Figure 5 A schematic diagram of the structure of a terminal device or server suitable for implementing an embodiment of the present application is shown.
[0150] like Figure 5 As shown, the terminal device or server includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the terminal device or server are also stored. CPU501, ROM 502 and RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0151] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0152] In particular, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present application are executed.
[0153] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0154] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the aforementioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0155] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0156] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application.
[0157] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.
Claims
1. A Cable calibration method, It is characterized in that include: Based on the central frequency point in the initial list, sending a first power instruction to the device to be measured; Receive the device to be measured, and in response to the serial port data fed back by the first power instruction, set the measurement parameters of the spectrum analyzer corresponding to the current center frequency point; receive the first power value obtained by the spectrum analyzer through the set measurement parameters; and construct a first list based on the first power value; Writing a first power value corresponding to the current center frequency point into the device to be measured to obtain a target device; Through a first preset algorithm, according to a dictionary constructed by test points, span data and power bandwidth, respectively operate a spectrum analyzer and a serial port of the device under test, process the spectrum analyzer data and the serial port data, and construct a third list for storing center frequency points that do not meet preset requirements; Based on the central frequency point in the initial list, sending a second power instruction to the target device and sending a second test instruction to the spectrum analyzer; receiving the second serial port data fed back by the target device in response to the second power instruction; receiving the second power value fed back by the spectrum analyzer in response to the second test instruction; constructing a second list based on the first list, the second serial port data and the second power value; Based on the second list and the third list, updating the first list by a second preset algorithm; The updated first list is written into the device to be measured.
2. The method according to claim 1, It is characterized in that The initial list includes: An initial list is constructed based on a predefined configuration file; the initial list includes a central frequency point of a power value to be measured.
3. The method according to claim 2, It is characterized in that The serial port data includes the device uss power value.
4. The method according to claim 3, It is characterized in that The first preset algorithm is used to operate the spectrum analyzer and the serial port of the device under test respectively according to the dictionary constructed by the test point, span data and power bandwidth, and the spectrum analyzer data and the serial port data are processed to construct a third list for storing the center frequency points that do not meet the preset requirements, including: Calculate the difference between the power value of the spectrum analyzer and the device uss power value in the serial port data; If the difference exceeds a preset threshold, the subscript of the center frequency point corresponding to the current power value is added to the third list.
5. The method according to claim 4, It is characterized in that The constructing the second list based on the first list, the second serial port data and the second power value comprises: Calculate the difference between the second power value and the device uss power value in the second serial port data; Halving the difference to obtain a half value of the corrected deviation; Calculate the difference between the first power value in the first list and the half value to obtain a target value; Based on the target value, a second list is constructed.
6. The method according to claim 5, It is characterized in that The updating of the first list based on the second list and the third list by using a second preset algorithm includes: Using the third list as index subscript; Overwrite the values in the second list that meet the index criteria into the first list to complete the update of the first list.
7. The method according to claim 6, It is characterized in that Also includes: Read the configuration file into a dictionary form; The spectrum analyzer is configured with measurement parameters by reading a configuration file in a dictionary form.
8. A Cable calibration device, It is characterized in that include: A first transmitting module, used for sending a first power instruction to the device to be measured based on the central frequency point in the initial list; A first receiving module is used to receive the device to be measured, and in response to the serial port data fed back by the first power instruction, set the measurement parameters of the spectrum analyzer corresponding to the current center frequency point; receive the first power value obtained by the spectrum analyzer through the set measurement parameters; and construct a first list based on the first power value; Writing a first power value corresponding to the current center frequency point into the device to be measured to obtain a target device; A calculation module, used to operate the spectrum analyzer and the serial port of the device under test respectively according to a dictionary constructed by test points, span data and power bandwidth through a first preset algorithm, process the spectrum analyzer data and the serial port data, and construct a third list of center frequency points that do not meet the preset requirements; A second transmitting module is used to send a second power instruction to the target device and a second test instruction to the spectrum analyzer based on the central frequency point in the initial list; A second receiving module is used to receive the second serial port data fed back by the target device in response to the second power instruction; and receive the second power value fed back by the spectrum analyzer in response to the second test instruction; A construction module, configured to construct a second list based on the first list, the second serial port data and the second power value; An updating module, configured to update the first list based on the second list and the third list by a second preset algorithm; The input module is used to write the updated first list into the device to be measured.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory. It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
