Disclosure of Invention
The embodiment of the application provides a method for adjusting communication rate, which aims to solve the problem of adjusting the communication rate of a bus type network according to the operation mode of equipment on the bus type network in time.
Correspondingly, the embodiment of the application also provides a device for adjusting the communication rate, an electronic device and a storage medium, which are used for ensuring the realization and the application of the method.
In order to solve the above problems, an embodiment of the present application discloses a method for adjusting a communication rate, which is applied to a communication rate adjuster in a bus type network, wherein the bus type network further includes an upper computer and at least one lower computer, the upper computer, the lower computer and the communication rate adjuster communicate according to a preset communication rate, the lower computer includes a target lower computer, and the method includes:
When the number of the target lower computers is changed, receiving a rate adjustment signal sent by the upper computer, wherein the rate adjustment signal comprises a target communication rate;
adjusting the preset communication rate to the target communication rate;
acquiring the bit error rate, bit error rate threshold value, stable communication rate and optimized communication rate of the target lower computer;
If the error rate is higher than the error rate threshold, adjusting the preset communication rate to the stable communication rate;
And if the error rate is continuously lower than the error rate threshold value within the preset time, adjusting the preset communication rate to the optimized communication rate.
In an optional embodiment of the present application, the target lower computer has a corresponding device priority, where the device priority is a priority of data transmission in the communication process, and the method further includes:
acquiring the equipment load of the target lower computer;
And adjusting the equipment priority of the target lower computer according to the equipment load.
In an optional embodiment of the present application, the target lower computer has a corresponding device identifier, and the adjusting the device priority of the target lower computer according to the device load includes:
determining a high load area and a normal area in the bus type network according to the equipment identifier and the equipment load;
And increasing the equipment priority of the target lower computer in the high-load area or decreasing the equipment priority of the target lower computer in the normal area.
In an alternative embodiment of the present application, after the acquiring the device load of the target lower computer, the method further includes:
adjusting the bit error rate threshold according to the equipment load to obtain an adjusted bit error rate threshold;
and adjusting the preset communication rate according to the adjusted bit error rate threshold.
In an alternative embodiment of the application, the method further comprises:
acquiring the online state of the target lower computer;
If the offline lower computer exists in the target lower computer, the preset communication rate is reduced, and the reconnection attempt operation is executed on the offline lower computer.
In an alternative embodiment of the application, the method further comprises:
detecting the actual number of the currently running lower computers;
And if the actual number of the currently operated lower computers is larger than the number of the target lower computers, adjusting the preset communication rate according to the actual number.
In an alternative embodiment of the present application, the adjusting the preset communication rate to the target communication rate includes:
Transmitting the rate change signal to the target lower computer, wherein the rate change signal comprises the target communication rate;
receiving a rate receiving signal fed back by the target lower computer;
determining an abnormal lower computer from the target lower computers according to the rate receiving signals;
Resending the rate change signal to the abnormal lower computer;
and sending alarm information aiming at the abnormal lower computer to the upper computer.
The embodiment of the application also discloses a method for adjusting the communication rate, which is applied to an upper computer in a bus type network, wherein the bus type network also comprises a communication rate adjuster and at least one lower computer, the upper computer, the lower computer and the communication rate adjuster communicate according to a preset communication rate, the bus type network is provided with at least two system types, and different system types correspond to different numbers of target lower computers, and the method comprises the following steps:
Receiving a system switching request, wherein the system switching request comprises target system types, and the target system types have corresponding target quantity;
determining the target number of the target lower computers from the lower computers according to the target system type;
Transmitting a switching signal to the lower computer, wherein the switching signal comprises the target system type and the target lower computer so that the target lower computer operates according to the switching signal;
And sending a rate adjusting signal to the communication rate adjuster, so that the communication rate adjuster adjusts the preset communication rate according to a preset rule according to the rate adjusting signal.
In an optional embodiment of the present application, the determining, according to the target system type, the target number of the target lower computers from the lower computers includes:
Acquiring running accumulated time of the lower computer;
and determining the target lower computers with the target quantity from the lower computers according to the running accumulated time and the target system type.
The embodiment of the application also discloses a communication rate adjusting device which is applied to a communication rate adjuster in a bus type network, wherein the bus type network further comprises an upper computer and at least one lower computer, the upper computer, the lower computer and the communication rate adjuster communicate according to a preset communication rate, the lower computer comprises a target lower computer, and the device comprises:
The adjusting signal sending module is used for receiving a rate adjusting signal sent by the upper computer when the number of the target lower computers changes, and the rate adjusting signal comprises a target communication rate;
The first rate adjusting module is used for adjusting the preset communication rate to the target communication rate;
The adjusting parameter acquisition module is used for acquiring the bit error rate, the bit error rate threshold value, the stable communication rate and the optimized communication rate of the target lower computer;
The second rate adjusting module is used for adjusting the preset communication rate to the stable communication rate if the error rate is higher than the error rate threshold;
And the third rate adjusting module is used for adjusting the preset communication rate to the optimized communication rate if the error rate is continuously lower than the error rate threshold value within the preset time.
The embodiment of the application also discloses a device for adjusting the communication rate, which is applied to an upper computer in a bus type network, wherein the bus type network also comprises a communication rate adjuster and at least one lower computer, the upper computer, the lower computer and the communication rate adjuster communicate according to a preset communication rate, the bus type network is provided with at least two system types, different system types correspond to different numbers of target lower computers, and the device comprises:
The system comprises a switching request receiving module, a switching request processing module and a switching request processing module, wherein the switching request receiving module is used for receiving a system switching request, the system switching request comprises target system types, and the target system types have corresponding target quantity;
the target equipment determining module is used for determining the target lower computers with the target quantity from the lower computers according to the target system type;
the switching signal sending module is used for sending a switching signal to the lower computer, wherein the switching signal comprises the target system type and the target lower computer so that the target lower computer operates according to the switching signal;
and the rate adjusting module is used for sending a rate adjusting signal to the communication rate adjuster so that the communication rate adjuster can adjust the preset communication rate according to a preset rule according to the rate adjusting signal.
The embodiment of the application also discloses electronic equipment which comprises a processor and a memory, wherein executable codes are stored on the memory, and when the executable codes are executed, the processor is caused to execute the communication rate adjusting method according to one or more of the embodiments of the application.
Embodiments of the present application also disclose one or more machine readable media having executable code stored thereon that, when executed, cause a processor to perform a method of adjusting communication rate as described in one or more of the embodiments of the present application.
Compared with the prior art, the embodiment of the application has the following advantages:
In the embodiment of the application, when the number of the target lower computers changes, a rate adjusting signal sent by the upper computer is received, the rate adjusting signal comprises a target communication rate, the preset communication rate is adjusted to the target communication rate, the error rate threshold value, the stable communication rate and the optimized communication rate of the target lower computers are obtained, the preset communication rate is adjusted to the stable communication rate if the error rate is higher than the error rate threshold value, and the preset communication rate is adjusted to the optimized communication rate if the error rate is continuously lower than the error rate threshold value within the preset time. When the number of the target lower computers is changed, the preset communication rate is automatically judged and adjusted to the corresponding target communication rate in real time through the communication rate regulator, so that the response sensitivity of the communication rate regulation is effectively improved; furthermore, the communication rate regulator can optimally adjust the preset communication rate to be stable or optimize the communication rate according to the real-time error rate of the bus type network, and the mechanism of the staged self-adaptive regulation ensures the complete receiving and transmitting of equipment data in the bus type network and simultaneously can realize the cooperative optimization between the low-speed stable transmission of a single system and the high-speed communication requirements of multiple systems.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will become more readily apparent, a more particular description of the application will be rendered by reference to the appended drawings and appended detailed description.
Referring to fig. 1, a flowchart of steps of an embodiment of a method for adjusting a communication rate according to the present application includes the following steps:
And step 101, when the number of the target lower computers is changed, receiving a rate adjustment signal sent by the upper computer, wherein the rate adjustment signal comprises a target communication rate.
Referring to fig. 2, a bus network is shown according to an embodiment of a method for adjusting a communication rate of the present application.
The communication rate adjusting method is applied to the communication rate adjuster in the bus type network. The bus type network is the CAN network. The CAN network comprises an upper computer, at least one lower computer and a communication rate regulator, and the upper computer, the lower computer and the communication rate regulator are communicated in the CAN network according to a preset communication rate through communication data. The CAN network CAN have a plurality of system types, and the number of the target lower computers which are required to be operated and are determined according to the current system types corresponds to the number of different target lower computers which are currently operated. The communication data is data communicated between the upper computer, the lower computer and the communication rate regulator through the CAN bus, and in an example, in a case where a single lower computer operates, the preset communication rate may be 20kbps.
In one embodiment, the upper computer may be a touch screen, and the touch screen is used as an industrial control screen, and includes a communication rate regulator and a display panel, and the touch screen may include functions of parameter setting, status, fault information display, and the like. The communication rate adjuster may adjust a specific value of the preset communication rate. The lower computer CAN be a unit system of the multi-system commercial air conditioner unit, the unit system comprises a main board, load equipment such as a compressor, a frequency converter, a bearing and other load equipment is connected through the main board, a plurality of lower computers CAN be arranged on a CAN network, the situation that N lower computers are arranged on the CAN network is shown in fig. 2, and N is a positive integer. And an error rate monitoring module can be further arranged, and each load device is embedded into the error rate monitoring module to monitor the error rate of the load device, so that the load device can feed back the error rate in real time, and the error rate of the load device can be displayed on the touch screen.
In step 101 of this embodiment, the target lower computer is that when the current user switches the system type through the upper computer, the number of target lower computers that need to be operated may be changed, so that a rate adjustment signal sent by the upper computer when switching the system type needs to be received, and the preset communication rate is adjusted to the target communication rate according to the number of target lower computers.
In one embodiment, corresponding target communication rates may be preset corresponding to different target numbers of lower computers. For example, in the case of a single lower computer operation, communication may be performed at a default preset communication rate m0 kbps, in the case of two lower computers operation, communication may be performed at a target communication rate m1 kbps(m1 > m 0), m1 kbps is a maximum communication rate in the case, in the case of three lower computers operation, communication may be performed at a target communication rate m2 kbps(m2>m1), m2 kbps is a maximum communication rate in the case, in the case of four lower computers operation, communication may be performed at a target communication rate m3 kbps(m3>m2), m3 kbps is a maximum communication rate in the case, in the case of N lower computers operation, communication may be performed at a target communication rate m(n-1)kbps(m(n-1)>m(n-2)), m(n-1) kbps is a maximum communication rate in the case, and N is a positive integer.
Step 102, adjusting the preset communication rate to the target communication rate.
In step 102, after receiving the rate adjustment signal, the communication rate adjuster adjusts the preset communication rate to the target communication rate. In one embodiment, the rate adjustment signal increases the predetermined communication rate to the target communication rate when switching from a single system to multiple systems, and decreases the predetermined communication rate to the target communication rate when switching from the single system to the multiple systems.
And 103, acquiring the bit error rate, the bit error rate threshold value, the stable communication rate and the optimized communication rate of the target lower computer.
In step 103, the communication rate regulator monitors the bit error rate of the target lower computer in real time, and determines whether the preset communication rate needs to be further adjusted from the target communication rate to a better communication rate according to the comparison condition of the bit error rate of the target lower computer and the bit error rate threshold value
And 104, if the error rate is higher than the error rate threshold, adjusting the preset communication rate to the stable communication rate.
In step 104, in the case that the bit error rate is higher than the bit error rate threshold, the preset communication rate may be adjusted to a stable communication rate, so that the communication on the bus network is more stable. In one example, in the case where the bit error rate is higher than the bit error rate threshold, the preset communication rate may be reduced to a stable communication rate, so as to avoid communication data transmission errors, communication interruption, and even system failure caused by too high bit error rate.
And step 105, if the bit error rate is continuously lower than the bit error rate threshold value within a preset time, adjusting the preset communication rate to the optimized communication rate.
In step 105, in the case where the bit error rate is continuously below the bit error rate threshold for a predetermined time, the predetermined communication rate may be adjusted to an optimal communication rate to further optimize communication over the bus-based network. Optimal performance of communication is achieved. In one example, the preset communication rate may be increased to an optimal communication rate in the event that the bit error rate continues to be below the bit error rate threshold for a preset time.
In one embodiment, the communication rate adjustment process of steps 101 to 105 may be briefly represented as three stages shown in table 1. When the number of target lower computers is increased due to the switching of the system types, the communication rate can be increased by delta m1, the communication rate can rapidly respond to the switching change of the system types through larger adjustment amplitude, the preset communication rate can be reduced by delta m2 under the condition that the error rate is higher than the error rate threshold value, communication abnormality caused by too high error rate can be avoided through smaller adjustment amplitude, and the preset communication rate can be further finely adjusted by delta m3 under the condition that the error rate is continuously lower than the error rate threshold value in preset time, and communication with optimal performance can be realized through extremely small adjustment amplitude.
TABLE 1 communication Rate segment adjustment strategy
| System status | Adjusting policies | Adjusting amplitude |
| Target lower computer number increase | Increase of communication rate Deltam 1 | Large adjustment amplitude |
| Bit error rate > preset bit error rate threshold | Reducing communication rate Deltam 2 | Smaller adjustment amplitude |
| Long-term bit error rate is extremely low | Further fine tuning of the rate Δm3 | Very small adjustment amplitude |
The embodiment of the application does not limit the specific values of the target communication rate, the stable communication rate, the optimized communication rate and other data in the communication rate adjusting process corresponding to each system type, and can be set by a person skilled in the art according to actual requirements.
In one embodiment, after the communication rate adjustment is completed, a flag indicating that the communication rate adjustment is completed may be displayed on the upper computer touch screen.
When the number of the target lower computers is changed, the preset communication rate is automatically judged and adjusted to the corresponding target communication rate in real time through the communication rate regulator, so that the response sensitivity of the communication rate regulation is effectively improved; furthermore, the communication rate regulator can optimally adjust the preset communication rate to be stable or optimize the communication rate according to the real-time error rate of the bus type network, and the mechanism of the staged self-adaptive regulation ensures the complete receiving and transmitting of equipment data in the bus type network and simultaneously can realize the cooperative optimization between the low-speed stable transmission of a single system and the high-speed communication requirements of multiple systems.
In an optional embodiment of the present application, the target lower computer has a corresponding device priority, where the device priority is a priority of data transmission in the communication process, and the method further includes:
acquiring the equipment load of the target lower computer;
And adjusting the equipment priority of the target lower computer according to the equipment load.
In this embodiment, devices on the bus type network have different device priorities. In an example, the device priority of the upper computer may be the highest priority, so as to ensure that the control command of the upper computer can be transmitted preferentially and avoid interference by the low priority message of other devices, the device priority of other devices may be determined according to the device ID (Identifier) address, for example, the larger the ID address, the higher the device priority may be set, and in addition, some device priority determinations may be implemented through program software, for example, limiting the remote control priority to be higher than the local control. Those skilled in the art may set the device priority of the devices on the bus network according to actual needs, and the embodiment of the present application does not impose any limitation on the device priority of a specific device.
In the embodiment of the application, the equipment load of the target lower computer can be obtained in real time, and the equipment priority of the target lower computer is adjusted according to the equipment load of the target lower computer, for example, the equipment priority of the high-load target lower computer is improved, so that the data of the high-load target lower computer is transmitted preferentially, and the error rate of the data is reduced. In one embodiment, the priority transmission of the data of the high-load target lower computer can be achieved by increasing the data transmission frequency of the high-load target lower computer or reducing the load of other devices.
According to the embodiment of the application, the equipment load of the target lower computer is obtained, and the equipment priority of the target lower computer is adjusted according to the equipment load, so that the error rate of the target lower computer with high load is effectively reduced, and the communication quality is ensured.
In an optional embodiment of the present application, the target lower computer has a corresponding device identifier, and the adjusting the device priority of the target lower computer according to the device load includes:
determining a high load area and a normal area in the bus type network according to the equipment identifier and the equipment load;
And increasing the equipment priority of the target lower computer in the high-load area or decreasing the equipment priority of the target lower computer in the normal area.
In this embodiment, since each target lower computer will report its own data transmission amount and device identifier to the upper computer in real time, after the upper computer gathers, the load distribution on the bus can be analyzed according to the device identifier and the device load of the target lower computer. Specifically, it can be judged which device identifier has more data transmission amount, and the target lower computer corresponding to the device identifier is the high-load target lower computer, so that the data transmission amount is classified and analyzed according to the device ID and the data flow direction, and the high-load area and the normal area in the bus network are identified. The priority transmission of the data of the high-load target lower computer is realized by improving the equipment priority of the target lower computer in the high-load area or reducing the equipment priority of the target lower computer in the normal area.
In one embodiment, when the upper computer is a touch screen, the data transmission amount and the corresponding equipment identifier reported by the target lower computer can be displayed in real time.
According to the embodiment of the application, the high-load area and the normal area are identified according to the equipment identifier and the equipment load, and the equipment priority of the target lower computer in the high-load area and the normal area is adjusted, so that the priority transmission of the data of the target lower computer with high load is ensured, and the communication data congestion and delay are avoided.
In an alternative embodiment of the present application, after the acquiring the device load of the target lower computer, the method further includes:
adjusting the bit error rate threshold according to the equipment load to obtain an adjusted bit error rate threshold;
and adjusting the preset communication rate according to the adjusted bit error rate threshold.
In this embodiment, the bit error rate threshold may be dynamically adjusted according to the working state of the device and the environmental change. For example, the bit error rate threshold can be adjusted according to the equipment load, and the bit error rate threshold can be properly reduced to obtain the adjusted bit error rate threshold under the condition of higher equipment load or larger environmental interference, and then the preset communication rate is adjusted according to the adjusted bit error rate threshold.
The embodiment of the application can adjust the error rate threshold according to the equipment load, thereby further adjusting the preset communication rate according to the adjusted error rate threshold. After the error rate threshold is reduced, the adjustment of the preset communication rate is triggered more easily, the sensitivity of the communication rate adjustment is improved, and the system can flexibly face the conditions of higher equipment load or larger environmental interference.
In an alternative embodiment of the application, the method further comprises:
acquiring the online state of the target lower computer;
If the offline lower computer exists in the target lower computer, the preset communication rate is reduced, and the reconnection attempt operation is executed on the offline lower computer.
In the embodiment of the application, the communication rate regulator can also continuously scan the equipment identifier on the bus to monitor data and judge the on-line state of the target lower computer. The online status may include online and offline. If off-line lower computers exist in the target lower computers, namely the number of actually operated lower computers is smaller than that of the preset target lower computers, the communication rate regulator can reduce the preset communication rate, and the influence on the overall performance of the bus network due to single equipment faults is avoided. Meanwhile, the communication rate regulator also tries to reconnect the off-line lower computer.
The embodiment of the application can effectively avoid influencing the overall performance of the bus network due to single equipment faults by dynamically detecting the on-line state of the target lower computer and adjusting the communication rate, thereby realizing more sensitive communication rate adjustment. According to the embodiment of the application, the integrity of the bus type network can be quickly recovered on the premise of no manual intervention by automatically trying to reconnect the offline target lower computer.
In an alternative embodiment of the application, the method further comprises:
detecting the actual number of the currently running lower computers;
And if the actual number of the currently operated lower computers is larger than the number of the target lower computers, adjusting the preset communication rate according to the actual number.
In this embodiment, the communication rate regulator also continuously scans the device identifier on the bus to detect the actual number of the currently actually operated lower computer. If the fact that the new lower computers start to operate is detected, namely that the actual number of the currently operated lower computers is larger than the number of the target lower computers corresponding to the current system type is detected, the preset communication rate is adjusted according to the actual number of the currently operated lower computers, and therefore the system is enabled to adapt to the new load.
The embodiment of the application can realize more sensitive communication rate adjustment when new equipment is added by dynamically detecting the actual number of the currently running lower computers and adjusting the communication rate.
In an alternative embodiment of the present application, the adjusting the preset communication rate to the target communication rate includes:
Transmitting the rate change signal to the target lower computer, wherein the rate change signal comprises the target communication rate;
receiving a rate receiving signal fed back by the target lower computer;
determining an abnormal lower computer from the target lower computers according to the rate receiving signals;
Resending the rate change signal to the abnormal lower computer;
and sending alarm information aiming at the abnormal lower computer to the upper computer.
In this embodiment, the communication rate adjuster sends a rate change signal including the target communication rate to all devices involved in the communication, including an upper computer, a target lower computer, and other lower computers. After receiving the rate change signal, the target lower computer needs to feed back the rate receiving signal to the communication rate regulator to confirm that the target lower computer has received the rate change signal. In one embodiment, the communication rate adjustor can cycle through sending the rate altering signal until all of the rate receiving signals fed back by the devices involved in the communication are received.
If the target lower computer still does not feed back the rate receiving signal after the rate changing signal with preset times is sent, the target lower computer can be judged to be an abnormal lower computer, and the communication rate regulator sends alarm information aiming at the abnormal lower computer to the upper computer while sending the rate changing signal to the abnormal lower computer again. In one embodiment, the host computer may display the alarm information on the touch screen.
According to the communication rate regulator, through circularly sending the rate change signal, it is ensured that all devices participating in communication can receive the rate change signal to change the communication rate, meanwhile, the communication rate regulator judges an abnormal lower computer through the received rate receiving signal and alarms, and communication failure caused by failure of a target lower computer is avoided.
When the number of the target lower computers is changed, the preset communication rate is automatically judged and adjusted to the corresponding target communication rate in real time through the communication rate regulator, so that the response sensitivity of the communication rate regulation is effectively improved; furthermore, the communication rate regulator can optimally adjust the preset communication rate to be stable or optimize the communication rate according to the real-time error rate of the bus type network, and the mechanism of the staged self-adaptive regulation ensures the complete receiving and transmitting of equipment data in the bus type network and simultaneously can realize the cooperative optimization between the low-speed stable transmission of a single system and the high-speed communication requirements of multiple systems.
On the basis of the above embodiment, the present embodiment also provides another method for adjusting the communication rate.
Referring to fig. 3, a flowchart illustrating steps of another embodiment of a method for adjusting a communication rate according to the present application includes the steps of:
step 301, receiving a system switching request, where the system switching request includes a target system type, and the target system type has a corresponding target number.
The method for adjusting the communication rate is applied to an upper computer in a bus type network. Reference is made to the above and fig. 2 for specific structure of the bus type network, and details thereof are not repeated here. The bus type network has at least two system types, different system types correspond to different numbers of target lower computers, and corresponding target communication rates can be preset corresponding to different numbers of target lower computers. In one embodiment, different system types are identified by flag bits
For example, referring to table 2, in the case of a single lower computer operation (single system), the single system flag bit may be 0 according to the default preset communication rate m0 kbps, in the case of two lower computers operation (dual system), the single system flag bit may be 0 according to the target communication rate m1 kbps(m1>m0), m1 kbps may be 1 according to the maximum communication rate in the case, in the case of three lower computers operation (tri system), the single system flag bit may be 2 according to the target communication rate m2 kbps(m2>m1), m2 kbps may be the maximum communication rate in the case, the tri system flag bit may be 3 according to the target communication rate m3 kbps(m3>m2, in the case of four lower computers operation (quad system), m3 kbps may be 3 according to the target communication rate m(n-1)kbps(m(n-1)>m(n-2)), in the case of N lower computers operation, m(n-1) kbps may be the maximum communication rate in the case of N may be an integer N-N, and N may be a positive integer.
Table 2 system types and corresponding settings
In step 301 of this embodiment, the upper computer may receive a system switching request sent by a user on the touch screen, where the system switching request includes a flag bit, where the flag bit has a corresponding target system type, and the target system type has a corresponding target number of target lower computers.
And 302, determining the target number of the target lower computers from the lower computers according to the target system type.
In step 302, a target number of target lower computers is determined from the lower computers according to the flag bit in the system switch request. Specifically, the target lower computer used by default of different system types can be preset, and the target lower computer is determined directly according to the default setting when the target lower computer is determined. For example, assuming that there are four lower computers 1,2, 3,4, a single-system default lower computer 1 may be set to participate in operation, a dual-system default lower computer 1,2 may participate in operation, three-system default lower computers 1,2, 3 may participate in operation, and four-system default lower computers 1,2, 3,4 may all participate in operation. When the flag bit in the system switching request is 2 (i.e. switching to three systems), the lower computers 1,2 and 3 are directly confirmed as target lower computers.
And 303, sending a switching signal to the lower computer, wherein the switching signal comprises the target system type and the target lower computer so that the target lower computer operates according to the switching signal.
In step 303, according to the flag bit corresponding to the target system type and the target lower computer, the upper computer sends a switching signal containing the target system type and the target lower computer to the lower computer. After the lower computers receive the switching signals, the target lower computers in the lower computers start to operate according to the switching signals, and the rest lower computers stop operating.
And 304, sending a rate adjustment signal to the communication rate adjuster, so that the communication rate adjuster adjusts the preset communication rate according to a preset rule according to the rate adjustment signal.
In step 304, while the system type is switched, the upper computer also sends a rate adjustment signal to the communication rate adjuster, so that the communication rate adjuster adjusts the preset communication rate according to the preset rule according to the rate adjustment signal. The specific communication rate adjustment procedure is described in detail above and will not be described in detail here.
In the embodiment of the application, a system switching request is received, the system switching request comprises target system types, the target system types have corresponding target numbers, target lower computers of the target numbers are determined from lower computers according to the target system types, switching signals are sent to the lower computers, the switching signals comprise the target system types and the target lower computers so that the target lower computers can operate according to the switching signals, and a speed adjusting signal is sent to a communication speed regulator so that the communication speed regulator can adjust the preset communication speed according to a preset rule by the speed adjusting signal. When the number of the target lower computers is changed, the preset communication rate is adjusted to the corresponding target communication rate in real time through the communication rate regulator, so that the response sensitivity of the communication rate regulation is effectively improved, the complete receiving and transmitting of equipment data in the bus type network is ensured, and the collaborative optimization between the low-speed stable transmission of a single system and the high-speed communication requirements of multiple systems can be realized.
In an optional embodiment of the present application, the determining, according to the target system type, the target number of the target lower computers from the lower computers includes:
Acquiring running accumulated time of the lower computer;
and determining the target lower computers with the target quantity from the lower computers according to the running accumulated time and the target system type.
In this embodiment, the target lower computer may also be selected according to the running accumulated time of the lower computer. The upper computer can monitor the running accumulation time of each lower computer, and when the target lower computer is selected according to the type of the target system, the lower computer with less running accumulation time is selected from the lower computers according to the running accumulation time of the lower computers to serve as the target lower computer.
According to the embodiment of the application, the target lower computer is determined according to the running accumulated time, so that the load of the target lower computer is increased or the service life of the target lower computer is shortened caused by using the same target lower computer for a long time, the load balance of the lower computer is ensured, and the service life of the lower computer is prolonged.
In order to make the person skilled in the art more clearly aware of a communication rate adjustment method according to an embodiment of the present application, a complete flow of communication rate adjustment is described below with reference to fig. 4 and 5.
Referring to fig. 4, a system type switching flowchart of an embodiment of a communication rate adjusting method according to the present application is shown.
As shown in fig. 4, after the system type is switched, the number of running lower computer devices on the bus type network is changed, and thus the communication data amount is also changed. When the system type is switched, the touch screen is used as an upper computer, and a rate change request needs to be sent to the communication rate regulator to be used as a rate regulating signal. The communication rate regulator regulates the communication rate according to a preset rule, and after the regulation is completed, the devices in the bus network can communicate according to the regulated preset communication rate.
Referring to fig. 5, a communication rate adjustment flow chart of an embodiment of a communication rate adjustment method according to the present application is shown.
Specifically, referring to fig. 5, after receiving a rate change request sent by the upper computer touch screen, the communication rate regulator determines whether the number of currently running lower computer devices in the bus type network is the same as the target number, and whether all target lower computers in the bus type network are online. If the number of the currently running lower computer devices is different from the target number, or not all the target lower computers in the bus network are online, the communication rate regulator needs to re-receive the rate change request, and the communication rate is regulated according to the number of the actually running lower computers.
If the number of the currently running lower computer devices is the same as the target number and all target lower computers in the bus type network are online, the communication rate regulator circularly sends rate change signals containing new communication rate values to all devices participating in communication, and determines whether all the devices in the bus type network receive the rate change signals according to rate receiving signals fed back by the lower computers. After the communication rate adjustment is completed, the communication rate adjuster needs to send a rate adjustment completion flag to the host computer.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the application.
On the basis of the above embodiment, the present embodiment further provides a device for adjusting a communication rate, which is applied to electronic devices such as a terminal device and a server.
Referring to fig. 6, a block diagram of an embodiment of a communication rate adjusting device according to the present application is shown, which may specifically include the following modules:
The adjusting signal sending module 601 is configured to receive a rate adjusting signal sent by the upper computer when the number of the target lower computers changes, where the rate adjusting signal includes a target communication rate;
A first rate adjustment module 602, configured to adjust the preset communication rate to the target communication rate;
an adjustment parameter obtaining module 603, configured to obtain an error rate, an error rate threshold, a stable communication rate, and an optimized communication rate of the target lower computer;
a second rate adjustment module 604, configured to adjust the preset communication rate to the stable communication rate if the bit error rate is higher than the bit error rate threshold;
and a third rate adjustment module 605, configured to adjust the preset communication rate to the optimized communication rate if the bit error rate is continuously lower than the bit error rate threshold for a preset time.
In an optional embodiment of the present application, the target lower computer has a corresponding device priority, where the device priority is a priority of data transmission in the communication process, and the apparatus further includes:
The load acquisition module is used for acquiring the equipment load of the target lower computer;
And the load adjustment module is used for adjusting the equipment priority of the target lower computer according to the equipment load.
In an optional embodiment of the present application, the target lower computer has a corresponding device identifier, and the load adjustment module includes:
the area identification sub-module is used for determining a high-load area and a normal area in the bus type network according to the equipment identifier and the equipment load;
and the region adjustment sub-module is used for improving the equipment priority of the target lower computer in the high-load region or reducing the equipment priority of the target lower computer in the normal region.
In an alternative embodiment of the application, the apparatus further comprises:
the error rate threshold value adjusting module is used for adjusting the error rate threshold value according to the equipment load to obtain an adjusted error rate threshold value;
And the fourth rate adjusting module is used for adjusting the preset communication rate according to the adjusted bit error rate threshold value.
In an alternative embodiment of the application, the apparatus further comprises:
the lower computer state acquisition module is used for acquiring the online state of the target lower computer;
and the offline state processing module is used for reducing the preset communication rate and executing the reconnection attempt operation on the offline lower computer if the offline lower computer exists in the target lower computer.
In an alternative embodiment of the application, the apparatus further comprises:
The quantity detection module is used for detecting the actual quantity of the currently operated lower computers;
And the fifth rate adjusting module is used for adjusting the preset communication rate according to the actual number if the actual number of the currently operated lower computers is larger than the number of the target lower computers.
In an alternative embodiment of the present application, the first rate adjustment module 602 includes:
A change signal sending sub-module, configured to send the rate change signal to the target lower computer, where the rate change signal includes the target communication rate;
The feedback signal receiving sub-module is used for receiving a rate receiving signal fed back by the target lower computer;
the abnormality determination submodule is used for determining an abnormal lower computer from the target lower computers according to the rate receiving signals;
A signal retransmission sub-module, configured to retransmit the rate change signal to the abnormal lower computer;
And the alarm sub-module is used for sending alarm information aiming at the abnormal lower computer to the upper computer.
In the embodiment of the application, when the number of the target lower computers changes, a rate adjusting signal sent by the upper computer is received, the rate adjusting signal comprises a target communication rate, the preset communication rate is adjusted to the target communication rate, the error rate threshold value, the stable communication rate and the optimized communication rate of the target lower computers are obtained, the preset communication rate is adjusted to the stable communication rate if the error rate is higher than the error rate threshold value, and the preset communication rate is adjusted to the optimized communication rate if the error rate is continuously lower than the error rate threshold value within the preset time. When the number of the target lower computers is changed, the preset communication rate is automatically judged and adjusted to the corresponding target communication rate in real time through the communication rate regulator, so that the response sensitivity of the communication rate regulation is effectively improved; furthermore, the communication rate regulator can optimally adjust the preset communication rate to be stable or optimize the communication rate according to the real-time error rate of the bus type network, and the mechanism of the staged self-adaptive regulation ensures the complete receiving and transmitting of equipment data in the bus type network and simultaneously can realize the cooperative optimization between the low-speed stable transmission of a single system and the high-speed communication requirements of multiple systems.
Referring to fig. 7, a block diagram of another embodiment of a communication rate adjusting device according to the present application is shown, and may specifically include the following modules:
A handover request receiving module 701, configured to receive a system handover request, where the system handover request includes a target system type, and the target system type has a corresponding target number;
A target device determining module 702, configured to determine the target number of the target lower computers from the lower computers according to the target system type;
a switching signal sending module 703, configured to send a switching signal to the lower computer, where the switching signal includes the target system type and the target lower computer, so that the target lower computer operates according to the switching signal;
and the rate adjusting module 704 is configured to send a rate adjusting signal to the communication rate adjuster, so that the communication rate adjuster adjusts the preset communication rate according to a preset rule according to the rate adjusting signal.
In an alternative embodiment of the present application, the target device determining module 702 includes:
the running time acquisition sub-module is used for acquiring running accumulated time of the lower computer;
and the target lower computer determining submodule is used for determining the target lower computers with the target quantity from the lower computers according to the running accumulated time and the target system type.
In the embodiment of the application, a system switching request is received, the system switching request comprises target system types, the target system types have corresponding target numbers, target lower computers of the target numbers are determined from lower computers according to the target system types, switching signals are sent to the lower computers, the switching signals comprise the target system types and the target lower computers so that the target lower computers can operate according to the switching signals, and a speed adjusting signal is sent to a communication speed regulator so that the communication speed regulator can adjust the preset communication speed according to a preset rule by the speed adjusting signal. When the number of the target lower computers is changed, the preset communication rate is adjusted to the corresponding target communication rate in real time through the communication rate regulator, so that the response sensitivity of the communication rate regulation is effectively improved, the complete receiving and transmitting of equipment data in the bus type network is ensured, and the collaborative optimization between the low-speed stable transmission of a single system and the high-speed communication requirements of multiple systems can be realized.
The embodiment of the application also provides a non-volatile readable storage medium, where one or more modules (programs) are stored, where the one or more modules are applied to a device, and the instructions (instructions) of each method step in the embodiment of the application may cause the device to execute.
Embodiments of the application provide one or more machine-readable media having instructions stored thereon that, when executed by one or more processors, cause an electronic device to perform a method as described in one or more of the above embodiments. In the embodiment of the application, the electronic equipment comprises various types of equipment such as terminal equipment, servers (clusters) and the like.
Embodiments of the present disclosure may be implemented as an apparatus for performing a desired configuration using any suitable hardware, firmware, software, or any combination thereof, which may include electronic devices such as terminal devices, servers (clusters), etc. Fig. 8 schematically illustrates an exemplary apparatus 1100 that may be used to implement various embodiments described in the present disclosure.
For one embodiment, fig. 8 illustrates an example apparatus 800 having one or more processors 802, a control module (chipset) 804 coupled to at least one of the processor(s) 802, a memory 806 coupled to the control module 804, a non-volatile memory (NVM)/storage 808 coupled to the control module 804, one or more input/output devices 810 coupled to the control module 804, and a network interface 812 coupled to the control module 804.
The processor 802 may include one or more single-core or multi-core processors, and the processor 802 may include any combination of general-purpose or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, the apparatus 800 can be used as a terminal device, a server (cluster), or the like in the embodiments of the present application.
In some embodiments, the apparatus 800 can include one or more computer-readable media (e.g., memory 806 or NVM/storage 808) having instructions 814 and one or more processors 802 coupled with the one or more computer-readable media and configured to execute the instructions 814 to implement the modules to perform the actions described in this disclosure.
For one embodiment, the control module 804 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 802 and/or any suitable device or component in communication with the control module 804.
The control module 804 may include a memory controller module to provide an interface to the memory 806. The memory controller modules may be hardware modules, software modules, and/or firmware modules.
Memory 806 may be used to load and store data and/or instructions 814 for device 800, for example. For one embodiment, memory 806 may include any suitable volatile memory, such as, for example, a suitable DRAM. In some embodiments, memory 806 may include double data rate type four synchronous dynamic random access memory (DDR 4 SDRAM).
For one embodiment, control module 804 may include one or more input/output controllers to provide an interface to NVM/storage 808 and input/output device(s) 810.
For example, NVM/storage 808 may be used to store data and/or instructions 814. NVM/storage 808 may include any suitable nonvolatile memory (e.g., flash memory) and/or may include any suitable nonvolatile storage device(s) (e.g., one or more Hard Disk Drives (HDDs), one or more Compact Disc (CD) drives, and/or one or more Digital Versatile Disc (DVD) drives).
NVM/storage 808 may include storage resources that are physically part of the device on which apparatus 800 is installed or may be accessible by the device without necessarily being part of the device. For example, NVM/storage 808 may be accessed over a network via input/output device(s) 810.
Input/output device(s) 810 may provide an interface for apparatus 800 to communicate with any other suitable devices, input/output device 810 may include communication components, audio components, sensor components, and the like. Network interface 812 may provide an interface for device 800 to communicate over one or more networks, and device 800 may communicate wirelessly with one or more components of a wireless network according to any of one or more wireless network standards and/or protocols, such as accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof.
For one embodiment, at least one of the processor(s) 802 may be packaged together with logic of one or more controllers (e.g., memory controller modules) of the control module 804. For one embodiment, at least one of the processor(s) 802 may be packaged together with logic of one or more controllers of the control module 804 to form a System In Package (SiP). For one embodiment, at least one of the processor(s) 802 may be integrated on the same die with logic of one or more controllers of the control module 804. For one embodiment, at least one of the processor(s) 802 may be integrated on the same die with logic of one or more controllers of the control module 804 to form a system on chip (SoC).
In various embodiments, apparatus 800 may be, but is not limited to being, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet, a netbook, etc.). In various embodiments, device 800 may have more or fewer components and/or different architectures. For example, in some embodiments, the apparatus 800 includes one or more cameras, a keyboard, a Liquid Crystal Display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an Application Specific Integrated Circuit (ASIC), and a speaker.
The detection device can adopt a main control chip as a processor or a control module, sensor data, position information and the like are stored in a memory or an NVM/storage device, a sensor group can be used as an input/output device, and a communication interface can comprise a network interface.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable communication rate adjustment terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable communication rate adjustment terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable communication rate adjustment terminal device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable communication rate regulating terminal device to cause a series of operational steps to be performed on the computer or other programmable terminal device to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal device provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing describes in detail a method and apparatus for adjusting a communication rate, an electronic device and a storage medium, wherein specific examples are provided herein to illustrate the principles and embodiments of the present application, and the above examples are provided to assist in understanding the method and core ideas of the present application, and meanwhile, to those skilled in the art, there are variations in the specific embodiments and application scope according to the ideas of the present application, so the disclosure should not be construed as limiting the present application.