CN115857910A - Programming method, device, server and medium of edge computing collector - Google Patents

Programming method, device, server and medium of edge computing collector Download PDF

Info

Publication number
CN115857910A
CN115857910A CN202310182132.XA CN202310182132A CN115857910A CN 115857910 A CN115857910 A CN 115857910A CN 202310182132 A CN202310182132 A CN 202310182132A CN 115857910 A CN115857910 A CN 115857910A
Authority
CN
China
Prior art keywords
module
collector
edge calculation
programming
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310182132.XA
Other languages
Chinese (zh)
Other versions
CN115857910B (en
Inventor
高政
王孙骏
宋小平
党俊
宣慧栋
王丛林
周祥明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Kongtrolink Information Technology Co ltd
Original Assignee
Hangzhou Kongtrolink Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Kongtrolink Information Technology Co ltd filed Critical Hangzhou Kongtrolink Information Technology Co ltd
Priority to CN202310182132.XA priority Critical patent/CN115857910B/en
Publication of CN115857910A publication Critical patent/CN115857910A/en
Application granted granted Critical
Publication of CN115857910B publication Critical patent/CN115857910B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a programming method, a device, a server and a medium of an edge computing collector, wherein the method is applied to a cloud server and comprises the following steps: acquiring a text file corresponding to an edge calculation collector, wherein the text file comprises elements of a module corresponding to the extracted edge calculation collector, and the module corresponding to the edge calculation collector is a developed module based on a graphical programming platform; acquiring a module relation description file corresponding to the edge calculation collector, wherein the module relation description file is used for describing the connection relation between modules corresponding to the edge calculation collector; and generating a programming code of the edge calculation collector according to the text file, the module relation description file and a pre-constructed function body library, and sending the programming code to the edge calculation collector. The remote server converts the graphical programming of the edge computing collector into codes and issues the codes, the method is not limited by regions, the reusability is high, and the convenience and the efficiency of the programming are improved.

Description

Programming method, device, server and medium of edge computing collector
Technical Field
The embodiment of the application relates to the technical field of programming, in particular to a programming method, a programming device, a server and a medium for an edge computing collector.
Background
The edge computing collector operates between the bottom layer equipment and the cloud server, supports connection modes such as a serial port and an Ethernet port, collects data of the bottom layer equipment (such as a sensor and production equipment), and transmits the collected data to the server after corresponding computation.
In an industrial internet of things scene, an edge computing collector needs to be connected with devices such as massive sensors and industrial internet of things intelligent devices, protocols of devices produced by different manufacturers are different, in order to improve protocol development efficiency and reusability, the edge computing collector performs device access programming in a graphical mode through a graphical programming platform, but the graphical programming platform can only run at a Personal Computer (PC) end, and a common development mode is that a developer programs one edge computing collector through the graphical programming platform on a client according to actual field conditions.
With the development of the industrial internet of things, the access scene of industrial equipment has the requirements of cross-region, real-time performance and diversification, and the traditional one-to-one mode equipment access mode cannot meet the rapid promotion requirement of factory digitization. Therefore, an efficient and convenient programming method for the edge calculation collector is needed.
Disclosure of Invention
The embodiment of the application provides a programming method, a programming device, a server and a medium of an edge computing collector.
In a first aspect, an embodiment of the present application provides a programming method for an edge computing collector, where the method is applied to a cloud server, and the method includes:
acquiring a text file corresponding to an edge calculation collector, wherein the text file comprises extracted elements of a module corresponding to the edge calculation collector, the module corresponding to the edge calculation collector is a module developed based on a graphical programming platform, and the elements comprise input parameters, output parameters and function names of the module; acquiring a module relation description file corresponding to the edge calculation collector, wherein the module relation description file is used for describing the connection relation between modules corresponding to the edge calculation collector; and generating a programming code of the edge calculation collector according to the text file, the module relation description file and a pre-constructed function body library, and sending the programming code to the edge calculation collector.
Optionally, the process of generating the text file includes the following steps:
acquiring a developed function block, a graphical control and a custom protocol which are based on a graphical programming platform and correspond to the edge computing collector through a client; extracting a plurality of elements of the function block, the graphical control and the custom protocol, wherein the elements comprise input parameters, output parameters and function names; and generating a text file corresponding to the edge calculation collector based on the extracted functional blocks, the graphical control and the plurality of elements of the user-defined protocol.
Optionally, obtaining the module relationship description file corresponding to the edge calculation collector includes:
acquiring a configuration file corresponding to the edge calculation collector uploaded by a user side, wherein the configuration file comprises equipment connected with an interface of the edge calculation collector; and generating a module relation description file corresponding to the edge calculation collector according to the configuration file.
Optionally, generating a programming code of the edge calculation collector according to the text file, the module relationship description file, and a pre-constructed function library, includes:
analyzing the module relation description file to obtain the connection relation between the modules corresponding to the edge calculation collector; loading elements of each module corresponding to the edge calculation collector according to the text file, and linking each module according to the connection relation to obtain a module linked list; and generating a programming code of the edge calculation collector according to a pre-constructed function body library and the module linked list.
Optionally, generating a programming code of the edge calculation collector according to a pre-constructed function library and the module linked list, includes:
determining a function body of a function corresponding to each module in the module linked list according to a pre-constructed function body library; and calling a code conversion module, and converting each module into codes according to the sequence corresponding to the module linked list based on the function body of the function corresponding to each module to obtain the programming codes of the edge calculation collector.
Optionally, the method further includes:
and updating the function body library based on the newly added functions uploaded by the client.
Optionally, the format of the text file is an extensible markup language format.
In a second aspect, an embodiment of the present application further provides a programming apparatus for an edge computing collector, where the apparatus is applied to a cloud server, and the apparatus includes:
the system comprises a text file acquisition module, a text file acquisition module and a data processing module, wherein the text file acquisition module is used for acquiring a text file corresponding to an edge calculation collector, the text file comprises extracted elements of a module corresponding to the edge calculation collector, the module corresponding to the edge calculation collector is a module based on development of a graphical programming platform, and the elements comprise input parameters, output parameters and function names of the module; the system comprises a relation description file acquisition module, a module relation description file acquisition module and a module relation description file acquisition module, wherein the relation description file acquisition module is used for acquiring a module relation description file corresponding to the edge calculation collector, and the module relation description file is used for describing a connection relation between modules corresponding to the edge calculation collector; and the code generation module is used for generating a programming code of the edge calculation collector according to the text file, the module relation description file and a pre-constructed function body library and sending the programming code to the edge calculation collector.
In a third aspect, the present application provides a cloud server, including: a memory and at least one processor; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the programming method of the edge calculation collector provided by any embodiment corresponding to the first aspect of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer execution instruction is stored, and when a processor executes the computer execution instruction, the programming method of an edge computation gatherer provided in any embodiment corresponding to the first aspect of the present application is implemented.
In a fifth aspect, the present application provides a computer program product, including a computer program, which when executed by a processor implements the method for programming an edge computation gatherer as provided in any embodiment corresponding to the first aspect of the present application.
In order to implement cloud programming of the edge computing collector, developers can perform graphical programming of the edge computing collector through a graphical programming platform of a client to obtain a plurality of modules corresponding to the edge computing collector, and extract elements of the modules to obtain a text file corresponding to the edge computing collector.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic diagram of a programming process of an edge calculation collector according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a programming method of an edge calculation collector according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a graphical process in the embodiment of FIG. 2 of the present application;
fig. 4 is a flowchart of a programming method of an edge calculation collector according to another embodiment of the present application;
FIG. 5 is a schematic diagram of a module relationship description file according to an embodiment of the present application;
fig. 6 is a schematic diagram of a cloud-based programming process according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a programming apparatus of an edge calculation collector according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a cloud server according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
First, terms related to the present application are explained:
the edge calculation collector comprises: the data acquisition unit with the edge computing capability is arranged between the bottom layer device and the cloud server and used for relieving the computing pressure of the cloud server, has the network, storage and computing capabilities, can acquire bottom layer device data, performs storage, computation and other processing on the acquired data, and uploads the data to the cloud server.
A graphical programming platform: the method can be used for graphically programming software, websites and the like, and comprises a plurality of functional blocks and graphical controls which are established in advance, such as logic operation, mathematical operation, peripheral equipment and the like, a user can realize programming by dragging the functional blocks to a development page and realizing the connection between the functional blocks deployed on the development page through the graphical controls, and the original codes are replaced by the graphical modes, so that the coding is simplified, and the coding efficiency is improved.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a programming process of an edge computing collector according to an embodiment of the present disclosure, and as shown in fig. 1, a field of an industrial system includes a plurality of bottom-layer devices with various types and distributed layouts, where the bottom-layer devices include sensors, control devices, and execution devices. In fig. 1, the industrial system includes 1 control device, a plurality of execution devices and a plurality of sensors, for example, and the number of the control devices may be plural in some embodiments.
Illustratively, the sensor may be a temperature sensor, a humidity sensor, an amplitude sensor, or the like.
Taking an industrial system as an injection molding system as an example, the equipment in the industrial system comprises a temperature and humidity sensor, an air conditioner, electric equipment and a workshop injection molding machine. The edge calculation collector can collect data output by the temperature and humidity sensor and can also monitor information such as amplitude, voltage, frequency and the like of the workshop injection molding machine.
The edge calculation collector is arranged on an industrial field of an industrial system and used for carrying out data interaction with bottom equipment, including the steps of obtaining data collected by the sensor to carry out storage, calculation and other processing, and uploading the processed data to the cloud server to carry out storage or utilize the powerful computing power of the cloud server to carry out data analysis.
The edge computing collector needs to be connected with more sensors, internet intelligent equipment and other equipment in an industrial system, and communication protocols of the equipment are different due to different manufacturers and types of the equipment. In order to improve the efficiency and reusability of the edge calculation collector programming, developers usually program the edge calculation collector through a graphical programming platform.
During programming, developers need to perform one-to-one graphical programming on the edge computing collector based on the field condition of an industrial system corresponding to the edge computing collector, namely, the graphical programming of the edge computing collector is performed through a graphical programming platform installed on a PC (personal computer) end of the developers, the needed function blocks, the user-defined function blocks and the like are dragged to a development page, the selected function blocks are connected based on a graphical control component to obtain a graphical program, then the graphical programming platform compiles the graphical program to generate an executable file, and the executable file is downloaded to the edge computing collector to be executed, so that the programming of the edge computing collector is realized.
For example, the graphic programming platform may be a graphic programming platform or a graphic editor of a PLC (Programmable Logic Controller), and the resulting graphic program may be a Ladder Diagram (LD-Ladder Diagram).
The graphical programming platform may also be other platforms for performing graphical programming, such as a programming platform for obtaining a Sequential Function Chart (SFC), which is not limited in this application.
Due to the difference of operating systems, a cloud server does not support functional blocks and graphical controls developed based on a graphical programming platform, in order to realize the programming of the edge collector based on the cloud, thereby overcoming the regional limitation and improving the convenience and efficiency of the programming, the application provides a programming method of the edge computing collector, which realizes the programming mode of the edge computing collector based on the cloud server. And the programming code can be rapidly issued to a plurality of edge computing collectors through the cloud, so that the reusability is high.
Fig. 2 is a schematic flowchart of a programming method of an edge computation gatherer according to an embodiment of the present disclosure, where the method is applied to a cloud server, and may be a physical server or a virtual server, as shown in fig. 2, the programming method of the edge computation gatherer according to the embodiment includes the following steps:
step S201, acquiring a text file corresponding to the edge calculation collector.
The text file comprises extracted elements of a module corresponding to the edge calculation collector, the module corresponding to the edge calculation collector is a developed module based on a graphical programming platform, and the elements comprise input parameters, output parameters and function names of the module.
Due to the difference of the operating systems, the cloud server does not support modules such as functional blocks, graphical control components and the like developed by a graphical programming platform. The module corresponding to the edge computing collector can be developed through a graphical programming platform installed at a user side (or a PC side), and comprises a functional block, a graphical control, a functional block corresponding to a custom protocol and the like, so that a graphical program corresponding to the edge computing collector is obtained. The user end can extract elements of the graphical program output by the graphical programming platform to obtain a text file corresponding to the edge calculation collector, and the text file is sent to the cloud server.
The functional blocks are modules designed for realizing certain functions in the graphical program, such as a noise reduction functional block, a storage functional block, a data operation functional block and the like. A functional block may be comprised of one or more graphical controls. The graphical control is provided for the graphical programming platform and can support some basic logical operation controls, such as addition operation, multiplication operation and the like, and the graphical control comprises a timer control, a counter control and the like. The function block corresponding to the custom protocol is used for realizing the communication protocol customized by the user, and the format of the transmitted data can be limited through the custom protocol.
Specifically, elements of the functional block corresponding to the graphical program, the graphical control and the custom protocol in the edge calculation collector can be extracted, and the text file is generated based on the extracted elements.
Elements of each module in the graphical program may be extracted based On an Activity On Vertex Network (AOV) of the graphical program. Elements of each module in the graphical program may also be identified based on a graph-text recognition technique, such as a neural network-based graph-text recognition technique.
The extracted elements comprise input parameters, output parameters and function names of modules such as function blocks, graphical controls, function blocks corresponding to the custom protocol and the like. The input parameters may include parameters such as an interface, a transmission frequency, a protocol type, and the like, and the name of the function is the name of the function corresponding to the module and is a unique identifier of the function. The output parameters may include an interface, and the output parameters of the module may be default, i.e. the output parameters of the module may be empty.
Optionally, the process of generating the text file includes the following steps:
acquiring a developed functional block, a graphical control and a custom protocol based on a graphical programming platform corresponding to the edge computing collector through a client; extracting a plurality of elements of the function block, the graphical control and the custom protocol, wherein the elements comprise input parameters, output parameters and function names; and generating a text file corresponding to the edge calculation collector based on the extracted functional blocks, the graphical controls and the plurality of elements of the custom protocol.
After a developer finishes the graphical programming of the edge computing collector based on a graphical programming platform installed on a client, the graphical programming corresponding to the edge computing collector is converted into a text file through a conversion tool installed on the client, the conversion tool extracts elements of the obtained modules such as the graphical programming function block corresponding to the edge computing collector, the graphical control, the user-defined protocol function block and the like to obtain input parameters, output parameters and function names of the modules corresponding to the edge computing collector, and the extracted elements are integrated into the text file.
Specifically, the extracted elements such as the input parameters, the output parameters, and the function names of the modules may be organized according to the format corresponding to the text file, so as to obtain the text file corresponding to the edge calculation collector.
The extracted elements such as input parameters, output parameters and function names of the modules can be organized into text files with required formats through a third-party editor.
The text file may be described in any Markup Language, such as ML (Markup Language), XML (Extensible Markup Language), or other Markup languages.
The method comprises the steps of extracting elements from modules such as a function block and a graphical control component through a client, arranging the extracted elements into a text file, and providing a basis for a cloud server to analyze graphical programming.
Optionally, the format of the text file is an Extensible Markup Language (XML) format.
And the text file is described in an XML format, and marks are used for describing extracted elements such as function names, input interfaces, output interfaces and the like.
The XML-description-based text file supports multiple encoding modes, cross-platform use can be achieved, and therefore the client and the cloud server can process the text file.
For example, fig. 3 is a schematic diagram of a graphical program in the embodiment shown in fig. 2 of the present application, fig. 3 takes the graphical program as a ladder diagram as an example, a part of the ladder diagram corresponding to the edge calculation collector is shown in fig. 3, and the ladder diagram provided in fig. 3 is used for implementing that the variable K5 is added to the variable K6 and then is reassigned to the variable K5. The graphical control In fig. 3 is named ADDW1 and is of type ADDW, and includes two input parameters In1 and In2, and an output parameter Out1. Through the steps provided by this embodiment, the obtained text file (in XML format for example) corresponding to the part of the ladder diagram is:
Figure SMS_1
v/graphical control type and name
Figure SMS_2
V/graphical control element position
Figure SMS_3
// graphical control size
Figure SMS_4
// graphical control input parameters
Figure SMS_5
// graphical control input parameters
Figure SMS_6
// graphical control output parameters
Figure SMS_7
The Location and Size attributes are used for defining the position and Size of the graphical control respectively, the Size may include length and width, and the position may be the position of the central point or the top left corner vertex of the graphical control.
Step S202, obtaining a module relation description file corresponding to the edge calculation collector.
The module relation description file is used for describing the connection relation between the modules corresponding to the edge calculation collector.
And constructing a module relation description file based on the connection relation among the modules in the graphical programming corresponding to the edge computing collector by the cloud server.
The connection relationship between modules in the graphical programming can be extracted through a module relationship description file, and the connection relationship between modules can be recorded in the module relationship description file, for example, by marking the previous module and the next module of the recording module.
The module relationship description file can also be generated based on a configuration file of an industrial system corresponding to the edge collector, the configuration file is used for describing equipment connected with each interface of the edge collector, the connection relationship of each module is further determined by combining the input parameters and the output parameters of each module in the text file, and the module relationship description file is constructed based on the connection relationship.
And step S203, generating a programming code of the edge calculation collector according to the text file, the module relation description file and a pre-constructed function body library, and sending the programming code to the edge calculation collector.
The pre-constructed function body library comprises function bodies of all functions used in graphical programming.
Specifically, determining the connection relationship among the modules according to the module relationship description file; determining functions corresponding to the modules based on the text files; extracting function bodies of functions corresponding to the modules through a function body library; and generating a programming code of the edge calculation collector based on the connection relation and the function body of the function corresponding to each module.
The modules can be converted into standard codes through the code conversion module according to the corresponding sequence of the connection relation and the function body based on the function corresponding to each module, so that the programming codes of the edge calculation collector are obtained.
If the industrial system has the same programming of the edge calculation collectors distributed in a plurality of areas, the cloud server may issue the generated programming code of the edge calculation collector to the plurality of edge calculation collectors.
In order to implement cloud programming of the edge computing collector, a developer may perform graphical programming of the edge computing collector through a graphical programming platform of a client to obtain a plurality of modules corresponding to the edge computing collector, and obtain a text file corresponding to the edge computing collector by extracting elements of the plurality of modules, based on the text file, a module relationship description file describing a connection relationship between the plurality of modules, and a pre-constructed function library, the cloud server may convert the plurality of modules designed by the graphical programming platform into programming codes to obtain codes of the edge computing collector, and issue the codes to the edge computing collector through the cloud server, so that a user does not need to reach a site of the edge computing collector to perform one-to-one programming, thereby removing a geographical limitation on the programming of the edge computing collector, and improving convenience of programming.
The programming of the edge calculation collector is mainly to realize a communication protocol between an interface of the edge calculation collector and connected equipment (such as a sensor, internet of things equipment and the like), the graphical programming corresponding to the edge calculation collector realizes the expression of a logical relationship corresponding to the communication protocol between the interface of the edge calculation collector and the connected equipment through a functional block, a functional block corresponding to a self-defined protocol and a graphical control.
And through programming the edge calculation acquisition, the interface of the edge calculation acquisition unit performs data interaction with the connected equipment based on a specified protocol.
Fig. 4 is a flowchart of a programming method of an edge calculation collector according to another embodiment of the present application, where this embodiment further details step S202 and step S203 on the basis of the embodiment shown in fig. 2, and as shown in fig. 4, the programming method of an edge calculation collector according to this embodiment may include the following steps:
step S301, acquiring a text file corresponding to the edge calculation collector.
Step S302, obtaining a configuration file corresponding to the edge calculation collector uploaded by a user side.
Wherein the configuration file comprises the equipment connected with the edge computing collector interface. The device may be any device in an industrial system, such as a sensor, an actuator, a controller, etc.
The configuration file may further include protocol information corresponding to the interface of the edge computing collector, such as a protocol type, a protocol identifier, a communication address, and the like.
The configuration file can be obtained by determining information such as other industrial system equipment connected with the interface of the edge computing collector, communication addresses of the interfaces, adopted communication protocols and the like by field personnel based on the field condition of the industrial system, generating the configuration file corresponding to the edge computing collector based on the information, and uploading the configuration file to the cloud server.
The field personnel can upload the configuration file to the cloud server through mobile phones, computers and other equipment.
Specifically, field personnel can configure the equipment connected with the edge computing collector interface and the corresponding protocol information in an optional manner through a configuration page, for example, select a communication protocol through a pull-down menu, and generate a configuration file based on the configuration information of the configuration page.
Step S303, generating a module relation description file corresponding to the edge calculation collector according to the configuration file.
Specifically, the connection relationship between the modules may be determined based on information such as devices connected to the edge calculation collector interface in the configuration file and the interfaces corresponding to the functional blocks, and a module relationship description file corresponding to the edge calculation collector may be constructed based on the connection relationship.
Further, the cloud server can generate a module relation description file corresponding to the edge calculation collector based on the configuration file and the text file.
The module relation description file can be generated based on the input parameters and the output parameters of the modules in the configuration file and the text file, the module relation description file comprises the connection relation between the modules of the edge calculation collector, and the elements of the modules also comprise protocol information of the modules, such as protocol types, communication addresses and the like.
The cloud server can generate a module relation description file based on protocol information of the edge calculation collector interface in the configuration file, and information of the interface corresponding to each module, the previous module and the next module of the module and the like in the text file.
For example, fig. 5 is a schematic diagram of a module relationship description file provided in an embodiment of the present application, and fig. 5 illustrates that an edge calculation collector corresponds to 5 modules, and includes a start module, modules D1 to D3, and an end module, as shown in fig. 5, in the module relationship description file, each module is represented by an input parameter, an output parameter, a previous module identifier and a next module identifier, where the previous module identifier and the next module identifier are identifiers of a previous module and a next module, respectively, the previous module and the next module are both modules connected to the modules in a connection relationship, the previous module is a previous module of the modules in the connection relationship, and the next module is a next module of the modules in the connection relationship. The last module of the module D2 is the module D1, the next module is the module D3, D1, D2, D3 are the module identifications of the module D1, the module D2, the module D3 respectively, the module identification of the starting module is STAR, and the module identification of the ending module is END. The input parameters may include serial ports corresponding to the modules, communication addresses, communication checks, bits of serial port transmission data, bits of serial port communication stop bits, serial port communication rates, and the like. The input parameters of the module D1 sequentially include COM1, N, 8, 1, and 9600, where a first input parameter "COM1" indicates that a physical port corresponding to the module D1 is a serial port 1, a second input parameter "1" indicates that a communication address of the module D1 is 1, a third input parameter "N" indicates that communication is not verified, a fourth parameter "8" indicates that a data bit number transmitted by serial communication is 8 bits, a fifth parameter "1" indicates that a stop bit of serial communication is 1 bit, and a last parameter "9600" indicates that a rate of serial communication is 9600bps, and so on, the meanings of the input parameters corresponding to other modules can be determined.
An example function for module D1 is:
{
module D1 = new module;
module d1.Port = COM1;
module d1.Addr = 1;
module d1.Parity = 'N';
module d1.Data = 8;
module d1.Stopbits = 1;
module d1.Baudrate = 9600;
module d1.pre = START;
module D1.Next = D2;
}
and step S304, analyzing the module relation description file to obtain the connection relation between the modules corresponding to the edge computing collector.
And loading and analyzing the module relation description file based on a relation analyzer in the cloud server, and analyzing the connection relation between the modules corresponding to the edge computing collector.
Step S305, loading elements of each module corresponding to the edge computing collector according to the text file, and linking each module according to the connection relation to obtain a module linked list.
And loading elements of each module in the text file to realize the loading of the modules, and further linking each module according to the sequence among the modules in the connection relation to obtain a corresponding module linked list. The order of the modules in the module linked list is consistent with the order of the modules in the connection relation. The module chain table includes elements corresponding to the modules, where the elements include functions (which may be represented by function names) corresponding to the modules, input parameters, and may also include output parameters.
The module linked list is composed of a plurality of columns of nodes, the nodes are dynamically generated during operation, and the sequence of the modules in the module linked list is represented by the sequence pointed by the pointers in the nodes.
And step S306, generating a programming code of the edge calculation collector according to a pre-constructed function body library and the module linked list.
The pre-built library of function bodies may be developed in a standard language, such as C, python, java, or other languages.
The function body of the function name can be searched from the function body library based on the function name of each module in the module linked list, and the programming code of the edge calculation collector is generated based on the function body corresponding to each module and the connection relation of each module in the module linked list. The programming code is code in a standard language.
Optionally, generating a programming code of the edge calculation collector according to a pre-constructed function library and the module linked list, includes:
determining a function body of a function corresponding to each module in the module linked list according to a pre-constructed function body library; and calling a code conversion module, and converting each module into codes according to the sequence corresponding to the module linked list based on the function body of the function corresponding to each module to obtain the programming codes of the edge calculation collector.
Specifically, based on the function name of each module in the module linked list, the function body of the function name can be searched from the function body library, the code conversion module is called based on the function body of the function corresponding to the module to obtain the programming code corresponding to each module, and the programming codes corresponding to each module are spliced according to the sequence of the connection relationship of the modules to obtain the programming code of the edge calculation collector.
Further, the programming method of the edge calculation collector further comprises the following steps:
and updating the function body library based on the newly added functions uploaded by the client.
When the graphical programming of the edge computing collector is carried out by a graphical programming platform on a client side by a user, a newly added function can be registered, and graphical programming is carried out based on a module corresponding to the newly added function. When detecting the new function, the client uploads the new function to the cloud server, and the cloud server updates the function body library based on the new function, so as to ensure real-time updating of the function body library.
Step S307, sending the programming code to the edge calculation collector.
Furthermore, an executable file can be generated based on the programming code and downloaded to the edge computing collector, so that the edge computing collector can realize data interaction based on a corresponding protocol based on the executable file.
In this embodiment, the graphical programming developed by the graphical programming platform is converted into a text file, such as an XML file, by the client, so that the cloud server can determine an element corresponding to the module based on the text file, and a basis is provided for converting the graphical programming into a standard code; the cloud server constructs a module relation description file by combining the uploaded configuration file of the industrial system site and the connection relation of the modules in the text file; and then when the codes are mapped, the connection relation between the modules is obtained by analyzing the module relation description file, based on the elements of the modules in the text file, the loading of the module elements is realized, the modules are linked according to the connection relation, a module chain table is obtained, a code conversion module is called, the modules in the module chain table are converted into standard codes according to a fixed sequence, the conversion of cloud codes is completed, the codes of the edge calculation collector are issued through a cloud, the programming of the edge calculation collector based on the cloud is realized, the region limitation is overcome in the face of the edge calculation collectors distributed in a plurality of regions, the programming method through the cloud is realized, the programming efficiency is high, and the convenience is high.
Fig. 6 is a schematic diagram of a cloud-based programming process according to an embodiment of the present application, and as shown in fig. 6, after the graphical programming of the edge computing collector is completed through a graphical programming platform of a client, a conversion tool based on the client performs element extraction on a function block, a graphical control, and a custom function block (corresponding to a custom protocol) obtained by the graphical programming, generates a text file in an XML format based on the extracted elements, records the text file as an XML file, and uploads the XML file to a cloud server. Based on the module relation description file and the XML file, the relation analyzer of the cloud server loads each module through the XML file according to the sequence of the connection relation between the modules indicated in the module relation description file, and further generates a programming code (or called standard code) of the edge computing collector through the code conversion module based on each loaded module and the function body library, so as to realize code conversion of graphical programming. And then the generated programming codes are converted into executable files through the cloud server, and the executable files are downloaded to one or more edge computing collectors so as to realize data interaction through a specified protocol by executing the executable files.
Fig. 7 is a schematic structural diagram of a programming device of an edge computation collector according to an embodiment of the present application, where the programming device of the edge computation collector is applied to a cloud server, as shown in fig. 7, the programming device of the edge computation collector according to the embodiment includes: a text file acquisition module 610, a relationship description file acquisition module 620 and a code generation module 630.
The text file obtaining module 610 is configured to obtain a text file corresponding to an edge calculation collector, where the text file includes extracted elements of a module corresponding to the edge calculation collector, the module corresponding to the edge calculation collector is a module developed based on a graphical programming platform, and the elements include input parameters, output parameters, and function names of the modules; the relationship description file obtaining module 620 is configured to obtain a module relationship description file corresponding to the edge calculation collector, where the module relationship description file is used to describe a connection relationship between modules corresponding to the edge calculation collector; the code generating module 630 is configured to generate a programming code of the edge calculation collector according to the text file, the module relationship description file, and a pre-constructed function library, and send the programming code to the edge calculation collector.
Optionally, the apparatus further comprises:
the text file generation module is used for acquiring a developed functional block, a graphical control and a custom protocol which are based on a graphical programming platform and correspond to the edge computing collector through a client; extracting a plurality of elements of the function block, the graphical control and the custom protocol, wherein the elements comprise input parameters, output parameters and function names; and generating a text file corresponding to the edge calculation collector based on the extracted functional blocks, the graphical controls and the plurality of elements of the custom protocol.
Optionally, the relationship description file obtaining module 620 is specifically configured to:
acquiring a configuration file corresponding to the edge calculation collector uploaded by a user side, wherein the configuration file comprises equipment connected with an interface of the edge calculation collector; and generating a module relation description file corresponding to the edge calculation collector according to the configuration file.
Optionally, the code generating module 630 includes:
the analysis unit is used for analyzing the module relation description file to obtain the connection relation between the modules corresponding to the edge calculation collector; a linked list generating unit, configured to load elements of each module corresponding to the edge calculation collector according to the text file, and link each module according to the connection relationship to obtain a module linked list; and the code generation unit is used for generating the programming code of the edge calculation collector according to a pre-constructed function body library and the module linked list.
Optionally, the code generating unit is specifically configured to:
determining a function body of a function corresponding to each module in the module linked list according to a pre-constructed function body library; and calling a code conversion module, and converting each module into codes according to the sequence corresponding to the module linked list based on the function body of the function corresponding to each module to obtain the programming codes of the edge calculation collector.
Optionally, the apparatus further comprises:
and the function body updating module is used for updating the function body library based on the newly added functions uploaded by the client.
The programming device of the edge calculation collector provided by the embodiment of the application can execute the programming method of the edge calculation collector provided by any embodiment of the application, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 8 is a schematic structural diagram of a cloud server according to an embodiment of the present application, and as shown in fig. 8, the cloud server includes: a memory 710 and at least one processor 720.
Wherein memory 710 stores computer-executable instructions; the at least one processor 720 executes the computer-executable instructions stored by the memory, so that the at least one processor executes to implement the method for programming the edge computation gatherer provided in any embodiment of the present application.
Wherein the memory 710 and the processor 720 are connected by a bus 730.
The relevant description may be understood by referring to relevant descriptions and effects corresponding to the steps of the programming method of the edge calculation collector provided in any embodiment of the present application, and will not be described in detail herein.
An embodiment of the present application provides a computer-readable storage medium, in which a computer executing instruction is stored, and when a processor executes the computer executing instruction, the programming method of the edge calculation collector provided in any embodiment of the present application is implemented.
The computer readable storage medium may be, among others, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the programming method of the edge calculation collector provided in any embodiment of the present application.
The processor may be an integrated circuit chip having signal processing capabilities. The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1.A programming method of an edge computing collector is characterized in that the method is applied to a cloud server, and the method comprises the following steps:
acquiring a text file corresponding to an edge calculation collector, wherein the text file comprises extracted elements of a module corresponding to the edge calculation collector, the module corresponding to the edge calculation collector is a module developed based on a graphical programming platform, and the elements comprise input parameters, output parameters and function names of the module;
acquiring a module relation description file corresponding to the edge calculation collector, wherein the module relation description file is used for describing the connection relation between modules corresponding to the edge calculation collector;
and generating a programming code of the edge calculation collector according to the text file, the module relation description file and a pre-constructed function body library, and sending the programming code to the edge calculation collector.
2. The method of claim 1, wherein the generating of the text file comprises the steps of:
acquiring a developed function block, a graphical control and a custom protocol which are based on a graphical programming platform and correspond to the edge computing collector through a client;
extracting a plurality of elements of the function block, the graphical control and the custom protocol, wherein the elements comprise input parameters, output parameters and function names;
and generating a text file corresponding to the edge calculation collector based on the extracted functional blocks, the graphical control and the plurality of elements of the user-defined protocol.
3. The method of claim 1, wherein obtaining the module relationship description file corresponding to the edge calculation collector comprises:
acquiring a configuration file corresponding to the edge calculation collector uploaded by a user side, wherein the configuration file comprises equipment connected with an interface of the edge calculation collector;
and generating a module relation description file corresponding to the edge calculation collector according to the configuration file.
4. The method of claim 1, wherein generating the programming code of the edge computation gatherer according to the text file, the module relationship description file, and a pre-constructed function body library comprises:
analyzing the module relation description file to obtain the connection relation between the modules corresponding to the edge calculation collector;
loading elements of each module corresponding to the edge calculation collector according to the text file, and linking each module according to the connection relation to obtain a module linked list;
and generating a programming code of the edge calculation collector according to a pre-constructed function body library and the module linked list.
5. The method of claim 4, wherein generating the programming code of the edge computation gatherer according to a pre-constructed function library and the module linked list comprises:
determining a function body of a function corresponding to each module in the module linked list according to a pre-constructed function body library;
and calling a code conversion module, converting each module into codes according to the sequence corresponding to the module linked list based on the function body of the function corresponding to each module, and obtaining the programming codes of the edge calculation collector.
6. The method according to any one of claims 1 to 5, wherein the format of the text file is an extensible markup language format.
7. The programming device of the edge computing collector is applied to a cloud server, and comprises the following components:
the system comprises a text file acquisition module, a text file processing module and a text file processing module, wherein the text file acquisition module is used for acquiring a text file corresponding to an edge calculation collector, the text file comprises extracted elements of a module corresponding to the edge calculation collector, the module corresponding to the edge calculation collector is a module based on development of a graphical programming platform, and the elements comprise input parameters, output parameters and function names of the module;
the system comprises a relation description file acquisition module, a module relation description file acquisition module and a module relation description file acquisition module, wherein the relation description file acquisition module is used for acquiring a module relation description file corresponding to the edge calculation collector, and the module relation description file is used for describing a connection relation between modules corresponding to the edge calculation collector;
and the code generation module is used for generating a programming code of the edge calculation collector according to the text file, the module relation description file and a pre-constructed function body library and sending the programming code to the edge calculation collector.
8. A cloud server, comprising: a memory and at least one processor;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of any one of claims 1-6.
9. A computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, perform the method of any one of claims 1-6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of any one of claims 1-6.
CN202310182132.XA 2023-03-01 2023-03-01 Programming method and device of edge computing collector, server and medium Active CN115857910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310182132.XA CN115857910B (en) 2023-03-01 2023-03-01 Programming method and device of edge computing collector, server and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310182132.XA CN115857910B (en) 2023-03-01 2023-03-01 Programming method and device of edge computing collector, server and medium

Publications (2)

Publication Number Publication Date
CN115857910A true CN115857910A (en) 2023-03-28
CN115857910B CN115857910B (en) 2023-06-06

Family

ID=85659431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310182132.XA Active CN115857910B (en) 2023-03-01 2023-03-01 Programming method and device of edge computing collector, server and medium

Country Status (1)

Country Link
CN (1) CN115857910B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116679610A (en) * 2023-07-17 2023-09-01 上海能誉科技股份有限公司 Programming method of controller, visual development tool and controller

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108681444A (en) * 2018-04-12 2018-10-19 华中科技大学 A kind of Soft- PLC configuration development approach based on XML technology
CN110376959A (en) * 2019-07-25 2019-10-25 大连理工大学 A kind of Soft- PLC configuration software generation system based on FPGA platform
US10884732B1 (en) * 2019-08-29 2021-01-05 International Business Machines Corporation Automation utilizing infrastructure as code modules
CN113050933A (en) * 2021-06-02 2021-06-29 上海钛米机器人股份有限公司 Brain graph data processing method, device, equipment and storage medium
CN114115900A (en) * 2021-11-25 2022-03-01 北京力控元通科技有限公司 Script compiling method and device and electronic equipment
CN114675830A (en) * 2022-03-08 2022-06-28 南京南瑞继保电气有限公司 Method and device for deploying edge AI (Artificial Intelligence) and constructing visual AI programming platform and electronic equipment
CN115562634A (en) * 2022-09-28 2023-01-03 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Radar-service-flow-oriented visual development platform

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108681444A (en) * 2018-04-12 2018-10-19 华中科技大学 A kind of Soft- PLC configuration development approach based on XML technology
CN110376959A (en) * 2019-07-25 2019-10-25 大连理工大学 A kind of Soft- PLC configuration software generation system based on FPGA platform
US10884732B1 (en) * 2019-08-29 2021-01-05 International Business Machines Corporation Automation utilizing infrastructure as code modules
CN113050933A (en) * 2021-06-02 2021-06-29 上海钛米机器人股份有限公司 Brain graph data processing method, device, equipment and storage medium
CN114115900A (en) * 2021-11-25 2022-03-01 北京力控元通科技有限公司 Script compiling method and device and electronic equipment
CN114675830A (en) * 2022-03-08 2022-06-28 南京南瑞继保电气有限公司 Method and device for deploying edge AI (Artificial Intelligence) and constructing visual AI programming platform and electronic equipment
CN115562634A (en) * 2022-09-28 2023-01-03 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Radar-service-flow-oriented visual development platform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BIROL ÇAPA: "Rapid PLC-to-Cloud Prototype for Smart Industrial Automation", 《PROCEEDINGS OF THE 2ND INTERNATIONAL SYMPOSIUM ON COMPUTER SCIENCE AND INTELLIGENT CONTROL》 *
邹光华;刘毅;: "基于XML的PLC数据描述", 计算机工程 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116679610A (en) * 2023-07-17 2023-09-01 上海能誉科技股份有限公司 Programming method of controller, visual development tool and controller

Also Published As

Publication number Publication date
CN115857910B (en) 2023-06-06

Similar Documents

Publication Publication Date Title
US20060265469A1 (en) XML based scripting framework, and methods of providing automated interactions with remote systems
CN111209005A (en) Method and apparatus for compiling program file, and computer-readable storage medium
CN111241182A (en) Data processing method and apparatus, storage medium, and electronic apparatus
CN113467771B (en) Model-based industrial edge cloud collaboration system and method
CN112130993A (en) Power edge Internet of things agent edge calculation method and system based on graphical modeling
US11740997B2 (en) Method and apparatus for debugging a device
CN115857910A (en) Programming method, device, server and medium of edge computing collector
CN111309332A (en) File content on-demand loading method and device, electronic equipment and storage medium
CN112882817A (en) Workflow processing method based on super computer
CN113792008A (en) Method and device for acquiring network topology structure, electronic equipment and storage medium
CN113806429A (en) Canvas type log analysis method based on large data stream processing framework
CN112464620A (en) Implementation method and implementation system of financial rule engine
CN105550179A (en) Webpage collection method and browser plug-in
CN116774645A (en) Method, device, medium and equipment for associating equipment object model with entity equipment
CN113127413B (en) Operator data processing method, device, server and storage medium
CN104166545A (en) Webpage resource sniffing method and device
CN114095535A (en) Method for automatically mapping time sequence variable of physical equipment into digital model
CN117170727A (en) Inspection method and device
CN108984221B (en) Method and device for acquiring multi-platform user behavior logs
CN115237399A (en) Method for collecting data, storage medium, processor and engineering vehicle
CN115756448A (en) Method, device, equipment and medium for acquiring vehicle cloud data acquisition system architecture
CN108196853A (en) For disposing the method for Android system SDK, storage medium, equipment and system
CN114281341A (en) Compiling method and device of data structure definition file, computer equipment and medium
CN113783960B (en) Intelligent substation equipment data processing method and related equipment
CN113220287B (en) Computer automatic programming method, system, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant