A clock synchronization instruction synchronization method and system for multiple single-chip computers working cooperatively
By converting environmental physical phenomena into a unified time reference signal source, adjusting the microcontroller clock frequency, and distributing instructions according to the task window, the problem of insufficient synchronization in multi-microcontroller collaborative work is solved, thereby improving the system's reliability and efficiency.
Patent Information
- Application Number
- CN202511073277.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-08-01
AI Technical Summary
In scenarios where multiple microcontrollers work together, insufficient synchronization in instruction distribution and execution leads to data conflicts and low system collaboration efficiency.
The generation module transforms physical phenomena with constant periodicity in the environment into pulse trains with fixed time intervals as a unified time reference signal source, adjusts the microcontroller's oscillation frequency, sorts and distributes instructions according to the task execution window, monitors and mediates conflicts in real time, and activates the backup coordination mechanism.
It achieves high-precision time synchronization of multiple microcontroller systems, improves instruction distribution efficiency, dynamically handles conflicts, and enhances system stability and fault tolerance.
Smart Images

Figure CN120803208B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microcontroller technology, specifically to a clock synchronization instruction synchronization method and system for multiple microcontrollers working collaboratively. Background Technology
[0002] In collaborative operation of multiple microcontrollers, clock synchronization is crucial. Hardware synchronization or software protocols can be used to control the clock deviation of each microcontroller within microseconds. Synchronization commands ensure consistent task execution timing, avoid data conflicts, and improve system collaboration efficiency.
[0003] Patent application number 202111252171.X discloses a collaborative operating system for multiple virtual microcontroller systems in web3D, comprising: multiple virtual microcontroller systems communicatively connected to each other; a virtual computer connected to the multiple virtual microcontroller systems, the virtual computer being used to configure sequential codes for each virtual microcontroller system and control the operation of the collaborative operating system, each sequential code corresponding to a specific virtual microcontroller system; a code input editing box located on the virtual computer for writing C language control code to the virtual microcontroller systems; and a virtual programming adapter located between the virtual computer and the virtual microcontroller systems; the virtual programming adapter... The system identifies and connects to the corresponding virtual microcontroller system based on the sequential encoding instructions output by the virtual computer, and writes the C language control code to it; a virtual power supply connected to the virtual microcontroller system; a virtual voltage converter set between the virtual power supply and the virtual microcontroller system; the virtual voltage converter is used to convert different analog voltages to power the virtual microcontroller system. This system aims to solve the problems that: "traditional virtual microcontrollers cannot achieve the ability to execute logic code, and cannot meet the needs of multi-machine collaborative operation scenarios; the connection relationship between each virtual microcontroller system cannot be correctly configured and lacks a correct signal transmission mechanism, resulting in chaotic signal response between systems".
[0004] However, for scenarios involving multiple microcontrollers working together, the synchronization of instruction distribution and execution is a crucial prerequisite for accurately executing specified instructions.
[0005] To address this, a clock synchronization instruction synchronization method and system for multi-microcontroller collaborative operation is proposed. Summary of the Invention
[0006] In view of the above-mentioned shortcomings of the existing technology, the present invention provides a clock synchronization instruction synchronization method and system for multiple microcontrollers working together, which can effectively solve the problems of the existing technology.
[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions;
[0008] This invention discloses a clock synchronization instruction synchronization system for multi-microcontroller collaborative operation, comprising:
[0009] The system comprises the following modules: a generation module, a receiving module, and a monitoring module. The generation module selects physical phenomena with constant periodicity in the environment and converts them into unique pulse trains with fixed time intervals, serving as a unified time reference signal source for the entire system. The receiving module continuously receives the reference pulse train and compares the cumulative difference between the local clock and the reference pulse train in real time to adjust the microcontroller's oscillation frequency to eliminate the difference. The distribution module collects instructions from each microcontroller, sorts them according to the preset execution window of the associated task, and distributes them to the target microcontroller. The feedback module collects the status information of each microcontroller after executing instructions, encapsulates the collected status information, and feeds it back to the microcontroller that initiated the instruction. The mediation module monitors and identifies instruction execution conflicts or timing conflicts in real time, mediates them according to preset rules prioritizing core system functions, and eliminates conflicts. The monitoring module tracks the operating parameters of system modules and microcontrollers in real time, triggering an abnormal signal and activating a preset backup coordination mechanism when parameters exceed preset thresholds.
[0010] Furthermore, the physical phenomena with constant periodicity selected in the generation module include, but are not limited to: the carrier migration period of semiconductor materials under constant voltage; the round-trip period of ion directional movement in an electrolyte solution of a preset concentration; the stimulated vibration period of a certain type of crystal under laser irradiation of a preset frequency; the collision period of the thermal motion of fixed mass gas molecules in a closed cavity; and the deflection vibration period of magnetic particles in a magnetic field of preset strength.
[0011] The dedicated conversion component in the generation module is integrated with a signal acquisition unit, a periodic purification unit, a pulse shaping unit, and a feedback verification unit.
[0012] Furthermore, during the operation of the dedicated conversion component, the signal acquisition unit selects a periodicity from a preset physical phenomenon. The corresponding conversion element converts it into an initial electrical signal: The periodic purification unit is for Noise is filtered out, and then the period is locked by a closed-loop period locking circuit, thereby stabilizing the output period. Purification signal The pulse shaping unit will Compared with a preset threshold, when When the output width is greater than or equal to the preset threshold, the output width is High-level pulses form a pulse train. The feedback verification unit monitors the pulse interval in real time, and the real-time deviation exceeds... That is, the trigger cycle purification unit is used for correction, and the final output is a pulse train with a fixed and unique time interval;
[0013] In the formula: The amplitude of the signal; The time variable is calculated from the moment when the signal acquisition unit begins to capture the periodic change of the preset physical phenomenon; This is the initial phase;
[0014] The conversion elements include carrier concentration sensors, ion migration detectors, vibration sensors, molecular collision counters, and particle deflection detectors. When performing noise filtering, a filter adapted to this physical phenomenon is used for noise filtering. .
[0015] Furthermore, during the operation of the receiving module, the microcontroller oscillation frequency is adjusted according to the following:
[0016] Calculate the cumulative difference ;
[0017] Adjusted microcontroller oscillation frequency: ;
[0018] In the formula: To calibrate the local clock initial frequency of the receiver module; The time interval between two consecutive reference pulses; The frequency of the reference pulse; These are the linear fine-tuning coefficients;
[0019] in, express The actual cumulative number of pulses of the local clock within the time period. express The theoretical cumulative number of reference pulses within a given time period.
[0020] Furthermore, the operation process of the distribution module includes:
[0021] Instruction collection phase: The distribution module receives instruction data packets from each microcontroller in real time through a preset signal interface. The instruction data packets contain instruction content, initiator identifier, target identifier, task association code, and are stored in a temporary buffer.
[0022] Sorting process: Extract the preset execution window parameters corresponding to the task association code in each instruction data packet, namely the earliest start time stamp and the latest completion time stamp. Sort the instructions in the cache according to the logic that the earlier the latest completion time stamp is, the higher the priority. If there are the same time stamps, sort them again according to the importance level of the functional module to which the initiator belongs, or sort them in parallel.
[0023] Targeted distribution phase: Based on the sorting results, the instruction data packets are sent to the target microcontroller through the corresponding data transmission channels in sequence, and the distribution time and instruction status are recorded synchronously. At the same time, instruction data with the instruction status of "distributed" in the temporary buffer are cleared.
[0024] Furthermore, the status information of each microcontroller after executing the instruction in the feedback module includes: execution progress, result code, and reason for the exception;
[0025] When the feedback module encapsulates the status information of each microcontroller after executing the instruction, the encapsulation format of the status information of each microcontroller after executing the instruction is consistent, and the encapsulation content is the execution progress, result code, and exception reason.
[0026] Furthermore, when the mediation module monitors and identifies instruction execution conflicts or timing conflicts, it continuously scans the instruction execution requests issued by each microcontroller and records the resources involved in each request, including: specific interfaces, computing units, and planned execution periods. When two or more instruction requests simultaneously point to the same resource and the planned execution periods overlap, it is determined to be an instruction execution conflict; when there is a dependency relationship between instructions, it is determined to be a timing conflict.
[0027] After identifying the conflict, the mediation module obtains the number of microcontrollers associated with each conflicting instruction, and determines the conflicting instruction with a large number of associated microcontrollers as the priority execution object and grants it the right to use resources.
[0028] The remaining conflicting instructions enter a preset dynamic waiting pool. The instructions in the pool are sorted in real time according to the number of associated microcontrollers. When the conflicting instruction that is executed first finishes execution or an execution gap occurs, the conflicting instruction with the most associated microcontrollers in the dynamic waiting pool automatically takes over and obtains the right to use the resources.
[0029] Furthermore, the system module for tracking operating parameters by the monitoring module includes a generation module, a receiving module, a distribution module, a feedback module, and a mediation module. The operating parameters include module response time, microcontroller load rate, pulse interval deviation of the generation module, synchronization error of the receiving module, instruction backlog of the distribution module, feedback delay of the feedback module, and conflict handling time of the mediation module.
[0030] The synchronization error of the receiving module is the time difference that still exists between the local clock and the reference clock after adjustment.
[0031] The abnormal signal triggered by the monitoring module is a digital signal consisting of the source module name and microcontroller number of the operating parameters exceeding a preset threshold. During the abnormal signal triggering phase, the abnormal signal is synchronously transmitted to the mediation module and the distribution module, and then the preset backup coordination mechanism is activated.
[0032] The backup coordination mechanism is customized by the system user.
[0033] Furthermore, the generation module is interconnected with the receiving module and the distribution module via a wireless network. The distribution module is interconnected with the feedback module via a wireless network. The feedback module is interconnected with the mediation module via a wireless network. The mediation module is interconnected with the monitoring module via a wireless network.
[0034] On the other hand, a clock synchronization instruction synchronization method for multiple microcontrollers working collaboratively includes the following steps:
[0035] The system captures physical phenomena with constant periodicity in the environment, converts these phenomena into unique pulse trains with fixed time intervals using a dedicated conversion component, and generates and outputs a unified time reference for the entire system. It continuously receives these reference pulse trains, compares the cumulative difference between the local clock and the reference pulse train in real time, and eliminates this difference by linearly fine-tuning its own oscillation frequency, achieving zero-difference synchronization between the local clock and the reference clock. It aggregates instructions issued by various microcontrollers, sorts them according to the preset execution window of the tasks associated with the instructions, and distributes the sorted instructions to the corresponding target microcontrollers. It also collects the execution instructions from each microcontroller. The status information, including execution progress, result code, and exception reason, is encapsulated in a unified format and fed back to the microcontroller that initiated the instruction. Conflicts during instruction execution are monitored and identified in real time, including simultaneous calls to the same resource and contradictory instruction execution order. These conflicts are mediated and eliminated according to preset rules prioritizing core system functions. The operating parameters of each component and the microcontroller are tracked in real time, including module response time and microcontroller load rate. When these operating parameters exceed preset thresholds, an exception signal is triggered and a preset backup coordination mechanism is activated.
[0036] The preset execution window includes the earliest start time and the latest completion time.
[0037] Compared with the known prior art, the technical solution provided by this invention has the following beneficial effects:
[0038] This invention provides a clock synchronization method and system for multi-microcontroller collaborative operation. During execution, this method and system utilize a constant-period physical phenomenon in the environment as a unified time reference, precisely converting it into a stable pulse. This allows for real-time calibration of the local clocks of each microcontroller, significantly reducing clock deviation and ensuring the overall system's time synchronization accuracy. Simultaneously, instructions are scheduled in an orderly manner according to pre-set task execution windows, and hierarchical prioritization based on functional importance improves instruction distribution efficiency. It can dynamically identify and handle instruction execution and timing conflicts, prioritizing tasks with more associated devices to reduce resource contention. Unified encapsulated execution status feedback facilitates real-time tracking of progress and results by the instruction initiator. Furthermore, it monitors system operating parameters in real time, triggering a backup mechanism when thresholds are exceeded, enhancing system stability and fault tolerance, and comprehensively improving the reliability and efficiency of multi-microcontroller collaborative operation. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0040] Figure 1 This is a schematic diagram of a clock synchronization instruction synchronization system for multiple microcontrollers working collaboratively.
[0041] Figure 2 This is a flowchart illustrating a clock synchronization instruction synchronization method for multiple microcontrollers working collaboratively. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0043] The present invention will be further described below with reference to embodiments. Example 1:
[0044] This embodiment describes a clock synchronization instruction synchronization system for multi-microcontroller collaborative operation, such as... Figure 1 As shown, it includes:
[0045] The generation module is used to select physical phenomena with constant periodicity in the environment, and convert them into pulse trains with fixed and unique time intervals through a dedicated conversion component, which serve as a unified time reference signal source for the entire system and are then output.
[0046] It should be noted that:
[0047] The physical phenomena involved in the generation module all originate from dedicated physical generation devices independently set up outside the system, specifically including:
[0048] Semiconductor carrier generator: It consists of a constant temperature chamber independent of the microcontroller, a dedicated semiconductor chip and a regulated power supply, and is specifically designed to generate stable carrier migration phenomena;
[0049] Electrolyte ion movement device: includes a sealed container, a preset concentration electrolyte solution and a DC power supply module. It has no circuit connection with the microcontroller system and only serves as the source of ion movement phenomena.
[0050] Crystal stimulated vibration device: It consists of a laser emitter, a crystal holder and a shockproof base. Its vibration signal is output through a photoelectric converter and is not related to the core processing unit of the microcontroller.
[0051] Gas molecule motion device: It is a sealed metal cavity with a fixed mass of inert gas inside. A constant environment is maintained by a temperature control system, and it is independent of the power supply system of the microcontroller.
[0052] Magnetic particle vibration device: It consists of an electromagnet, a particle suspension cavity and a magnetic field strength controller. Its power supply is completely isolated from the microcontroller power supply system.
[0053] The above devices all exist as independent physical units of the system, and are connected to the microcontroller only through signal transmission lines (not power supply or control lines). The physical phenomena they produce are not affected by the operating status of the microcontroller.
[0054] The physical phenomena with constant periodicity selected in the generation module include, but are not limited to: the carrier migration period of semiconductor materials under constant voltage; the round-trip period of ion directional movement in an electrolyte solution of preset concentration; the stimulated vibration period of a certain type of crystal under laser irradiation of preset frequency; the collision period of thermal motion of fixed mass gas molecules in a closed cavity; and the deflection vibration period of magnetic particles in a magnetic field of preset intensity.
[0055] The dedicated conversion component in the generation module is integrated with a signal acquisition unit, a periodic purification unit, a pulse shaping unit, and a feedback verification unit;
[0056] During the operation of the dedicated conversion component, the signal acquisition unit selects a periodicity from preset physical phenomena. The corresponding conversion element converts it into an initial electrical signal: The periodic purification unit is for Noise is filtered out, and then the period is locked by a closed-loop period locking circuit, thereby stabilizing the output period. Purification signal The pulse shaping unit will Compared with a preset threshold, when When the output width is greater than or equal to the preset threshold, the output width is High-level pulses form a pulse train. The feedback verification unit monitors the pulse interval in real time, and the real-time deviation exceeds... That is, the trigger cycle purification unit is used for correction, and the final output is a pulse train with a fixed and unique time interval;
[0057] In the formula: The amplitude of the signal; The time variable is calculated from the moment when the signal acquisition unit begins to capture the periodic change of the preset physical phenomenon; This is the initial phase;
[0058] The closed-loop period lockout circuit described above consists of a period comparator, an error signal generator, a proportional-integral regulator, and a controllable periodic oscillator cascaded together. Its operation is as follows:
[0059] The period comparator receives the purification signal and the reference signal output by the controllable periodic oscillator in real time. The period values of the two signals are recorded by a counter triggered by the rising edge, and the period difference is calculated (the period difference is equal to the period of the purification signal minus the period of the reference signal). The measurement error of the two period values does not exceed one billionth of the inherent period.
[0060] After receiving the period difference, the error signal generator linearly converts it into a voltage-type error signal. When the period difference is 0, the error signal is 0 volts. When the period difference is positive, the error signal outputs a positive voltage of no more than 5 volts. When the period difference is negative, the error signal outputs a negative voltage of no less than -5 volts.
[0061] The proportional-integral controller processes the error signal by combining proportional and integral regulation, and outputs a control voltage. The proportional regulation quickly reduces the instantaneous error, while the integral regulation eliminates the steady-state error, making the control voltage respond linearly with the period difference.
[0062] The voltage-controlled oscillator unit of the controllable periodic oscillator dynamically adjusts the oscillation frequency according to the control voltage. When the control voltage is 0 volts, the period of the reference signal is equal to the natural period. When the control voltage is positive, the oscillation frequency decreases, which increases the period of the reference signal and the increase is proportional to the value of the control voltage. When the control voltage is negative, the oscillation frequency increases, which decreases the period of the reference signal and the decrease is proportional to the absolute value of the control voltage.
[0063] The deviation between the period of the adjusted reference signal and the inherent period does not exceed eight parts per billion of the inherent period. Through the above closed-loop feedback, when the period of the purified signal fluctuates due to interference, the circuit can correct the period difference to an absolute value not exceeding eight parts per billion of the inherent period within 10 periods, ensuring that the period of the reference signal is stably locked to the inherent period;
[0064] Among them, the conversion elements include a carrier concentration sensor, an ion migration detector, a vibration sensor, a molecular collision counter, and a particle deflection detector. When performing noise filtering, a filter adapted to this physical phenomenon is used for noise filtering. ;
[0065] The receiving module is used to continuously receive the reference pulse train, and compare the cumulative difference between the local clock and the reference pulse in real time to adjust the oscillation frequency of the single-chip microcomputer to eliminate this difference;
[0066] During the operation stage of the receiving module, when adjusting the oscillation frequency of the single-chip microcomputer, it follows:
[0067] Calculate the cumulative difference ;
[0068] The oscillation frequency of the single-chip microcomputer after adjustment: ;
[0069] In the formula: is the initial frequency of the local clock of the clock calibration receiving module; is the time interval between two consecutive reference pulses; is the frequency of the reference pulse; is the linear fine-tuning coefficient;
[0070] Among them, represents the actual cumulative number of pulses of the local clock within the time of represents the theoretical cumulative number of reference pulses within the time of
[0071] It should be noted that the linear fine-tuning coefficient Initial calibration stage: When the cumulative difference between the local clock and the reference pulse is large (such as ), a larger k value is taken (such as 0.6 < k < 0.8). At this time, it is necessary to quickly reduce the difference and accelerate the calibration speed to avoid deviating from the reference clock for a long time.
[0072] Fine-tuning calibration stage: When the cumulative difference is small (such as 1 ≤ |ΔN| < 5), a medium k value is taken (such as 0.3 < k < 0.5). This not only ensures continuous reduction of the difference but also avoids frequent oscillation of the clock due to excessive adjustment amplitude.
[0073] Steady-state maintenance stage: When the cumulative number difference approaches 0 (such as ΔN| = 0 or 1), a smaller k value is taken (such as 0.1 < k < 0.2). At this time, the main focus is on maintaining the clock stability. Only through minor adjustments can the drift caused by environmental interference be offset to ensure the synchronization accuracy;
[0074] In addition, the maximum value of k needs to be limited within 0.8 to prevent the local clock frequency from mutating due to an overly large single adjustment, which may disrupt the continuity of system operation; the minimum value should not be lower than 0.1 to ensure that small deviations can still be effectively corrected under environmental interference.
[0075] Distribution module, used to collect the instructions sent by each single-chip microcomputer, sort them according to the preset execution window period of the tasks associated with the instructions, and then distribute them to the target single-chip microcomputer in a targeted manner;
[0076] The operation process of the distribution module includes:
[0077] Instruction collection link: The distribution module receives the instruction data packets sent by each single-chip microcomputer in real time through the preset signal interface. The instruction data packets include instruction content, originator identification, target identification, and task association code, and are stored in the temporary buffer;
[0078] Sorting link: Extract the preset execution window period parameters corresponding to the task association code in each instruction data packet, that is, the earliest start timestamp and the latest completion timestamp. According to the logic that the higher the priority is when the latest completion timestamp is earlier, sort the instructions in the buffer. If there are identical timestamps, secondary sorting or parallel sorting is performed based on the importance level of the functional module to which the originator belongs;
[0079] Targeted distribution link: According to the sorting result, sequentially send the instruction data packets to the target single-chip microcomputer through the corresponding data transmission channels, and synchronously record the distribution time and instruction status. At the same time, clear the instruction data with the instruction status of "completed distribution" in the temporary buffer;
[0080] Feedback module, used to collect the status information of each single-chip microcomputer after executing the instruction, encapsulate the collected status information of each single-chip microcomputer after executing the instruction, and feedback it to the single-chip microcomputer that initiated the instruction;
[0081] The status information of each single-chip microcomputer after executing the instruction in the feedback module includes: execution progress, result code, and reason for exception;
[0082] Further explanations regarding the execution progress, result code, and reason for exception:
[0083] Execution progress:
[0084] Based on the total number of operation steps contained in the instruction, the percentage of the currently completed steps is quantified using percentages. For example, if an instruction needs to complete three steps: "data acquisition - processing - result output", the execution progress is 66.66% when the first two steps are completed.
[0085] The actual time spent on each step is recorded synchronously and compared with the preset standard time to generate a progress deviation value (such as 5% ahead or 3% behind) to help judge the execution efficiency.
[0086] Result code:
[0087] A 4-digit code is used. The first two digits identify the instruction type (e.g., "01" represents data transmission and "02" represents control). The last two digits indicate the execution result. For example, "00" means the execution is completed as expected; "01" means the core function is completed but the additional function is not implemented; "10" means the execution is interrupted and cannot be recovered; and "11" means the execution result conflicts with the expectation.
[0088] Reason for the abnormality:
[0089] Hardware-related: including quantifiable physical anomalies such as "no signal input at the specified interface", "vibration of the actuator exceeds the stability threshold", and "power supply voltage fluctuation exceeds 3%".
[0090] Logical issues include program execution errors such as "instruction parameters conflict with local preset range", "preceding dependent instructions not executed", and "simultaneously received instructions have irreconcilable overlap in timing".
[0091] All abnormal causes are associated with the specific time of occurrence (accurate to 1 / 10 of the reference pulse period) to facilitate tracing and troubleshooting;
[0092] When encapsulating the status information of each microcontroller after executing instructions in the feedback module, the encapsulation format of the status information of each microcontroller after executing instructions is consistent, and the encapsulation content is the execution progress, result code, and exception reason.
[0093] The mediation module is used to monitor and identify command execution conflicts or timing conflicts in real time, and mediate and eliminate conflicts according to preset rules that prioritize the core functions of the system.
[0094] When the mediation module monitors and identifies instruction execution conflicts or timing conflicts, it continuously scans the instruction execution requests issued by each microcontroller and records the resources involved in each request, including: specific interfaces, computing units, and planned execution periods. When two or more instruction requests point to the same resource at the same time and the planned execution periods overlap, it is determined to be an instruction execution conflict; when there is a dependency relationship between instructions, it is determined to be a timing conflict.
[0095] Examples of the above dependencies:
[0096] If instruction B needs to be executed after instruction A is completed, but it is detected that instruction B starts before instruction A;
[0097] The specific interface and the arithmetic unit are shared collaborative components independent of each microcontroller. The specific interface and the arithmetic unit are connected to all microcontrollers through a dedicated signal interaction path, and can be called by any microcontroller to complete instruction execution.
[0098] Specific interfaces include: command transmission interface, status feedback interface, pulse signal interface, and resource call interface;
[0099] After the mediation module identifies the conflict, it obtains the number of microcontrollers associated with each conflicting instruction, and determines the conflicting instruction with a larger number of associated microcontrollers as the priority execution object and grants it the right to use resources.
[0100] The remaining conflicting instructions enter the preset dynamic waiting pool. The instructions in the pool are sorted in real time according to the number of associated microcontrollers. When the conflicting instruction that is executed first finishes execution or an execution gap occurs, the conflicting instruction with the most associated microcontrollers in the dynamic waiting pool automatically takes over and obtains the right to use the resources.
[0101] The monitoring module is used to track the operating parameters of the system modules and the microcontroller in real time. When the parameters exceed the preset threshold, an abnormal signal is triggered and the preset backup coordination mechanism is activated.
[0102] Pre-defined backup coordination mechanisms include, but are not limited to:
[0103] The first preset backup coordination mechanism is as follows: After the system triggers an abnormal signal, the material resonance sensor equipped on each microcontroller is activated to capture the resonant frequency change of a specific solid material under the influence of environmental pressure and convert it into a temporary coordination signal. At the same time, according to the execution stage of the task undertaken by the abnormal module, the task is broken down into multiple consecutive operation units. Based on the real-time load of the unaffected microcontrollers, the operation units are dynamically allocated. The execution order of each operation unit is coordinated through the temporary coordination signal to ensure that the core functions of the system are uninterrupted. After the abnormality is resolved, the task flow is reassembled to restore the original coordination mode.
[0104] The second preset backup coordination mechanism is as follows: When the system triggers an abnormal signal, the environmental field strength sensing components of each microcontroller are activated to collect fluctuation data of a certain stable field strength in the surrounding space, thereby generating a temporary synchronization benchmark. Then, according to the functional importance of the abnormal module, the tasks it is responsible for are sorted by priority, and high-priority tasks are assigned to unaffected microcontrollers with corresponding functional interfaces. The execution time of each microcontroller is calibrated through the temporary synchronization benchmark to ensure the timely completion of critical tasks. After the abnormality is eliminated, the tasks are gradually migrated back and the original coordination architecture is restored.
[0105] The third preset backup coordination mechanism is as follows: After the system triggers an abnormal signal, the energy fluctuation capture device built into each microcontroller is activated to obtain the periodic fluctuation information of a certain energy form in the environment and convert it into temporary coordination instructions. At the same time, the tasks undertaken by the abnormal module are functionally decomposed, the core functional modules are extracted, and the core functional modules are adapted to the corresponding microcontrollers according to the functional compatibility of the unaffected microcontrollers. The operation of each core functional module is coordinated through temporary coordination instructions to maintain the most basic functional output of the system. After the abnormality is resolved, the functional modules are re-integrated to restore the original coordination state.
[0106] The system modules that monitor and track operating parameters include a generation module, a receiving module, a distribution module, a feedback module, and a mediation module. The operating parameters include module response time, microcontroller load rate, pulse interval deviation of the generation module, synchronization error of the receiving module, instruction backlog of the distribution module, feedback delay of the feedback module, and conflict handling time of the mediation module.
[0107] The synchronization error of the receiving module is the time difference that still exists between the local clock and the reference clock after adjustment;
[0108] The abnormal signal triggered by the monitoring module is a digital signal consisting of the source module name and microcontroller number of the operating parameters exceeding the preset threshold. During the abnormal signal triggering phase, the abnormal signal is synchronously transmitted to the mediation module and the distribution module, and then the preset backup coordination mechanism is activated.
[0109] The backup coordination mechanism is customized by the system user.
[0110] The generation module interacts with the receiving module and the distribution module via a wireless network. The distribution module interacts with the feedback module via a wireless network. The feedback module interacts with the mediation module via a wireless network. The mediation module interacts with the monitoring module via a wireless network.
[0111] In this embodiment, the generation module selects physical phenomena with constant periodicity in the environment and converts them into pulse trains with fixed and unique time intervals through a dedicated conversion component. These pulse trains serve as a unified time reference signal source for the entire system and are output. The receiving module continuously receives the reference pulse train and compares the cumulative difference between the local clock and the reference pulse in real time to adjust the microcontroller's oscillation frequency to eliminate the difference. The distribution module then collects the instructions issued by each microcontroller, sorts them according to the preset execution window period of the task associated with the instruction, and distributes them to the target microcontroller. The feedback module further collects the status information of each microcontroller after executing the instruction, encapsulates the collected status information, and feeds it back to the microcontroller that initiated the instruction. The mediation module monitors and identifies instruction execution conflicts or timing conflicts in real time and mediates them according to preset rules that prioritize the core functions of the system to eliminate conflicts. Finally, the monitoring module tracks the operating parameters of the system modules and microcontrollers in real time. When the parameters exceed the preset threshold, an abnormal signal is triggered and a preset backup coordination mechanism is activated.
[0112] In the above embodiments, the system can provide a unified time reference by using constant periodic physical phenomena in the environment to synchronize the clocks of each microcontroller; it can distribute instructions in an orderly manner according to the task window period to ensure orderly execution, and provide timely feedback on the execution status, resolve instruction and timing conflicts, and prioritize the protection of core functions; it can monitor operating parameters in real time, activate the backup mechanism in case of abnormalities, improve the efficiency and stability of multi-microcontroller collaboration, reduce conflicts, and enhance the system's fault tolerance. Example 2:
[0113] At the implementation level, based on Example 1, this example refers to... Figure 2 A further detailed description of the clock synchronization instruction synchronization system for multi-microcontroller collaborative operation in Embodiment 1 is provided below:
[0114] A clock synchronization instruction synchronization method for multiple microcontrollers working collaboratively includes the following steps:
[0115] It captures physical phenomena with constant periodicity in the environment, uses a dedicated conversion component to convert the physical phenomena into pulse trains with fixed and unique time intervals, and generates and outputs a unified time reference for the entire system.
[0116] It continuously receives reference pulse trains, compares the cumulative difference between the local clock and the reference pulse in real time, and eliminates the difference by linearly fine-tuning its own oscillation frequency, so that the local clock and the reference clock achieve zero-difference synchronization.
[0117] The system collects instructions from various microcontrollers, sorts them according to the preset execution window of the task associated with each instruction, and then distributes the sorted instructions to the corresponding target microcontroller.
[0118] Collect the status information of each microcontroller after executing the instruction. The status information includes the execution progress, result code and exception reason. After the status information is encapsulated in a unified format, it is fed back to the microcontroller that initiated the instruction.
[0119] Real-time monitoring and identification of conflicts during instruction execution, including simultaneous calls to the same resource and contradictory instruction execution order; resolving conflicts based on preset rules that prioritize the core functions of the system to eliminate them.
[0120] Real-time tracking of the operating parameters of each component and the microcontroller, including module response time and microcontroller load rate. When the operating parameters exceed the preset threshold, an abnormal signal is triggered and the preset backup coordination mechanism is activated.
[0121] The preset execution window includes the earliest start time and the latest completion time.
[0122] In summary, during execution, the system in the above embodiments uses constant-period physical phenomena in the environment as a unified time reference. Through precise conversion, stable pulses are formed, enabling real-time calibration of the local clocks of each microcontroller, significantly reducing clock deviation and ensuring the time synchronization accuracy of the entire system. Simultaneously, instructions are scheduled in an orderly manner according to pre-set execution windows for each task, and hierarchical sorting based on functional importance improves instruction distribution efficiency. It can dynamically identify and handle instruction execution and timing conflicts, prioritizing tasks with many associated devices to reduce resource contention. The unified encapsulated execution status feedback facilitates real-time tracking of progress and results by the instruction initiator. Furthermore, it monitors system operating parameters in real time, triggering a backup mechanism when thresholds are exceeded, enhancing system stability and fault tolerance, and overall improving the reliability and efficiency of multi-microcontroller collaborative work.
[0123] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A clock synchronization instruction synchronization system for multi-microcontroller collaborative operation, characterized in that, include: The generation module is used to select physical phenomena with constant periodicity characteristics in the environment, and convert them into pulse trains with fixed and unique time intervals through a dedicated conversion component. These pulse trains serve as a unified time reference signal source for the entire system and are then output. The physical phenomena with constant periodicity characteristics selected by the generation module include, but are not limited to: the carrier migration period of semiconductor materials under constant voltage; the round-trip period of directional ion movement in an electrolyte solution of a preset concentration; the stimulated vibration period of a certain type of crystal under laser irradiation of a preset frequency; the collision period of the thermal motion of fixed mass gas molecules in a closed cavity; and the deflection vibration period of magnetic particles in a magnetic field of preset intensity. The dedicated conversion component in the generation module is integrated with a signal acquisition unit, a periodic purification unit, a pulse shaping unit, and a feedback verification unit. The receiving module is used to continuously receive the reference pulse train and compare the cumulative difference between the local clock and the reference pulse in real time to adjust the microcontroller oscillation frequency to eliminate the difference. The distribution module is used to collect instructions issued by each microcontroller, sort them according to the preset execution window of the task associated with the instruction, and then distribute them to the target microcontroller. The operation process of the distribution module includes: Instruction collection phase: The distribution module receives instruction data packets from each microcontroller in real time through a preset signal interface. The instruction data packets contain instruction content, initiator identifier, target identifier, task association code, and are stored in a temporary buffer. Sorting process: Extract the preset execution window parameters corresponding to the task association code in each instruction data packet, namely the earliest start time stamp and the latest completion time stamp. Sort the instructions in the cache according to the logic that the earlier the latest completion time stamp is, the higher the priority. If there are the same time stamps, sort them again according to the importance level of the functional module to which the initiator belongs, or sort them in parallel. Targeted distribution stage: Based on the sorting results, the instruction data packets are sent to the target microcontroller through the corresponding data transmission channels in sequence, and the distribution time and instruction status are recorded synchronously. At the same time, instruction data with the instruction status of "distributed" in the temporary buffer are cleared. The feedback module is used to collect the status information of each microcontroller after executing the instruction, encapsulate the collected status information of each microcontroller after executing the instruction, and feed it back to the microcontroller that initiated the instruction. The mediation module is used to monitor and identify command execution conflicts or timing conflicts in real time, and mediate and eliminate conflicts according to preset rules that prioritize the core functions of the system. The monitoring module is used to track the operating parameters of system modules and microcontrollers in real time. When the parameters exceed the preset threshold, an abnormal signal is triggered and the preset backup coordination mechanism is activated.
2. The clock synchronization instruction synchronization system for multi-microcontroller collaborative operation according to claim 1, characterized in that, During the operation of the dedicated conversion component, the signal acquisition unit selects a periodicity from a preset physical phenomenon. The corresponding conversion element converts it into an initial electrical signal: The periodic purification unit is for Noise is filtered out, and then the period is locked by a closed-loop period locking circuit, thereby stabilizing the output period. Purification signal The pulse shaping unit will Compared with a preset threshold, when When the output width is greater than or equal to the preset threshold, the output width is High-level pulses form a pulse train. The feedback verification unit monitors the pulse interval in real time, and the real-time deviation exceeds... That is, the trigger cycle purification unit is used for correction, and the final output is a pulse train with a fixed and unique time interval; In the formula: The amplitude of the signal; The time variable is calculated from the moment when the signal acquisition unit begins to capture the periodic change of the preset physical phenomenon; This is the initial phase; The conversion elements include carrier concentration sensors, ion migration detectors, vibration sensors, molecular collision counters, and particle deflection detectors. When performing noise filtering, a filter adapted to this physical phenomenon is used for noise filtering. ∈ .
3. A clock synchronization instruction synchronization system for multi-microcontroller collaborative operation according to claim 1, characterized in that, During the operation of the receiving module, the microcontroller oscillation frequency is adjusted according to the following: Calculate the cumulative difference ; Adjusted microcontroller oscillation frequency: ; In the formula: To calibrate the local clock initial frequency of the receiver module; The time interval between two consecutive reference pulses; The frequency of the reference pulse; These are the linear fine-tuning coefficients; in, express The actual cumulative number of pulses of the local clock within the time period. express The theoretical cumulative number of reference pulses within a given time period.
4. A clock synchronization instruction synchronization system for multi-microcontroller collaborative operation according to claim 1, characterized in that, The status information of each microcontroller after executing instructions in the feedback module includes: execution progress, result code, and reason for the exception. When the feedback module encapsulates the status information of each microcontroller after executing the instruction, the encapsulation format of the status information of each microcontroller after executing the instruction is consistent, and the encapsulation content is the execution progress, result code, and exception reason.
5. A clock synchronization instruction synchronization system for multi-microcontroller collaborative operation according to claim 1, characterized in that, When the mediation module monitors and identifies instruction execution conflicts or timing conflicts, it continuously scans the instruction execution requests issued by each microcontroller and records the resources involved in each request, including: specific interfaces, computing units, and planned execution periods. When two or more instruction requests point to the same resource at the same time and the planned execution periods overlap, it is determined to be an instruction execution conflict; when there is a dependency relationship between instructions, it is determined to be a timing conflict. After identifying the conflict, the mediation module obtains the number of microcontrollers associated with each conflicting instruction, and determines the conflicting instruction with a large number of associated microcontrollers as the priority execution object and grants it the right to use resources. The remaining conflicting instructions enter a preset dynamic waiting pool. The instructions in the pool are sorted in real time according to the number of associated microcontrollers. When the conflicting instruction that is executed first finishes execution or an execution gap occurs, the conflicting instruction with the most associated microcontrollers in the dynamic waiting pool automatically takes over and obtains the right to use the resources.
6. A clock synchronization instruction synchronization system for multi-microcontroller collaborative operation according to claim 1, characterized in that, The system modules for tracking operating parameters by the monitoring module include a generation module, a receiving module, a distribution module, a feedback module, and a mediation module. The operating parameters include module response time, microcontroller load rate, pulse interval deviation of the generation module, synchronization error of the receiving module, instruction backlog of the distribution module, feedback delay of the feedback module, and conflict handling time of the mediation module. The synchronization error of the receiving module is the time difference that still exists between the local clock and the reference clock after adjustment. The abnormal signal triggered by the monitoring module is a digital signal consisting of the source module name and microcontroller number of the operating parameters exceeding a preset threshold. During the abnormal signal triggering phase, the abnormal signal is synchronously transmitted to the mediation module and the distribution module, and then the preset backup coordination mechanism is activated. The backup coordination mechanism is customized by the system user.
7. A clock synchronization instruction synchronization system for multi-microcontroller collaborative operation according to claim 1, characterized in that, The generation module is interconnected with the receiving module and the distribution module via a wireless network. The distribution module is interconnected with the feedback module via a wireless network. The feedback module is interconnected with the mediation module via a wireless network. The mediation module is interconnected with the monitoring module via a wireless network.
8. A method for synchronizing clock and instructions for multi-microcontroller collaborative operation, wherein the method is an implementation method of the clock and instruction synchronization system for multi-microcontroller collaborative operation as described in any one of claims 1-7, characterized in that, Includes the following steps: The system captures physical phenomena with constant periodicity in the environment, uses a dedicated conversion component to convert the physical phenomena into pulse trains with fixed and unique time intervals, and generates and outputs a unified time reference for the entire system. The system continuously receives the reference pulse train, compares the cumulative difference between the local clock and the reference pulse in real time, and eliminates the difference by linearly fine-tuning its own oscillation frequency, so that the local clock and the reference clock achieve zero-difference synchronization. The system collects instructions from various microcontrollers, sorts them according to the preset execution window of the task associated with each instruction, and then distributes the sorted instructions to the corresponding target microcontroller. Collect the status information of each microcontroller after executing the instruction. The status information includes the execution progress, result code and exception reason. After the status information is encapsulated in a unified format, it is fed back to the microcontroller that initiated the instruction. Real-time monitoring and identification of conflicts during instruction execution, including simultaneous invocation of the same resource and contradictory instruction execution order; and mediation of the conflicts based on preset rules that prioritize the core functions of the system to eliminate them. The system tracks the operating parameters of each component and the microcontroller in real time. These operating parameters include module response time and microcontroller load rate. When the operating parameters exceed a preset threshold, an abnormal signal is triggered and a preset backup coordination mechanism is activated. The preset execution window includes the earliest start time and the latest completion time.
Citation Information
Patent Citations
A collaborative operation method and system for a web3D multi-virtual microcontroller system
CN113703925B
Shortwave channel synchronous device and shortwave channel synchronous switching control system
CN103051409A
Multi-source instruction uploading method and system based on priority scheduling, medium and equipment
CN114528020A