Communication method, device, server and communication system
By obtaining the description file of the edge device and generating query information, analyzing the response information to obtain target data, the problem of high complexity in communication protocol portability between the edge computing host and the edge device is solved, and more efficient protocol development and cross-platform use is achieved.
Patent Information
- Application Number
- CN202211725989.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In the prior art, the communication protocol transplantation between the edge computing host and the edge device is high in complexity, resulting in low development efficiency and high technical skills requirements.
By obtaining the description file of the target edge device, the description file includes the protocol type, communication address, a set of vectors to be queried and a set of signal analysis vectors, query information is generated and sent, and response information is parsed according to the signal analysis vector set to obtain target data.
It reduces the complexity of protocol development and migration between server and edge devices, improves the cross-platform usage efficiency and development efficiency of communication protocols, and reduces the development technical requirements of technicians.
Smart Images

Figure CN116033047B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communications, and in particular, to a communication method, apparatus, server, and communication system. Background Art
[0002] In the industrial Internet of Things scenario, an edge computing host can communicate with edge devices through intelligent interfaces. Among them, edge devices can include intelligent sensors, intelligent equipment, etc. Among them, different edge devices may use different intelligent interfaces and different communication protocols.
[0003] In the prior art, technicians need to write parsing codes using programming languages (such as Java) or scripting languages (such as Lua) according to the interfaces and communication protocols of different edge devices and different edge computing hosts. After loading the parsing code, the edge computing host can implement the parsing of the messages sent by the edge devices.
[0004] However, different interfaces, different protocols, and different operating platforms usually require corresponding different parsing codes. That is, in the prior art, there is a problem of high complexity in porting communication protocols between edge computing hosts and edge devices. Summary of the Invention
[0005] This application provides a communication method, apparatus, server, and communication system to solve the problem of high complexity in porting communication protocols between edge computing hosts and edge devices in the prior art.
[0006] In a first aspect, this application provides a communication method, including:
[0007] Obtain a description file of a target edge device, where the description file includes a protocol type, a communication address, a set of vectors to be queried, and a set of signal parsing vectors;
[0008] Generate and send query information according to the protocol type, the communication address, and the set of vectors to be queried;
[0009] Obtain response information, and parse the response information according to the set of signal parsing vectors to obtain target data.
[0010] Optionally, the set of signal parsing vectors includes multiple signal parsing vectors, and each signal parsing vector is used to parse and obtain a target data. The signal parsing vector at least includes a frame index, a target data name, a target data type, a target data length, and a target data start bit.
[0011] Optionally, the parsing the response information according to the set of signal parsing vectors to obtain target data specifically includes:
[0012] Extract the target data information from the response information according to the target data length and the target data start bit;
[0013] Save the target data according to the target data name, the target data type, and the target data information.
[0014] Optionally, the set of query vectors to be queried includes multiple query vectors, and each query vector includes a frame index and a data frame to be queried.
[0015] Optionally, generating and sending the query information according to the protocol type, the communication address, and the set of query vectors to be queried specifically includes:
[0016] Generate multiple pieces of query information according to the protocol type and each query vector in the set of query vectors to be queried, and each piece of query information includes the frame index of the query vector corresponding to the query information;
[0017] Send multiple pieces of the query information to the target edge device corresponding to the communication address in the order of the frame index.
[0018] In a second aspect, the present application provides a communication device, including:
[0019] An acquisition module, configured to acquire a description file of a target edge device, where the description file includes a protocol type, a communication address, a set of query vectors to be queried, and a set of signal parsing vectors;
[0020] A processing module, configured to generate and send query information according to the protocol type, the communication address, and the set of query vectors to be queried; acquire response information, and parse the response information according to the set of signal parsing vectors to obtain target data.
[0021] Optionally, the set of signal parsing vectors includes multiple signal parsing vectors, each signal parsing vector is used to parse and obtain a target data, and the signal parsing vector at least includes a frame index, a data name, a data type, a start byte, a start bit, and a data bit number.
[0022] Optionally, the processing module is specifically configured to:
[0023] Extract the target data information from the response information according to the start byte, the start bit, and the data bit number;
[0024] Save the target data according to the data name, the data type, and the target data information.
[0025] Optionally, the set of query vectors to be queried includes multiple query vectors to be queried, and each query vector to be queried includes a frame index and a data frame to be queried.
[0026] Optionally, the processing module is specifically configured to:
[0027] Generate multiple pieces of query information according to the protocol type and the query vectors in the set of query vectors to be queried, and each piece of query information includes the frame index of the query vector corresponding to the query information;
[0028] Send the multiple pieces of query information to the target edge device corresponding to the communication address in sequence according to the order of the frame indices.
[0029] In a third aspect, the present application provides a server, including: a memory and a processor;
[0030] The memory is used to store a computer program; the processor is used to execute the communication method in the first aspect and any possible design of the first aspect according to the computer program stored in the memory.
[0031] In a fourth aspect, the present application provides a communication system, and the system includes multiple edge devices and a server in the third aspect and any possible design of the third aspect.
[0032] In a fifth aspect, the present application provides a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium. When at least one processor of the server executes the computer program, the server executes the communication method in the first aspect and any possible design of the first aspect.
[0033] In a sixth aspect, the present application provides a computer program product, and the computer program product includes a computer program. When at least one processor of the server executes the computer program, the server executes the communication method in the first aspect and any possible design of the first aspect.
[0034] The communication method, device, server, and communication system provided by this application obtain a description file of a target edge device. The description file may include a protocol type, a communication address, a set of query vectors, and a set of signal parsing vectors. Each query vector in the set of query vectors includes a query data frame. Determine the communication protocol of the target device according to the protocol type. Convert these query data frames into query information according to the type of the communication protocol. Send the query information to the target edge device according to the communication address. Obtain the response information fed back by the target edge device. Parse the response information according to the set of signal parsing vectors to obtain the target data, achieving the effect of reducing the complexity of protocol development and transplantation between the server and the edge device, making the communication protocol have better cross-platform performance, improving the development efficiency of the communication protocol of the edge device, and reducing the requirements for developers. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] To more clearly illustrate the technical solutions in this application or the prior art, the following briefly introduces the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0036] Figure 1 FIG. 9 is a schematic diagram of the application of a communication system provided by an embodiment of this application in an industrial scenario;
[0037] Figure 2 FIG. 13 is an interaction schematic diagram of a communication system provided by an embodiment of this application;
[0038] Figure 3 FIG. 17 is a schematic diagram of the parsing process of a server provided by an embodiment of this application;
[0039] Figure 4 FIG. 21 is a flowchart of a communication method provided by an embodiment of this application;
[0040] Figure 5 FIG. 25 is a schematic diagram of the structure of a description file provided by an embodiment of this application;
[0041] Figure 6 FIG. 29 is a schematic diagram of the structure of a communication device provided by an embodiment of this application;
[0042] Figure 7 FIG. 33 is a schematic diagram of the hardware structure of a server provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following will clearly and completely describe the technical solutions in this application in conjunction with the accompanying drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.
[0044] In the industrial Internet of Things scenario, with the development of intelligent manufacturing and digitization, more and more devices in factories are interconnected. In this scenario, it is usually necessary to deploy an edge computing host, which can communicate with edge devices through an interface. Among them, edge devices can include intelligent sensors, intelligent equipment, etc. Among them, since each edge device is produced by different manufacturers, has different models, and different specifications, different edge devices may use different interfaces and different communication protocols. For example, the interface can include physical interfaces such as network ports, serial ports, and CAN interfaces. The communication protocol can include OPCUA, MODBUS, YDT1363, etc. The edge computing host can only communicate with intelligent devices and complete intelligent device data collection and control by loading the communication protocols of the intelligent devices that need to be parsed. In the prior art, technicians usually write different interfaces, communication protocols for different edge devices, and corresponding parsing codes for different edge computing hosts through programming languages such as Java or scripting languages such as Lua. The edge computing host can communicate with the corresponding intelligent device by loading this parsing code. The edge computing host can use this parsing code to encode the information sent to the edge device and parse the message sent by the edge device.
[0045] In the industrial Internet of Things scenario, with the development of intelligent manufacturing and digitization, more and more devices in factories are interconnected. In this scenario, it is usually necessary to deploy an edge computing host, which can communicate with edge devices through an interface. Among them, edge devices can include intelligent sensors, intelligent equipment, etc. Among them, since each edge device is produced by different manufacturers, has different models, and different specifications, different edge devices may use different interfaces and different communication protocols. For example, the interface can include physical interfaces such as network ports, serial ports, and CAN interfaces. The communication protocol can include OPCUA, MODBUS, YDT1363, etc. The edge computing host can only communicate with intelligent devices and complete intelligent device data collection and control by loading the communication protocols of the intelligent devices that need to be parsed. In the prior art, technicians usually write different interfaces, communication protocols for different edge devices, and corresponding parsing codes for different edge computing hosts through programming languages such as Java or scripting languages such as Lua. The edge computing host can communicate with the corresponding intelligent device by loading this parsing code. The edge computing host can use this parsing code to encode the information sent to the edge device and parse the message sent by the edge device.
[0046] However, different interfaces, different protocols, and different operating platforms usually require corresponding different parsing codes. It can be seen that in the prior art, there is a problem of high development complexity in the communication protocol between the edge computing host and the edge device. Moreover, when transplanting a parsing code from one operating platform to another, there will be an adaptation process. Even some operating platforms support different programming languages. In view of this situation, technicians usually need to re-develop the parsing code for this operating platform or modify the original parsing code to meet the new platform adaptation requirements. It can be seen that in the prior art, there is also a problem of high transplant complexity in the communication protocol between the edge computing host and the edge device. Furthermore, these problems lead to high communication complexity between the edge computing host and the edge device, and usually require technicians to consume a large amount of time and labor costs to complete the development and transplantation of the parsing code for the communication protocol between the edge computing host and the edge device. At the same time, due to the platform characteristics of the edge computing host, technicians usually need to be proficient in multiple languages such as Java and Lua. Therefore, the prior art also has a problem of high skill requirements for technicians.
[0047] To solve the above technical problems, the inventive concept of the communication method provided in the embodiments of the present application lies in designing a description file for the edge device. This description file not only describes the device information, communication protocol, etc. of its corresponding edge device, but also can be read in the form of XML text, making the communication protocol of the edge device independent of the operating platform, enabling smooth cross-platform transplantation of the communication protocol of the edge device, reducing the development and transplantation complexity of the communication protocol of the edge device, improving the cross-platform usage efficiency and development efficiency of the communication protocol of the edge device, and at the same time reducing the technical requirements for technicians to develop communication.
[0048] Next, an exemplary application scenario of the embodiments of the present application will be introduced.
[0049] Figure 1The figure shows a schematic diagram of the application of a communication system provided by an embodiment of the present application in an industrial scenario. In actual use, the edge computing host is usually a terminal device with computing functions. In this embodiment, the edge computing host is referred to as a server. The edge computing host can be connected to multiple edge devices. The connection method can be through physical interfaces such as network ports, serial ports, and CAN interfaces. Alternatively, the edge computing host can also be connected through wireless communication methods such as wireless networks, Bluetooth, and infrared. The edge device can be a terminal device or a sensor with communication functions. For example, the edge device can be a temperature sensor, a humidity sensor, an ammeter, a voltmeter, etc. In an industrial Internet of Things scenario, there are usually multiple communication systems. Each communication system includes a server and multiple edge devices. Different communication systems can be divided according to regions. For example, in workshop A, there is server A and edge devices A1 to An connected to server A. In workshop B, there is server B and edge devices B1 to Bm connected to server B. Among them, edge devices A1 to An and edge devices B1 to Bm can include devices of the same model, the same specification, and the same manufacturer. Alternatively, edge devices A1 to An and edge devices B1 to Bm can also include devices of different models and / or different specifications and / or different manufacturers. The multiple servers can also communicate with the service background to achieve the interconnection and interoperability of multiple communication systems in this industrial scenario.
[0050] During the interaction process, taking the communication between an edge device and a server as an example, the interaction process can be as Figure 2 shown. The server can send query information to the edge device. The edge device can feedback response information to the server according to the query information. Before sending the query information, the server needs to generate the message of the query information according to the type of the communication protocol corresponding to the edge device. When the server receives the response information feedback by the edge device, it can parse the message corresponding to the response information according to the type of the communication protocol to obtain the target information therein. In the present application, the server obtains the communication protocol by loading the description file corresponding to the edge device. The process of the server using the description file to communicate with the edge device can be as Figure 3As shown in the figure. The server may include a protocol parser. The server may read the description file of the target edge device through the protocol parser. The description file may be downloaded from the cloud and stored in the storage device of the server when the edge device first connects to the server. Alternatively, the description file may also be uploaded and stored in the storage device of the server before and after the edge device first connects to the server through the local upload method. The server may read the content of the internal elements and all elements of the description file. The internal elements and element content may include device information, protocol type, the number of query vectors to be queried, the set of query vectors to be queried, the combination of signal parsing vectors, etc. After the server extracts the query vectors from the combination of query vectors to be queried, it may generate query information that can normally communicate according to each query vector and the device address. Since the query vector usually includes a frame index, the server may sequentially send the query information to the target edge device according to the frame index. The target edge device may respond to the query information and feedback the response information to the server. After the server receives the response information from the edge device, it may store the response information in the cache. The server may parse the target information according to the combination of signal parsing vectors to obtain the target information.
[0051] In this application, taking the server as the execution subject, the communication method of the following embodiments is executed. Specifically, the execution subject may be the hardware device of the server, or the software application implemented in the server, or the computer-readable storage medium installed with the software application implementing the following embodiments, or the code of the software application implementing the following embodiments.
[0052] The technical solution of this application will be described in detail below with specific embodiments. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0053] Figure 4 The flowchart of a communication method provided by an embodiment of this application is shown. Based on the embodiment shown in Figures 1 to 3 On the basis of the shown embodiment, as shown in Figure 4 shown, taking the server as the execution subject, the method of this embodiment may include the following steps:
[0054] S101. Obtain the description file of the target edge device, where the description file includes a protocol type, a communication address, a set of query vectors to be queried, and a set of signal parsing vectors.
[0055] In this embodiment, the server can download the description file of the target edge device from the cloud when connecting to the target edge device for the first time, or obtain the description file of the uploaded target edge device from the local. The server can store the description file of the target edge device in the server. In subsequent use, the server can directly retrieve the description file of the target edge device. The description file at least includes a protocol type, a communication address, a set of query vectors to be queried, and a set of signal parsing vectors. Optionally, the protocol type includes the communication protocol of the target edge device. Optionally, the communication address can include information such as an IP address and a port number. Optionally, the set of query vectors to be queried can include multiple query vectors to be queried. Each query vector to be queried includes a frame index and a data frame to be queried. Optionally, the set of signal parsing vectors includes multiple signal parsing vectors. Each signal parsing vector is used to parse and obtain a target data. The signal parsing vector at least includes a frame index, a target data name, a target data type, a target data length, and a target data start bit. Optionally, in addition to the protocol type, the communication address, the set of query vectors to be queried, and the set of signal parsing vectors, the description file can also include device information and the number of query vectors to be queried.
[0056] In one example, the specific content of the description file can be as Figure 5 shown. Each content can be used as a node. Its node, node name, and specific node content can be shown in Table 1.
[0057] Table 1
[0058]
[0059] As shown in Table 1, Node 1 includes basic information. This basic information is the basic information of the target edge device. The basic information includes at least three pieces of information: Model, Manu, and SoftwareVer. Among them, Model represents the device model. Manu represents the manufacturer. SoftwareVer represents the software version number. Node 2 includes the protocol type. For example, the protocol type of the target edge device shown in Table 1 is PT. In addition, the protocol type can also be MODBUS, YDT1363, etc. Usually, different edge devices may have different protocol types. Node 3 includes the number of query vectors to be queried. For example, as shown in Table 1, the number of query vectors to be queried is n. Correspondingly, Node 5 can include n query vectors F1 - Fn. The serial numbers from 1 to n can be frame indices. Each frame is a vector. Node 4 includes the communication address. This communication address is the communication address of the target edge device. The communication address can specifically include information such as IP address, port number, serial port number, etc. Node 5 includes a set of query vectors to be queried. This node 5 specifically lists these n query vectors. Each query vector can include a frame index and data content. For example, in Table 1, "F1" is the frame index of the first query vector. "x11, x12, ……, x1m" is the data content of the first query vector. The server can send these multiple query vectors to the edge device in sequence according to the frame index to obtain the target data. Node 6 includes a set of signal parsing vectors. Since each query data frame can be used to query multiple target data. In this description file, usually each signal parsing vector can correspond to one target data. Therefore, the number of signal parsing vectors in this set of signal parsing vectors is usually greater than or equal to the number of query vectors. Each signal parsing vector includes parameters such as Index, FrameIndex, Name, Type, Bytes, StartByte, StartBit, Bits, RefVal, Unit, etc. Among them, Index represents the serial number of the signal parsing vector. FrameIndex represents the frame index of the query vector parsed by this signal parsing vector. Name represents the data name of the target data parsed by this signal parsing vector. Type represents the data type of this target data. For example, the data type can include float, int, string, etc. Bytes represents the number of bytes required for the target data of this data type. That is, the memory space allocated to the target data parsed by this signal parsing vector. For example, when the data type is float, its Bytes can be 4. That is, the server can allocate 4 bytes of memory space for each variable of the float data type. StartByte is the starting byte, which is used to indicate from which byte in the response information the target data parsed by this signal parsing vector starts.For example, when the StartByte is D09, it indicates that the target data for parsing the signal parsing vector starts from the D09th byte. The StartBit is the starting bit, which is used to indicate from which bit of the starting byte the target data begins. For example, when the StartBit is 0, it means that the target data for parsing the signal parsing vector starts from the 0th bit of the D09th byte. Bits is the number of data bits, which is used to indicate the number of bits of the target data parsed by the signal parsing vector. For example, when Bytes is 4, the corresponding bits are usually 32. RefVal is the reference value of the target data parsed by the signal parsing vector. If this value is "-", it means that the target data has no reference value. Otherwise, when the target data is the same as the reference value, the label of the target data is set to 1, and when the target data is different from the reference value, the label of the target data is set to 0. Unit is used to indicate the unit of the target data parsed by the signal parsing vector. For example, when the target data is a voltage signal, its unit can be volts (V).
[0060] S102. Generate and send query information according to the protocol type, communication address, and the set of vectors to be queried.
[0061] In this embodiment, each vector to be queried in the set of vectors to be queried includes a data frame to be queried. The server can determine the communication protocol of the target device according to the protocol type. The server can convert these data frames to be queried into query information according to the type of the communication protocol. The server can send the query information to the target edge device according to the communication address. After the query data generated using the protocol is received by the target edge device, it can be parsed and recognized by the edge device.
[0062] In one example, the specific process for the server to generate and send query information may include:
[0063] Step 1. Generate multiple query information according to the protocol type and the vectors to be queried in the set of vectors to be queried. Each query information includes the frame index of the vector to be queried corresponding to the query information.
[0064] In this step, the server can obtain the vectors to be queried from the set of vectors to be queried according to the frame index order. The server can process the data frames to be queried in each vector to be queried according to the type of the communication protocol to obtain the query information corresponding to each vector to be queried. The server can also retain the frame index of each vector to be queried in the query information.
[0065] Step 2. Send multiple query information to the target edge device corresponding to the communication address in the order of the frame index.
[0066] In this step, the server can sort according to the frame index of each query message. The server can sequentially send the sorted query messages to the target edge device.
[0067] For example, each query vector in the query vector set of node 5 can be as shown in Table 2. Each row represents a query vector. In a query vector, the first character is the frame index. For example, 1, 2, …, 8 in Table 2 are frame indexes. The remaining characters are the data frames to be queried. For example, "7E32313134303431433030324644464346460D" is the data frame to be queried.
[0068] Table 2
[0069]
[0070] S103. Obtain the response message, and parse the response message according to the signal parsing vector set to obtain the target data.
[0071] In this embodiment, after obtaining the query message, the target edge device can generate its corresponding response message according to each query message. The response message may include the frame index. The target edge device can feedback the response message to the server. After obtaining the response message, the server can parse the response message according to the signal parsing vector set to obtain the target data. The signal parsing vector set includes multiple signal parsing vectors. Each signal parsing vector is used to parse and obtain a target data. Multiple target data can be queried from one query vector. Therefore, each signal parsing vector may include the frame index. The server can determine the frame index of the signal parsing vector used to parse the response message according to the frame index in the response message and the frame index in the signal parsing vector. The server can use the signal parsing vector to parse the response message to obtain the target data.
[0072] In one example, the specific steps for the server to parse the response message may include:
[0073] Step 1. Extract the target data information from the response message according to the start byte, start bit, and data bit number.
[0074] In this step, the signal parsing vector may include a start byte, a start bit, and the number of data bits. Among them, the start byte is used to indicate from which byte of the response message the target data starts. The start bit is used to indicate from which bit of the start byte the target data starts. The number of data bits is used to indicate the number of bits of the target data. After determining multiple signal parsing vectors corresponding to the response message, the server can use these signal parsing vectors one by one to parse the response message. The server can, according to each signal parsing vector, start from the start bit of the start byte of the response message and read a string according to the number of data bits. The server can save the string into the target data information.
[0075] Step 2: Save the target data according to the data name, data type, and target data information.
[0076] In this step, the signal parsing vector may further include a data name and a data type. The server can, according to the data type, perform data conversion on the string of the target data information. The server can form a data structure of the target data by combining the converted data and the data name. The server can save the target data. For example, as shown in Table 3, among them, the 1st - 7th signal parsing vectors are used to parse the query vector with a frame index of 1, and the 8th and 9th signal parsing vectors are used to parse the query vector with a frame index of 3.
[0077] Table 3
[0078]
[0079]
[0080] In the communication method provided by this application, the server can obtain a description file of a target edge device. The description file may include a protocol type, a communication address, a set of query vectors, and a set of signal parsing vectors. Each query vector in the set of query vectors includes a query data frame. The server can determine the communication protocol of the target device according to the protocol type. The server can convert these query data frames into query information according to the type of the communication protocol. The server can send the query information to the target edge device according to the communication address. The server can obtain a response message fed back by the target edge device. The server can parse the response message according to the set of signal parsing vectors to obtain the target data. In this application, by using the description file to implement the generation of query information and the parsing of response information, without rewriting the parsing code, the server can directly load a set of parsing codes to implement the function of communicating with each edge device, reduce the complexity of the communication protocol between the server and the edge device, improve the development efficiency and portability of the parsing code of the communication protocol, and improve the cross - platform usage efficiency of the parsing code.
[0081] Figure 6 shows a schematic structural diagram of a communication device provided in an embodiment of the present application. As Figure 6 shown, the communication device 10 in this embodiment is used to implement the operations corresponding to the server in any of the above method embodiments. The communication device 10 in this embodiment includes:
[0082] An acquisition module 11, configured to acquire a description file of a target edge device, where the description file includes a protocol type, a communication address, a set of vectors to be queried, and a set of signal parsing vectors.
[0083] A processing module 12, configured to generate and send query information according to the protocol type, the communication address, and the set of vectors to be queried, acquire response information, and parse the response information according to the set of signal parsing vectors to obtain target data.
[0084] In an example, the set of signal parsing vectors includes multiple signal parsing vectors, and each signal parsing vector is used to parse and obtain a target data. The signal parsing vector at least includes a frame index, a data name, a data type, a starting byte, a starting bit, and a data bit width.
[0085] In an example, the processing module 12 is specifically configured to:
[0086] Extract target data information from the response information according to the starting byte, the starting bit, and the data bit width.
[0087] Save the target data according to the data name, the data type, and the target data information.
[0088] In an example, the set of vectors to be queried includes multiple vectors to be queried, and each vector to be queried includes a frame index and a data frame to be queried.
[0089] In an example, the processing module 12 is specifically configured to:
[0090] Generate multiple query information according to the protocol type and the vectors to be queried in the set of vectors to be queried, and each query information includes the frame index of the vector to be queried corresponding to the query information.
[0091] Send multiple query information to the target edge device corresponding to the communication address in the order of the frame index.
[0092] The communication device 10 provided in the embodiment of the present application can execute the above method embodiment. For the specific implementation principle and technical effect, reference can be made to the above method embodiment, which will not be elaborated here in this embodiment.
[0093] Figure 7 shows a schematic hardware structure diagram of a server provided in an embodiment of the present application. As Figure 7As shown, the server 20 is used to implement the operations corresponding to the server in any of the above method embodiments. The server 20 in this embodiment may include: a memory 21, a processor 22, and a communication interface 24.
[0094] The memory 21 is used to store computer programs. The memory 21 may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk, or an optical disc, etc.
[0095] The processor 22 is used to execute the computer programs stored in the memory to implement the communication method in the above embodiments. For specific details, please refer to the relevant descriptions in the foregoing method embodiments. The processor 22 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the invention may be directly implemented by the execution of the hardware processor, or may be implemented by the combination of the hardware and software modules in the processor.
[0096] Optionally, the memory 21 may be either independent or integrated with the processor 22.
[0097] When the memory 21 is a device independent of the processor 22, the server 20 may further include a bus 23. The bus 23 is used to connect the memory 21 and the processor 22. The bus 23 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0098] The communication interface 24 may be connected to the processor 21 through the bus 23. The communication interface 24 is used to communicate with the edge device.
[0099] The server provided in this embodiment can be used to execute the above-mentioned communication method, and its implementation manner and technical effects are similar, which will not be elaborated here in this embodiment.
[0100] This application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the methods provided by the above various embodiments.
[0101] Among them, the computer-readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, the computer-readable storage medium is coupled to the processor, so that the processor can read information from the computer-readable storage medium and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can be located in an Application Specific Integrated Circuits (ASIC). In addition, the ASIC can be located in the user equipment. Of course, the processor and the computer-readable storage medium can also exist as discrete components in the communication device.
[0102] Specifically, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically-Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable read-only memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, a magnetic disk or an optical disc. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0103] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device can read the computer program from the computer-readable storage medium, and the execution of the computer program by at least one processor enables the device to implement the methods provided by the above various embodiments.
[0104] An embodiment of the present application also provides a chip, which includes a memory and a processor, the memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that a device equipped with the chip executes the methods in various possible implementation modes as described above.
[0105] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0106] Among them, each module can be physically separated, for example, installed in different locations of a device, or installed on different devices, or distributed on multiple network units, or distributed on multiple processors. Each module can also be integrated together, for example, installed in the same device, or integrated in a set of codes. Each module can exist in the form of hardware, or can also exist in the form of software, or can also be implemented in the form of software plus hardware. The present application can select some or all of the modules according to actual needs to achieve the purpose of the present embodiment.
[0107] When each module is implemented as an integrated module in the form of a software function module, it can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of each embodiment of the present application.
[0108] It should be understood that, although the various steps in the flowcharts in the above-described embodiments are sequentially displayed according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily to be carried out sequentially, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A communication method, characterized in that, The method includes: Obtain a description file of a target edge device, where the description file includes a protocol type, a communication address, a set of query vectors to be queried, and a set of signal parsing vectors; the set of query vectors to be queried includes multiple query vectors to be queried, and each query vector to be queried includes a frame index and a data frame to be queried; the set of signal parsing vectors includes multiple signal parsing vectors, and each signal parsing vector is used to parse and obtain a target data, and the signal parsing vector at least includes the frame index, data name, data type, start byte, start bit, and data bit width; Obtain the query vectors to be queried from the set of query vectors to be queried in the order of the frame index, and convert the data frames to be queried in each query vector to be queried into query information according to the protocol type, generate multiple pieces of query information, and each piece of query information includes the frame index of the query vector corresponding to the query information; Send multiple pieces of the query information to the target edge device corresponding to the communication address in the order of the frame index; Obtain response information, and extract the target data information from the response information according to the start byte, the start bit, and the data bit width; the response information includes the frame index; Perform data conversion on the string of the target data information based on the data type, obtain the target data based on the converted data and the data name, and save the target data.
2. A communication device, characterized in that, The device includes: An obtaining module, configured to obtain a description file of a target edge device, where the description file includes a protocol type, a communication address, a set of query vectors to be queried, and a set of signal parsing vectors; the set of query vectors to be queried includes multiple query vectors to be queried, and each query vector to be queried includes a frame index and a data frame to be queried; the set of signal parsing vectors includes multiple signal parsing vectors, and each signal parsing vector is used to parse and obtain a target data, and the signal parsing vector at least includes the frame index, data name, data type, start byte, start bit, and data bit width; A processing module, configured to obtain the query vectors to be queried from the set of query vectors to be queried in the order of the frame index, convert the data frames to be queried in each query vector to be queried into query information according to the protocol type, generate multiple pieces of query information, and each piece of query information includes the frame index of the query vector corresponding to the query information; send multiple pieces of the query information to the target edge device corresponding to the communication address in the order of the frame index; obtain response information, extract the target data information from the response information according to the start byte, the start bit, and the data bit width; the response information includes the frame index; perform data conversion on the string of the target data information based on the data type, obtain the target data based on the converted data and the data name, and save the target data.
3. A server, characterized in that, The server includes: a memory, a processor; The memory is used to store a computer program; the processor is used to implement the communication method as described in claim 1 according to the computer program stored in the memory.
4. A communication system, characterized in that, The system includes a plurality of edge devices and a server as described in claim 3.
5. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, it is used to implement the communication method as described in claim 1.
6. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the communication method as described in claim 1.
Citation Information
Patent Citations
Internet-of-things communication protocol processing method, electronic equipment and storage medium
CN113835708A
Communication protocol adaptation method and device, computer equipment and storage medium
CN113839902A