Method and device for controlling data exchange of multiple processors through single port

By sending service commands to the target processor in parallel through the serial port processing unit, the problem of a single port being unable to effectively control multiple processors is solved, and physical isolation and efficient management are achieved.

CN119292973APending Publication Date: 2025-01-10STATE GRID FUJIAN ELECTRIC POWER CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411803516.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In existing technologies, a single port cannot effectively control multiple processors, resulting in cumbersome operation and problems with serial port channel switching failures.

Method used

A serial port processing unit is used to identify service commands through the external serial port, parse the serial port number of the target processor, and send the service commands to the target processor in parallel, thereby realizing physical isolation and parallel management of multiple processors.

Benefits of technology

It simplifies multiprocessor management, avoids frequent serial port channel switching, improves processing efficiency, avoids serial port switching failures, and achieves effective control of multiple processors from a single port.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292973A_ABST
    Figure CN119292973A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for controlling data exchange of multiple processors through a single port, the device comprises a serial port processing unit, the serial port processing unit comprises at least two processor serial ports and an external serial port, different processor serial ports are used for being connected with different service processors respectively, and physical isolation between the different service processors is achieved; the external serial port is used for being connected with terminal equipment, and the serial port processing unit executes the following steps: acquiring a service command; analyzing the service command to obtain at least one target processor serial port serial number; and according to the serial port sequence number of the target processor, sending the service command to a target service processor corresponding to the serial port sequence number of the target processor in parallel. As the service commands are sent out in parallel, frequent switching of serial port channels is not needed, and management of multiple processors is simplified; moreover, a serial port channel switching step does not exist, and the problem that serial port switching cannot be completed can be avoided, so that the problem that an existing single port cannot effectively control multiple processors is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method and device for controlling multi-processor data exchange with a single port. Background Art

[0002] With the intelligent transformation of power distribution networks, the number of three-remote and four-remote services, unmanned operations, and environmental monitoring services has increased sharply, and the number of devices required has also increased, resulting in increased equipment procurement investment, network deployment and construction costs, and management and operation and maintenance manpower investment. Therefore, the integrated bearer of multiple types of services has emerged. In order to meet the requirements of physical isolation of multiple types of services, integrated bearer equipment generally uses independent processors to process each type of service to ensure that resources are completely independent. Therefore, there are multiple processors in the integrated device. When further managing and debugging each processor through the serial port, there is a need to manage multiple processors through a single serial port.

[0003] At present, a single serial port usually manages multiple processors by: 1) external jumpers, dip switches, etc. to control the internal serial port switching module. The serial port switching module identifies the status of the switch / dip switch, etc., switches the serial port channel to connect different processors, and achieves the purpose of communicating with different processors. However, when managing different processors, it is necessary to frequently control jumpers or switches, which is cumbersome.

[0004] 2) After the processor parses the serial port command, it controls the serial port switching module to switch the serial port channel and communicate with different processors. However, when the processor currently connected to the serial port channel fails and cannot parse the command, the serial port switching cannot be completed.

[0005] 3) Manage other processors by adding a main control board, such as modular switches, routers, etc. However, due to the existence of the management channel, there will be a risk of intercommunication between other processors, and the effect of physical isolation cannot be achieved. Summary of the invention

[0006] The technical problem to be solved by the present invention is to provide a method and device for controlling data exchange of multiple processors with a single port, so as to solve the problem that the existing single port cannot effectively control multiple processors.

[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is: A method for controlling multi-processor data exchange with a single port, comprising a serial port processing unit, the serial port processing unit comprising at least two processor serial ports and an external serial port, different processor serial ports are respectively used to connect to different service processors, the external serial port is used to connect to a terminal device, and the serial port processing unit performs the following steps: Identify external serial port commands through the external serial port and obtain business commands; Parsing the service command to obtain at least one target processor serial port number; According to the target processor serial port number, the service command is sent in parallel to the target service processor corresponding to the target processor serial port number.

[0008] In order to solve the above technical problems, another technical solution adopted by the present invention is: A device for controlling data exchange of multiple processors with a single port, characterized in that it comprises a serial port processing unit, the serial port processing unit comprises at least two processor serial ports and an external serial port, different processor serial ports are respectively used to connect to different service processors, and the external serial port is used to connect to a terminal device, and also comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Identify external serial port commands through the external serial port and obtain business commands; Parsing the service command to obtain at least one target processor serial port number; According to the target processor serial port number, the service command is sent in parallel to the target service processor corresponding to the target processor serial port number.

[0009] The beneficial effects of the present invention are as follows: the multiple processor serial ports of the serial port processing unit are respectively connected to multiple groups of different business processors to achieve physical isolation between different business processors; in the process of processing business commands, after receiving the business commands and parsing the serial port number of the target processor therein, the business commands are sent in parallel to the target business processor corresponding to the serial port number of the target processor; since the business commands are sent in parallel, there is no need to frequently switch the serial port channels, thereby simplifying the management of multiple processors; and there is no step of switching the serial port channels, which can avoid the problem of being unable to complete the serial port switching, thereby solving the problem that the existing single port cannot effectively control multiple processors. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 A schematic diagram of the connection of a serial port processing unit in a method for controlling multi-processor data exchange with a single port in an embodiment of the present invention; Figure 2 A flowchart of a method for controlling multi-processor data exchange through a single port in an embodiment of the present invention; Figure 3 A first communication schematic diagram of a serial port processing unit in a method for controlling multi-processor data exchange with a single port in an embodiment of the present invention; Figure 4 A second communication schematic diagram of a serial port processing unit in a method for controlling multi-processor data exchange with a single port in an embodiment of the present invention; Figure 5 A third communication schematic diagram of a serial port processing unit in a method for controlling multi-processor data exchange with a single port in an embodiment of the present invention; Figure 6 The present invention is a schematic diagram of a device for controlling data exchange among multiple processors using a single port. DETAILED DESCRIPTION

[0011] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0012] Please refer to Figure 1 A method for controlling data exchange of multiple processors with a single port, comprising a serial port processing unit, wherein the serial port processing unit comprises at least two processor serial ports and an external serial port, wherein different processor serial ports are respectively used to connect to different service processors, and the external serial port is used to connect to a terminal device, wherein the serial port processing unit performs the following steps: Get business commands; Parsing the service command to obtain at least one target processor serial port number; According to the target processor serial port number, the service command is sent in parallel to the target service processor corresponding to the target processor serial port number.

[0013] From the above description, it can be seen that the beneficial effects of the present invention are: the multiple processor serial ports of the serial port processing unit are respectively connected to multiple groups of different business processors to achieve physical isolation between different business processors; in the process of processing business commands, after receiving the business commands and parsing the serial port number of the target processor therein, the business commands are sent in parallel to the target business processor corresponding to the serial port number of the target processor; since the business commands are issued in parallel, there is no need to frequently switch the serial port channels, thereby simplifying the management of multiple processors; and there is no step of switching the serial port channels, which can avoid the problem of being unable to complete the serial port switching, thereby solving the problem that the existing single port cannot effectively control multiple processors.

[0014] Furthermore, the parsing of the service command further includes: It is determined whether the service command is parsed to obtain the serial port number of the target processor; if not, the service command is executed by the serial port processing unit, and the execution result is fed back through the external serial port.

[0015] From the above description, it can be seen that when the service command does not need to be processed by the service processor, the service command is directly executed by the serial port processing unit and the execution result is fed back, thereby improving the processing efficiency of the service command and avoiding the waste of service processor resources.

[0016] Furthermore, after sending the service commands in parallel to the target service processor corresponding to the serial port number of the target processor, the method further includes: Receive the service execution result returned by the target service processor that executes the service command, and determine whether all the target service processors have returned the service execution result. If so, feed back all the service execution results in turn through the external serial port.

[0017] From the above description, it can be known that only after receiving the service execution results returned by all target service processors processing the service commands, all the service execution results are fed back in sequence through the external serial port, so as to avoid the problem of missing service execution results.

[0018] Furthermore, the step of sequentially feeding back all the service execution results through the external serial port includes: Obtain the serial port number of the target processor corresponding to all the business execution results; Sorting all the service execution results according to the target processor serial port numbers corresponding to the service execution results to obtain an output sequence; All the service execution results are fed back in sequence through the external serial port according to the output sequence.

[0019] From the above description, it can be seen that after all business execution results are sorted according to the target processor serial port numbers corresponding to the business execution results, they are fed back in sequence through the external serial port, so that the business execution results are arranged in order, thereby improving the efficiency of subsequent data processing.

[0020] Further, after receiving the service execution result returned by the target service processor that executes the service command, the method further includes: Associating the target service processor with the service execution result to obtain association information; Feedback of all the service execution results in sequence through the external serial port includes: After all the business execution results carry the corresponding associated information, they are fed back through the external serial port.

[0021] It can be seen from the above description that by associating the target service processor with the service execution result and outputting the service execution result to the external serial port after carrying the corresponding association information, it is possible to clearly identify which service processor generated the service execution result.

[0022] A device for controlling data exchange of multiple processors with a single port, comprising a serial port processing unit, wherein the serial port processing unit comprises at least two processor serial ports and an external serial port, wherein different processor serial ports are respectively used to connect to different service processors, and the external serial port is used to connect to a terminal device, and further comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Get business commands; Parsing the service command to obtain at least one target processor serial port number; According to the target processor serial port number, the service command is sent in parallel to the target service processor corresponding to the target processor serial port number.

[0023] From the above description, it can be seen that the beneficial effects of the present invention are: the multiple processor serial ports of the serial port processing unit are respectively connected to multiple groups of different business processors to achieve physical isolation between different business processors; in the process of processing business commands, after receiving the business commands and parsing the serial port number of the target processor therein, the business commands are sent in parallel to the target business processor corresponding to the serial port number of the target processor; since the business commands are issued in parallel, there is no need to frequently switch the serial port channels, thereby simplifying the management of multiple processors; and there is no step of switching the serial port channels, which can avoid the problem of being unable to complete the serial port switching, thereby solving the problem that the existing single port cannot effectively control multiple processors.

[0024] Furthermore, the parsing of the service command further includes: It is determined whether the service command is parsed to obtain the serial port number of the target processor; if not, the service command is executed by the serial port processing unit, and the execution result is fed back through the external serial port.

[0025] From the above description, it can be seen that when the service command does not need to be processed by the service processor, the service command is directly executed by the serial port processing unit and the execution result is fed back, thereby improving the processing efficiency of the service command and avoiding the waste of service processor resources.

[0026] Furthermore, after sending the service commands in parallel to the target service processor corresponding to the serial port number of the target processor, the method further includes: Receive the service execution result returned by the target service processor that executes the service command, and determine whether all the target service processors have returned the service execution result. If so, feed back all the service execution results in turn through the external serial port.

[0027] From the above description, it can be known that only after receiving the service execution results returned by all target service processors processing the service commands, all the service execution results are fed back in sequence through the external serial port, so as to avoid the problem of missing service execution results.

[0028] Furthermore, the step of sequentially feeding back all the service execution results through the external serial port includes: Obtain the serial port number of the target processor corresponding to all the business execution results; Sorting all the service execution results according to the target processor serial port numbers corresponding to the service execution results to obtain an output sequence; All the service execution results are fed back in sequence through the external serial port according to the output sequence.

[0029] From the above description, it can be seen that after all business execution results are sorted according to the target processor serial port numbers corresponding to the business execution results, they are fed back in sequence through the external serial port, so that the business execution results are arranged in order, thereby improving the efficiency of subsequent data processing.

[0030] Further, after receiving the service execution result returned by the target service processor that executes the service command, the method further includes: Associating the target service processor with the service execution result to obtain association information; Feedback of all the service execution results in sequence through the external serial port includes: After all the business execution results carry the corresponding associated information, they are fed back through the external serial port.

[0031] It can be seen from the above description that by associating the target service processor with the service execution result and outputting the service execution result to the external serial port after carrying the corresponding association information, it is possible to clearly identify which service processor generated the service execution result.

[0032] The method and device for controlling data exchange of multiple processors by a single port provided by the present invention can be applied to various business integration scenarios to realize data exchange of multiple processors by a single port, which is described below through specific implementation methods: Embodiment 1 A method for controlling multi-processor data exchange with a single port, please refer to Figure 1 , including a serial port processing unit, the serial port processing unit includes at least two processor serial ports and an external serial port, and different processor serial ports are used to connect to different service processors, such as Figure 1 The serial ports 1 to 1 are connected to processors 1 to 1 respectively, and the external serial ports are used to connect to terminal equipment.

[0033] Please refer to Figure 2 , the serial port processing unit performs the following steps: S1. Obtaining a service command; that is, the serial port processing unit identifies an external serial port instruction through an external serial port to obtain the service command.

[0034] S2. Parse the service command to obtain at least one target processor serial port number. In an optional implementation, the instruction frame of the service command is: command (console[m]); wherein m is 1-n, indicating the target processor serial port number; and may include multiple numbers separated by English “,”; for example, console[1,2,3,5,9], i.e., the target processor serial port numbers include 1, 2, 3, 5 and 9. The parsing of the service command also includes: Step S21, determining whether the service command is parsed to obtain the serial port number of the target processor; if not, executing the service command through the serial port processing unit, and feeding back the execution result through the external serial port.

[0035] Please refer to Figure 3 For example, when the received instruction is command (console[]), it means that the service command does not contain the serial port number of the target processor. Therefore, the instruction is issued to the serial port processing unit for execution. After the serial port processing unit executes the command, it feeds back the result of executing the command.

[0036] S3, according to the serial port number of the target processor, sending the service command in parallel to the target service processor corresponding to the serial port number of the target processor; waiting for the target service processor to execute the service command and receive the returned service execution result; Please refer to Figure 4 When the instruction command (console[m]) has content, this instruction is issued to the processor of the corresponding serial port for execution. The multi-serial port processor sends the instruction to the corresponding processor through the corresponding serial port, and recovers the execution result of the corresponding processor on this serial port, and then outputs its execution result through the external serial port; for example, command (console[1]), that is, this instruction is issued to the processor 1 of the corresponding serial port for execution, and the serial port processing unit sends the instruction to the corresponding business processor 1 through serial port 1, and recovers the execution result of business processor 1 on serial port 1.

[0037] Please refer to Figure 5When m in the instruction command (console[m]) includes multiple numbers, this instruction is issued to the processors of multiple serial ports for execution. The multi-serial port processors issue the instructions in parallel to the corresponding multiple processors through the corresponding serial ports for execution, and recover the execution results of each processor on the corresponding serial port; for example, command (console[1,2]), that is, this instruction is issued in parallel to the business processor 1 and business processor 2 of the corresponding serial port for execution. The serial port processing unit issues the instructions in parallel to the corresponding business processor 1 and business processor 2 through serial port 1 and serial port 2, and recovers the execution result of business processor 1 on serial port 1, and recovers the execution result of business processor 2 on serial port 2. That is, the serial port line does not need to be switched, and one-to-many parallel processing can be achieved; while in the prior art, for example, the method adopted in method 2), it is necessary to connect one serial port to another for switching and docking processing. For example, after the processor 1 of serial port 1 executes the instruction, serial port 1 is switched to serial port 2, and then the processor 2 based on serial port 2 executes the instruction, and the processing efficiency is low; and when the processor 1 connected to the serial port 1 channel fails and cannot parse the instruction, the serial port switching cannot be completed, that is, the switching between serial port 1 and serial port 2 cannot be realized.

[0038] S4. Receive the business execution result returned by the target business processor that executes the business command, and determine whether all the target business processors have returned the business execution result. If so, all the business execution results are fed back in turn through the external serial port; if not, an exception is displayed, and the abnormal target business processor and the corresponding serial port are reported.

[0039] S41, obtaining the serial port numbers of the target processor corresponding to all the business execution results; for example, if the instruction is console[1,2,3,5,9], the serial port numbers of the target processor obtained include 1, 2, 3, 5 and 9; S42. Sort all the business execution results according to the serial port number of the target processor corresponding to the business execution results to obtain an output sequence; that is, the output sequence is [1, 2, 3, 5, 9]; wherein, in an optional implementation, the target business processor is also associated with the business execution result to obtain association information; for example, business processor 1 is associated with the business execution result generated by it, and business processor 9 is associated with the business execution result generated by it.

[0040] S43. Feedback all the business execution results through the external serial port in sequence according to the output sequence; at the same time, after all the business execution results carry the corresponding associated information, they are fed back through the external serial port, that is, the output content also indicates which processor the execution result is; for example, first the business execution result is outputted by serial port 1, and it is indicated that the business execution result is the execution result of business processor 1; then the business execution result is outputted by serial port 2, and so on, and finally the business execution result is outputted by serial port 9.

[0041] Embodiment 2 Please refer to Figure 6 , a device for controlling data exchange of multiple processors with a single port, comprising a serial port processing unit, wherein the serial port processing unit comprises at least two processor serial ports and an external serial port, wherein different processor serial ports are respectively used to connect to different service processors, and the external serial port is used to connect to a terminal device, and further comprises a memory, a processor, and a computer program stored in the memory and executable on the processor; and the multiple processors are indirectly managed through the serial port processing unit.

[0042] The serial port processing unit includes a single-chip microcomputer, a microprocessor, a central processing unit, and can also be a programmable device with serial port management function implemented by logic devices such as FPGA (Field Programmable Gate Array), such as devices with model STM32H5 and CH32V307. At the same time, the serial port processing unit can be integrated with multiple processors on a single board, or it can be used as a separate entity module; when used as a separate entity module, it can be placed in a box body with a single board containing multiple processors, or it can be placed outside the box body to achieve unified management of multiple serial ports on the original box body. When the processor executes the computer program, the following steps are implemented: S1. Obtain business commands; S2, parsing the service command to obtain at least one target processor serial port number; The parsing of the service command further includes step S21: determining whether the service command is parsed to obtain the serial port number of the target processor; if not, executing the service command through the serial port processing unit and feeding back the execution result through the external serial port.

[0043] S3. According to the serial port number of the target processor, the service command is sent in parallel to the target service processor corresponding to the serial port number of the target processor.

[0044] S4. Receive the service execution result returned by the target service processor that executes the service command, and determine whether all the target service processors have returned the service execution result. If so, feed back all the service execution results in turn through the external serial port.

[0045] S41, obtaining the serial port numbers of the target processors corresponding to all the service execution results; S42, sorting all the service execution results according to the serial port sequence numbers of the target processors corresponding to the service execution results to obtain an output sequence; wherein, the target service processor is also associated with the service execution results to obtain associated information; S43, feeding back all the service execution results in sequence through the external serial port according to the output sequence; feeding back all the service execution results through the external serial port after carrying the corresponding associated information.

[0046] In summary, the present invention provides a method and device for controlling data exchange of multiple processors with a single port, which realizes physical isolation between different business processors by connecting multiple processor serial ports of a serial port processing unit to multiple groups of different business processors respectively; in the process of processing business commands, after receiving the business command and parsing the serial port number of the target processor therein, the business command is sent in parallel to the target business processor corresponding to the serial port number of the target processor; since the business commands are issued in parallel, there is no need to frequently switch the serial port channel, which simplifies the management of multiple processors; at the same time, since the business commands are issued in parallel, there is no step of switching the serial port channel, which can avoid the problem of being unable to complete the serial port switching, thereby solving the problem that the existing single port cannot effectively control multiple processors. In addition, the multi-serial port processor does not require the Ethernet channel management or other complex management channels required by the traditional main control board, and has the effects of low cost, lightweight development, and fast startup.

[0047] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for controlling multi-processor data exchange by a single port, characterized in that: It includes a serial port processing unit, the serial port processing unit includes at least two processor serial ports and an external serial port, different processor serial ports are used to connect to different service processors, and the external serial port is used to connect to a terminal device. The serial port processing unit performs the following steps: Identify external serial port commands through the external serial port and obtain business commands; Parsing the service command to obtain at least one target processor serial port number; According to the target processor serial port number, the service command is sent in parallel to the target service processor corresponding to the target processor serial port number.

2. The method for controlling multi-processor data exchange by a single port according to claim 1, characterized in that: The parsing of the service command further includes: It is determined whether the service command is parsed to obtain the serial port number of the target processor; if not, the service command is executed by the serial port processing unit, and the execution result is fed back through the external serial port.

3. The method for controlling multi-processor data exchange by a single port according to claim 1, characterized in that: After the service command is sent in parallel to the target service processor corresponding to the serial port number of the target processor, the following step further comprises: Receive the service execution result returned by the target service processor that executes the service command, and determine whether all the target service processors have returned the service execution result. If so, feed back all the service execution results in turn through the external serial port.

4. The method for controlling multi-processor data exchange by a single port according to claim 3, characterized in that: Feedback of all the service execution results in sequence through the external serial port includes: Obtain the serial port number of the target processor corresponding to all the business execution results; Sorting all the service execution results according to the target processor serial port numbers corresponding to the service execution results to obtain an output sequence; All the service execution results are fed back in sequence through the external serial port according to the output sequence.

5. A method for controlling multi-processor data exchange by a single port according to claim 3 or 4, characterized in that: After receiving the service execution result returned by the target service processor for executing the service command, the method further includes: Associating the target service processor with the service execution result to obtain association information; Feedback of all the service execution results in sequence through the external serial port includes: After all the business execution results carry the corresponding associated information, they are fed back through the external serial port.

6. A device for controlling data exchange of multiple processors with a single port, characterized in that: The system comprises a serial port processing unit, wherein the serial port processing unit comprises at least two processor serial ports and an external serial port, wherein different processor serial ports are respectively used to connect to different service processors, and the external serial port is used to connect to a terminal device, and further comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: Identify external serial port commands through the external serial port and obtain business commands; Parsing the service command to obtain at least one target processor serial port number; According to the target processor serial port number, the service command is sent in parallel to the target service processor corresponding to the target processor serial port number.

7. The device for controlling data exchange of multiple processors with a single port according to claim 6, characterized in that: The parsing of the service command further includes: It is determined whether the service command is parsed to obtain the serial port number of the target processor; if not, the service command is executed by the serial port processing unit, and the execution result is fed back through the external serial port.

8. The device for controlling data exchange of multiple processors with a single port according to claim 6, characterized in that: After the service command is sent in parallel to the target service processor corresponding to the serial port number of the target processor, the following step further comprises: Receive the service execution result returned by the target service processor that executes the service command, and determine whether all the target service processors have returned the service execution result. If so, feed back all the service execution results in turn through the external serial port.

9. The device for controlling data exchange of multiple processors with a single port according to claim 8, characterized in that: Feedback of all the service execution results in sequence through the external serial port includes: Obtain the serial port number of the target processor corresponding to all the business execution results; Sorting all the service execution results according to the target processor serial port numbers corresponding to the service execution results to obtain an output sequence; All the service execution results are fed back in sequence through the external serial port according to the output sequence.

10. A device for controlling data exchange of multiple processors with a single port according to claim 8 or 9, characterized in that: After receiving the service execution result returned by the target service processor for executing the service command, the method further includes: Associating the target service processor with the service execution result to obtain association information; Feedback of all the service execution results in sequence through the external serial port includes: After all the business execution results carry the corresponding associated information, they are fed back through the external serial port.

Citation Information

Patent Citations

  • Non-time-sharing port multiplexing method and device

    CN104820644A

  • Switching method, device and system for multiplexing of plurality of processors serial ports on single board

    CN106549881A

  • Parallel processor with redundancy of processor pairs

    US6363453B1