A control system, method and electronic device
By allocating programs to corresponding CPUs in smart industrial scenarios, program isolation is achieved, solving the problem of complex code in distributed applications, reducing development and maintenance difficulty, and improving computing speed and data interaction efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER
- Filing Date
- 2023-08-07
- Publication Date
- 2026-08-04
AI Technical Summary
In smart industrial scenarios, developing multiple functions in a distributed application leads to complex code and increases the difficulty of development and maintenance.
By assigning programs to corresponding CPUs through the operation module, isolation between programs is achieved, ensuring that the mechanical control module and the upper-level control module do not interfere with each other, and the corresponding functions are implemented by calling the CPU, thus avoiding the development of multiple functions in a distributed application.
It reduces the difficulty of developing and maintaining distributed applications, improves computing speed and real-time performance, simplifies the implementation process of mechanical control, and accelerates data interaction.
Smart Images

Figure CN117032021B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial Internet of Things (IoT) technology, and in particular to a control system, method, and electronic device. Background Technology
[0002] Currently, in smart industrial scenarios, to control and coordinate multiple components, clusters, and nodes, distributed applications are typically implemented on different controllers, allowing different functions to be achieved based on different controllers. However, in practical applications, multiple functions are developed within a single distributed application, making the code complex and increasing the difficulty of developing and maintaining such an application. Summary of the Invention
[0003] This application provides a control system, method, and electronic device that can solve the problem that in current smart industrial scenarios, multiple functions are developed in a distributed application, which makes the code in the distributed application complex and leads to high difficulty in the development and maintenance of the distributed application.
[0004] In a first aspect, this application provides a control system, the system comprising: an operation module, a mechanical control module, and an upper-level control module;
[0005] The operation module is used to allocate a first program to a first central processing unit (CPU) and a second program to a second CPU, wherein the first program is a program running on the mechanical control module and the second program is a program running on the upper-level control module.
[0006] The mechanical control module is used to send a request instruction to the upper-level control module after the system is started, and when it receives the processing result of the request instruction returned by the upper-level control module, it calls the first target CPU in the first CPU according to the processing result, and generates the control task of the processing result according to the first target CPU, wherein the request instruction includes the position information of the object;
[0007] The upper-level control module is used to, upon receiving the request instruction, parse the request instruction, obtain the parsing result, call the second target CPU in the second CPU according to the parsing result, generate the processing result according to the second target CPU, and return the processing result to the mechanical control module.
[0008] Based on the above system, by assigning programs to corresponding CPUs through the operation module, isolation between programs can be achieved, ensuring that the mechanical control module calls the first CPU and the upper-level control module calls the second CPU without interference. Moreover, this method of implementing corresponding functions by calling the CPU can avoid the problem of developing multiple functions in a distributed application, which leads to the high development and maintenance difficulty of the distributed application.
[0009] In some possible designs, the operation module is also used to identify the threads in the first program when allocating the first program to the first CPU, and to allocate the threads to the third CPU.
[0010] Based on the above system, allocating a third CPU to the thread can speed up the calculation and improve the real-time performance of the operation.
[0011] In some possible designs, the operation module is also used to set the priority of the thread when determining the thread in the first program and allocating the thread to the third CPU.
[0012] Based on the above system, thread priorities are set so that when multiple threads compete for resources, high-priority threads can interrupt low-priority threads, ensuring the real-time operation of the mechanical control module.
[0013] In some possible designs, the mechanical control module includes functional units and execution units;
[0014] The functional unit is configured to, upon receiving the processing result, call the first target CPU in the first CPU and / or the third target CPU in the third CPU according to the processing result, and send the first target CPU and / or the third target CPU to the execution unit;
[0015] The execution unit is configured to perform a control task that generates the processing result based on the first target CPU and / or the third target CPU.
[0016] Based on the above system, mechanical control is achieved through the coordinated action of functional units and execution units, which simplifies the implementation process of mechanical control and reduces maintenance costs.
[0017] In some possible designs, the system also includes a shared memory module;
[0018] The shared memory module is used for data interaction between the mechanical control module and the upper-level control module.
[0019] Based on the above system, the mechanical control module and the upper-level control module interact with each other through a shared memory module, eliminating the need for data interaction around the communication protocol. This not only ensures stable and efficient communication quality but also speeds up the interaction process.
[0020] Secondly, this application provides a control method applied to the control system described in the first aspect, the method comprising:
[0021] Upon receiving a request instruction, the request instruction is parsed to obtain a parsing result, wherein the request instruction includes the object's position information;
[0022] The second target CPU in the second central processing unit (CPU) is invoked based on the parsing result, and the processing result of the request instruction is generated based on the second target CPU.
[0023] Upon receiving the processing result, the first target CPU in the first CPU is invoked according to the processing result, and the control task for the processing result is generated according to the first target CPU.
[0024] In some possible designs, prior to the invocation of the first target CPU in the first CPU, the following is also included:
[0025] When allocating the first program to the first CPU, the threads in the first program are determined;
[0026] The thread is assigned to the third CPU.
[0027] In some possible designs, allocating the thread to a third CPU includes:
[0028] When allocating the thread to the third CPU, the priority of the thread is set.
[0029] In some possible designs, upon receiving the processing result, the step of invoking a first target CPU within the first CPU based on the processing result, and generating a control task for the processing result based on the first target CPU, includes:
[0030] Upon receiving the processing result, the first target CPU in the first CPU and / or the third target CPU in the third CPU are invoked according to the processing result.
[0031] The control task is generated based on the first target CPU and / or the third target CPU.
[0032] In some possible designs, the method further includes:
[0033] The request instruction is transmitted through the shared memory module, and the processing result of the request instruction is also transmitted through the shared memory module.
[0034] Thirdly, this application provides an electronic device, comprising:
[0035] Memory, used to store computer programs;
[0036] When the processor executes the computer program stored in the memory, it implements the control method steps of the second aspect described above.
[0037] Fourthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the control method steps of the second aspect described above.
[0038] Based on the above control system, the program can be allocated to the corresponding CPU through the operation module, which can achieve isolation between programs and ensure that the mechanical control module calls the first CPU and the upper-level control module calls the second CPU without interference. Moreover, this method of implementing the corresponding function by calling the CPU can avoid the problem of developing multiple functions in a distributed application, which leads to the high development and maintenance difficulty of the distributed application.
[0039] The technical effects of each of the second to fourth aspects mentioned above, as well as the technical effects that each aspect may achieve, are described above with reference to the technical effects that can be achieved for the first aspect or the various possible solutions in the first aspect, and will not be repeated here. Attached Figure Description
[0040] Figure 1 A schematic diagram of a control system provided in an embodiment of this application;
[0041] Figure 2 This is a schematic diagram illustrating the applicable scenarios for the embodiments of this application;
[0042] Figure 3 A schematic diagram of another control system provided in an embodiment of this application;
[0043] Figure 4 A flowchart of a control method provided in an embodiment of this application;
[0044] Figure 5 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The specific operational methods in the method embodiments can also be applied to the device embodiments or system embodiments. It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing together, or B existing alone. A connected to B can represent: A and B directly connected, or A and B connected through C. Furthermore, in the description of this application, terms such as "first" and "second" are used only for distinguishing the purpose of description and should not be construed as indicating or implying relative importance or order.
[0046] To facilitate understanding by those skilled in the art, the technical terms involved in the embodiments of this application will first be explained.
[0047] (1) An embedded real-time multi-threaded operating system (RT-Thread) is an IoT operating system that integrates a real-time operating system (RTOS) kernel, as well as relatively complete middleware components such as file system, network framework, and device framework. It has the capabilities of low power consumption, security, communication protocol support and cloud connectivity.
[0048] (2) 4daic is an open-source software platform for industrial automation control systems. It supports the IEC 614499 standard and builds applications by pulling function blocks and connecting them.
[0049] (3) Automated Guided Vehicle (AGV) is an industrial vehicle that loads goods automatically or manually, travels automatically along a set route or pulls a cargo trolley to a designated location, and then loads and unloads goods automatically or manually.
[0050] (4) Robot Operating System (ROS) is an open-source software framework and toolset used to help developers build robot applications. It provides hardware abstraction, device drivers, function libraries, visualization tools, messaging, and package management. ROS2 is a newer version of ROS.
[0051] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods.
[0052] Currently, in smart industrial scenarios, to control and coordinate multiple components, clusters, and nodes, distributed applications are typically implemented on different controllers, allowing different functions to be achieved based on different controllers. However, in practical applications, multiple functions are developed within a single distributed application, making the code complex and increasing the difficulty of developing and maintaining such an application.
[0053] To address the aforementioned problems, this application provides a control system that allocates programs to corresponding CPUs through an operation module. This achieves program isolation, ensuring that the mechanical control module's access to the first CPU and the upper-level control module's access to the second CPU do not interfere with each other. Furthermore, this method of implementing functions by calling CPUs avoids the problem of developing multiple functions within a distributed application, which leads to significant development and maintenance difficulties. The systems and methods described in this application are based on the same technical concept. Since the principles by which the systems and methods solve the same problems are similar, embodiments of the systems and methods can be referred to interchangeably, and repeated details will not be elaborated further.
[0054] Figure 1 This is a schematic diagram of a control system provided in an embodiment of this application. Figure 1 As shown, the system includes: an operation module 11, a mechanical control module 12, and an upper-level control module 13.
[0055] Optionally, this control system can be applied to machine vision: quality inspection, object recognition and workpiece positioning through machine vision; AGV navigation: automatic path planning, precise positioning and emergency obstacle avoidance according to navigation requirements; robotic arm control: dynamic planning of robotic arm motion paths and generation of smooth motion curves according to application needs, and other intelligent industrial scenarios.
[0056] For example, the operation module 11 may include an embedded real-time multi-threaded operating system (RT-Thread). The operation module 11 is used to allocate a first program to a first central processing unit (CPU) and a second program to a second CPU, wherein the first program is a program running on the mechanical control module 12 and the second program is a program running on the upper-level control module 13.
[0057] In the application of the mechanical control module 12, each event chain exists as a thread, and some components on some events may have real-time requirements. Therefore, in order to ensure the real-time performance of the component, the operation module 11 is also used to determine the thread in the first program when the first program is allocated to the first CPU, and allocate the thread to the third CPU, thereby speeding up the calculation speed and improving the real-time performance of the operation.
[0058] In some embodiments, considering that there may be resource contention among CPUs after the system is running, in order to ensure the real-time performance of some threads, the thread priority can be set according to the real-time requirements of the threads. For example, the priority of the thread of the mechanical control part in the first program can be set to be higher than that of the upper control module 13, so that the mechanical control part will not be interfered with by the upper control module 13, thereby ensuring that the thread of the mechanical control part can run in real time.
[0059] Additionally, the priority of threads with higher real-time requirements in the first program can be set to precede that of threads with lower real-time requirements, so that when multiple threads compete for resources, high-priority threads can interrupt low-priority threads.
[0060] The mechanical control module 12 can adopt the open-source 4diac architecture. 4diac provides some basic and general-purpose components for use. The motion control components required by the AGV are developed based on 4diac. After the control system starts, the mechanical control module 12 sends request commands to the upper-level control module 13. Upon receiving the processing result of the request command returned by the upper-level control module 13, it calls the first target CPU in the first CPU according to the processing result and generates the control task based on the first target CPU. The request command includes the object's position information and surrounding environment information. Specifically:
[0061] The mechanical control module 12 includes a functional unit and an execution unit. The functional unit includes a first CPU and a third CPU packaged according to the IEC 614499 standard, as well as some basic arithmetic function blocks. The execution unit includes various devices. The functional unit, upon receiving the processing result, calls the first target CPU and / or the third target CPU and / or function block in the first CPU, and then sends the first target CPU and / or the third target CPU and / or function block to the execution unit. The execution unit generates the control task based on the processing result.
[0062] The upper-level control module 13 can perform functional calculations based on ROS2. ROS2 provides a series of software frameworks and tools for writing robot software programs, such as AGV mapping, navigation, and path planning programs. When the upper-level control module 13 receives a request instruction sent by the mechanical control module 12, it parses the request instruction, obtains the parsing result, calls the second target CPU in the second CPU according to the parsing result, generates the processing result of the request instruction according to the second target CPU, and returns the processing result to the mechanical control module.
[0063] For example, the above control system is applied to AGVs, such as... Figure 2 As shown, the control system controls the AGV to automatically travel from its current position to position A. First, when the mechanical control module 12 receives the AGV's online status information, it sends a request command to the upper-level control module 13. Upon receiving the request command, the upper-level control module 13 parses it to obtain the AGV's current position information and surrounding environment information. Then, based on the AGV's current position information and surrounding environment information, the upper-level control module 13 calls the second target CPU, which contains a path calculation program, to calculate the AGV's target travel path L, and returns L to the functional unit of the mechanical control module 13.
[0064] When the functional unit receives L, it determines that the AGV needs to change direction in the next moment. Then, according to L, it calls the third target CPU1 and the third target CPU2, which contain the steering program and the gear calculation program. The priority of the gear calculation program is the same as the priority of the steering program. The third target CPU1 and the third target CPU2 are sent to the corresponding devices 1 and 2 in the execution unit. Different devices communicate with each other through the same communication function block.
[0065] At this time, device 1 calculates that the AGV's next driving gear is first gear and transmits this driving gear to device 2 through the communication function block. Device 2 calculates that the AGV should turn right in the next moment, and outputs a control task to set the AGV's driving gear to first gear and turn right. The mechanical control module 12 issues a driving command to the AGV according to this control task, so that the AGV changes its driving gear to first gear and turns right.
[0066] Furthermore, the mechanical control module 12 detects in real time whether the AGV needs to change direction in the next moment. When it detects that a change of direction is needed, it outputs the corresponding control task in the same way as above. At the same time, the mechanical control module 12 also detects in real time whether there are obstacles in L. When an obstacle is detected, it promptly sends a new request command to the upper control module 13 so that the upper control module 13 can recalculate the new travel path. Then, the mechanical control module 12 generates the corresponding control task according to the new travel route in the same way as above. Until the mechanical control module 12 detects that the AGV has traveled to position A, it issues a stop command to the AGV.
[0067] It should be noted that both the mechanical control module 12 and the upper-level control module 13 have mature and reliable distributed communication mechanisms available for use. The number of the aforementioned first program, second program, first CPU, second CPU, third CPU, first target CPU, second target CPU, third target CPU, function blocks, and devices can be one or more, depending on the situation; no specific limit is made here. Furthermore, to meet the computing power requirements of the upper-level control module 13, several more second CPUs can be reasonably allocated to the upper-level control module 13 according to actual needs. For example, if program A consists of two parts, program B and program C, then program B can be allocated to second CPU 1, and program C can be allocated to second CPU 2.
[0068] In some possible embodiments, to ensure the communication quality between the mechanical control module 12 and the upper-level control module 13, the control system may further include a shared memory module, such as... Figure 3 The diagram shown is a schematic of another control system provided in this application. The system includes an operation module 11, a mechanical control module 12, an upper-level control module 13, and a shared memory module 31.
[0069] For example, the shared memory module 31 is used for data interaction between the mechanical control module 12 and the upper control module 13. For instance, the mechanical control module 12 sends a request command to the upper control module 13 through the shared memory module 31, and the upper control module 13 returns the processing result of the request command to the mechanical control module 12 through the shared memory module 31.
[0070] Based on the above control system, the program can be allocated to the corresponding CPU through the operation module, which can achieve isolation between programs and ensure that the mechanical control module calls the first CPU and the upper-level control module calls the second CPU without interference. Moreover, this method of implementing the corresponding function by calling the CPU can avoid the problem of developing multiple functions in a distributed application, which leads to the high development and maintenance difficulty of the distributed application.
[0071] Based on the same inventive concept, this application also provides a control method, such as... Figure 4 The diagram shown is a flowchart of a control method provided in an embodiment of this application. This process, applied to the aforementioned control system, avoids the problem of developing multiple functions within a single distributed application, which leads to significant development and maintenance difficulties for that distributed application. The method includes the following steps:
[0072] S41, upon receiving a request instruction, parse the request instruction and obtain the parsing result;
[0073] In this embodiment of the application, the method first requires, as follows: Figure 1 or Figure 3The operation module 11 shown assigns a first program to the first central processing unit (CPU) and a second program to the second CPU. The first program runs on the mechanical control module 12, and the second program runs on the upper-level control module 13. Then, when the upper-level control module 13 receives a request instruction from the mechanical control module 12, it parses the request instruction and obtains the parsing result. The request instruction includes the position information of the object.
[0074] S42, based on the parsing result, call the second target CPU in the second central processing unit (CPU), and generate the processing result of the request instruction based on the second target CPU;
[0075] For example, this method is applied to dynamically plan the motion path of a robotic arm, and the parsed result is the current position information of the robotic arm and the surrounding environment information. Based on the current position information of the robotic arm and the surrounding environment information, the second target CPU containing the path calculation program in the second CPU is called to calculate the motion curve of the robotic arm, and the motion curve is returned to the mechanical control module 13.
[0076] S43, upon receiving the processing result, the first target CPU in the first CPU is invoked according to the processing result, and the control task of the processing result is generated according to the first target CPU.
[0077] Optionally, in the application of the mechanical control module 12, each event chain exists as a thread, and some components on some events may have real-time requirements. Therefore, in order to ensure the real-time performance of the component, before calling the first target CPU in the first CPU according to the processing result, the thread in the first program needs to be determined when the first program is allocated to the first CPU, and the thread is allocated to the third CPU.
[0078] In some embodiments, considering the potential resource contention between CPUs, in order to ensure the real-time performance of some threads, the thread priority can be set according to the real-time requirements of the threads. For example, the priority of the threads of the mechanical control part on the mechanical control module 12 can be set to be higher than that of the upper control module 13, so that the mechanical control part on the mechanical control module 12 will not be interfered with by the upper control module 13, thereby ensuring that the threads of the mechanical control part in the mechanical control module 12 can run in real time.
[0079] Additionally, the priority of threads with higher real-time requirements in the 4diac application can be set to precede that of threads with lower real-time requirements, so that when multiple threads compete for resources, high-priority threads can interrupt low-priority threads.
[0080] In other possible embodiments, in order to ensure the reliability of data transmission and improve the speed of data transmission, the above-mentioned request instruction can also be transmitted through a shared memory module, and the processing result of the request instruction can also be transmitted through the shared memory module.
[0081] It should be noted that although the above describes data transfer via a shared memory module, in practice, shared memory can take the form of either hardware or software, depending on the specific circumstances. No specific limitations are made here. Furthermore, the data transferred via the shared memory module described above is merely an example; in actual applications, the data transferred can be determined based on actual needs, and no restrictions are imposed here.
[0082] By using the above control method, the program is allocated to the corresponding CPU based on the operation module, which can achieve isolation between programs and ensure that the mechanical control module calls the first CPU and the upper-level control module calls the second CPU without interference. Moreover, this method of implementing the corresponding function by calling the CPU can avoid the problem of developing multiple functions in a distributed application, which leads to the difficulty of developing and maintaining the distributed application.
[0083] Based on the same inventive concept, this application also provides an electronic device that can realize the functions of the aforementioned control system. (Refer to...) Figure 5 The electronic device includes:
[0084] At least one processor 51 and a memory 52 connected to at least one processor 51. In this embodiment, the specific connection medium between the processor 51 and the memory 52 is not limited. Figure 5 The example shown is the connection between processor 51 and memory 52 via bus 50. Bus 50 is... Figure 5 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. Bus 50 can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 5 The term is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, the processor 51 can also be called a controller; there is no restriction on the name.
[0085] In this embodiment, memory 52 stores instructions executable by at least one processor 51. By executing the instructions stored in memory 52, at least one processor 51 can perform the control method described above. Processor 51 can implement... Figure 1 or Figure 3 The system shown illustrates the functions of each module.
[0086] The processor 51 is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory 52 and calling data stored in memory 52, the processor can perform various functions and process data, thereby monitoring the device as a whole.
[0087] In one possible design, processor 51 may include one or more processing units. Processor 51 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 51. In some embodiments, processor 51 and memory 52 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.
[0088] The processor 51 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array, or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the control method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0089] Memory 52, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 52 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 52 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 52 may also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0090] By designing and programming the processor 51, the code corresponding to the control method described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute the code during operation. Figure 4 The steps of the control method in the illustrated embodiment are as follows. How to design and program the processor 51 is a technique well-known to those skilled in the art and will not be described further here.
[0091] Based on the same inventive concept, embodiments of this application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the control method described above.
[0092] In some possible implementations, various aspects of the control method provided in this application may also be implemented in the form of a program product, which includes program code that, when the program product is run on a device, causes the control device to perform the steps of the control method according to the various exemplary embodiments of this application described above.
[0093] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0094] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0095] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0096] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0097] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A control system, characterized in that, The system includes: an operation module, a mechanical control module, an upper-level control module, and a shared memory module; The operation module is used to allocate a first program to a first CPU and a second program to a second CPU, wherein the first program is a program running on the mechanical control module and the second program is a program running on the upper-level control module. The mechanical control module is used to send a request instruction to the upper-level control module after the system is started, and when it receives the processing result of the request instruction returned by the upper-level control module, it calls the first target CPU in the first CPU according to the processing result, and generates the control task of the processing result according to the first target CPU, wherein the request instruction includes the position information of the object; The upper-level control module is used to, upon receiving the request instruction, parse the request instruction, obtain the parsing result, call the second target CPU in the second CPU according to the parsing result, generate the processing result according to the second target CPU, and return the processing result to the mechanical control module; The shared memory module is used for data interaction between the mechanical control module and the upper-level control module.
2. The system as described in claim 1, characterized in that, The operation module is further configured to, when allocating the first program to the first CPU, identify the threads in the first program and allocate the threads to the third CPU.
3. The system as described in claim 2, characterized in that, The operation module is further configured to, when determining the thread in the first program and allocating the thread to the third CPU, set the priority of the thread.
4. The system as described in claim 1, characterized in that, The mechanical control module includes functional units and execution units; The functional unit is configured to, upon receiving the processing result, call the first target CPU in the first CPU and / or the third target CPU in the third CPU according to the processing result, and send the first target CPU and / or the third target CPU to the execution unit; The execution unit is configured to perform a control task that generates the processing result based on the first target CPU and / or the third target CPU.
5. A control method, said method being applied to the control system as described in any one of claims 1-4, characterized in that, The method includes: The operation module allocates a first program to a first CPU and a second program to a second CPU; wherein, the first program is a program running in the mechanical control module; and the second program is a program running in the upper-level control module. Upon receiving a request instruction, the request instruction is parsed to obtain a parsing result, wherein the request instruction includes the object's position information; the request instruction is transmitted via a shared memory module. The second target CPU in the second CPU is invoked according to the parsing result, and the processing result of the request instruction is generated according to the second target CPU; Upon receiving the processing result, the first target CPU in the first CPU is invoked according to the processing result, and a control task for the processing result is generated according to the first target CPU; wherein, the processing result is transmitted through the shared memory module.
6. The method as described in claim 5, characterized in that, Before invoking the first target CPU in the first CPU, the method further includes: When allocating the first program to the first CPU, the threads in the first program are determined; The thread is assigned to the third CPU.
7. The method as described in claim 6, characterized in that, The step of allocating the thread to a third CPU includes: When allocating the thread to the third CPU, the priority of the thread is set.
8. The method as described in claim 5, characterized in that, The step of, upon receiving the processing result, invoking a first target CPU within the first CPU based on the processing result, and generating a control task for the processing result based on the first target CPU, includes: Upon receiving the processing result, the first target CPU in the first CPU and / or the third target CPU in the third CPU are invoked according to the processing result. The control task is generated based on the first target CPU and / or the third target CPU.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a computer program stored in the memory, implements the method of any one of claims 5-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 5-8.