Single-chip microcomputer design system based on fusion of multiple communication modes

By integrating multiple communication interfaces into the MCU design system and combining it with reinforcement learning algorithms, the hardware resource allocation is dynamically adjusted, which solves the problem of resource waste when multiple communication interfaces of the MCU share resources, and achieves efficient utilization of hardware resources and stable communication.

CN120811901APending Publication Date: 2025-10-17延安大学西安创新学院
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510934209.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In the prior art, when a single-chip microcomputer shares resources with multiple communication interfaces, hardware resource allocation is not flexible enough, resulting in some communication modes being over-occupied in specific situations while other communication modes are idle, causing a waste of system performance.

Method used

A single-chip microcomputer design system based on the integration of multiple communication modes is adopted. By integrating the monitoring management center, communication interface management module, hardware resource scheduling module, and state perception module, the dynamic scheduling of hardware resources is realized through the integration of communication interfaces of multiple communication interfaces. Combined with the reinforcement learning algorithm, the working status and data flow of each communication interface are monitored in real time, and the resource allocation strategy is dynamically adjusted to avoid idle or excessive resource occupation.

Benefits of technology

It achieves efficient utilization of hardware resources in complex communication scenarios, improves system performance and communication reliability and stability, and reduces the risk of system downtime due to communication failures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120811901A_ABST
    Figure CN120811901A_ABST
Patent Text Reader

Abstract

The invention discloses a single-chip microcomputer design system based on fusion of multiple communication modes, and relates to the technical field of dynamic scheduling of hardware resources, the single-chip microcomputer design system comprises a monitoring management center, and the monitoring management center is in communication connection with the following modules: a communication interface management module used for integrating multiple communication interfaces, the working state of each communication interface is monitored in real time; and the hardware resource scheduling module is used for integrating hardware resources of the single chip microcomputer to predict resource requirements of different communication modes. The hardware resource scheduling module is used for integrating resources such as a CPU, a memory and peripheral interfaces of the single-chip microcomputer to form a dynamic resource pool, resource requirements of different communication modes are predicted based on a reinforcement learning algorithm, load changes of all the communication interfaces can be sensed in real time, a resource allocation strategy is dynamically adjusted, and resource allocation efficiency is improved. Therefore, excessive resource occupation or resource idling in a single communication mode is avoided, the hardware resource utilization rate is maximized, efficient utilization of resources in a complex communication scene is ensured, and the overall performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of dynamic scheduling of hardware resources, and particularly relates to a single-chip design system based on fusion of multiple communication modes. BACKGROUND

[0002] In industrial automation, single-chip microcomputers are often used to control various devices and systems. With the rapid development of the Internet of Things (IoT), industrial automation and other fields, the communication needs between devices are becoming increasingly complex. A single communication mode often cannot meet the communication needs in different scenarios. In a factory environment, Ethernet, CAN bus, RS-485 and other communication modes need to be used at the same time to meet the communication needs between different devices.

[0003] In the prior art, when multiple communication interfaces share single-chip microcomputer resources, the allocation of hardware resources is not flexible enough, resulting in over-occupation of certain communication modes in certain situations, while other communication modes are idle, causing waste of system performance. Therefore, how to use reinforcement learning to adaptively adjust the allocation of hardware resources according to the needs of different communication modes, maximize the utilization rate of hardware resources, and avoid over-occupation or resource idling is a problem to be solved by the application. For this purpose, a single-chip microcomputer design system based on fusion of multiple communication modes is proposed. SUMMARY

[0004] The application aims to provide a single-chip microcomputer design system based on fusion of multiple communication modes to solve the problems raised in the background.

[0005] To solve the above technical problems, the technical solution adopted by the application is as follows:

[0006] A single-chip microcomputer design system based on fusion of multiple communication modes comprises a monitoring and management center, which is communicatively connected to the following modules, wherein:

[0007] A communication interface management module is used to integrate multiple communication interfaces and monitor the working states of the communication interfaces in real time.

[0008] A hardware resource scheduling module is used to integrate the hardware resources of the single-chip microcomputer, predict the resource needs of different communication modes, and dynamically adjust the resource allocation strategies of the communication interfaces according to a reinforcement learning algorithm.

[0009] A state perception module is used to perceive the current communication state of the system in real time, combine the adjustment results of the resource allocation strategies, dynamically adjust the resource allocation strategies according to the current state and historical experience, and maximize the system performance.

[0010] A feedback adjustment module is used to monitor the overall performance of the system in real time, adjust the parameters of the reinforcement learning algorithm to continuously optimize the resource allocation strategies, and ensure that the system performance always remains in an optimal state.

[0011] The further improvement of the technical scheme of the application is that the communication interface management module comprises a multi-communication interface integration unit and an interface state monitoring unit.

[0012] The multi-communication interface integration unit is configured to integrate multiple communication interfaces including an Ethernet interface, a CAN bus interface and an RS-485 interface, and connect different types of devices and networks.

[0013] The interface state monitoring unit is configured to manage initialization, configuration and state monitoring of the communication interfaces, and acquire communication states and data flow information of the interfaces in real time.

[0014] The further improvement of the technical scheme of the application is that the multi-communication interface integration unit specifically comprises:

[0015] When the system is started, the Ethernet interface, the CAN bus interface and the RS-485 interface are initialized and configured, the working mode, the baud rate, the data bits and the stop bits are set according to the communication protocols and the hardware characteristics of different interfaces, so as to ensure that the interfaces can work normally, and a unique identifier is allocated to each interface, and then the communication interfaces are connected to the single-chip microcomputer through hardware circuit design, so as to ensure stable and reliable connection, and an initialization program is written to configure parameters of the interfaces, verify the initialization results of the interfaces and ensure that the interfaces can normally send and receive data.

[0016] After the hardware connection and initialization are completed, the communication link establishment stage is entered, the communication format is configured according to the requirements of the device, the establishment of the communication link and the parameter configuration are completed, and the communication interfaces transmit data according to the set parameters.

[0017] After the communication link is established and the parameter configuration is completed, the data transmission and communication management stage is entered, and the communication states of the communication interfaces are monitored in real time.

[0018] The further improvement of the technical scheme of the application is that the interface state monitoring unit specifically comprises:

[0019] When the interface is accessed, the interface state monitoring unit initializes the communication interface, loads the preset configuration parameters and establishes the interface management record, reads the interface parameters from the system configuration file, including the communication protocol type (TCP / UDP, CAN2.0B, RS-485Modbus), the hardware address (MAC, CANID, serial port address) and the communication rate (baud rate, IP port), writes the parameters into the register of the corresponding interface through the hardware abstraction layer (HAL), confirms whether the interface hardware and the protocol stack are normally started by sending a test frame, and creates an interface state table in the system database to record the interface type, the unique identifier, the current configuration parameters and the initialization time stamp.

[0020] Through the periodic polling or event triggering mechanism, the communication state and data flow information of each interface are continuously collected, and the real-time data transmission rate and cumulative flow of each interface are recorded, the cumulative flow is counted in a 1-minute window, a CSV format report is generated, the fields include timestamp, interface type and uplink / downlink flow, and an abnormal threshold is set to trigger an alarm and record the abnormal event to a log file;

[0021] Based on the collected state data, the abnormal interface is recovered through adaptive adjustment or manual intervention to ensure long-term stable operation of the system, wherein, for short-term abnormality, automatic reconnection or parameter fine-tuning is performed, for serious failure, hardware reset or notification of maintenance personnel intervention is triggered, for the interface that fails to initialize for 3 times, hardware reset is triggered, the reset pin is controlled through GPIO, the fault details are recorded to the system knowledge base, a maintenance work order is generated and pushed to the operation and maintenance platform, and the maintenance personnel is notified to intervene.

[0022] The further improvement of the technical scheme of the application is that the hardware resource scheduling module comprises a resource demand prediction unit and a resource allocation strategy unit.

[0023] The resource demand prediction unit is used for integrating the hardware resources of the single-chip microcomputer, including CPU processing capacity, memory, peripheral interface and the like, forming a resource pool that can be dynamically allocated, and predicting resource demand of different communication modes based on historical data and current communication interface state, and sensing resource demand change in advance.

[0024] The resource allocation strategy unit is used for adjusting the hardware resource allocation strategy by using a reinforcement learning algorithm according to the resource demand prediction result, so as to maximize the hardware resource utilization rate.

[0025] The further improvement of the technical scheme of the application is that the resource demand prediction unit specifically comprises:

[0026] The hardware resource information of the single-chip microcomputer including CPU processing capacity, memory capacity and peripheral interface is collected, and the hardware resources are abstracted into a unified resource pool, each resource in the resource pool is marked as a distributable state, and a resource allocation table is initialized to record the allocation of the current resources, including the type, quantity of the allocated resources and the corresponding communication interface.

[0027] The historical resource usage mode is extracted from the system database, the historical trend is analyzed, the current communication interface state is monitored, and the time series analysis is applied to predict the future resource demand trend, and then the resource demand prediction value is generated in combination with the historical trend and the current communication interface state.

[0028] When the resource demand prediction value exceeds 80% of the current resource pool capacity, a warning is triggered, a warning report is generated, including the resource bottleneck type and the predicted overrun time, and low-priority tasks are migrated to the backup CPU core to release the computing power.

[0029] The further improvement of the technical scheme of the application is that the calculation process of the resource demand prediction value is:

[0030] The resource usage at the past n time points is obtained from the system database, the historical data is averaged to obtain a historical average value, and the historical average value is multiplied by a weight coefficient of the historical trend to obtain a historical trend item;

[0031] The current resource usage is obtained, the minimum and maximum values of the resource usage are obtained through historical statistics, the difference between the current resource usage and the minimum value of the resource usage, and the difference between the maximum and minimum values of the resource usage are calculated, and then the ratio of the two differences is calculated to obtain the normalized value of the current resource usage, and the normalized value of the current resource usage is multiplied by the weight coefficient of the current state to obtain a current state item;

[0032] The communication interface load indicator at the current time is obtained, and the average and maximum values of the interface load are obtained through historical statistics, the difference between the communication interface load indicator at the current time and the average value of the interface load, and the difference between the maximum and average values of the interface load are calculated, and then the ratio of the two differences is calculated to obtain the normalized value of the communication interface load, and the normalized value of the communication interface load is multiplied by the weight coefficient of the interface load to obtain an interface load item;

[0033] A random disturbance item is introduced to simulate burst load, and the historical trend item, the current state item, the interface load item and the random disturbance item are added to calculate the resource demand prediction value, and the resource demand warning value is set to 80%, if the resource demand prediction value exceeds 80%, the warning is triggered and the resource optimization strategy is executed.

[0034] The further improvement of the technical scheme of the application is that the resource allocation strategy unit specifically comprises:

[0035] The prediction result from the resource demand prediction unit is received, including the resource demand of each communication interface in the future period of time, the resource allocation strategy is initialized according to the prediction data, the hardware resource pool of the single-chip microcomputer is preliminarily allocated according to the current demand, at the same time, the initial parameters of the reinforcement learning algorithm are defined, including the reward function, the state space and the action space;

[0036] Based on the initialization strategy and reinforcement learning algorithm, the resource allocation is dynamically adjusted, at each time step, according to the current resource allocation state and the actual demand of the communication interface, an action is selected, through the interaction with the system, the new state is observed and the reward signal is obtained, and then according to the reinforcement learning algorithm of Q-learning, the strategy is updated, and the resource allocation scheme is optimized, so that the reward function value is maximized.

[0037] After dynamic adjustment, the hardware resources are finally allocated according to the optimization result of the reinforcement learning algorithm, so that each communication interface can obtain sufficient resource support when needed, while avoiding resource waste and maximizing hardware resource utilization, and at the same time, the key data and parameter adjustment during the optimization process are recorded, if the system performance does not reach the expected target, the parameters of the reinforcement learning algorithm are continuously adjusted, and the resource allocation strategy is further optimized.

[0038] The further improvement of the technical scheme of the application is that the state perception module specifically comprises:

[0039] The current communication state of the system is monitored in real time, and the real-time data of each communication interface (Ethernet, CAN bus, RS-485) is obtained through the interaction with the communication interface management module and the hardware resource scheduling module;

[0040] Combined with the resource allocation strategy adjustment result provided by the hardware resource scheduling module, the current communication state is analyzed in depth, the real-time communication state is compared with the resource allocation situation, the effectiveness of the current resource allocation strategy is evaluated, the resource allocation link that needs to be adjusted is identified through the analysis of the current state and historical experience data, and the preliminary adjustment suggestion is generated;

[0041] Based on the analysis result of the real-time communication state and the resource allocation strategy, the resource allocation proportion is fine-tuned according to the current state and historical experience, so as to maximize the system performance, and the adjusted resource allocation strategy is fed back to the hardware resource scheduling module, so that the hardware resources are re-allocated according to the new strategy, and at the same time, the communication state and the resource allocation situation before and after the adjustment are recorded.

[0042] The further improvement of the technical scheme of the application is that the feedback adjustment module specifically comprises:

[0043] The overall performance of the system is continuously monitored in real time, the key performance data of the system running is collected, and the key performance data is stored in the local database;

[0044] Based on the collected key performance data, the system performance is comprehensively evaluated, the current performance index is compared and analyzed with the preset optimal performance target, whether the system reaches the expected performance level is judged, if it is found that the performance does not meet the standard, the cause of the performance bottleneck is analyzed, and the suggestion for adjusting the parameters of the reinforcement learning algorithm is generated according to the analysis result.

[0045] According to the performance evaluation result and the adjustment suggestion, the parameters of the reinforcement learning algorithm are updated, the new parameter values are applied to the reinforcement learning algorithm, and the updated parameters are fed back to the hardware resource scheduling module, the resource allocation strategy is re-adjusted according to the new parameters, and the system performance change after each parameter update is recorded.

[0046] Due to the adoption of the above technical solutions, the technical progress achieved by the present application relative to the prior art is:

[0047] 1. The present application provides a single-chip microcomputer design system based on the fusion of multiple communication modes, which integrates the CPU, memory, peripheral interface and other resources of the single-chip microcomputer through a hardware resource scheduling module to form a dynamic resource pool, and predicts the resource requirements of different communication modes based on a reinforcement learning algorithm, which can real-time perceive the load changes of each communication interface, dynamically adjust the resource allocation strategy, avoid excessive resource occupation by a single communication mode or resource idling, and thus maximize the hardware resource utilization, ensure efficient use of resources in complex communication scenarios, and improve the overall performance.

[0048] 2. The present application provides a single-chip microcomputer design system based on the fusion of multiple communication modes, which integrates multiple communication interfaces of Ethernet, CAN bus and RS-485, and real-time monitors the working state and data flow of each interface, manages the initialization, configuration and state monitoring of the interface, discovers and handles abnormal interfaces in time, ensures the stability of the communication link, and further improves the reliability and stability of the communication by self-adaptive adjustment or manual intervention to restore abnormal interfaces, reduces the risk of system downtime caused by communication failure. BRIEF DESCRIPTION OF DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.

[0050] Figure 1 The workflow diagram of the present application;

[0051] Figure 2 The workflow diagram of the resource demand prediction unit of the present application. DETAILED DESCRIPTION

[0052] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0053] As shown in Embodiment 1, Figure 1 , Figure 2 The present application provides a single-chip design system based on fusion of multiple communication modes, comprising a monitoring and management center, the monitoring and management center being in communication connection with the following modules, wherein:

[0054] A communication interface management module is used for integrating multiple communication interfaces and monitoring the working states of the communication interfaces in real time. The communication interface management module comprises a multi-communication interface integration unit and an interface state monitoring unit.

[0055] The multi-communication interface integration unit is used for integrating multiple communication interfaces including an Ethernet interface, a CAN bus interface and an RS-485 interface, connecting different types of devices and networks, realizing physical layer connection of multiple communication modes, initializing and configuring the Ethernet interface, the CAN bus interface and the RS-485 interface at system startup, setting the working mode, baud rate, data bits and stop bits of the parameters according to the communication protocol and hardware characteristics of different interfaces, ensuring that each interface can work normally, at the same time, allocating a unique identifier for each interface, and then connecting each communication interface to the single-chip microcomputer through hardware circuit design, ensuring stable and reliable connection, writing an initialization program, configuring the parameters of each interface, verifying the interface initialization result, and ensuring that each interface can normally send and receive data. The Ethernet interface is connected to the SPI interface of the single-chip microcomputer through an Ethernet chip, the network parameters are configured to establish a network communication link, the CAN bus interface is connected to the corresponding pin of the single-chip microcomputer by using a CAN controller and a transceiver, the communication baud rate and bit timing parameters are set to ensure the initialization of bus communication, and the RS-485 interface is connected to the serial port of the single-chip microcomputer through an RS-485 chip, the communication baud rate and communication mode are set, after the hardware connection and initialization are completed, the communication link establishment stage is entered, wherein the Ethernet interface establishes a connection with the main network or other devices of the factory through a TCP / IP protocol stack, and the port number, connection mode and other parameters are configured according to actual needs, the CAN bus interface is added to the CAN bus network after initialization, and the node address, communication priority and other parameters are set according to the communication protocol and device requirements on the bus, so that the bus communication can be normally participated, the RS-485 interface establishes a communication link with a remote sensor or actuator through a serial communication protocol, and the communication format is configured according to the device requirements, the establishment of the communication link and the parameter configuration are completed, each communication interface transmits data according to the set parameters, after the communication link is established and the parameter configuration is completed, the data transmission and communication management stage is entered, wherein the Ethernet interface is responsible for receiving and sending network data packets, encapsulating and decapsulating data through a TCP / IP protocol stack, realizing high-speed data transmission with remote devices or monitoring centers, the CAN bus interface receives and sends data frames on the bus in real time, processes data according to the frame format and priority, and ensures that the communication requirements of devices with strong real-time performance are met, and the RS-485 interface sends and receives data according to a serial communication protocol, realizes data interaction between long-distance communication devices, at the same time, the communication states of each communication interface are monitored in real time, ensuring the accuracy and reliability of data transmission.

[0056] The interface state monitoring unit is used for managing initialization, configuration and state monitoring of the communication interface, and real-time acquisition of communication states and data flow information of each interface. When the interface is accessed, the interface state monitoring unit initializes the communication interface, loads preset configuration parameters, and establishes an interface management record. The interface parameters are read from the system configuration file, including communication protocol type (TCP / UDP, CAN2.0B, RS-485Modbus), hardware address (MAC, CANID, serial port address) and communication rate (baud rate, IP port). The parameters are written into the registers of the corresponding interface through the hardware abstraction layer (HAL). The SPI / RMII registers of the Ethernet interface are configured. The baud rate divider and acceptance filter of the CAN controller are set for the CAN bus interface. The UART registers and direction control pins are initialized for the RS-485 interface. Whether the interface hardware and protocol stack are normally started is confirmed by sending a test frame. The network connectivity is verified by sending an ARP request or Ping packet for the Ethernet interface. An “initialization request frame” is sent for the CAN bus interface, and the bus response is listened to. A short data frame (such as “AT” instruction) is sent for the RS-485 interface, and the echo or ACK signal of the slave station is checked. If the expected response is not received or the register state is abnormal, the interface is marked as “initialization failure” and an alarm is triggered. At the same time, an interface state table is created in the system database to record the interface type, unique identifier, current configuration parameters and initialization timestamp. Through periodic polling or event triggering mechanism, the communication states and data flow information of each interface are continuously collected. For the Ethernet interface, the state registers of the network chip are read periodically every 500 ms. For the CAN bus interface, the error counter and bus load rate of the CAN controller are monitored every 100 ms. For the RS-485 interface, the transmit and receive byte count, check error count and timeout event of the serial port communication are counted every 200 ms. At the same time, the real-time data transmission rate and cumulative flow of each interface are recorded. The cumulative flow is counted in a 1-minute window to generate a CSV format report. The fields include timestamp, interface type and uplink / downlink flow. The abnormal threshold is set. The Ethernet packet loss rate is >1%, the delay is >50 ms, the CAN bus TEC is >127 (bus shutdown threshold), the load rate is >80%, and the RS-485 check error rate is >0.If a timeout event occurs >3 times per minute, an alarm is triggered and the abnormal event is recorded in a log file. Based on the collected status data, the abnormal interface is restored through adaptive adjustments or manual intervention to ensure long-term stable system operation. For brief abnormalities, automatic reconnection or parameter fine-tuning is performed. For serious faults, a hardware reset is triggered or maintenance personnel are notified. Ethernet automatically reconnects (closing and reinitializing the socket), the CAN bus fine-tunes the baud rate or activates the backup filter, and RS-485 reduces the baud rate or increases the number of retries. For interfaces that fail to initialize three times in a row, a hardware reset is triggered, and the reset pin is controlled via GPIO. Fault details are recorded in the system knowledge base, and a maintenance work order is generated and pushed to the operation and maintenance platform, notifying maintenance personnel to intervene.

[0057] The hardware resource scheduling module is used to integrate the hardware resources of the MCU to predict the resource requirements of different communication methods and dynamically adjust the resource allocation strategy of each communication interface based on the reinforcement learning algorithm;

[0058] The state perception module is used to perceive the current communication status of the system in real time and dynamically adjust the resource allocation strategy based on the current status and historical experience to maximize system performance.

[0059] The feedback adjustment module is used to monitor the overall performance of the system in real time, adjust the parameters of the reinforcement learning algorithm to continuously optimize the resource allocation strategy, and ensure that the system performance always remains in the optimal state.

[0060] Example 2, as Figure 1 、 Figure 2 As shown, based on embodiment 1, the present invention provides a technical solution: preferably, the hardware resource scheduling module includes a resource demand prediction unit and a resource allocation strategy unit;

[0061] The resource demand prediction unit is used for integrating hardware resources of the single-chip microcomputer, including CPU processing capability, memory, peripheral interface and the like, to form a resource pool that can be dynamically allocated, and predicting resource demand of different communication modes based on historical data and current communication interface state, to perceive resource demand change in advance. Hardware resource information of the single-chip microcomputer, including CPU processing capability, memory capacity and peripheral interface, is collected, and the hardware resources are abstracted into a unified resource pool. Each resource in the resource pool is marked as a distributable state. Meanwhile, a resource allocation table is initialized to record the allocation of current resources, including the type and quantity of allocated resources and the corresponding communication interface. CPU processing capability is quantified by a performance counter to establish a dynamic calculation model. Memory resources are divided into memory areas to monitor the remaining memory in real time. Peripheral interfaces scan peripheral states to generate a peripheral resource occupation map. Historical resource usage patterns are extracted from a system database to analyze historical trends. Meanwhile, the current communication interface state is monitored, and time series analysis is applied to predict future resource demand trends. For the communication interface state, real-time bandwidth occupancy and TCP connection number are counted for Ethernet, message queue length and arbitration loss number are monitored for CAN bus, serial port buffer occupancy and check error rate are recorded for RS-485, and resource usage rate is calculated for instantaneous load of CPU, memory and peripherals. Then, in combination with historical trends and the current communication interface state, a resource demand prediction value is generated. When the resource demand prediction value exceeds 80% of the current resource pool capacity, a warning is triggered, a warning report is generated, including resource bottleneck type and predicted overrun time, and low-priority tasks are migrated to a backup CPU core to release computing power. Meanwhile, non-critical data buffers are compressed to release memory.

[0062] In addition, the calculation process of the resource demand prediction value is as follows:

[0063] The resource usage rates of the past n time points are obtained from the system database, the historical data is averaged to obtain a historical average value, the historical average value is multiplied by a weight coefficient of a historical trend to obtain a historical trend term, a current resource usage rate is obtained, and the minimum and maximum values of the resource usage rate are obtained through historical statistics, the difference between the current resource usage rate and the minimum value of the resource usage rate and the difference between the maximum and minimum values of the resource usage rate are calculated, and then the ratio of the two differences is calculated to obtain a normalized value of the current resource usage rate, and the normalized value of the current resource usage rate is multiplied by a weight coefficient of a current state to obtain a current state term, a communication interface load indicator at the current time is obtained, and the average and maximum values of the interface load are obtained through historical statistics, the difference between the communication interface load indicator at the current time and the average value of the interface load and the difference between the maximum and average values of the interface load are calculated, and then the ratio of the two differences is calculated to obtain a normalized value of the communication interface load, and the normalized value of the communication interface load is multiplied by a weight coefficient of the interface load to obtain an interface load term, a random disturbance term is introduced to simulate a burst load, and the resource demand prediction value is calculated by adding the historical trend term, the current state term, the interface load term and the random disturbance term, and the resource demand warning value is set to 80%, if the resource demand prediction value exceeds 80%, an early warning is triggered and a resource optimization strategy is executed;

[0064] The calculation formula of the resource demand prediction value is:

[0065] P t+Δt =(f(H)+f(C)+f(I)+∈)×100%;

[0066]

[0067] In the formula, P t+Δt is the resource demand prediction value of the future time P t+Δt , which increases with the increase of the historical trend, the current state and the interface load, f(H) is the historical trend term, H t , H t-1 , …, H t-n+1 are historical resource usage rates of the past n time points, n is the time window size of the historical data, the larger n is, the more smooth the influence of the historical trend is, α is the weight coefficient of the historical trend, f(C) is the current state term, C t is the resource usage rate at the current time t, C min and C max are the minimum and maximum values of the resource usage rate, β is the weight coefficient of the current state, f(I) is the interface load term, I t is the communication interface load indicator at the current time t, I avg and I maxThe average and maximum values of the interface load, γ is the weight coefficient of the interface load, and ∈ is a random disturbance term, and the randomness is introduced to make the predicted value closer to the actual fluctuation.

[0068] The resource allocation strategy unit is configured to adjust the hardware resource allocation strategy by using a reinforcement learning algorithm according to the resource demand prediction result, maximize the hardware resource utilization rate, ensure that each communication mode obtains sufficient resource support when needed, and avoid resource waste. The resource allocation strategy unit receives the prediction result from the resource demand prediction unit, and the prediction result includes the resource demand of each communication interface in a future period of time. According to the prediction data, the resource allocation strategy is initialized, and the hardware resource pool of the single-chip microcomputer is preliminarily allocated according to the current demand. At the same time, the initial parameters of the reinforcement learning algorithm are defined, including a reward function (used to measure the pros and cons of resource allocation), a state space (the current resource allocation situation and the communication interface demand), and an action space (the adjustment mode of resource allocation). Based on the initialized strategy and the reinforcement learning algorithm, the resource allocation is dynamically adjusted. At each time step, an action is selected according to the current resource allocation state and the actual demand of the communication interface. Through interaction with the system, a new state is observed and a reward signal is obtained. Then, according to the Q-learning reinforcement learning algorithm, the strategy is updated, and the resource allocation scheme is optimized to maximize the reward function value. After dynamic adjustment, the hardware resources are finally allocated according to the optimization result of the reinforcement learning algorithm, so that each communication interface can obtain sufficient resource support when needed, while avoiding resource waste and maximizing hardware resource utilization. At the same time, key data and parameter adjustment conditions in the optimization process are recorded. If the system performance does not meet the expected target, the parameters of the reinforcement learning algorithm are continuously adjusted to further optimize the resource allocation strategy.

[0069] The state perception module specifically includes:

[0070] The real-time monitoring system currently monitors the communication state, obtains the real-time data of each communication interface (Ethernet, CAN bus, RS-485) including data transmission rate, communication delay, error rate, bandwidth occupation, etc. through interaction with the communication interface management module and the hardware resource scheduling module, adjusts the current communication state in combination with the resource allocation strategy adjustment result provided by the hardware resource scheduling module, compares the real-time communication state with the resource allocation, evaluates the effectiveness of the current resource allocation strategy, wherein if the bandwidth occupation rate of a certain communication interface is close to the upper limit but the resource allocation proportion is low, it means that there is a resource bottleneck, otherwise, if the resource allocation proportion of a certain interface is high but the actual communication load is low, there is resource waste, the resource allocation link that needs to be adjusted is identified through analysis of the current state and historical experience data, and preliminary adjustment suggestions are generated, the resource allocation proportion is fine-tuned based on the analysis results of the real-time communication state and the resource allocation strategy according to the current state and historical experience to maximize the system performance, and the adjusted resource allocation strategy is fed back to the hardware resource scheduling module so that it can reallocate hardware resources according to the new strategy, and at the same time, the communication state and resource allocation before and after adjustment are recorded.

[0071] The feedback adjustment module specifically includes:

[0072] The overall performance of the system is continuously monitored in real time, key performance data of the system running is collected, including CPU utilization, memory occupation, response time of communication interface, data transmission success rate, system throughput, etc., and the key performance data is stored in the local database, the system performance is comprehensively evaluated based on the collected key performance data, the current performance index is compared and analyzed with the preset optimal performance target, whether the system reaches the expected performance level is judged, if it is found that the performance does not meet the standard, the reason for the performance bottleneck is analyzed, the suggestion for adjusting the parameters of the reinforcement learning algorithm is generated according to the analysis result, the parameters of the reinforcement learning algorithm are updated according to the performance evaluation result and the adjustment suggestion, the new parameter value is applied to the reinforcement learning algorithm, and the updated parameters are fed back to the hardware resource scheduling module to adjust the resource allocation strategy according to the new parameters, at the same time, the system performance change after each parameter update is recorded to ensure that the system performance always remains in the optimal state.

[0073] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any skilled person in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A single-chip microcomputer design system based on the integration of multiple communication modes, including a monitoring management center, characterized in that: The monitoring management center is connected to the following modules: Communication interface management module, used to integrate multiple communication interfaces and monitor the working status of each communication interface in real time; The hardware resource scheduling module is used to integrate the hardware resources of the MCU to predict the resource requirements of different communication methods and dynamically adjust the resource allocation strategy of each communication interface based on the reinforcement learning algorithm; The state perception module is used to perceive the current communication status of the system in real time and dynamically adjust the resource allocation strategy based on the current status and historical experience in combination with the adjustment results of the resource allocation strategy; The feedback adjustment module is used to monitor the overall performance of the system in real time and adjust the parameters of the reinforcement learning algorithm to continuously optimize the resource allocation strategy.

2. The single-chip microcomputer design system based on the integration of multiple communication modes according to claim 1, characterized in that: The communication interface management module includes a multi-communication interface integration unit and an interface status monitoring unit; The multi-communication interface integration unit is used to integrate multiple communication interfaces including Ethernet interface, CAN bus interface and RS-485 interface to connect different types of devices and networks; The interface status monitoring unit is used to manage the initialization, configuration and status monitoring of the communication interface, and obtain the communication status and data flow information of each interface in real time.

3. The single chip microcomputer design system based on the integration of multiple communication modes according to claim 2, characterized in that: The multi-communication interface integrated unit specifically includes: When the system starts, the Ethernet interface, CAN bus interface and RS-485 interface are initialized and configured. According to the communication protocol and hardware characteristics of different interfaces, their operating mode, baud rate, data bits and stop bits are set. At the same time, a unique identifier is assigned to each interface. Then, through hardware circuit design, each communication interface is connected to the microcontroller, and an initialization program is written to configure the parameters of each interface and verify the interface initialization results. After completing the hardware connection and initialization, enter the communication link establishment phase, and configure the communication format according to the equipment requirements, complete the communication link establishment and parameter configuration, so that each communication interface transmits data according to the set parameters; After the communication link is established and parameter configuration is completed, the data transmission and communication management stage begins. At the same time, the communication status of each communication interface is monitored in real time.

4. The single chip microcomputer design system based on the integration of multiple communication modes according to claim 2, characterized in that: The interface status monitoring unit specifically includes: When the interface is connected, the interface status monitoring unit initializes the communication interface, loads the preset configuration parameters, and establishes an interface management record. It reads the interface parameters from the system configuration file, including the communication protocol type, hardware address, and communication rate, and writes the parameters to the registers of the corresponding interface through the hardware abstraction layer. It confirms whether the interface hardware and protocol stack are started normally by sending a test frame. At the same time, it creates an interface status table in the system database, recording the interface type, unique identifier, current configuration parameters, and initialization timestamp; Through periodic polling or event-triggered mechanisms, the communication status and data flow information of each interface are continuously collected. At the same time, the real-time data transmission rate and cumulative flow of each interface are recorded. The cumulative flow is counted in a 1-minute window and a CSV format report is generated. The fields include timestamp, interface type, and upstream / downstream flow. Abnormal thresholds can be set to trigger alarms and record abnormal events in log files. Based on the collected status data, abnormal interfaces are restored through adaptive adjustment or manual intervention. For short-term abnormalities, automatic reconnection or parameter fine-tuning is performed. For serious faults, hardware reset is triggered or maintenance personnel are notified to intervene. For interfaces that fail to initialize three times in a row, hardware reset is triggered, and the reset pin is controlled through GPIO. The fault details are recorded in the system knowledge base, and a maintenance work order is generated and pushed to the operation and maintenance platform to notify maintenance personnel to intervene.

5. The single chip microcomputer design system based on the integration of multiple communication modes according to claim 2, characterized in that: The hardware resource scheduling module includes a resource demand prediction unit and a resource allocation strategy unit; The resource demand prediction unit is used to integrate the hardware resources of the single-chip microcomputer to form a dynamically allocated resource pool, and predict the resource requirements of different communication modes based on historical data and the current communication interface status; The resource allocation strategy unit is used to adjust the hardware resource allocation strategy using a reinforcement learning algorithm according to the resource demand prediction result.

6. The single chip microcomputer design system based on the integration of multiple communication modes according to claim 5, characterized in that: The resource demand prediction unit specifically includes: Collect the hardware resource information of the MCU, including CPU processing power, memory capacity and peripheral interfaces, and abstract the hardware resources into a unified resource pool. Each resource in the resource pool is marked as allocable. At the same time, initialize a resource allocation table to record the current resource allocation status, including the allocated resource type, quantity and corresponding communication interface; Extract historical resource usage patterns from the system database and analyze historical trends. Simultaneously, monitor the current communication interface status and apply time series analysis to predict future resource demand trends. Combined with historical trends and current communication interface status, a resource demand forecast is generated. When the resource demand forecast exceeds 80% of the current resource pool capacity, an early warning is triggered and an early warning report is generated, including the resource bottleneck type and predicted overrun time. Low-priority tasks are then migrated to spare CPU cores to release computing power.

7. The single chip microcomputer design system based on the integration of multiple communication modes according to claim 6, characterized in that: The calculation process of the resource demand forecast value is as follows: Obtain resource usage rates at the past n time points from the system database, average the historical data to obtain the historical average value, and multiply the historical average value by the weight coefficient of the historical trend to obtain the historical trend item; Obtain the current resource utilization rate, and obtain the minimum and maximum resource utilization rates through historical statistics. Calculate the difference between the current resource utilization rate and the minimum resource utilization rate, as well as the difference between the maximum and minimum resource utilization rates. Calculate the ratio of the two differences to obtain the normalized value of the current resource utilization rate. Multiply the normalized value of the current resource utilization rate by the weight coefficient of the current state to obtain the current state item. Obtain the current communication interface load indicator, and obtain the average and maximum values ​​of the interface load through historical statistics. Calculate the difference between the current communication interface load indicator and the average value of the interface load, as well as the difference between the maximum value of the interface load and the average value. Calculate the ratio of the two differences to obtain a normalized value of the communication interface load. Multiply the normalized value of the communication interface load by the weight coefficient of the interface load to obtain an interface load item. A random disturbance term is introduced to simulate sudden loads, and the historical trend term, current status term, interface load term, and random disturbance term are added together to calculate the resource demand forecast value. The resource demand warning value is set to 80%. If the resource demand forecast value exceeds 80%, an early warning is triggered and the resource optimization strategy is executed.

8. The single chip microcomputer design system based on the integration of multiple communication modes according to claim 5, characterized in that: The resource allocation strategy unit specifically includes: Receive the prediction results from the resource demand prediction unit, including the resource requirements of each communication interface in the future, initialize the resource allocation strategy based on the predicted data, and preliminarily allocate the hardware resource pool of the MCU according to the current demand. At the same time, define the initial parameters of the reinforcement learning algorithm, including the reward function, state space, and action space; Based on the initialization strategy and reinforcement learning algorithm, resource allocation is dynamically adjusted. At each time step, an action is selected based on the current resource allocation status and the actual needs of the communication interface. By interacting with the system, the new status is observed and reward signals are obtained. Then, according to the Q-learning reinforcement learning algorithm, the strategy is updated and the resource allocation plan is optimized to maximize the reward function value. After dynamic adjustment, the hardware resources are finally allocated according to the optimization results of the reinforcement learning algorithm to maximize the utilization of hardware resources. At the same time, the key data and parameter adjustments during the optimization process are recorded. If the system performance does not meet the expected goals, the parameters of the reinforcement learning algorithm will continue to be adjusted to further optimize the resource allocation strategy.

9. The single chip microcomputer design system based on the integration of multiple communication modes according to claim 1, characterized in that: The state perception module specifically includes: Monitor the current communication status of the system in real time, and obtain real-time data of each communication interface through interaction with the communication interface management module and hardware resource scheduling module; Combined with the resource allocation policy adjustment results provided by the hardware resource scheduling module, the system conducts an in-depth analysis of the current communication status, compares the real-time communication status with the resource allocation situation, evaluates the effectiveness of the current resource allocation strategy, identifies resource allocation links that need adjustment by analyzing the current status and historical experience data, and generates preliminary adjustment suggestions. Based on the analysis results of real-time communication status and resource allocation strategy, the resource allocation ratio is fine-tuned according to the current status and historical experience to maximize system performance, and the adjusted resource allocation strategy is fed back to the hardware resource scheduling module. At the same time, the communication status and resource allocation before and after the adjustment are recorded.

10. The single chip microcomputer design system based on the integration of multiple communication modes according to claim 9, characterized in that: The feedback adjustment module specifically includes: Continuously monitor the overall performance of the system in real time, collect key performance data of the system operation, and store the key performance data in the local database; Based on the collected key performance data, a comprehensive evaluation of system performance is conducted. The current performance indicators are compared with the preset optimal performance targets to determine whether the system has achieved the expected performance level. If the performance is found to be below the target, the causes of the performance bottleneck are analyzed. Based on the analysis results, recommendations for adjusting the reinforcement learning algorithm parameters are generated. Based on the performance evaluation results and adjustment suggestions, the parameters of the reinforcement learning algorithm are updated, the new parameter values ​​are applied to the reinforcement learning algorithm, and the updated parameters are fed back to the hardware resource scheduling module. The resource allocation strategy is readjusted according to the new parameters. At the same time, the changes in system performance after each parameter update are recorded.