A multi-protocol self-adaptive system and method for power intelligent terminal
By designing a multi-protocol adaptation system in a power smart terminal, using the protocol stack collection library and communication service thread to dynamically process multiple protocols, the problems of protocol solidification and multi-protocol support in the existing technology are solved, and efficient and flexible communication is achieved The solution improves the applicability and maintenance convenience of the terminal.
Patent Information
- Application Number
- CN202411356863.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In the design of existing power smart terminal products, protocol solidification leads to high maintenance costs, poor applicability, and it is difficult to support multiple communication protocols at the same time, which cannot meet the needs of power IoT and intelligent development.
Design a multi-protocol adaptation system, including communication channels, protocol stack collection library and communication service threads, store multiple protocol stack instance objects through the protocol stack collection library, and the communication service thread dynamically calls the target protocol stack to process communication data, and realizes a Communication channels support multi-protocol communication.
It reduces the maintenance workload and maintenance cost of power smart terminals, improves communication efficiency, provides flexibility and unified multi-protocol usage methods, which are easy to transplant, use, expand and maintain.
Smart Images

Figure CN118900287B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electric power intelligent terminals, and in particular relates to a multi-protocol self-adaptation system and method for electric power intelligent terminals. Background Art
[0002] With the implementation of "informatization, automation, and interactivity" of the strong smart grid, the communication technology of power smart terminals has been continuously developed, and the communication protocols have become diverse. At present, the typical protocols for communication on the master station side are IEC101, IEC104, DL / T698, and Q / GDW1376.1; the typical protocols for the perception layer device side are DL / T645, Modbus, etc. Most of the existing terminal products use a proprietary protocol for one product, and few products can achieve a terminal product containing a collection of multiple protocol libraries. For example: DTU, FTU and other distribution terminals use IEC101 / 104 protocol; concentrators and collectors use Q / GDW1376.1 or DL / T698 protocol; smart meters use DL / T645 protocol; temperature and humidity sensors use Modbus protocol. Even the more advanced integrated terminal products, due to their design and R&D manufacturers, mostly use dedicated APPs with built-in dedicated protocols and are deployed in dedicated containers to achieve them, and do not have the characteristics of commonality and universality. Current terminal products not only have problems such as weak functional reusability, long product development cycle, and weak ability to respond quickly to customized needs during the development process, but also have the following objective shortcomings:
[0003] 1) For the master station communication, a product uses a proprietary protocol. The communication protocol stack used is designed and fixed in the terminal during the product development stage. When there are new requirements, such as changes in the master station or new master station connection requirements, the terminal firmware needs to be redesigned and upgraded. This makes the maintenance workload large and the maintenance cost high.
[0004] 2) There are differences in communication protocols between different regions. For example, the IEC104 protocol, which is used for distribution automation, has different protocols between different provinces. Terminal R&D has to design different communication protocol stacks according to the requirements of different provinces, which leads to the customization of the same type of power terminals. The poor applicability of the terminals leads to higher design, production and maintenance costs.
[0005] 3) In converged terminal products, the terminal uses a dedicated APP to process a dedicated protocol. The APP is deployed in a dedicated container, and a dedicated APP is deployed for each communication channel to process the communication data of this channel. This design provides great convenience and flexibility to cope with changes in the master station and new connection requirements; when the demand changes, only a new APP needs to be deployed; it effectively reduces the maintenance workload and maintenance costs. For the problem of regional protocol differences, it is only necessary to deploy different APPs according to different regions. Although this technology has certain advantages, it does not solve the problem of supporting multiple protocol communications on the same communication channel at the same time; with the development of power Internet of Things and intelligence, business integration, data integration, and master station integration will become inevitable; therefore, the problem of the same communication channel supporting multiple protocol communications at the same time will become a problem that must be dealt with. Obviously, it is difficult to solve this problem using a dedicated APP solution.
[0006] 4) On the sensing device side, since the terminal works in host mode, the terminal can actively select the protocol stack to process the response data according to the protocol type of the instrument or sensor. However, with the development of power IoT services, the requirements for the interactivity and real-time status of sensing devices are constantly increasing. This requires the sensing devices to send information to the acquisition terminal device in a timely manner when the status changes or the working abnormalities occur. This way of actively sending information makes the original protocol processing method seem incapable. Summary of the invention
[0007] In order to overcome the problems existing in the above-mentioned related technologies, the present application provides a multi-protocol self-adaptation system and method for a power intelligent terminal.
[0008] According to a first aspect of an embodiment of the present application, there is provided a multi-protocol self-adaptive system for an electric power intelligent terminal, comprising: a communication channel, a protocol stack collection library, and a communication service thread;
[0009] The communication channel is used to send the communication data to the communication service thread when receiving the communication data sent by the master station side or the sensing device side;
[0010] The protocol stack collection library is used to store a plurality of preset protocol stack instance objects;
[0011] The communication service thread is used to determine the target protocol stack instance object by using the communication data, and call the target protocol stack instance object from the protocol stack collection library to process the communication data.
[0012] Preferably, each protocol stack instance object includes: a name of the protocol stack instance object and an operation function of the protocol stack instance object.
[0013] Preferably, the communication service thread is specifically used for:
[0014] Calling the mounted protocol stack instance objects in sequence from the protocol stack mounting linked list to process the communication data;
[0015] If there is a mounted protocol stack instance object that is called and feeds back a return value after processing the communication data, the mounted protocol stack instance object that feeds back the return value is the target protocol stack instance object, and the target protocol stack instance object is found from the protocol stack collection library through the application layer interface;
[0016] If there is no called mounted protocol stack instance object to feed back a return value after processing the communication data, processing of the communication data fails, the communication data is discarded, and information on the failure to process the communication data is fed back to the main station side or the perception device side.
[0017] Preferably, the protocol stack mount linked list is used to dynamically mount the protocol stack instance objects in the protocol stack collection library, and to unload the protocol stack instance objects in the protocol stack collection library.
[0018] Preferably, the application layer interface is used to provide a unified application layer interface function for each protocol stack instance object in the protocol stack collection library.
[0019] Preferably, the communication channel is specifically used for:
[0020] Carry out interaction between the power intelligent terminal and the master station side / sensing device side.
[0021] Preferably, the communication channel includes: a remote communication channel and / or a local communication channel;
[0022] The remote communication channel includes: TCP Socket or UDP Socket;
[0023] The local communication channel includes: an RS485 communication interface or an RS232 communication interface.
[0024] Preferably, the multiple protocol stack instance objects include at least the following six: IEC101, IEC104, DL / T698, Q / GDW1376.1, DL / T645 and Modbus.
[0025] According to a second aspect of an embodiment of the present application, a multi-protocol self-adaptation method for a power intelligent terminal is provided, comprising:
[0026] Using a protocol stack collection library to store multiple preset protocol stack instance objects;
[0027] When the communication channel receives the communication data sent by the master station side or the sensing device side, the communication data is sent to the communication service thread;
[0028] The communication service thread uses the communication data to determine a target protocol stack instance object, and calls the target protocol stack instance object from the protocol stack collection library to process the communication data.
[0029] Preferably, each protocol stack instance object includes: a name of the protocol stack instance object and an operation function of the protocol stack instance object.
[0030] Preferably, the communication service thread uses the communication data to determine a target protocol stack instance object, and calls the target protocol stack instance object from the protocol stack collection library to process the communication data, including:
[0031] Calling the mounted protocol stack instance objects in sequence from the protocol stack mounting linked list to process the communication data;
[0032] If there is a mounted protocol stack instance object that is called and feeds back a return value after processing the communication data, the mounted protocol stack instance object that feeds back the return value is the target protocol stack instance object, and the target protocol stack instance object is found from the protocol stack collection library through the application layer interface;
[0033] If there is no called mounted protocol stack instance object to feed back a return value after processing the communication data, processing of the communication data fails, the communication data is discarded, and information on the failure to process the communication data is fed back to the main station side or the perception device side.
[0034] Preferably, the method further comprises:
[0035] The protocol stack instance objects in the protocol stack collection library are dynamically mounted by using the protocol stack mounting linked list, and the protocol stack instance objects in the protocol stack collection library are unmounted.
[0036] Preferably, the method further comprises:
[0037] The application layer interface is used to provide a unified application layer interface function for each protocol stack instance object in the protocol stack collection library.
[0038] Preferably, the method further comprises:
[0039] The communication channel is used for interaction between the power intelligent terminal and the master station side / sensing device side.
[0040] Preferably, the communication channel includes: a remote communication channel and / or a local communication channel;
[0041] The remote communication channel includes: TCP Socket or UDP Socket;
[0042] The local communication channel includes: an RS485 communication interface or an RS232 communication interface.
[0043] Preferably, the multiple protocol stack instance objects include at least the following six: IEC101, IEC104, DL / T698, Q / GDW1376.1, DL / T645 and Modbus.
[0044] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: at least one processor and a memory; the memory and the processor are connected via a bus;
[0045] The memory is used to store one or more programs;
[0046] When the one or more programs are executed by the at least one processor, the multi-protocol self-adaptation method for the power intelligent terminal is implemented.
[0047] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, on which an execution program is stored. When the execution program is executed, the method for multi-protocol self-adaptation for a power smart terminal is implemented.
[0048] The technical solution provided by the present invention has the following beneficial effects:
[0049] The present invention provides a multi-protocol self-adaptive system and method for electric power intelligent terminals. When communication data sent by a master station side or a sensing device side is received through a communication channel, the communication data is sent to a communication service thread, and a plurality of preset protocol stack instance objects are stored through a protocol stack collection library, thereby realizing that one communication channel supports multi-protocol communication.
[0050] The communication service thread utilizes the communication data to determine the target protocol stack instance object, and calls the target protocol stack instance object from the protocol stack collection library to process the communication data, thereby improving the communication efficiency between the master station side or the sensing device side and the power intelligent terminal, thereby providing a simple, standard and unified multi-protocol usage method;
[0051] By using the protocol stack mount list to dynamically mount and unmount protocol stack instance objects, great flexibility is provided, making it easy to cope with various multi-protocol processing requirements without changing the terminal firmware, thereby reducing the maintenance workload and maintenance cost of the power intelligent terminal;
[0052] By utilizing a multi-protocol stack collection library to uniformly manage protocol stack instance objects, using a unified interface for the application layer, and supporting multi-protocol communication through one communication channel, the multi-protocol self-adaptive system for the power intelligent terminal provided by the present invention is easy to transplant, use, expand and maintain. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 It is a structural block diagram of a multi-protocol self-adaptive system for electric power intelligent terminals provided by an embodiment of the present invention;
[0055] Figure 2 It is a communication thread workflow diagram provided by an embodiment of the present invention;
[0056] Figure 3 is a flow chart of a multi-protocol self-adaptation method for a power intelligent terminal provided by an embodiment of the present invention;
[0057] Figure 4 It is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the following embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] Embodiment 1
[0060] The present invention provides a multi-protocol self-adaptive system for power intelligent terminals, such as Figure 1 As shown, it includes: communication channel, protocol stack collection library and communication service thread;
[0061] The communication channel is used to send the communication data to the communication service thread when receiving the communication data sent by the master station side or the sensing device side;
[0062] A protocol stack collection library, used to store multiple preset protocol stack instance objects;
[0063] The communication service thread is used to use the communication data to determine the target protocol stack instance object and call the target protocol stack instance object from the protocol stack collection library to process the communication data.
[0064] It should be noted that the multi-protocol object is a class object used for multi-protocol processing. It has the following important attributes: name, device object, protocol stack mount list, and communication service thread. The name is the class instance name generated by the user when creating a multi-protocol object instance. It is used to indicate the main function and purpose of the object. It is named using the "MProt+device instance name" rule, indicating that this is a multi-protocol object working on the specified communication channel. For example, MProtRS485-2 indicates a multi-protocol instance working on RS485 port No. 2. The device object is a device object instance created for the communication channel. The protocol stack mount list is a linked list class object instance used to mount the protocol stack instance object. It provides external linked list operation methods such as add, delete, take the first, and take the next. The communication service thread is a thread class object instance created to complete multi-protocol processing.
[0065] Furthermore, each protocol stack instance object includes: a name of the protocol stack instance object and an operation function of the protocol stack instance object.
[0066] Specifically, the multiple protocol stack instance objects include at least the following six types: IEC101, IEC104, DL / T698, Q / GDW1376.1, DL / T645 and Modbus.
[0067] It should be noted that the protocol stack collection library contains multiple commonly used power protocol stack instance objects, and a protocol stack is a module. Each module object has a unique name and a set of operation functions. The name is used to obtain the protocol stack instance object from the protocol stack collection library through a search method; the operation functions include: protocol stack instance creation, protocol stack instance destruction, parameter configuration, state machine processing (i.e., the working state of the protocol stack) and received data processing, etc.; protocol stack instance creation and protocol stack instance destruction are for system calls, and are used for dynamic mounting and unloading of the protocol stack; parameter configuration is used to set the protocol stack working parameters, and state machine processing and received data processing are for protocol service thread calls, which are used for communication protocol processing. In some embodiments, the protocol stack instance object is defined as follows.
[0068] Protocol stack instance object
[0069] {
[0070] name,
[0071] Operation Function
[0072] {
[0073] Instance creation,
[0074] Instance destruction,
[0075] Parameter configuration,
[0076] State machine processing,
[0077] Receive data processing
[0078] }
[0079] }
[0080] Furthermore, the communication service thread is specifically used for:
[0081] Call the mounted protocol stack instance objects in sequence from the protocol stack mounting list to process communication data;
[0082] If there is a mounted protocol stack instance object that is called and feeds back a return value after processing the communication data, the mounted protocol stack instance object that feeds back the return value is the target protocol stack instance object, and the target protocol stack instance object is found from the protocol stack collection library through the application layer interface;
[0083] If there is no called mounted protocol stack instance object to feed back a return value after processing the communication data, the communication data processing fails, the communication data is discarded, and the information on the failure to process the communication data is fed back to the master station side or the perception device side.
[0084] It should be noted that the communication service thread is an attribute of the multi-protocol object. Its two main tasks are: first, reading the data from the communication device and then processing the data with the mounted protocol stack in turn; second, running the state machine of the mounted protocol stack in turn.
[0085] Furthermore, the protocol stack mount linked list is used to dynamically mount the protocol stack instance objects in the protocol stack collection library, and to uninstall the protocol stack instance objects in the protocol stack collection library.
[0086] The protocol stack mount list is an attribute of the multi-protocol object, which is used to dynamically mount and unmount the protocol stack instance object. The communication service thread sequentially accesses the mounted protocol stack instance object, and then calls the received data processing function of the protocol stack instance object to process the communication data, thereby realizing multi-protocol self-adaptive processing. Users can also dynamically mount or unmount the protocol stack instance object as needed.
[0087] It is understandable that a window may use multiple protocols. The communication service thread calls each protocol through the protocol stack mount list. When communication data is received, it is not sure which protocol the communication data uses. At this time, since the window has loaded the protocol stack mount list, the protocols in the protocol stack mount list are called one by one. The protocol that can process the communication data is the target protocol.
[0088] Furthermore, the application layer interface is used to provide a unified application layer interface function for each protocol stack instance object in the protocol stack collection library.
[0089] It should be noted that the application layer interface consists of a series of functions, including time reading and writing, file reading and writing, database reading and writing, device operations, etc. The protocol stack module completes the reading and writing of data and the control of the device by calling the application layer interface function during the protocol processing.
[0090] Furthermore, the communication channel is specifically used for:
[0091] Carry out interaction between the power intelligent terminal and the master station side / sensing device side.
[0092] Specifically, the communication channel includes: a remote communication channel and / or a local communication channel;
[0093] Remote communication channels include: TCP Socket or UDP Socket;
[0094] The local communication channel includes: RS485 communication interface or RS232 communication interface.
[0095] It should be noted that when the communication channel is used, it is encapsulated into a device object with unified specifications. The communication service thread can open, close, read, write, etc. the communication channel through the device operation function. The definition of the device object is as follows.
[0096] Device Object
[0097] {
[0098] name,
[0099] Operation Function
[0100] {
[0101] Open,
[0102] closure,
[0103] Read data,
[0104] Write data,
[0105] Other Controls
[0106] }
[0107] }
[0108] For example, the meter device accesses the data of other devices or receives access from other devices through the communication channel. The communication service thread sends and receives data through the communication channel for monitoring or timed access. After receiving the data, it parses the protocol and reads the data of other devices. It needs to call the protocol stack to obtain the data and then send it out through the channel.
[0109] The present invention forms a collection library of multiple protocol stacks by encapsulating the commonly used power protocol stack into a protocol stack instance object with unified specifications; the entire protocol stack collection library provides a set of unified application layer interface functions for the application layer, which is convenient for transplantation and use; for the communication channel, the communication channel is encapsulated into a device object with unified specifications, and the communication channel is accessed through a set of unified device operation functions; the communication service thread opens, closes, reads data, sends data, etc. of the communication channel by calling the device operation function; the communication service thread accesses the protocol stack mount list and uses the protocol stack instance object to realize multi-protocol self-adaptive processing. The above can be simply summarized as a service, a linked list, a channel, an interface and multiple modules, a service is a communication service thread, a linked list is a protocol stack mount linked list, a channel is a communication channel, an interface is an application layer interface, and multiple modules are a protocol stack collection library that stores multiple preset protocol stack instance objects.
[0110] The present invention adopts a multi-protocol stack collection library to uniformly manage the protocol stack, uses a unified interface for the application layer, and uses a unified device object model for the communication channel, which is convenient for transplantation, use, expansion, and maintenance;
[0111] The present invention adopts a protocol stack mount linked list, which can dynamically mount and unload protocol stack instances, providing great flexibility for use, so that various multi-protocol processing requirements can be easily met without changing the terminal firmware;
[0112] Each protocol stack instance object in the present invention has independent working parameters. Users can control its working mode and behavior by configuring the working parameters, and can quickly adapt to various usage requirements;
[0113] The present invention adopts a multi-protocol object class to aggregate and encapsulate various functional modules, and stipulates a simple, standard and unified use method, which is convenient for research and development personnel to learn and use.
[0114] To further illustrate the above-mentioned multi-protocol self-adaptive system for power intelligent terminals, the present invention also provides a specific example, as shown below:
[0115] When implementing the multi-protocol processing function on a communication channel, first, create a device object instance for the communication channel, and then use the device object instance as a parameter to create a multi-protocol object instance. In the process of creating a multi-protocol object instance, the name of the multi-protocol object instance is automatically generated according to the device object instance name, the device object is automatically assigned, the protocol stack mount list is automatically initialized, and the communication service thread is automatically created and started. After the multi-protocol object instance is successfully created, the protocol stack module is searched from the protocol stack collection library according to the requirements, the protocol stack instance is created, the working parameters are configured for the protocol stack instance, and the protocol stack instance is mounted to the protocol stack mount list. At this point, the use of the multi-protocol processing function on the communication channel is completed. It can be simply summarized as: first create a communication device, then create a multi-protocol instance.
[0116] like Figure 2 As shown, after the communication service thread is started, it turns on the communication device and reads the communication data from the communication device. After reading the communication data, it sequentially obtains the mounted protocol stack instances from the protocol stack mounting list to process the communication data. At the same time, it also sequentially runs the state machine processing functions of the mounted protocol stack instances. If there is a return value from processing the communication data, the processing is successful. Otherwise, the processing fails, and the next mounted protocol stack instance is taken from the protocol stack mounting list to process the communication data until the communication data is successfully processed or there is no mounted protocol stack instance that can process the communication data.
[0117] The present invention provides a multi-protocol self-adaptive system for electric power intelligent terminals. The protocol stack adopts an object-oriented modular design, which is uniformly managed through a protocol stack collection library, and the application interface is unified. This design has many advantages: first, it is easy to use. Research and development personnel do not need to care about how the protocol stack works internally, but only need to understand how to use its application interface; second, it is easy to maintain and expand. The application interfaces of all protocol stacks are the same and unchanged. Modifications to the protocol stack code will not affect the application code. When a new protocol stack is required, it is only necessary to design and add the protocol stack according to the protocol stack application interface specification. Third, it is easy to transplant. When a protocol stack collection library needs to be added to a new product, it is only necessary to adapt the application interface of the collection library to the new product.
[0118] The multi-protocol self-adaptive system for electric power intelligent terminals provided by the present invention adopts a protocol stack dynamic mounting technology such as a protocol stack mounting linked list, so that any communication channel can dynamically mount any protocol stack in the protocol stack collection library, which provides great flexibility for use and can easily cope with various needs. For example, in the early stage of terminal installation, the RS485 interface only has access to the electric energy meter, and only the DLT645 protocol stack needs to be mounted to meet the needs. In the middle stage of use, various sensors need to be connected, and the sensors use the MODBUS protocol stack, so only the MODBUS protocol stack needs to be mounted to meet the use needs, avoiding the work of modifying the code and upgrading the firmware.
[0119] The present invention provides a multi-protocol self-adaptation system for electric power intelligent terminals, which aggregates and encapsulates various functional modules using multi-protocol object classes and specifies simple, standard and unified usage methods for them. R&D and design personnel can easily master the usage methods, and this multi-protocol self-adaptation technology can be quickly applied to various products.
[0120] The multi-protocol self-adaptive system for electric power intelligent terminals provided by the present invention utilizes a set of universal and common electric power typical protocol libraries, namely a protocol stack collection library, which is of great significance. The present invention can solve the problems of weak functional reusability, long product development cycle, and weak ability to respond quickly to customized needs in the development process of terminal products, and can accelerate the adaptation to the digital transformation and development of power grids, and enhance the market competitiveness and market supply capacity of terminal products.
[0121] Embodiment 2
[0122] The present invention also provides a multi-protocol self-adaptation method for a power intelligent terminal, such as Figure 3 As shown, the following steps are included:
[0123] Step 101: using a protocol stack collection library to store a plurality of preset protocol stack instance objects;
[0124] Step 102: When the communication channel receives the communication data sent by the master station side or the sensing device side, the communication data is sent to the communication service thread;
[0125] Step 103: The communication service thread uses the communication data to determine the target protocol stack instance object, and calls the target protocol stack instance object from the protocol stack collection library to process the communication data.
[0126] Furthermore, each protocol stack instance object includes: a name of the protocol stack instance object and an operation function of the protocol stack instance object.
[0127] Further, step 103 includes:
[0128] Step 1031: sequentially calling the mounted protocol stack instance objects from the protocol stack mounting list to process communication data;
[0129] Step 1032: If there is a mounted protocol stack instance object that is called and feeds back a return value after processing the communication data, the mounted protocol stack instance object that feeds back the return value is the target protocol stack instance object, and the target protocol stack instance object is found from the protocol stack collection library through the application layer interface;
[0130] If there is no called mounted protocol stack instance object to feed back a return value after processing the communication data, the communication data processing fails, the communication data is discarded, and the information on the failure to process the communication data is fed back to the master station side or the perception device side.
[0131] Furthermore, the method also includes:
[0132] The protocol stack mount linked list is used to dynamically mount the protocol stack instance object in the protocol stack collection library, and to uninstall the protocol stack instance object in the protocol stack collection library.
[0133] Furthermore, the method also includes:
[0134] The application layer interface is used to provide a unified application layer interface function for each protocol stack instance object in the protocol stack collection library.
[0135] Furthermore, the method also includes:
[0136] The communication channel is used for interaction between the power intelligent terminal and the master station side / sensing device side.
[0137] Further, the communication channel includes: a remote communication channel and / or a local communication channel;
[0138] Remote communication channels include: TCP Socket or UDP Socket;
[0139] The local communication channel includes: RS485 communication interface or RS232 communication interface.
[0140] Furthermore, the multiple protocol stack instance objects include at least the following six: IEC101, IEC104, DL / T698, Q / GDW1376.1, DL / T645 and Modbus.
[0141] It can be understood that the method embodiment provided above corresponds to the system embodiment described above, and the corresponding specific contents can be referenced to each other and will not be repeated here.
[0142] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0143] Embodiment 3
[0144] like Figure 4 As shown, the present invention also provides an electronic device, which may be a computer device, a single-chip device, an intelligent mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, the processor, and the transceiver component are connected via a bus; the memory may be used to store an execution program, and an exemplary execution program may include instructions; the processor is used to execute the instructions stored in the memory. The memory may also be used to store data, which may be called and / or modified when the instructions are executed.
[0145] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in a storage medium to implement the corresponding method flow or corresponding functions, so as to implement the steps of a multi-protocol self-adaptation method for a power smart terminal in the above-mentioned embodiment.
[0146] Embodiment 4
[0147] Based on the same inventive concept, the present invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It can be understood that the storage medium here can include both built-in storage media in electronic devices and extended storage media supported by electronic devices. The storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more execution programs (including program codes). It should be noted that the storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor loads and executes one or more instructions stored in the storage medium, which can implement the steps of a multi-protocol self-adaptation method for a power smart terminal in the above embodiment.
[0148] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0149] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0150] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A multi-protocol self-adaptive system for power intelligent terminals, characterized in that: include: Communication channels, protocol stack collection libraries and communication service threads; The communication channel is used to send the communication data to the communication service thread when receiving the communication data sent by the master station side or the sensing device side; The protocol stack collection library is used to store a plurality of preset protocol stack instance objects; The communication service thread is used to determine the target protocol stack instance object by using the communication data, and call the target protocol stack instance object from the protocol stack collection library to process the communication data; The communication service thread is specifically used for: Calling the mounted protocol stack instance objects in sequence from the protocol stack mounting linked list to process the communication data; If there is a mounted protocol stack instance object that is called and feeds back a return value after processing the communication data, the mounted protocol stack instance object that feeds back the return value is the target protocol stack instance object, and the target protocol stack instance object is found from the protocol stack collection library through the application layer interface; If there is no called mounted protocol stack instance object to feed back a return value after processing the communication data, processing of the communication data fails, the communication data is discarded, and information on the failure to process the communication data is fed back to the main station side or the perception device side.
2. The system according to claim 1, characterized in that Each protocol stack instance object includes: a name of the protocol stack instance object and an operation function of the protocol stack instance object.
3. The system according to claim 1, characterized in that The protocol stack mount linked list is used to dynamically mount the protocol stack instance objects in the protocol stack collection library, and to uninstall the protocol stack instance objects in the protocol stack collection library.
4. The system according to claim 1, characterized in that The application layer interface is used to provide a unified application layer interface function for each protocol stack instance object in the protocol stack collection library.
5. The system according to claim 1, characterized in that The communication channel is specifically used for: Carry out interaction between the power intelligent terminal and the master station side / sensing device side.
6. The system according to claim 1, characterized in that The communication channel includes: a remote communication channel and / or a local communication channel; The remote communication channel includes: TCP Socket or UDP Socket; The local communication channel includes: an RS485 communication interface or an RS232 communication interface.
7. The system according to claim 2, characterized in that The multiple protocol stack instance objects include at least the following six types: IEC101, IEC104, DL / T698, Q / GDW1376.1, DL / T645 and Modbus.
8. A multi-protocol self-adaptation method for a power intelligent terminal, characterized in that: include: Using a protocol stack collection library to store multiple preset protocol stack instance objects; When the communication channel receives the communication data sent by the master station side or the sensing device side, the communication data is sent to the communication service thread; The communication service thread uses the communication data to determine a target protocol stack instance object, and calls the target protocol stack instance object from the protocol stack collection library to process the communication data; The communication service thread uses the communication data to determine a target protocol stack instance object, and calls the target protocol stack instance object from the protocol stack collection library to process the communication data, including: Calling the mounted protocol stack instance objects in sequence from the protocol stack mounting linked list to process the communication data; If there is a mounted protocol stack instance object that is called and feeds back a return value after processing the communication data, the mounted protocol stack instance object that feeds back the return value is the target protocol stack instance object, and the target protocol stack instance object is found from the protocol stack collection library through the application layer interface; If there is no called mounted protocol stack instance object to feed back a return value after processing the communication data, processing of the communication data fails, the communication data is discarded, and information on the failure to process the communication data is fed back to the main station side or the perception device side.
9. The method according to claim 8, characterized in that Each protocol stack instance object includes: a name of the protocol stack instance object and an operation function of the protocol stack instance object.
10. The method according to claim 8, characterized in that The method further comprises: The protocol stack instance objects in the protocol stack collection library are dynamically mounted by using the protocol stack mounting linked list, and the protocol stack instance objects in the protocol stack collection library are unmounted.
11. The method according to claim 8, characterized in that The method further comprises: The application layer interface is used to provide a unified application layer interface function for each protocol stack instance object in the protocol stack collection library.
12. The method according to claim 8, characterized in that The method further comprises: The communication channel is used for interaction between the power intelligent terminal and the master station side / sensing device side.
13. The method according to claim 8, characterized in that The communication channel includes: a remote communication channel and / or a local communication channel; The remote communication channel includes: TCP Socket or UDP Socket; The local communication channel includes: an RS485 communication interface or an RS232 communication interface.
14. The method according to claim 8, characterized in that The multiple protocol stack instance objects include at least the following six types: IEC101, IEC104, DL / T698, Q / GDW1376.1, DL / T645 and Modbus.
15. An electronic device, characterized in that: include: at least one processor and memory; The memory and the processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the multi-protocol self-adaptation method for a power intelligent terminal according to any one of claims 8 to 14 is implemented.
16. A readable storage medium, characterized in that: An execution program is stored thereon, and when the execution program is executed, the multi-protocol self-adaptation method for a power intelligent terminal as claimed in any one of claims 8 to 14 is implemented.
Citation Information
Patent Citations
Communication protocol stack multiplexing method, communication method, computer equipment and medium
CN114785631A
Method and system for realizing data exchange protocol stack based on container technology
CN116668552A