Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1 and 2, as shown in the drawings, an embodiment of the present invention provides a synchronous loading control method of a PTC driver, where the synchronous loading control method of the PTC driver is applied to an interposer 10, and the interposer 10 is simultaneously connected with a plurality of drivers 20 to realize transmission of data information, and meanwhile, the interposer is also connected with a loader sending terminal 30 to realize transmission of data information, and the loader sending terminal 30 is a terminal device for sending a driver segment to the interposer, such as a desktop computer, a notebook computer, a tablet computer or a mobile phone; the driver 20 is a terminal device for loading the driver segments, such as a PTC driver; the patch panel 10 is a terminal device, such as a circuit control board having an MCU chip and a plurality of connection ports, for connecting with the loader sending terminal 30 and the drivers 20 to synchronously load the received driver segments to the respective drivers 20. As shown in FIG. 1, the method includes steps S110 to S150.
S110, configuring corresponding port connection resources according to the connected drivers and recording and obtaining port resource information.
And configuring corresponding port connection resources according to the connected drivers and recording and obtaining port resource information. The adapter plate is provided with a plurality of connection ports, each connection port can be correspondingly connected with one driver, and when the driver is connected to the adapter plate, the adapter plate can configure port connection resources for the connection ports connected with the driver according to the connected drivers, and correspondingly record the resource information configured by the connection ports to obtain port resource information. The adapter plate is pre-configured with corresponding connection resources, and only connection ports connected with the driver can be allocated to the adapter plate in order to realize efficient and balanced use of the connection resources. The connection resources comprise a buffer space, port channel bandwidth and the like, and the connection ports correspondingly output the driver program segments to the driver through the allocated connection resources, so that the driver program is loaded by the driver.
In a specific embodiment, the configuring the corresponding port connection resource according to the connected driver and recording to obtain the port resource information includes: determining connection port information according to the connection condition of the driver; and distributing preset connection resources to each effective port in the connection port information according to the connection port information so as to realize port connection resource allocation for each effective port.
Specifically, the adapter plate can send connection detection information to the driver, the driver feeds back corresponding receiving feedback information to the adapter plate after receiving the connection detection information, and the adapter plate can determine an effective port connected with the adapter plate in the connection ports and port codes of all the effective ports according to the receiving feedback information fed back by the driver, so that corresponding connection port information is obtained. And then, the adapter plate distributes the connection resources pre-configured in the adapter plate to each effective connection port according to the connection port information so as to realize port connection resource configuration of each effective port.
In a specific embodiment, the allocating, according to the connection port information, a preset connection resource to each valid port in the connection port information includes: calculating the distribution proportion corresponding to the effective port number in the connection port information according to a preset distribution proportion calculation formula; acquiring available connection resources matched with the allocation proportion from the connection resources; and evenly distributing the available connection resources to each effective port according to the number of the effective ports.
Specifically, the allocation ratio corresponding to the number of effective ports may be calculated according to an allocation ratio calculation formula, which may be shown in formula (1):
(1);
wherein x is the number of effective ports, and B is the distribution ratio obtained by corresponding calculation.
And obtaining the matched available connection resources from the connection resources according to the allocation proportion, namely multiplying the total number of each resource item in the preset connection resources by the allocation proportion respectively, so as to obtain the corresponding available connection resources. For example, if the total number of resource items corresponding to the buffer space in the preset connection resources is 10Mb and the allocation ratio is 0.805, the available resource information corresponding to the resource items is calculated to be 10mb×0.805=8.05 Mb. According to the method, the available resource information corresponding to the total number of each resource can be obtained respectively, so that the available connection resource is obtained.
S120, receiving input driving program segments, loading the driving program segments to each driver respectively, and acquiring driving feedback information fed back by each driver.
And receiving an input driver program segment, loading the driver program segment to each driver respectively, and acquiring driving feedback information fed back by each driver. The adapter plate can receive the driver program segments from the loading program sending terminal, one complete driver program file can be split into a plurality of driver program segments, the adapter plate can load the received driver program segments to each driver respectively, in the process of the device of the driver program segments, the drivers also feed back driving feedback information to the adapter plate in real time, the driving feedback information comprises the installation progress information of the driver program segments, and the installation progress information is any percentage value from 0% to 100%.
S130, acquiring corresponding connection adjustment parameters from a connection configuration table according to the driving feedback information.
And acquiring corresponding connection adjustment parameters from a connection configuration table according to the driving feedback information. The connection adjustment parameters corresponding to the driving feedback information can be obtained from the connection configuration table according to the driving feedback information, wherein the connection adjustment parameters are the parameter information for adjusting the port connection resources of each effective port, and the connection resources of each effective port can be allocated and adjusted through the obtained connection adjustment parameters, so that the effective port corresponding to the driver with slower loading of the driver section can be allocated to more connection resources.
In a specific embodiment, the obtaining, according to the driving feedback information, the corresponding connection adjustment parameter from the connection configuration table includes: judging whether the driving feedback information meets a preset loading judgment condition or not; if the driving feedback information meets the loading judgment condition, acquiring a connection adjustment strategy matched with the driving feedback information from a connection configuration table; and calculating to obtain the connection adjustment parameters corresponding to the drivers according to the connection adjustment strategy and the driving feedback information.
Specifically, whether the driving feedback information meets a preset loading judgment condition can be judged, the maximum installation progress and the minimum installation progress in the driving feedback information are obtained, the progress difference value of the maximum installation progress and the minimum installation progress is calculated, and whether the progress difference value is larger than a difference value threshold in the loading judgment condition is judged, so that whether the driving feedback information meets the loading judgment condition is judged. If the progress difference is greater than the difference threshold, judging that the driving feedback information meets the loading judgment condition; if the progress difference is not greater than the difference threshold, it is determined that the driving feedback information does not satisfy the loading determination condition.
If the loading judgment condition is met, a connection adjustment strategy matched with the driving feedback information is obtained from the connection configuration table, and connection adjustment parameters corresponding to all the drivers are obtained through calculation according to the connection adjustment strategy and the driving feedback information.
In a specific embodiment, the obtaining, from the connection configuration table, a connection adjustment policy that matches the driving feedback information includes: calculating corresponding loading difference coefficients according to the driving feedback information; judging whether unallocated connection resources are contained or not to obtain a resource judgment result; and obtaining the matched adjustment strategy from the connection configuration table according to the loading difference coefficient and the resource judgment result as the connection adjustment strategy.
Further, a corresponding loading difference coefficient can be calculated according to the driving feedback information, and the loading difference coefficient can be used for reflecting the difference between the installation progress of the drivers; the larger the difference in the mounting progress of each driver, the larger the corresponding loading difference coefficient. The calculation process of the loading difference coefficient can be represented by the following formula (2):
(2);
wherein z is 1 To drive the difference value between the maximum installation progress and the average installation progress in the feedback information, z 2 To drive the difference between the minimum installation progress and the average installation progress in the feedback information, x is the number ofThe effective port number, e, is the natural logarithmic base number, and C is the calculated loading difference coefficient.
Further, whether unallocated connection resources are contained in the adapter plate is judged, and a resource judgment result is obtained, wherein the resource judgment result is that unallocated connection resources are contained or unallocated connection resources are not contained.
And matching the loading difference coefficient and the resource judgment result with each adjustment strategy contained in the connection configuration table, so as to obtain the adjustment strategy matched with the loading difference coefficient and the resource judgment result as the connection adjustment strategy. The resource judgment result determines the adjustment type, and the loading difference coefficient determines the adjustment proportion and the corresponding adjustment calculation formula.
In a specific embodiment, the calculating, according to the connection adjustment policy and the driving feedback information, the connection adjustment parameter corresponding to each driver includes: if the adjustment type of the connection adjustment strategy is compensation adjustment, determining a corresponding target compensation port according to the driving feedback information and the compensation adjustment proportion in the connection adjustment strategy; calculating compensation coefficients corresponding to the target compensation ports according to a compensation calculation formula in the connection adjustment strategy to serve as the connection adjustment parameters; if the adjustment type of the connection adjustment strategy is balanced adjustment, determining a corresponding target balanced port according to the driving feedback information and the balanced adjustment proportion in the connection adjustment strategy; and calculating an equalization adjustment coefficient corresponding to each target equalization port according to an equalization calculation formula in the connection adjustment strategy to serve as the connection adjustment parameter.
Specifically, if the adjustment type of the connection adjustment policy is compensation adjustment, unallocated connection resources need to be allocated to a part of the effective ports with smaller installation progress in a compensation manner. The corresponding target compensation ports can be determined according to the driving feedback information and the compensation adjustment proportion in the connection adjustment strategy, firstly, the installation progress of each effective port in the driving feedback information is ordered from big to small, the compensation adjustment proportion is multiplied by the number of the effective ports, the obtained values are rounded, a plurality of effective ports which are ordered later are intercepted from the ordering of the effective ports according to the rounded values to serve as the target compensation ports, namely, a plurality of effective ports which are ordered later and equal to the rounded values are used as the target compensation ports which need to be subjected to connection resource compensation.
And calculating compensation coefficients corresponding to the target compensation ports according to the compensation calculation formula, and obtaining the compensation coefficients of the target compensation ports to obtain the connection adjustment parameters. The compensation calculation formula can be represented by a formula (3):
(3);
wherein S is i For the calculated compensation coefficient corresponding to each i-th target compensation port, r i And (3) setting the installation progress information of the ith target compensation port, wherein K is the unallocated connection resource duty ratio, and N is the total number of the target compensation ports.
If the adjustment type of the connection adjustment strategy is balanced adjustment, the connection resources of the part of the effective ports with the larger installation progress are required to be distributed to the part of the effective ports with the smaller installation progress, so that the balanced adjustment of the connection resources of the part of the effective ports with the larger installation progress and the part of the effective ports with the smaller installation progress is realized. Specifically, the corresponding target equalization ports can be determined according to the driving feedback information and the equalization adjustment proportion in the connection adjustment strategy, firstly, the installation progress of each effective port in the driving feedback information is ordered from big to small, the equalization adjustment proportion is multiplied by the number of the effective ports, the obtained values are rounded, a plurality of effective ports with the ordered values are intercepted from the ordering of the effective ports according to the rounded values, and a plurality of effective ports with the ordered values being equal to the rounded values are intercepted, and the plurality of effective ports with the ordered values are jointly used as the target equalization ports. The plurality of effective ports with the front ordering and the rounded values intercepted in the target equalizing ports are surplus effective ports, the plurality of effective ports with the rear ordering and the rounded values intercepted in the target equalizing ports are under-run effective ports, partial connection resources of the surplus effective ports can be distributed to the under-run effective ports, and one surplus effective port corresponds to one under-run effective port.
Specifically, the equalization adjustment coefficients corresponding to the target equalization ports can be calculated according to an equalization calculation formula in the connection adjustment policy, and the equalization adjustment coefficients of the target equalization ports are obtained and combined to obtain the connection adjustment parameters. The equalization calculation formula can be expressed by the formula (4):
(4 );
wherein S is t To adjust the scaling factor of connecting resources from surplus effective ports to corresponding one of the deficiency effective ports, r x Installation progress information r for surplus effective port y And the installation progress information of the underrun effective port corresponding to the surplus effective port. For example, r x Is 0.5, r y Is 0.3, and the corresponding calculated adjustment scaling factor S t And 0.1, namely, 0.1 of the connection resource corresponding to the surplus effective port needs to be adjusted to a corresponding underrun effective port.
140. And adjusting the port connection resources corresponding to the drivers according to the connection adjustment parameters and the port resource information.
And adjusting the port connection resources corresponding to the drivers according to the connection adjustment parameters and the port resource information. Specifically, the port connection resources of each driver can be adjusted according to the connection adjustment parameters and the port resource information which is currently allocated, that is, the connection resources allocated by each driver are subjected to balanced adjustment.
In a specific embodiment, the adjusting the port connection resource corresponding to each driver according to the connection adjustment parameter and the port resource information includes: calculating the resource allocation value in the port resource information according to the connection adjustment parameter to obtain a calculated target allocation value; and adjusting the port connection resources corresponding to the port resource information according to the target allocation value, so that the adjusted port connection resources are matched with the target allocation value.
Specifically, the port connection resources of each driver may be adjusted according to the connection adjustment parameters and the port resource information, that is, the port connection resources allocated in each effective port may be adjusted. Specifically, the resource allocation value in the port resource information can be calculated according to the connection adjustment parameter, and the resource allocation value of each effective port is calculated according to the connection adjustment parameter, so as to obtain the target allocation value of each effective port.
For example, if it is necessary to compensate the port connection resource of a certain target compensation port, the target allocation value of the target compensation port is calculated as S 0 +S i ,S 0 Compensating the original allocated connection resource duty ratio of the port for the target, S i Is the supplementary coefficient calculated according to formula (3).
If the connection resources of one surplus effective port and the corresponding one deficiency effective port in the target balanced ports need to be adjusted, calculating to obtain a target allocation value of the surplus effective port as S 1 ×(1-S t ),S 1 The original allocated connection resource ratio for the surplus effective port, S t A supplementary coefficient calculated according to formula (4); calculating a corresponding target allocation value S of an under-run effective port 2 +S 1 ×S t ,S 2 For the original allocated connection resource ratio of the insufficient effective port, S 1 And the original allocated connection resource duty ratio of the surplus effective port corresponding to the deficiency effective port is determined.
And S150, synchronously loading the driver program segments based on the adjusted port connection resources, and returning to execute the step of acquiring the driving feedback information fed back by each driver.
And synchronously loading the driver program segments based on the adjusted port connection resources, and returning to execute the step of acquiring the driving feedback information fed back by each driver. And after the port resources are adjusted, the loading speed of each driver on the driver segments can be more balanced, and the step of acquiring the driving feedback information fed back by each driver can be returned to be executed in the subsequent loading process, namely, the step S120 is executed until the adapter plate loads all the received driver segments into each driver.
According to the synchronous loading control method of the PTC driver, corresponding port connection resources are configured according to the connected drivers, and port resource information is recorded and obtained; receiving input driver program segments, respectively loading the driver program segments to each driver and acquiring driving feedback information fed back by each driver; acquiring corresponding connection adjustment parameters from the connection configuration table according to the driving feedback information; according to the connection adjustment parameters and the port resource information, adjusting the port connection resources corresponding to each driver; and synchronously loading the driver program segments based on the adjusted port connection resources, and returning to execute the step of acquiring the driving feedback information fed back by each driver. According to the synchronous loading control method of the PTC drivers, the port connection resources can be dynamically adjusted according to the driving feedback information, so that the drivers can synchronously complete loading of the drivers, and the efficiency of loading the drivers with the drivers is improved.
The embodiment of the invention also provides a synchronous loading control device of the PTC driver, which can be arranged in the adapter plate and is used for executing any embodiment of the synchronous loading control method of the PTC driver. Specifically, referring to fig. 3, fig. 3 is a schematic block diagram of a synchronous loading control device of a PTC driver according to an embodiment of the present invention.
As shown in fig. 3, the synchronous loading control device 100 of the PTC driver includes a port resource information acquisition unit 110, a driving feedback information acquisition unit 120, a connection adjustment parameter acquisition unit 130, an adjustment unit 140, and a return execution unit 150.
The port resource information obtaining unit 110 is configured to configure corresponding port connection resources according to the connected drivers and record and obtain port resource information.
The driving feedback information obtaining unit 120 is configured to receive an input driving program segment, load the driving program segment to each driver, and obtain driving feedback information fed back by each driver.
And a connection adjustment parameter obtaining unit 130, configured to obtain a corresponding connection adjustment parameter from the connection configuration table according to the driving feedback information.
And the adjusting unit 140 is configured to adjust the port connection resources corresponding to each driver according to the connection adjustment parameters and the port resource information.
And the return execution unit 150 is configured to perform synchronous loading of the driver segments based on the adjusted port connection resources, and return and execute the step of obtaining the driving feedback information fed back by each driver.
The synchronous loading control device of the PTC driver provided by the embodiment of the invention is applied to the synchronous loading control method of the PTC driver, and corresponding port connection resources are configured according to the connected drivers and port resource information is recorded and obtained; receiving input driver program segments, respectively loading the driver program segments to each driver and acquiring driving feedback information fed back by each driver; acquiring corresponding connection adjustment parameters from the connection configuration table according to the driving feedback information; according to the connection adjustment parameters and the port resource information, adjusting the port connection resources corresponding to each driver; and synchronously loading the driver program segments based on the adjusted port connection resources, and returning to execute the step of acquiring the driving feedback information fed back by each driver. According to the synchronous loading control method of the PTC drivers, the port connection resources can be dynamically adjusted according to the driving feedback information, so that the drivers can synchronously complete loading of the drivers, and the efficiency of loading the drivers with the drivers is improved.
The synchronous loading control device of the PTC driver described above may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 4.
Referring to fig. 4, fig. 4 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device may be an adapter board for performing a synchronous loading control method of the PTC driver to synchronously load the received driver segments to the driver.
Referring to fig. 4, the computer device 500 includes a processor 502, a memory, and a network interface 505, which are connected by a communication bus 501, wherein the memory may include a storage medium 503 and an internal memory 504.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a method of controlling the synchronous loading of PTC drives, wherein the storage medium 503 may be a volatile storage medium or a nonvolatile storage medium.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform the method of synchronous loading control of PTC drives.
The network interface 505 is used for network communication, such as providing for transmission of data information, etc. It will be appreciated by those skilled in the art that the architecture shown in fig. 4 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting of the computer device 500 to which the present inventive arrangements may be implemented, and that a particular computer device 500 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The processor 502 is configured to run a computer program 5032 stored in a memory, so as to implement the corresponding functions in the synchronous loading control method of the PTC driver.
Those skilled in the art will appreciate that the embodiment of the computer device shown in fig. 4 is not limiting of the specific construction of the computer device, and in other embodiments, the computer device may include more or less components than those shown, or certain components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may include only a memory and a processor, and in such embodiments, the structure and function of the memory and the processor are consistent with the embodiment shown in fig. 4, and will not be described again.
It should be appreciated that in an embodiment of the invention, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a volatile or nonvolatile computer readable storage medium. The computer readable storage medium stores a computer program which, when executed by a processor, implements the steps included in the PTC driver synchronous loading control method described above.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units is merely a logical function division, there may be another division manner in actual implementation, or units having the same function may be integrated into one unit, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or part of what contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a computer-readable storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.