A compilation method and compilation engine for physical object programming

By designing the compilation method and compilation engine in the physical programming system, decoupling hardware programming and underlying interfaces, the compilation and execution of the physical programming language is realized, and the problem of strong hardware coupling in the existing technology is solved, and the universality of programming logic is improved. and scalability, adapt to complex scenarios.

CN114610310BActive Publication Date: 2024-11-08HANGZHOU CHOHOO SMART TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210066397.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2024-11-08
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

The existing physical programming technology lacks high-level language support and unified standards. The code block information acquisition method directly calls the underlying interface, resulting in strong hardware coupling and lack of universality and scalability.

Method used

Design a compilation method and compilation engine for physical programming, embedded in a physical programming system, configured on a cloud server, including a verifier and a compiler, and verify instruction information, object data and interface data through the verifier, and compile it. The device parses and compiles it into a physical programming language, generates executable scripts or encodings, and realizes the decoupling of the hardware and the underlying interface.

Benefits of technology

It realizes independent operation of programming logic, adapts to complex programming scenarios, supports a variety of executable code and scripts through cloud-edge integration, and has a high degree of scenario adaptability and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610310B_ABST
    Figure CN114610310B_ABST
Patent Text Reader

Abstract

The present invention discloses a compilation method and a compilation engine for physical programming. In the present invention, instruction information is compiled into a physical programming language, and then the physical programming language is compiled into a script language or other executable code that can be executed by hardware entities and software twin devices, thereby driving the hardware entities and software twin devices. The present invention decouples the physical programming language, isolates the hardware programming from the underlying interface, makes the programming logic no longer strongly dependent on the hardware underlying interface, and allows the programming logic to run independently, completes highly complex logic programming, and adapts to complex programming scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of physical object programming, and in particular to a compilation method and a compilation engine for physical object programming. Background Art

[0002] Physical programming is based on the graphical programming language, which physically expresses the program logic by making the code blocks on the screen appear.

[0003] In the physical programming system, there is generally a lack of support from high-level languages ​​and unified standards. Information is obtained through code blocks, and other similar methods directly call the underlying interface. The code block information is highly coupled to the underlying hardware and lacks universality and scalability. Summary of the invention

[0004] The purpose of the present invention is to provide a compilation method and a compilation engine for physical programming in order to overcome the defects of the prior art in view of the various situations listed in the background technology.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] A compilation method for physical programming, wherein the compilation method is embedded in a physical programming system, a compilation engine is configured in a cloud server, and the compilation engine includes at least a verifier and a compiler;

[0007] The compilation method comprises:

[0008] When physical programming is performed on a physical programming device, the compilation engine

[0009] Receiving instruction information, and using the checker to check the syntax of the instruction information, to check the programming object data, and to check the interface data;

[0010] Utilizing the compiler to parse object data, parse event data, parse programming instruction data, and compile them into a physical programming language;

[0011] Compile physical programming languages ​​into scripts or codes that can be executed by hardware entities;

[0012] When the virtualization programming system performs virtualization programming, the compilation engine

[0013] Receiving a virtualization programming instruction for a software twin, and using the verifier to verify the syntax of the virtualization programming instruction information, to verify the programming object data, and to verify the interface data;

[0014] Utilizing the compiler to parse object data, parse event data, parse programming instruction data, and compile them into a physical programming language;

[0015] Compile the physical programming language into a script or code that can be executed by the physical programming device corresponding to the software twin.

[0016] Furthermore, the checker is used to check the syntax of the instruction information, the programming object data, and the interface data, which is specifically implemented as follows:

[0017] The checker includes a syntax check component, an interface check component and an object check component;

[0018] First, the syntax of the instruction information is verified by using the syntax verification component to verify whether there is any syntax error in the instruction information;

[0019] Then, the object verification component is used to verify the programming object data, verify whether the programming object exists, and verify the instruction data and object data from the cache. If the instruction data or object data of the object does not exist, the instruction data and object data are synchronized from the cloud;

[0020] Finally, the interface verification component is used to verify the interface data to see whether it exists.

[0021] Furthermore, the compiler is used to parse object data, parse event data, parse programming instruction data, and convert the object programming language into a specific implementation as follows:

[0022] The compiler includes an instruction parser, an object parser and an event parser; first, the object parser is used to parse object data and compile the object data into a physical programming language; then the event parser is used to parse event data and compile the event data into a physical programming language; finally, the instruction parser is used to parse instruction data and compile the instruction data into a physical programming language.

[0023] Furthermore, the compiler also includes a script generator; the script generator recompiles the physical programming language to form a script or code that can be executed by a hardware entity or a software twin device.

[0024] Furthermore, the compilation engine also includes a cache center, which includes an instruction cache and an object cache; the instruction cache is used to cache instruction information; and the object cache is used to cache object information.

[0025] Furthermore, the cache center also includes language keywords and a standard library; the language keywords are used to store keywords of the physical programming language; the standard library is used to store standard library functions of the physical programming language; the language keywords include syntax keywords, objects and event keywords.

[0026] Furthermore, the physical programming language is compiled into a script or code that can be executed by the hardware entity, which is specifically implemented as follows:

[0027] Generate compilation data that matches the physical programming device and the programming instructions, send it to the physical programming device, and the physical programming device executes the programming instructions and feeds back execution data.

[0028] Furthermore, the physical programming language is compiled into a script or code that can be executed by the physical programming device corresponding to the software twin, which is specifically implemented as follows:

[0029] Compiled data matching the physical programming device and the virtualized programming instruction is generated and sent to the physical programming device. The physical programming device executes the virtualized programming instruction and feeds back the execution data.

[0030] A computing device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When executing the computer program, the processor can implement the steps in the above-mentioned compilation method for physical programming.

[0031] A computer readable medium stores a computer program, which can implement the steps of the above-mentioned compilation method for physical programming when executed by a processor.

[0032] The beneficial effects of the present invention are:

[0033] (1) In the present invention, the instruction information is compiled into a physical programming language, and then the physical programming language is compiled into a script language or other executable code that can be executed by the hardware entity and the software twin device, thereby driving the hardware entity and the software twin device. The present invention decouples the physical programming language, isolates the hardware programming from the underlying interface, makes the programming logic no longer strongly dependent on the hardware underlying interface, and allows the programming logic to run independently, completes highly complex logic programming, and adapts to complex programming scenarios.

[0034] (2) In the present invention, instruction data and object data are stored in the cloud through cloud-edge integration. A unified compilation engine integrated in the cloud can be used to run both in physical programming scenarios and in virtual scenarios. It has a high degree of scenario adaptability through lightweight configuration and support for multiple executable codes and / or executable scripts. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a flow chart of the compilation method for physical programming in Example 1.

[0036] Figure 2 This is a flow chart of verification using a checker in Example 1.

[0037] Figure 3 This is a flowchart of the process of compiling using a compiler in Example 1.

[0038] Figure 4 It is a schematic diagram of the compilation engine in the present invention.

[0039] Figure 5 This is a flow chart of the compilation method for physical programming in Example 2.

[0040] Figure 6 This is an example of a computer device in Embodiment 6.

[0041] Figure 7 This is an example of a computer-readable medium in Embodiment 7. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0043] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0044] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; the words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application means greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships. For example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in this application are only used to distinguish similar objects and do not represent a specific ordering of objects.

[0045] In order to enable those skilled in the art to better understand the specific technical solutions of the embodiments when reading the embodiments and to help those skilled in the art to implement the technical solutions of the present invention by reading the embodiments of the present invention, some technical terms mentioned in the present invention are first explained. The purpose of the explanation is not to limit the present invention.

[0046] The physical programming is a special form of programming, as a tangible programming language. Physical programming can be: on the basis of a graphical programming language, the code blocks on the screen are materialized and encapsulated into physical modules such as building blocks and instruction blocks. These physical modules are given different properties or functions, such as functions, variables, logic, sensors, etc. They can express program logic through different splicing and arrangement methods and respond to instructions. In the present invention, physical programming can be embodied as a program that can be stored, interacted or executed in an electronic device.

[0047] It should be noted that the physical programming device described in the present invention can be a programming machine or a smart building block, or it can be a programmable device, such as a smart speaker, a smart desk lamp, a smart watch, etc.

[0048] The specific embodiments will be described in detail below with reference to the accompanying drawings.

[0049] Example 1

[0050] like Figure 1 As shown, a compilation method for physical programming, the compilation method is embedded in a physical programming system, the compilation engine is configured in a cloud server, and the compilation engine includes at least a verifier and a compiler;

[0051] The compilation method comprises:

[0052] When physical programming is performed on a physical programming device, the compilation engine

[0053] S11 receives instruction information, and uses the checker to check the syntax of the instruction information, the programming object data, and the interface data;

[0054] S12 uses the compiler to parse object data, event data, and programming instruction data, and compiles them into a physical programming language;

[0055] S13 uses the compiler to compile the physical programming language into a script or code that can be executed by the hardware entity.

[0056] In the present invention, the physical programming language is a code language after the instruction information is compiled. The physical programming language is an important part of the physical programming system. It is an intermediate language between the physical programming block and the hardware program. Its function is to shield the differences in specific hardware and can be easily translated into programs on different hardware platforms. Compared with the computer programming language, the physical programming language in the present invention has similar parts (such as logic control, process control, operators, etc.), but there are also some differences; the difference lies in that the physical programming language has various capabilities that embody physical programmable devices. In addition to the grammatical system of the programming language, it also contains language elements related to the physical object, such as actions, sensor message events, sensor parameters, etc.

[0057] In some preferred embodiments, the checker is used to check the syntax of the instruction information, the programming object data, and the interface data, which is specifically implemented as follows:

[0058] The checker includes a syntax check component, an interface check component and an object check component;

[0059] First, the syntax of the instruction information is verified by using the syntax verification component to verify whether there is any syntax error in the instruction information;

[0060] Then, the object verification component is used to verify the programming object data, verify whether the programming object exists, and verify the instruction data and object data from the cache. If the instruction data or object data of the object does not exist, the instruction data and object data are synchronized from the cloud;

[0061] Finally, the interface verification component is used to verify the interface data to see whether it exists.

[0062] The interface refers to an interface that can be referenced and read by a physical programming device.

[0063] Specifically, Figure 2 As shown, the process of using the verifier for verification is:

[0064] Command information input,

[0065] Check the syntax of the command information. If the syntax is incorrect, the command ends.

[0066] If the syntax of the instruction information is correct, object verification is performed, and the object data is pulled and verified. If the object data or the object instruction data does not exist, the instruction data and object data are synchronized from the cloud. If the programming object and the object instruction data exist, interface verification is performed. If the interface data exists, the physical programming language compilation stage is entered.

[0067] In some preferred embodiments, the compiler is used to parse object data, event data, and programming instruction data, and compile them into a physical programming language, which is specifically implemented as follows:

[0068] The compiler includes an instruction parser, an object parser and an event parser; first, the object parser is used to parse object data and compile the object data into a physical programming language; then the event parser is used to parse event data and compile the event data into a physical programming language; finally, the instruction parser is used to parse instruction data and compile the instruction data into a physical programming language.

[0069] Specifically, Figure 3 As shown, the process of compiling using the compiler is:

[0070] First, the object data is parsed and compiled into a physical programming language;

[0071] Then parse the event data, if the event exists, register the event information and message information in the object; compile the event data into a physical programming language;

[0072] Finally, the instruction data is parsed and compiled into the physical programming language.

[0073] In some preferred embodiments, the physical programming language is compiled into a script or code that can be executed by a hardware entity, which is specifically implemented as follows:

[0074] Generate compilation data that matches the physical programming device and the programming instructions, and send it to the physical programming device. The execution module or execution mechanism of the physical programming device executes the programming instructions and feeds back the execution data.

[0075] Example 2

[0076] like Figure 5 As shown, a compilation method for physical programming, the compilation method is embedded in a physical programming system, the compilation engine is configured in a cloud server, and the compilation engine includes at least a verifier and a compiler;

[0077] The compilation method comprises:

[0078] When the virtualization programming system performs virtualization programming, the compilation engine

[0079] S21 receives a virtualization programming instruction for the software twin, and uses the verifier to verify the syntax of the virtualization programming instruction information, the programming object data, and the interface data;

[0080] S22 uses the compiler to parse object data, parse event data, parse programming instruction data, and compile them into a physical programming language;

[0081] S23 uses the compiler to compile the physical programming language into a script or code that can be executed by the physical programming device corresponding to the software twin.

[0082] In some embodiments, step S23 is: using the compiler to compile the physical programming language into a script or code that can be executed by the software twin and / or the physical programming device corresponding to the software twin. In some embodiments, the two (the software twin and the physical programming device corresponding to the software twin) are executed synchronously.

[0083] In the present invention, the physical programming language is the code language after the instruction information is compiled.

[0084] In some preferred embodiments, the physical programming language is compiled into a script or code that can be executed by the physical programming device corresponding to the software twin, which is specifically implemented as follows:

[0085] In the virtualized programming system, compiled data matching the physical programming device and the virtualized programming instructions is generated and sent to the physical programming device. The execution module or execution mechanism of the physical programming device executes the virtualized programming instructions and feeds back the execution data.

[0086] In some embodiments, reference Figure 4 The physical programming system also includes a virtualization platform, which collects data information of the physical programming device and process information of the physical programming, and establishes a virtualization programming system in the form of a digital twin. The virtualization programming system executes virtualization programming and generates virtualization programming instructions. The compilation engine receives the virtualization programming instructions for the software twin, compiles them according to the above-mentioned compilation method, generates compilation data that matches the physical programming device and the virtualization programming instructions, and sends it to the physical programming device. The physical programming device executes the virtualization programming instructions and feeds back the execution data.

[0087] Specifically, on the virtualization platform, there are virtualization models of various forms or structures of physical programming devices, that is, users initiate programming instructions for the software twin (virtualized image) of the physical programming device in order to control the physical programming device. For example, the effect of controlling the physical programming device is achieved by sending virtualized programming instructions on the WEB side, that is: in order to achieve the control of the building shape (physical programming device) composed of smart building blocks; send a control signal (virtualized programming instruction) to the communication module of the building on the WEB side, use the above-mentioned compilation engine and the compilation method, and the control signal instructs the lamp post at the top of the building to flash;

[0088] Because they have common programming instruction data, physical programming language syntax standards, model standards, programming scenario data, and programming execution data, in the virtualized programming system, the building (software twin) composed of smart building blocks can execute control signals and make the light poles on the top of the building flash.

[0089] In some embodiments, the lamp posts on top of the building made of smart building blocks and the building in the virtualization system (software twin) flash simultaneously.

[0090] In this embodiment, the model standard includes entity form, physical programming language syntax standard and functional interface; in the present invention, the entity can be a programming machine or a smart building block, or a programmable device, such as a smart speaker, a smart desk lamp, a smart watch, etc.; the physical programming language syntax standard is detailed in some requirements of the physical programming language described in Example 1; the functional interface refers to an interface that can be referenced and read by the physical programming device.

[0091] Other implementations of this embodiment may be the same as or similar to Embodiment 1.

[0092] Example 3

[0093] In some preferred embodiments, reference Figure 4 The compilation engine also includes a cache center, which includes an instruction cache and an object cache; the instruction cache is used to cache instruction information; and the object cache is used to cache object information.

[0094] In some preferred embodiments, the cache center further includes language keywords and a standard library; the language keywords are used to store keywords of the physical programming language; and the standard library is used to store standard library functions of the physical programming language.

[0095] The standard library functions include physical programming programs. Physical programming programs (executable functions) are programs for programmable hardware, and the program body needs to specify the hardware objects on which the program is executed. Considering the scene requirements of multi-physical interaction, multiple hardware objects need to be programmed in the program, and sensors on different hardware need to be able to propagate message events through the network. The hardware that receives the events performs corresponding actions according to the program rules. Therefore, the physical programming program as a whole is a program that conforms to the TA (Trigger-Action) mode. The execution of actions is triggered by hardware sensor events locally or on the network. The physical programming program can be laid out according to the template pattern structure.

[0096] In some preferred embodiments, the language keywords include grammatical keywords, object keywords and event keywords.

[0097] The grammatical keywords may be and, or, case_begin, case, case_end, false, loop_begin, loop, not, true, end and function.

[0098] Object and event keywords can be objid, send, receive, action, and event, etc. These keywords are keywords used in physical programming languages ​​that are physical object-oriented and event-driven. For example, they can be used to specify which physical programming device to send or receive broadcasts, and what actions to perform.

[0099] Example 4

[0100] In some preferred embodiments, the compiler also includes a script generator; the script generator recompiles the physical programming language to form a script or code that can be executed by a hardware entity or a software twin device.

[0101] The compiler also includes other compilers, which are other compilers that can perform secondary compilation on physical programming languages, and after secondary compilation, they can form other executable codes that can be executed by hardware entities or software twin devices.

[0102] In the present invention, the physical programming language is a code language after the instruction information is compiled.

[0103] The physical programming language can be compiled into different scripting languages ​​or executable codes according to different needs and executed by a multi-terminal execution engine, thereby driving the physical hardware devices or software twin devices, and realizing the adaptation of the physical programming language in different environments, so that it can be suitable for different hardware environments and can also be adapted to software digital twin environments, thereby fundamentally realizing cloud-edge integration.

[0104] Specifically, taking the Lua script execution engine as an example, assume that there are two physical interaction scenes: a brightness sensor physical object and a fan physical object. The brightness sensor physical object executes: sending a broadcast message event according to the light intensity it detects, and the fan physical object executes: not sending message data, turning on the fan when the brightness is low, and turning off the fan when the brightness is high.

[0105] Example 5

[0106] The main function of the compilation engine of the present invention is to compile the code block information into a physical programming language, and further convert the physical programming language into an executable script or other executable code, which is then driven by the execution engine to drive the physical hardware device and / or software twin device.

[0107] In a physical programming system and a virtualized programming system, the compilation engine of the present invention can compile instructions and pass the compiled content to the execution engine to drive the physical hardware device or the software twin device.

[0108] As an implementation form, the compilation engine of the present invention can execute the entire compilation process into three stages, namely, a pre-compilation stage, a language compilation stage, and a script compilation stage. The specific stages and steps are not limited thereto.

[0109] The first stage, the pre-compilation stage, verifies the syntactic correctness of the instruction information and synchronizes object data and instruction information data that do not exist in the local cache from the cloud.

[0110] The second stage, the language compilation stage, compiles the instruction information into a physical programming language;

[0111] The third stage is the script compilation stage: according to different needs, the physical programming language can be compiled into different script languages ​​or executable codes, and handed over to the multi-terminal execution engine for execution. This enables the adaptation of the preset programming language in different environments, making it suitable for different hardware environments and software digital twin environments, thereby fundamentally realizing cloud-edge integration.

[0112] Example 6

[0113] A computer device, in the present invention, can be configured as a cloud server, such as Figure 6 As shown, it includes a memory 102, a processor 101, and a computer program 103 stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the compilation method for physical programming described above can be implemented.

[0114] Example 7

[0115] like Figure 7 As shown, a computer readable medium 91 stores a computer program, and when the computer program is executed by a processor, the steps in the compilation method for physical programming described above can be implemented.

[0116] In this embodiment, the computer program may be the computer program in Embodiment 6.

[0117] In this embodiment, the computer-readable storage medium can be executed by the computer device in Embodiment 6.

[0118] Those skilled in the art can understand that all or part of the processes in the above embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0119] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0120] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of protection. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the scope of protection of the present invention.

Claims

1. A compiling method for physical programming, characterized in that: The compilation method is embedded in a physical programming system, and the compilation engine is configured in a cloud server, and the compilation engine includes at least a verifier and a compiler; The compilation method comprises: When physical programming is performed on a physical programming device, the compilation engine Receiving instruction information, and using the checker to check the syntax of the instruction information, to check the programming object data, and to check the interface data; Utilizing the compiler to parse object data, parse event data, parse programming instruction data, and compile them into a physical programming language; Compile physical programming languages ​​into scripts or codes that can be executed by hardware entities; When the virtualization programming system performs virtualization programming, the compilation engine Receiving a virtualization programming instruction for a software twin, and using the verifier to verify the syntax of the virtualization programming instruction information, to verify the programming object data, and to verify the interface data; Utilizing the compiler to parse object data, parse event data, parse programming instruction data, and compile them into a physical programming language; Compile the physical programming language into a script or code that can be executed by the physical programming device corresponding to the software twin.

2. A compiling method for physical programming according to claim 1, characterized in that: The checker is used to check the syntax of the instruction information, the programming object data, and the interface data, which is specifically implemented as follows: The checker includes a syntax check component, an interface check component and an object check component; First, the syntax of the instruction information is verified by using the syntax verification component to verify whether there is any syntax error in the instruction information; Then, the object verification component is used to verify the programming object data, verify whether the programming object exists, and verify the instruction data and object data from the cache. If the instruction data or object data of the object does not exist, the instruction data and object data are synchronized from the cloud; Finally, the interface verification component is used to verify the interface data to see whether it exists.

3. A compiling method for physical programming according to claim 1, characterized in that: The compiler is used to parse object data, event data, and programming instruction data, and its physical programming language is specifically implemented as follows: The compiler includes an instruction parser, an object parser and an event parser; first, the object parser is used to parse object data and compile the object data into a physical programming language; then the event parser is used to parse event data and compile the event data into a physical programming language; finally, the instruction parser is used to parse instruction data and compile the instruction data into a physical programming language.

4. A compiling method for physical programming according to claim 1, characterized in that: The compiler also includes a script generator; the script generator recompiles the physical programming language to form a script or code that can be executed by a hardware entity or a software twin device.

5. A compiling method for physical programming according to claim 1, characterized in that: The compilation engine also includes a cache center, which includes an instruction cache and an object cache; the instruction cache is used to cache instruction information; and the object cache is used to cache object information.

6. A compiling method for physical programming according to claim 5, characterized in that: The cache center also includes language keywords and a standard library; the language keywords are used to store keywords of the physical programming language; the standard library is used to store standard library functions of the physical programming language; the language keywords include syntax keywords, objects and event keywords.

7. A compiling method for physical programming according to claim 1, characterized in that: Compile the physical programming language into a script or code that can be executed by the hardware entity, specifically implemented as follows: Generate compilation data that matches the physical programming device and the programming instructions, send it to the physical programming device, and the physical programming device executes the programming instructions and feeds back execution data.

8. A compiling method for physical programming according to claim 1, characterized in that: Compile the physical programming language into a script or code that can be executed by the physical programming device corresponding to the software twin. The specific implementation is: Compiled data matching the physical programming device and the virtualized programming instruction is generated and sent to the physical programming device. The physical programming device executes the virtualized programming instruction and feeds back the execution data.

9. A computing device, characterized in that The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor can implement the steps of the compiling method for physical programming described in any one of claims 1 to 8 when executing the computer program.

10. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, can implement the steps of the compiling method for physical programming according to any one of claims 1 to 8.