Trunking capacity calculation method
Through the automated trough capacity calculation method, the problems of long design cycle and low accuracy caused by manual verification are solved, and fast and accurate trough design is achieved, which improves work efficiency.
Patent Information
- Application Number
- CN202510271417.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-08
- Publication Date
- 2025-06-24
AI Technical Summary
In the prior art, railway vehicle duct design relies on manual verification, and the data of each cable leads to a long period and low accuracy.
It provides a method for calculating the capacity of the trench. By importing the cable data of the whole vehicle, extracting the starting point and end point of each cable, counting the number of cables in the trench interval, matching the cable outer diameter, and calculating the interval with the largest capacity, and finally drawing a section diagram.
It greatly improves work efficiency, shortens the design cycle, and increases the accuracy rate to 100%, which is more than 90% faster than manual drawing methods.
Smart Images

Figure CN120197241A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of rail transit, and particularly relates to a method for calculating the capacity of a cable trough. Background Art
[0002] At present, the process of designing the cable trough of railway vehicles is as follows: 1) Design based on the experience of previous products of the same type to obtain a rough cable trough frame; 2) Manually screen, summarize and count the types and quantities of cables in the data table; 3) Query the technical specification of each cable to obtain the outer diameter of the cable; 4) According to the types and quantities of cables obtained in step 2), manually draw the circular cross-section of each cable in the cable trough frame; 5) Judge whether the cable trough meets the usage requirements. The whole process relies entirely on manual verification of each cable. The data table has a large amount of information, resulting in a long cycle and low accuracy. Therefore, there is an urgent need to invent a method for quickly calculating the capacity of the cable trough to improve work efficiency. Summary of the Invention
[0003] The present invention solves the problems of long cycle and low accuracy caused by manual verification of each cable and large amount of information in the data table by providing a method for calculating the capacity of a cable trough.
[0004] The present invention is realized by the following technical solutions:
[0005] A method for calculating the capacity of a cable trough includes the following steps:
[0006] Step 1: Import and read the cable data of the whole vehicle line list;
[0007] Import the data table file, read the line number where the data table header is located, the total number of rows in the worksheet, read the harness number, quantity, material code, outlet, and the column number where the cable trough is located;
[0008] Step 2: Extract the starting point and ending point of each cable in the cable trough:
[0009] Set the name of the cable trough to be counted as xc_name = [RRA, RRB, RRC,...], and extract the starting point and ending point of each cable passing through the xc_name cable trough;
[0010] According to the set outlet expression, extract the numerical part, and set the smaller numerical part of the outlet as the starting point and the larger one as the ending point;
[0011] Step 3: Count the material code, the minimum value of the starting point, and the maximum value of the ending point of all cables in each xc_name cable trough;
[0012] For each cable trough, generate a two-dimensional data structure, whose row is the material code and whose column is the cable trough name. The initial value of the two-dimensional data structure is 0. Divide the cable trough into several equally spaced intervals for counting the number of cables passing through the interval;
[0013] Step 4: Count the number of all cables in each cable trough interval of xc_name;
[0014] Traverse the vehicle wiring list, read the material code, cable trough, starting point, and ending point of each line. If xc_name contains the cable trough name, then increment by 1 the value between the starting point and the ending point of the material code in the two-dimensional data structure of this cable trough to obtain the updated two-dimensional data structure;
[0015] Step 5: Match the outer diameter of each cable in each cable trough;
[0016] Summarize the material codes and outer diameters of the existing cables, save them as an array, and use it to match the outer diameter of each cable in each cable trough of xc_name;
[0017] Step 6: Calculate the interval with the largest capacity in each cable trough;
[0018] Multiply the number of cables of each material code in each interval by the outer diameter, calculate the sum of the outer diameters of the cables of all material codes, and select the cable material code, quantity, and outer diameter of the interval with the largest value and save them as an array max_interval for drawing the cross-sectional view;
[0019] Step 7: Input the width and height of each cable trough;
[0020] Set up a pop-up window, manually input the width and height of each cable trough, and save them to the array after clicking OK;
[0021] Step 8: Draw the cross-sectional view of each cable trough;
[0022] Let the width of the s-th cable trough be w, the height be h, the starting coordinates of the cable trough be init_x, init_y, the width already used by each layer of cables in the cable trough be sp, the vertical coordinate increment be pst, the initial values of both sp and pst are 0, and the initial value of per_wd is [0];
[0023] Traverse max_interval. For the x-th cable, let its quantity be n x and the outer diameter be d x . If n x is not 0, then the number of cables that can be placed in the available width of the current layer is
[0024] num_sp = int((w - sp) / d x )
[0025] where int() is used for floor division;
[0026] (1) If num < n x, then the available width of the current layer cannot accommodate all the cables of type x. The number of remaining cables after placing the cables on this layer is:
[0027] num_residue = n x -num_sp
[0028] The number of cables that can be placed on each layer is:
[0029] num_per = int(w / d x )
[0030] The number of layers that the remaining cables can be placed on is:
[0031] num_md = int(num_residue / num_per)
[0032] The number of cables that can be placed on the topmost layer is
[0033] num_upper = num_residue - num_md * num_per
[0034] Start drawing:
[0035] A. First, draw the cables on this layer. Traverse num_sp. The center coordinates of the y-th cable are
[0036] per_x = init_x + sp + (y - 0.5) * d x
[0037] per_y = init_y + pst + d x / 2
[0038] B. Update the data: Add d x to per_wd, and pst = pst + max(per_wd).
[0039] C. Then, draw the cables on the middle layers. Traverse num_md. The vertical center coordinate of the k-th layer of cables is
[0040] per_y = init_y + (k + 0.5) * d x + pst
[0041] For each layer, traverse num_per. The horizontal center coordinate of the z-th cable is
[0042] per_x = init_x + (z + 0.5) * d x
[0043] D. Update the data: per_wd = d x , sp = num_upper * d x, pst = pst + num_md * d x .
[0044] E. Finally, draw the top - layer cable. The ordinate of the cable center is
[0045] per_y = init_y + k * d x + pst
[0046] Traverse num_upper. The abscissa of the center of the p - th cable is
[0047] per_x = init_x + (p + 0.5) * d x
[0048] (2) If num ≥ n x , then the available width of the current layer can accommodate all the x - type cables. The ordinate of the cable center is
[0049] per_y = init_y + 0.5 * d x + pst
[0050] Traverse n x , the abscissa of the center of the q - th cable is
[0051] per_x = init_x + sp + (p + 0.5) * d x
[0052] Update data: sp = sp + n x * d x , add d x to per_wd;
[0053] Step 9: Save and export the file;
[0054] Output the CAD drawing and provide the calculation results.
[0055] Compared with the manual drawing method, the manual drawing method takes 4 hours. Through the present invention, the CAD file can be drawn in 2 - 3 minutes, the work efficiency is increased by more than 90%, and the accuracy rate is also increased to 100%. Brief Description of the Drawings
[0056] Figure 1 Cross - sectional view of the cable tray drawing;
[0057] Figure 2 Flow chart of the present invention. Detailed Embodiment
[0058] As Figure 2 shown, the present invention is a method for calculating the capacity of a cable tray, including the following steps:
[0059] 1. Import the data table file, read the line number where the data table header is located, the total number of rows in the worksheet, read the harness number, quantity, material code, outlet, and the column number where the wire duct is located. The data representation is shown in Table 1.
[0060]
[0061] Table 1 Partial data of the data table
[0062] 2. Assume that the name of the wire duct to be counted is xc_name = [RRA, RRB, RRC,...], and extract the starting point and ending point of each cable passing through the xc_name wire duct.
[0063] According to the set outlet expression, extract the numerical part. For example, the numerical part of R1 is 1. Set the smaller numerical part of the outlet as the starting point and the larger one as the ending point.
[0064] 3. Count the material code, the minimum value of the starting point, and the maximum value of the ending point of all cables in each xc_name wire duct.
[0065] For each wire duct, generate a two-dimensional data structure, where the rows are the material codes and the columns are the wire duct names, and the initial value of the two-dimensional data structure is 0. Divide the wire duct into several equally spaced intervals for counting the number of cables passing through that interval.
[0066] For example, the material codes of the cables passing through the wire duct RRA are 123456789, 132456789, 321456789, the minimum value of the outlet numerical part is 0, the maximum value is 18, and the wire duct spacing is set to 1. The generated two-dimensional data structure is shown in Table 2.
[0067] 132456789 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 321456789 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[0068] Table 2 Schematic diagram of the two-dimensional data structure
[0069] 4. Count the number of all cables in each xc_name wire duct interval.
[0070] Traverse the vehicle wiring harness table, read the material code, wire duct, starting point, and ending point of each row. If xc_name contains the wire duct name, then increment the value between the starting point and the ending point of the material code in the two-dimensional data structure of that wire duct by 1.
[0071] For example, for the 10th row, the wire duct name is RRA, the material code is 123456789, the starting point is 3, and the ending point is 10. RRA belongs to xc_name, and the interval from the starting point to the ending point where 123456789 appears once, increment the value in the RRA data structure by 1. The updated two-dimensional data structure is shown in Table 3.
[0072] 132456789 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 321456789 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[0073] The updated two-dimensional data structure in Table 3
[0074] 5. Summarize the material codes and outer diameters of the existing cables, save them as an array, and use it to match the outer diameters of each cable in each cable trough of xc_name.
[0075] 6. Calculate the interval with the largest capacity for each cable trough. Multiply the number of cables with each material code in each interval by the outer diameter, calculate the sum of the outer diameters of the cables with all material codes, and save the cable material codes, quantities, and outer diameters of the interval with the largest value as an array max_interval for drawing the cross-sectional view.
[0076] 7. Set up a pop-up window, manually input the width and height of each cable trough, and save them into an array after clicking OK.
[0077] 8. Draw the cross-sectional view of each cable trough. Let the width of the s-th cable trough be w, the height be h, the starting coordinates of the cable trough be init_x and init_y, the width already used by each layer of cables in the cable trough be sp, the vertical coordinate increment be pst, and the array of wire diameters for each layer be per_wd. The initial values of sp and pst are both 0, and the initial value of per_wd is [0].
[0078] Traverse max_interval. For the x-th cable, let its quantity be n x and the outer diameter be d x . If n x is not 0, then the number of cables that can be placed in the available width of the current layer is
[0079] num_sp = int((w - sp) / d x )
[0080] where int() is used for floor division.
[0081] (1) If num < n x , then all the x-th cables cannot be placed in the available width of the current layer. The number of remaining cables after removing the cables placed in this layer is:
[0082] num_residue = n x - num_sp
[0083] The number of cables that can be placed in each layer is:
[0084] num_per = int(w / d x )
[0085] The number of layers that the remaining cables can be placed in is:
[0086] num_md = int(num_residue / num_per)
[0087] The number of cables that can be placed on the top layer is
[0088] num_upper = num_residue - num_md * num_per
[0089] Start drawing:
[0090] A. First, draw the cables on this layer. Traverse num_sp. The center coordinates of the y-th cable are
[0091] per_x = init_x + sp + (y - 0.5) * d x
[0092] per_y = init_y + pst + d x / 2
[0093] B. Update the data: Add d x to per_wd, and pst = pst + max(per_wd).
[0094] C. Then, draw the cables on the middle layer. Traverse num_md. The vertical center coordinate of the k-th cable is
[0095] per_y = init_y + (k + 0.5) * d x + pst
[0096] For each layer, traverse num_per. The horizontal center coordinate of the z-th cable is
[0097] per_x = init_x + (z + 0.5) * d x
[0098] D. Update the data: per_wd = d x , sp = num_upper * d x , pst = pst + num_md * d x .
[0099] E. Finally, draw the top-layer cables. The vertical center coordinate of the cable is
[0100] per_y = init_y + k * d x + pst
[0101] Traverse num_upper. The horizontal center coordinate of the p-th cable is
[0102] per_x = init_x + (p + 0.5) * d x
[0103] (2) If num ≥ n x, the available width of the current layer can accommodate all the cables of type x. The vertical coordinate of the center of the cable is
[0104] per_y = init_y + 0.5 * d x + pst
[0105] Traverse n x , the horizontal coordinate of the center of the q-th cable is
[0106] per_x = init_x + sp + (p + 0.5) * d x
[0107] Update the data: sp = sp + n x * d x , add d x to per_wd.
[0108] The drawing effect of the cross-sectional view is as Figure 1 shown.
Claims
1. A method for calculating the capacity of a cable trough, characterized in that: The following steps are involved: Step 1: Import and read the vehicle cable list data; Import the data table file, read the row number of the data table header, the total number of rows in the worksheet, and read the column number of the harness number, quantity, material code, exit, and wire trough; Step 2: Extract the starting point and end point of each cable trough; Assume the name of the cable duct to be counted is xc_name = [RRA, RRB, RRC, ...], extract the starting point and end point of each cable passing through the xc_name cable duct; According to the set export expression, extract the numerical part, set the smaller export numerical part as the starting point and the larger one as the end point; Step 3: Count the material codes of all cables in each cable trough of xc_name, the minimum value of the starting point, and the maximum value of the end point; For each cable duct, a two-dimensional data structure is generated, whose rows are material codes and columns are cable duct names. The initial value of the two-dimensional data structure is 0, and the cable duct is subdivided into several equally spaced intervals to count the number of cables passing through the interval. Step 4: Count the number of all cables in each cable trough section of xc_name; Traverse the vehicle line table, read the material code, line slot, start point and end point of each row, if xc_name contains the line slot name, then add 1 to the value between the start point and end point of the material code in the two-dimensional data structure of the line slot to obtain the updated two-dimensional data structure; Step 5: Match the outer diameter of each cable in each cable trough; Summarize the material codes and outer diameters of existing cables and save them as an array to match the outer diameter of each cable in each cable trough of xc_name; Step 6: Calculate the interval with the maximum capacity of each cable trough; Multiply the number of cables of each material code in each interval by the outer diameter, calculate the sum of the outer diameters of cables of all material codes, select the cable material code, quantity, and outer diameter of the interval with the largest value, and save them as the array max_interval for drawing the cross-section diagram; Step 7: Enter the width and height of each wire trough; Set up a pop-up window, manually enter the width and height of each wire trough, and click OK to save it to the array; Step 8: Draw a cross-sectional view of each cable duct; Step 9: Save and export the file; Output CAD drawings and provide calculation results.
2. A method for calculating the capacity of a cable trough according to claim 1, characterized in that: Step 8 The specific steps for drawing the cross-section of each wire trough are: Assume that the width of the sth cable trough is w, the height is h, the starting coordinates of the cable trough are init_x, init_y, the used width of each layer of cables in the cable trough is sp, the vertical coordinate increment is pst, the array of wire diameters of each layer is per_wd, the initial values of sp and pst are both 0, and the initial value of per_wd is [0]; Traverse max_interval, for the xth type of cable, set its number to n x , outer diameter is d x , if n x If it is not 0, the number of cables that can be stored in the available width of the current layer is num_sp=int((w-sp) / d x ) In the formula, int() is used to round down; (1) If num <n x , then the available width of the current layer cannot accommodate all the x-th cables. Excluding the cables placed on this layer, the number of remaining cables is: num_residue=n x -num_sp The number of cables that can be placed on each layer is: num_per=int(w / d x ) The number of layers in which the remaining cables can be placed is: num_md=int(num_residue / num_per) The number of cables that can be placed on the top layer is num_upper=num_residue-num_md*num_per Start drawing: A. Draw the cables of this layer first, traverse num_sp, and the center coordinates of the yth cable are per_x=init_x+sp+(y-0.5)*d x per_y=init_y+pst+d x / 2 B. Update data: Change d x Added to per_wd, pst=pst+max(per_wd). C. Draw the middle layer cables again, traverse num_md, and the vertical coordinate of the center of the k-th layer cable circle is per_y=init_y+(k+0.5)*d x +pst For each layer, traverse num_per, the horizontal coordinate of the center of the z-th cable is per_x=init_x+(z+0.5)*d x D. Update data: per_wd = d x , sp = num_upper*d x , pst=pst+num_md*d x . E. Finally, draw the top layer of cables, and the vertical coordinate of the cable center is per_y=init_y+k*d x +pst Traversing num_upper, the horizontal coordinate of the center of the pth cable is per_x=init_x+(p+0.5)*d x (2) If num ≥ n x , then the available width of the current layer can accommodate all x-type cables, and the vertical coordinate of the cable center is per_y=init_y+0.5*d x +pst Traversal n x , the horizontal coordinate of the center of the qth cable is per_x=init_x+sp+(p+0.5)*d x Update data: sp = sp + n x *d x , d x Added to per_wd.