Programming method, device and equipment of modular hardware system, medium and product
By automatically generating program code for modular hardware systems using large language models, the problem of complex manual programming for users is solved, thus simplifying the programming process and expanding the applicable user base.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU SHENGPAI NETWORK TECHNOLOGY CO LTD
- Filing Date
- 2024-10-18
- Publication Date
- 2026-04-21
AI Technical Summary
Existing modular hardware systems require manual programming by users, which limits users without programming skills. The programming process is complex and time-consuming, reducing the fun and practicality of the product.
A large language model is used to generate preliminary program code. Based on the assembly information and functional requirements of the modular hardware system, the target program code is automatically generated and sent to the hardware system.
It enables automated programming of modular hardware systems, simplifies the programming process, expands the applicable user base, and enhances the product's fun and practicality.
Smart Images

Figure CN121900735A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a programming method, apparatus, device, medium and product for a modular hardware system. Background Technology
[0002] Currently, there are some modular hardware systems, such as modular toys, that allow users to assemble different modules together and program them to achieve different functions.
[0003] These hardware systems typically require users to manually write program code to control the assembled hardware. Summary of the Invention
[0004] This disclosure provides a programming method, apparatus, device, medium, and product for a modular hardware system.
[0005] According to one aspect of this disclosure, a programming method for a modular hardware system is provided, comprising: acquiring assembly information and functional requirement information of each module in the modular hardware system; using a large language model, generating preliminary program code based on the assembly information and the functional requirement information; acquiring target program code based on the preliminary program code; and sending the target program code to the modular hardware system.
[0006] According to another aspect of this disclosure, a programming apparatus for a modular hardware system is provided, comprising: an acquisition module for acquiring assembly information and functional requirement information of each module in the modular hardware system; a generation module for generating preliminary program code based on the assembly information and the functional requirement information using a large language model; and a sending module for acquiring target program code based on the preliminary program code and sending the target program code to the modular hardware system.
[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to said at least one processor; wherein the memory stores instructions executable by said at least one processor, said instructions being executed by said at least one processor to enable said at least one processor to perform the method as described in any of the foregoing aspects.
[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method according to any of the preceding aspects.
[0009] According to another aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method according to any of the preceding aspects.
[0010] This disclosure enables automated programming for modular hardware systems.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0013] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;
[0014] Figure 2 This is a schematic diagram of the overall structure used to implement the embodiments of this disclosure;
[0015] Figure 3 This is a schematic diagram according to the second embodiment of the present disclosure;
[0016] Figure 4 This is a schematic diagram according to the third embodiment of the present disclosure;
[0017] Figure 5 This is a schematic diagram of an electronic device used to implement a programming method for a modular hardware system according to embodiments of the present disclosure. Detailed Implementation
[0018] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0019] Currently, the following problems exist due to the use of manual programming by users:
[0020] Not every user has programming skills, which limits the product's target audience; even for users with programming skills, the programming process is relatively complex and time-consuming; users find it difficult to quickly realize their ideas, which reduces the product's fun and practicality.
[0021] To address the problem of manual programming, embodiments of this disclosure can achieve automated programming.
[0022] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure. This embodiment provides a programming method for a modular hardware system, such as... Figure 1 As shown, the method includes:
[0023] 101. Obtain the assembly information and functional requirements of each module in the modular hardware system.
[0024] 102. Using a large language model, preliminary program code is generated based on the assembly information and the functional requirements information.
[0025] 103. Obtain the target program code based on the preliminary program code, and send the target program code to the modular hardware system.
[0026] Specifically, this method can be executed in the cloud.
[0027] Assembly information can be sent by a modular hardware system.
[0028] Functional requirements information can be user-defined, and in this case, it can be sent by the device where the application (APP) is located.
[0029] The app is designed to work with the modular hardware system. It can be installed on user terminals such as personal computers (PCs), mobile phones, and tablets. Users can input custom functional requirements through the app, which then sends these requirements to the cloud. The user terminal and the modular hardware system can communicate via Bluetooth, Wi-Fi, or other methods.
[0030] In addition, if the modular hardware system itself can provide an interactive interface, then the aforementioned APP can also be deployed within the modular hardware system, so that the assembly information and functional requirement information are sent by the modular hardware system.
[0031] Functional requirements information can also be automatically generated in the cloud. Specifically, it can be automatically generated based on assembly information. For example, if a user assembles a vehicle with four wheels, the user may provide customized functional requirements information, such as "This is a vehicle that can move freely and automatically avoids obstacles," or they may leave it blank, i.e., not inputting any functional requirements information. In this case, assuming that a heat source sensor and a water gun are also installed, the cloud can directly and automatically generate functional requirements information based on this assembly information. Based on the functional requirements information, a program that can realize the functions of a fire truck can be generated. After the program is installed on the modular hardware system, it can realize functions similar to a fire truck.
[0032] A modular hardware system is a system that includes multiple hardware modules (or simply modules). These hardware modules are assembleable and can be programmed according to the user's own needs to achieve different functions.
[0033] Users can assemble modules locally and obtain the assembly results.
[0034] Users can assemble the model according to the instructions of the existing template or by using a custom method to obtain the assembled realistic model.
[0035] In a modular hardware system, the hardware modules typically include a motherboard module and multiple functional modules. After the functional modules are installed onto the motherboard module, the motherboard module can obtain assembly information based on the assembly results using pre-configured programs or models.
[0036] Assembly information may include: individual information of each module, and / or mutual information between different modules. Individual information includes, for example, a unique ID, type information, absolute pose (position and attitude) information, physical parameters (such as motor speed, sensor parameters), etc.; mutual information includes, for example, relative pose (position and attitude) information.
[0037] Functional requirements information is used to indicate functional requirements, such as the final functions implemented by the assembled hardware system and the custom physical parameters of each module.
[0038] The app provides an interactive interface through which users input their functional requirements, which the app then uses to obtain. The app subsequently sends this information to the cloud.
[0039] Large language models can be pre-deployed in the cloud.
[0040] Large Language Models (LLMs) have become a hot topic in the field of Artificial Intelligence (AI) in recent years. An LLM is a pre-trained language model that learns rich language and world knowledge by pre-training on massive amounts of data, thus achieving amazing results in various tasks such as Natural Language Processing (NLP) and image generation.
[0041] Because of its powerful generation capabilities, LLM can be used for code generation.
[0042] Specifically, using LLM (Limited Language Management), preliminary program code is generated based on assembly information and functional requirements. Then, the target program code is obtained based on this preliminary program code. Alternatively, the preliminary program code can be used as the target program code.
[0043] The initial program code can be tested, and the initial program code that passes the test is used as the target program code. If the test fails, the LLM is used to regenerate the code and retest it until the code generated by the LLM passes the test. The code that passes the test is then used as the target program code.
[0044] Taking the testing of preliminary program code as an example, a simulation system can also be pre-deployed in the cloud.
[0045] A simulation system used to generate simulation models based on assembly information.
[0046] For example, the simulation system generates a simulation model based on the individual information of each model and the mutual information between different modules. This simulation model can be a 3D model corresponding to the real model assembled by the user, or it can be a simulation physics engine or a digital simulation (e.g., a simulation of tension, pressure, etc.).
[0047] After obtaining the target program code from the cloud, the target program code can be sent to the modular hardware system, which will then run the target program code to implement the functions defined in the functional requirements information.
[0048] In this embodiment, a large language model is used to generate preliminary program code based on the assembly information and the functional requirements information. The target program code used as a modular hardware system when it passes the test is obtained based on the preliminary program code. This can realize the automated programming of the modular hardware system and solve the problems of manual programming.
[0049] To better understand the embodiments of this disclosure, the application scenarios involved in this disclosure will be described.
[0050] Figure 2 This is a schematic diagram of the overall structure used to implement the embodiments of this disclosure.
[0051] like Figure 2 As shown, this embodiment takes user-inputted custom functional requirements as an example, and mainly includes: a modular hardware system 201, an application (APP) 202 that matches the hardware system, and a cloud 203.
[0052] The modular hardware system 201 is composed of hardware modules, which users can assemble to obtain a three-dimensional realistic model.
[0053] The system includes a motherboard module and assemblable functional modules, which can be one or more, usually multiple, and these functional modules can be assembled onto the motherboard module.
[0054] The motherboard module can be pre-installed with an AI chip to obtain assembly information and send it to the cloud. Specifically, the motherboard module also has a pre-installed communication chip to send assembly information to the cloud.
[0055] Alternatively, a lightweight model can be deployed within the AI chip to perform preliminary checks, such as determining whether the actual model is installed correctly based on the assembly information. If correct, the assembly information is sent to the cloud; if incorrect, installation suggestions can be provided to the user.
[0056] APP 202 can be installed on the user's terminal (such as a PC, mobile phone, tablet, etc.) to interact with the user and the cloud. For example, the APP can obtain the user's input of functional requirements and send the functional requirements information to the cloud.
[0057] In addition, if the modular hardware system itself can provide an interactive interface, the APP can also be built into the system, obtain the user's input of functional requirements through the APP, and send the functional requirements information to the cloud.
[0058] Cloud 203 is used to obtain the target program code used by the modular hardware system based on the assembly information and functional requirements information.
[0059] Taking the testing of preliminary program code as an example, specifically, a simulation system and an LLM (Limited Language Management System) can be pre-deployed in the cloud. The simulation system generates a simulation model based on the assembly information, and the LLM generates preliminary program code based on the assembly information and functional requirements. Then, the preliminary program code is written into the simulation model to trigger its execution. If the execution result meets the user's customized functional requirements, it indicates that the preliminary program code has passed the test, and the tested preliminary program code is used as the target program code.
[0060] After obtaining the target program code from the cloud, it can be sent to the motherboard module. The motherboard module then runs the user-assembled real model based on the target program code, achieving automated programming of the modular hardware system. Additionally, the cloud and / or the motherboard module can save the target program code for future use.
[0061] In conjunction with the above application scenarios, this disclosure also provides the following embodiments.
[0062] Figure 3 Based on the schematic diagram of the second embodiment of this disclosure, this embodiment provides a programming method for a modular hardware system, such as... Figure 3 As shown, combining local devices and the cloud, the method includes:
[0063] 301. Modular hardware system, obtain its own assembly information.
[0064] 302. Modular hardware system: Check the assembly information mentioned above.
[0065] For example, a modular hardware system can have a built-in AI chip to obtain assembly information. In addition, the AI chip can also have preset inspection rules to check the assembly information based on these rules.
[0066] 303. If the inspection is passed, the modular hardware system will send the assembly information to the cloud.
[0067] If the check fails, the modular hardware system can prompt the user to reassemble and repeat the 301 procedure and subsequent steps described above.
[0068] Alternatively, assembly information can be sent directly to the cloud without inspection.
[0069] 304. The APP obtains the user's input of functional requirements and sends the functional requirements information to the cloud.
[0070] 305. In the cloud, a pre-deployed simulation system is used to generate a simulation model based on the above assembly information.
[0071] 306. In the cloud, a pre-deployed LLM is used to generate preliminary program code based on the above assembly information and functional requirements information.
[0072] 307. In the cloud, determine whether the initial program code has passed the test. If yes, execute 308. Otherwise, report the error message to the LLM and trigger the LLM to re-execute 306 and subsequent steps based on the error message.
[0073] Specifically, the initial program code is written into the simulation model to trigger the simulation model to run. If the running result meets the custom functional requirements in the user's functional requirements information, it indicates that the initial program code has passed the test; otherwise, it has failed the test.
[0074] 308. In the cloud, the initial program code is used as the target program code, and the target program code is sent to the modular hardware system.
[0075] In this embodiment, the example of testing the preliminary program code is used for illustration. It can be understood that testing may not be performed. That is, when generating the preliminary program code based on LLM, the preliminary program code can be directly used as the target program code. In this case, there is no need to deploy a simulation system in the cloud.
[0076] In addition, this embodiment takes user input of functional requirement information as an example. It can be understood that functional requirement information can also be automatically generated by the cloud. For example, the cloud can generate functional requirement information based on the assembly information. In this case, there is no need for an APP, but the cloud itself generates the functional requirement information.
[0077] Figure 4 This is a schematic diagram based on a third embodiment of the present disclosure, which provides a programming device for a modular hardware system. The device 400 includes: an acquisition module 401, a first generation module 402, a second generation module 403, a testing module 404, and a sending module 405.
[0078] The acquisition module 401 is used to acquire the assembly information and functional requirement information of each module in the modular hardware system; the generation module 402 is used to generate preliminary program code based on the assembly information and functional requirement information using a large language model; the sending module 403 is used to acquire target program code based on the preliminary program code and send the target program code to the modular hardware system.
[0079] In some embodiments, the sending module 403 is further configured to:
[0080] The preliminary program code is used as the target program code; or...
[0081] The preliminary program code is tested, and the preliminary program code that passes the test is used as the target program code.
[0082] In some embodiments, the device further includes:
[0083] The simulation module is used to generate a simulation model based on the assembly information;
[0084] The sending module 403 is further configured to:
[0085] The preliminary program code is written into the simulation model, and the simulation model is run based on the preliminary program code to obtain the running results; if the running results meet the preset requirements, the preliminary program code is used as the target program code.
[0086] In some embodiments, the sending module 403 is further configured to:
[0087] If the initial program code fails the test, an error message is sent to the large language model to trigger the large language model to regenerate the initial program code.
[0088] In some embodiments, the acquisition module 401 is further configured to:
[0089] Receive the assembly information sent by the modular hardware system;
[0090] Receive the functional requirement information input by the user from an APP that matches the modular hardware system; or generate the functional requirement information based on the assembly information.
[0091] In some embodiments, the assembly information is sent by the modular hardware system after being checked by a built-in AI chip.
[0092] It is understood that in the embodiments of this disclosure, the same or similar content in different embodiments can be referred to each other.
[0093] It is understood that the terms "first" and "second" in the embodiments of this disclosure are only used for distinction and do not indicate the degree of importance or the order of events.
[0094] It is understandable that, unless otherwise specified, the order of steps in the process indicates that the temporal relationship between these steps is not limited.
[0095] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0096] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0097] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device 500 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0098] like Figure 5 As shown, the electronic device 500 includes a processor 501 and a memory 502, which can be connected via a bus. The processor 501 can perform various appropriate actions and processes according to the computer program stored in the memory 502.
[0099] Processor 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 501 performs the various methods and processes described above, such as programming methods for modular hardware systems. For example, in some embodiments, the programming methods for modular hardware systems may be implemented as computer software programs tangibly contained in a machine-readable medium, such as memory 502. In some embodiments, part or all of the computer program may be loaded and / or installed onto electronic device 500 via memory 502. When the computer program is executed by processor 501, one or more steps of the programming methods for modular hardware systems described above may be performed. Alternatively, in other embodiments, processor 501 may be configured to perform programming methods for modular hardware systems by any other suitable means (e.g., by means of firmware).
[0100] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0102] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0104] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0105] Computer systems can include clients and servers. Clients and servers interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") in terms of management difficulty and weak business scalability. A server can also be a server for a distributed system, a server incorporating blockchain technology, or a locally deployed server.
[0106] It should be understood that the various forms of processes shown above can be used to reorder, add, or cancel steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0107] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A programming method for a modular hardware system, characterized in that, include: Obtain assembly information and functional requirements information for each module in a modular hardware system; Using a large language model, preliminary program code is generated based on the assembly information and the functional requirements information; The target program code is obtained based on the preliminary program code, and the target program code is sent to the modular hardware system.
2. The method according to claim 1, characterized in that, The step of obtaining the target program code based on the preliminary program code includes: The preliminary program code is used as the target program code; or... The preliminary program code is tested, and the preliminary program code that passes the test is used as the target program code.
3. The method according to claim 2, characterized in that, The step of testing the preliminary program code, and using the preliminary program code that passes the test as the target program code, includes: A simulation model is generated based on the assembly information; The preliminary program code is written into the simulation model, and the simulation model is run based on the preliminary program code to obtain the running results; If the running result meets the preset requirements, the preliminary program code will be used as the target program code.
4. The method according to claim 2, characterized in that, Also includes: If the initial program code fails the test, an error message is sent to the large language model to trigger the large language model to regenerate the initial program code.
5. The method according to claim 1, characterized in that, The acquisition of assembly information and functional requirement information of each module in the modular hardware system includes: Receive the assembly information sent by the modular hardware system; Receive the functional requirement information input by the user from an APP that matches the modular hardware system; or, generate the functional requirement information based on the assembly information.
6. The method according to claim 5, characterized in that, The assembly information is sent by the modular hardware system after being checked using its built-in AI chip.
7. A programming device for a modular hardware system, characterized in that, include: The acquisition module is used to acquire assembly information and functional requirements information of each module in the modular hardware system; The generation module is used to generate preliminary program code based on the assembly information and the functional requirement information using a large language model; The sending module is used to obtain the target program code based on the preliminary program code and send the target program code to the modular hardware system.
8. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
9. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.