CN114785864B - Data interaction method, system, electronic equipment and storage medium - Google Patents

Data interaction method, system, electronic equipment and storage medium Download PDF

Info

Publication number
CN114785864B
CN114785864B CN202210677491.8A CN202210677491A CN114785864B CN 114785864 B CN114785864 B CN 114785864B CN 202210677491 A CN202210677491 A CN 202210677491A CN 114785864 B CN114785864 B CN 114785864B
Authority
CN
China
Prior art keywords
data
packet
additional information
length
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210677491.8A
Other languages
Chinese (zh)
Other versions
CN114785864A (en
Inventor
汪二虎
付绘彬
李飞
姜毅
吴海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LCFC Hefei Electronics Technology Co Ltd
Original Assignee
LCFC Hefei Electronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LCFC Hefei Electronics Technology Co Ltd filed Critical LCFC Hefei Electronics Technology Co Ltd
Priority to CN202210677491.8A priority Critical patent/CN114785864B/en
Publication of CN114785864A publication Critical patent/CN114785864A/en
Application granted granted Critical
Publication of CN114785864B publication Critical patent/CN114785864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure provides a data interaction method, system, electronic device and storage medium, which relate to the technical field of communication, and the method comprises: the sending end assembles the original data according to a preset custom protocol to obtain a protocol data packet, wherein the protocol data packet comprises: the system comprises a packet header, an ontology data packet and data additional information for describing and limiting the ontology data packet; the storage format of the data additional information is xml; when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information; establishing long connection with at least one receiving end to generate at least one communication link; and transmitting the protocol data packet to a receiving end by using the communication link. The method, the system, the electronic equipment and the storage medium disclosed by the invention can better realize the rapid multiplexing of the communication protocol between the upper computer software and the algorithm software by utilizing the preset custom protocol, have better flexibility and expansibility and have wider application scenes.

Description

Data interaction method, system, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a data interaction method, system, electronic device, and storage medium.
Background
At present, data interaction between upper computer software and algorithm software is generally carried out in two ways. One is that the upper computer software calls the algorithm in the algorithm library in an interface calling mode; the other is to use a TCP/IP Protocol (Transmission Control Protocol/Internet Protocol), to use the upper computer software as a client, the algorithm software as an independent process, and the algorithm software as a server, to communicate through a socket.
However, the two methods cannot well achieve the rapid multiplexing of the communication part of the upper computer software and the algorithm software. For example: the first method requires the upper computer software development engineer to be familiar with the interface of each algorithm library, and is inconvenient to operate and troubleshoot when the algorithm libraries have problems. The mode also causes the workload of the upper computer development engineer to be huge, and is not beneficial to the extension and maintenance of software. The second method is not versatile enough, and requires modification of additional information of a command for each detection target. And the information of the data body is less, so that the method cannot better meet various scenes, such as the width and the height of an image, or the data type and the like, and brings great inconvenience to the communication of upper computer software and algorithm software.
Disclosure of Invention
The present disclosure provides a data interaction method, system, electronic device and storage medium, so as to solve at least the above-mentioned problems in the prior art.
According to a first aspect of the present disclosure, there is provided a data interaction method, the method comprising:
the method comprises the steps that a sending end assembles original data according to a preset custom protocol to obtain a protocol data packet, wherein the protocol data packet comprises: the system comprises a packet header, an ontology data packet and data additional information for describing and limiting the ontology data packet;
the storage format of the data additional information is xml, and when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information;
establishing long connection with at least one receiving end to generate at least one communication link;
and sending the protocol data packet to the receiving end by using the communication link.
In an embodiment, the step of adjusting the protocol data packet by modifying the data additional information includes:
when the service requirement information changes, the protocol data packet is adjusted by adding node information in the data additional information;
the method for acquiring the node information comprises the following steps: and acquiring the node information according to the service demand information and a preset node information acquisition rule.
In one embodiment, the packet header includes: the system comprises a service command, a data additional information length and a body data packet length, wherein the data additional information length is used for a receiving end to obtain data additional information, and the body data packet length is used for the receiving end to obtain a body data packet.
In one embodiment, the step of sending the protocol data packet to the receiving end includes:
a receiving end receives a packet header of the protocol data packet, wherein the packet header comprises a data additional information length and a body data packet length;
acquiring fixed-length data additional information and a fixed-length body data packet according to the length of the data additional information and the length of the body data packet in the packet header;
and executing the service command in the packet header by using the data additional information with the fixed length and the body data packet with the fixed length.
In an embodiment, the step of obtaining the fixed length data additional information and the fixed length body data packet according to the data additional information length and the body data packet length in the packet header includes:
determining a service task according to the service command in the packet header;
acquiring data additional information with fixed length according to the length of the data additional information;
according to body data package length, obtain the body data package of fixed length, body data package includes at least one sub-package, the sub-package includes: data separator, sub-package data length and data body;
separating sub-packets in the body data packet by using the data separator and the sub-packet data length to obtain data of at least one sub-packet;
and executing the service task according to the data additional information with the fixed length and the data of at least one sub-packet.
In one embodiment, the data additional information includes: data group level information and a data storage path.
According to a second aspect of the present disclosure, there is provided a data interaction system, the system comprising:
the sending end is used for assembling the original data according to a preset custom protocol to obtain a protocol data packet, and the protocol data packet comprises: the system comprises a packet header, an ontology data packet and data additional information for describing and limiting the ontology data packet; the storage format of the data additional information is xml, and when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information;
at least one receiving end, which is used for establishing long connection with the transmitting end and generating at least one communication link; and receiving the protocol data packet transmitted by the transmitting end by using the communication link.
In an implementation manner, the step of receiving the protocol data packet transmitted by the sender includes:
receiving a packet header of the protocol data packet, wherein the packet header comprises a data additional information length and a body data packet length;
acquiring fixed-length data additional information and a fixed-length body data packet according to the length of the data additional information and the length of the body data packet in the packet header;
and executing the service command in the packet header by using the data additional information with the fixed length and the body data packet with the fixed length.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods of the present disclosure.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the present disclosure.
According to the data interaction method, the data interaction system, the electronic device and the storage medium, the sending end assembles original data according to a preset custom protocol to obtain a protocol data packet, wherein the protocol data packet comprises: the system comprises a header, an ontology packet and data additional information for describing and defining the ontology packet. Wherein, the storage format of the data additional information is xml. And when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information. And the sending end establishes long connection with at least one receiving end to generate at least one communication link. And the protocol data packet is sent to the receiving end by utilizing the communication link, so that flexible communication can be carried out between the sending end and the receiving end. The rapid multiplexing of the communication part between the upper computer software and the algorithm software, namely the rapid multiplexing of the communication part between the sending end and the receiving end, is better realized, the universality is stronger, the operation is more convenient, the workload of development and maintenance is less, and the information of a data body which can be born by the body data packet is larger. In addition, the self-defined protocol in the disclosure has better flexibility and expansibility, and is more widely applicable to scenes.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present disclosure will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
FIG. 1 is a flow chart illustrating an implementation of a data interaction method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating a structure of a protocol data packet in a data interaction method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating a structure of a packet header in the data interaction method according to the embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a structure of an ontology package in the data interaction method according to the embodiment of the present disclosure;
FIG. 5 is a schematic diagram illustrating an implementation flow of adjusting a protocol data packet in a data interaction method according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram illustrating a flow of implementing a receiving end receiving a packet header of a protocol data packet in the data interaction method according to the embodiment of the present disclosure;
FIG. 7 is a schematic diagram illustrating a component structure of a data interaction system according to an embodiment of the present disclosure;
fig. 8 shows a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, features and advantages of the present disclosure more apparent and understandable, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
At present, the communication between the upper computer software and the algorithm software usually adopts an interface calling mode or a TCP/IP protocol mode. The mode of interface calling is adopted, so that the workload of an upper computer development engineer is huge, and when an algorithm library has problems, the troubleshooting is not convenient, and the implementation is not convenient. However, the TCP/IP protocol is not versatile enough to quickly multiplex the communication part between the transmitting end and the receiving end. For example: the protocol portion of the TCP/IP protocol typically includes: a bag head and a bag body; the packet head portion includes: commands, packet data length, command additional information, etc. When the detection object of the command is changed, the additional information of the command needs to be changed, and because the packet header data is generated according to the TCP/IP protocol, if the additional information in the packet header needs to be modified, the additional information is very inconvenient, not easy to modify, high in cost consumption, incapable of better meeting the application requirements of multiple scenes, and poor in universality. Secondly, the packet body of the TCP/IP protocol part can bear a small amount of data, and when the packet body information sent at one time contains a plurality of images or a plurality of feature points, the packet body of the TCP/IP protocol part cannot complete the data bearing of the plurality of images or the plurality of feature points, and cannot well meet the use requirements of various scenes, such as the width and height of the images or the data types and the like. Furthermore, the TCP/IP protocol cannot handle the sticky data packets in the case of long connection, that is, when a plurality of data packets are sent out, the front and back data packets are stuck to each other. Therefore, the inventor proposes a data interaction method, a system, an electronic device and a storage medium, and firstly, a sending end assembles original data according to a preset custom protocol to obtain a protocol data packet. Wherein, the sending end can be upper computer software. The protocol data packet includes: the system comprises a header, an ontology packet and data additional information for describing and defining the ontology packet. The storage format of the data additional information is xml, and when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information. And, establishing a long connection with at least one receiving end, generating at least one communication link. And transmitting the protocol data packet to a receiving end by using the communication link. The receiving end may then be algorithmic software. The method enables the sending end and the receiving end to carry out flexible communication, and realizes information interaction between the upper computer software and the algorithm software. When the service requirement information or command changes, such as the detection object changes, the method can better adapt to various scenes by modifying the data additional information in the xml format, is more convenient to operate, better realizes the quick multiplexing of a communication part between upper computer software and algorithm software, has higher flexibility, stronger universality and more convenient operation, has less workload of development and maintenance, has larger information of a data body which can be born, and effectively avoids data package sticking.
Referring to fig. 1, a data interaction method provided by the present disclosure includes:
s11: the sending end assembles the original data according to a preset custom protocol to obtain a protocol data packet, wherein the protocol data packet comprises: the system comprises a packet header, an ontology data packet and data additional information for describing and limiting the ontology data packet; the storage format of the data additional information is xml, and when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information.
Specifically, the sending end can be upper computer software. The service requirement information refers to information of a service to be executed, and can be set according to actual conditions, such as service requirements for visual detection of a keyboard or a screen in an image. When the service requirement information changes, the rapid multiplexing of the communication part between the sending end and the receiving end can be realized by modifying the data additional information in the xml format. For example: when the acquired service requirement information changes, that is, new service requirement information is acquired, assuming that the new service requirement information is used for performing visual detection on a screen and a keyboard of a notebook, detection of the keyboard or screen detection needs to be shielded sometimes in the detection process, that is, shielding of a detection item is involved, the requirements can be completed by modifying data additional information, that is, adding node information < KeyBoardTest > true </KeyBoardTest > < PanelTest > and < PanelTest > false < PanelTest > to the data additional information in an xml format, so that shielding of the detection item is realized, and the multiplexing speed is high.
Unlike existing TCP/IP protocols, the protocol data packets generated by the present disclosure using custom protocols include: a header, data additional information, and an ontology packet. The structure of the protocol data packet is shown in fig. 2.
Because the additional information of the command in the packet header of the existing TCP/IP protocol cannot be extended and modified well, in this embodiment, the packet header of the protocol data packet removes the additional information of the command in the packet header of the existing TCP/IP protocol, and the data additional information in the xml format is added outside the packet header to describe and limit the body data packet, such as the data group information and the data storage path in the body data packet.
Further, the packet header of the protocol data packet of the present disclosure is used for the receiving end to analyze and acquire the additional data information and the body data packet, and the structure of the packet header refers to fig. 3, which includes: a service command (cmd), a data additional information length (data _ sub [0]), and a body packet length (data _ sub [1 ]). In some embodiments, the packet header further comprises: a command flag (echo _ flag), a total length of a data packet (data additional information length + body data packet length) (data _ sum), a data type (data type [0] (data _ type [0]), a data type [1] (data _ type [1]), a data type [2] (data _ type [2 ]), a data type [3] (data _ type [3 ])), a reserved data length of other data (reserved data length [0], reserved data length [1]), a check information length (data _ crc), a number of subpackets (data _ sub _ nums), a total number of data packet cycles (sum _ in _ period), a number of data packet cycles (index _ in _ period), a reserved data bit (reserved data bit [0], a reserved data bit [1], a reserved data bit [2], a reserved data bit [3], a reserved data bit [4], …, a reserved data bit [25] (data bit [25 ]), a data type (data type [0] (data _ type [0]), a data type [1]), a data type [3 ]), a check information length, a check information, a data type, Reserved data bits [26], reserved data bits [27], and check information (crc). The total number of data packet periods refers to a total number of data packet periods, and the number of data packet periods refers to the number of data packet periods. The size of the header is 64Bytes, Byte represents Byte, 1Byte =8bits, and bit is a measurement unit, meaning bit.
Please refer to fig. 4 for a structure of an ontology packet in the present disclosure. The ontology data package in this disclosure includes at least one sub-package, and the sub-package includes: data delimiters, data description information and data volumes. Wherein the data description information includes: sub-packet data length (data len), sub-packet data type, and optional fields. The sub-packet data types include: main data type (Main data type), Sub data type (Sub data type), Sub packet number (data No). Optional fields include: an image width (image width) and an image height (image height), and when the sub-packet data type is an image, the optional fields are valid fields. 0x00, 0x01 denote hexadecimal numbers. In fig. 4, a byte stream is composed of sub-packets 1 and 2 to form an ontology data packet. The data packet format has high flexibility and high universality.
S12: and establishing long connection with at least one receiving end to generate at least one communication link. The receiving end can be algorithm software. The long connection means that a plurality of data packets can be continuously sent on one connection, and at least one communication link is generated by controlling the sending end to establish the long connection with at least one receiving end, so that the stability of protocol data packet transmission can be ensured to a certain extent. For example: and the upper computer software establishes long connection with at least one algorithm software to generate a corresponding communication link.
S13: and transmitting the protocol data packet to a receiving end by using the communication link. Therefore, by using the custom protocol in this embodiment to assemble data, fast multiplexing of the communication part between the sending end (upper computer software) and the receiving end (algorithm software) can be better achieved, flexibility is higher, the receiving end can better receive and analyze the assembled protocol data packet, accuracy is higher, cost is lower, and implementability is stronger.
Referring to fig. 5, in some embodiments, the step of adjusting the protocol data packet by modifying the data additional information includes:
s111: when the service requirement information changes, the protocol data packet is adjusted by adding node information in the data additional information; the acquisition mode of the node information comprises the following steps: and acquiring the node information according to the service demand information and a preset node information acquisition rule. The node information obtaining rule may be set according to actual conditions, and is not described herein again.
Referring to fig. 6, in order to realize information interaction between a sending end (upper computer software) and a receiving end (algorithm software), in some embodiments, the step of sending the protocol data packet to the receiving end includes:
s21: the receiving end receives the packet head of the protocol data packet, and the packet head comprises the length of the data additional information and the length of the body data packet.
S22: acquiring data additional information with fixed length and an ontology data packet with fixed length according to the length of the data additional information and the length of the ontology data packet in the packet header; and executing the service command in the packet header by using the data additional information with the fixed length and the body data packet with the fixed length.
In some embodiments, the step of obtaining the fixed length data additional information and the fixed length body data packet according to the data additional information length and the body data packet length in the packet header comprises:
s221: and determining the service task according to the service command in the packet header. Namely, the current service task to be executed is judged according to the service command cmd in the packet header.
S222: and acquiring the data additional information with fixed length according to the length of the data additional information.
S223: and acquiring the body data packet with fixed length according to the length of the body data packet.
S224: and mutually separating sub-packets in the body data packet by using the data separators and the data length of the sub-packets in the body data packet to acquire the data of at least one sub-packet.
S225: and executing the service task according to the data additional information with the fixed length and the data of at least one sub-packet. Therefore, the service processing of the receiving end to the sending end is realized, the flexibility is higher, and the accuracy is higher.
In some embodiments, after the receiving end executes the service task, the processing result is fed back to the sending end.
The first embodiment is as follows:
when a plurality of images need to be visually detected, the upper computer software serves as a sending end, and firstly, the plurality of images are assembled by utilizing a preset custom protocol to obtain a protocol data packet. The protocol data packet includes: the system comprises a header, an ontology packet and data additional information for describing and defining the ontology packet. The data additional information can be set and modified according to actual conditions, such as data group information, data storage paths and the like. The packet header includes: service command, data additional information length and body data packet length. The body data package includes a plurality of sub-packages, and the sub-package includes: data delimiters, data description information and data volumes. And then, transmitting the protocol data packet to the receiving end by using a communication link established with at least one receiving end.
The visual inspection algorithm software is used as a receiving end, and firstly, a packet header of a protocol data packet is received. And acquiring the data additional information with fixed length and the body data packet with fixed length according to the data additional information length and the body data packet length in the packet header. And determining the service task according to the service command in the packet header. And acquiring the data additional information with fixed length according to the length of the data additional information. And acquiring the body data packet with fixed length according to the length of the body data packet. And mutually separating sub-packets in the body data packet by using the data separator and the data length of the sub-packets in the body data packet to acquire the data of at least one sub-packet. Then, a business task is executed according to the fixed length data additional information and the data of the at least one sub-packet. And finally, feeding back the acquired processing result to a corresponding sending end to complete information interaction between the upper computer software and the visual inspection algorithm software.
When the service requirement information changes, the rapid multiplexing of the communication part between the upper computer software and the visual detection algorithm software can be realized only by modifying the data additional information, and the universality is strong.
Example two:
when images of a plurality of cameras need to be spliced, the upper computer software serves as a sending end, and the plurality of images are assembled by utilizing a preset custom protocol to obtain a protocol data packet. The protocol data packet includes: the system comprises a header, an ontology packet and data additional information for describing and defining the ontology packet. The data additional information may be camera parameters, exposure times, and the like. The packet header includes: service command, data additional information length and body data packet length. The body data package includes a plurality of sub-packages, and the sub-package includes: data delimiters, data description information, and data volumes. And then, transmitting the protocol data packet to the receiving end by using a communication link established with at least one receiving end.
And the image splicing algorithm software is used as a receiving end and receives the packet header of the protocol data packet in the same way. And acquiring the data additional information with fixed length and the body data packet with fixed length according to the data additional information length and the body data packet length in the packet header. And determining the service task according to the service command in the packet header. And acquiring the data additional information with fixed length according to the length of the data additional information. And acquiring the body data packet with fixed length according to the length of the body data packet. And mutually separating sub-packets in the body data packet by using the data separators and the data length of the sub-packets in the body data packet to acquire the data of at least one sub-packet. Then, the business task is executed according to the data additional information with fixed length and the data of at least one sub-package. And finally, feeding back the acquired processing result to the corresponding sending end. The method and the device finish the splicing of the images of the plurality of cameras, have higher flexibility and better realize the information interaction between the sending end and the receiving end.
Referring to fig. 7, the present disclosure further provides a data interaction system, including:
the sending end is used for assembling the original data according to a preset custom protocol and obtaining a protocol data packet, and the protocol data packet comprises: the system comprises a packet header, an ontology data packet and data additional information for describing and limiting the ontology data packet; the storage format of the data additional information is xml, and when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information;
the receiving end is used for establishing long connection with the transmitting end to generate at least one communication link; and receiving the protocol data packet transmitted by the transmitting end by using the communication link. This system assembles the original data through control sending end according to the self-defined agreement that sets up in advance, acquires the agreement data package, and the agreement data package includes: the system comprises a header, an ontology packet and data additional information for describing and defining the ontology packet. The storage format of the data additional information is xml, and when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information. And establishing a long connection with at least one receiving end to generate at least one communication link. The protocol data packet is sent to the receiving end by utilizing the communication link, so that the rapid multiplexing of the communication part between the upper computer software and the algorithm software is better realized, and the self-defined protocol in the system has better flexibility and expansibility, can be better suitable for various communication scenes such as the communication between the algorithm software and the upper computer software, and has the advantages of more convenient implementation and lower cost.
In some embodiments, the step of receiving the protocol data packet transmitted by the transmitting end comprises:
receiving a packet header of a protocol data packet;
acquiring data additional information with fixed length and an ontology data packet with fixed length according to the length of the data additional information and the length of the ontology data packet in the packet header;
and executing the service command in the packet header by using the data additional information with the fixed length and the body data packet with the fixed length.
In some embodiments, the step of adjusting the protocol data packet by modifying the data overhead information comprises:
when the service requirement information changes, the protocol data packet is adjusted by adding node information in the data additional information;
the acquisition mode of the node information comprises the following steps: and acquiring the node information according to the service demand information and a preset node information acquisition rule.
In some embodiments, the packet header comprises: the system comprises a service command, a data additional information length and a body data packet length, wherein the data additional information length is used for a receiving end to obtain data additional information, and the body data packet length is used for the receiving end to obtain a body data packet.
In some embodiments, the step of sending the protocol data packet to the receiving end comprises:
a receiving end receives a packet head of a protocol data packet;
acquiring data additional information with fixed length and an ontology data packet with fixed length according to the length of the data additional information and the length of the ontology data packet in the packet header;
and executing the service command in the packet header by using the data additional information with the fixed length and the body data packet with the fixed length.
In some embodiments, the step of obtaining the fixed length data additional information and the fixed length body data packet according to the data additional information length and the body data packet length in the packet header comprises:
determining a service task according to the service command in the packet header;
acquiring data additional information with fixed length according to the length of the data additional information;
according to body data package length, obtain the body data package of fixed length, the body data package includes at least one sub-package, and the sub-package includes: data separator, sub-package data length and data body;
separating sub-packets in the body data packet by using the data separator and the data length of the sub-packets to obtain data of at least one sub-packet;
and executing the service task according to the data additional information with the fixed length and the data of at least one sub-packet.
In some embodiments, the data additional information comprises: data group level information and a data storage path.
The present disclosure also provides an electronic device and a readable storage medium according to an embodiment of the present disclosure.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806 such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The computing unit 801 executes the various methods and processes described above, such as the data interaction method. For example, in some embodiments, the data interaction method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 800 via ROM 802 and/or communications unit 809. When loaded into RAM 803 and executed by computing unit 801, may perform one or more of the steps of the data interaction method described above. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the data interaction method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, "a plurality" means two or more unless specifically limited otherwise.
The above is only a specific embodiment of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present disclosure, and shall be covered by the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method of data interaction, the method comprising:
the sending end assembles original data according to a preset custom protocol to obtain a protocol data packet, wherein the protocol data packet comprises: the system comprises a packet header, an ontology data packet and data additional information for describing and limiting the ontology data packet;
the storage format of the data additional information is xml, and when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information;
establishing long connection with at least one receiving end to generate at least one communication link;
and sending the protocol data packet to the receiving end by using the communication link.
2. The data interaction method of claim 1, wherein the step of adjusting the protocol data packet by modifying the data additional information comprises:
when the service requirement information changes, the protocol data packet is adjusted by adding node information in the data additional information;
the method for acquiring the node information comprises the following steps: and acquiring the node information according to the service demand information and a preset node information acquisition rule.
3. The data interaction method according to claim 1, wherein the packet header comprises: the system comprises a service command, a data additional information length and a body data packet length, wherein the data additional information length is used for a receiving end to obtain data additional information, and the body data packet length is used for the receiving end to obtain a body data packet.
4. The data interaction method of claim 1, wherein the step of sending the protocol data packet to the receiving end is followed by:
a receiving end receives a packet header of the protocol data packet, wherein the packet header comprises a data additional information length and a body data packet length;
acquiring fixed-length data additional information and a fixed-length body data packet according to the length of the data additional information and the length of the body data packet in the packet header;
and executing the service command in the packet header by using the data additional information with the fixed length and the body data packet with the fixed length.
5. The data interaction method according to claim 4, wherein the step of obtaining fixed length data additional information and fixed length body data packet according to the data additional information length and the body data packet length in the packet header comprises:
determining a service task according to the service command in the packet header;
acquiring data additional information with fixed length according to the length of the data additional information;
according to the body data package length, acquire the body data package of fixed length, the body data package includes at least one sub-packet, the sub-packet includes: data separator, sub-package data length and data body;
separating sub-packets in the body data packet by using the data separator and the sub-packet data length to obtain data of at least one sub-packet;
and executing the service task according to the data additional information with the fixed length and the data of at least one sub-packet.
6. The data interaction method of claim 1, wherein the data additional information comprises: data group level information and a data storage path.
7. A data interaction system, the system comprising:
the sending end is used for assembling the original data according to a preset custom protocol to obtain a protocol data packet, and the protocol data packet comprises: the system comprises a packet header, an ontology data packet and data additional information for describing and limiting the ontology data packet; the storage format of the data additional information is xml, and when the acquired service requirement information changes, the protocol data packet is adjusted by modifying the data additional information;
at least one receiving end, which is used for establishing long connection with the transmitting end and generating at least one communication link; and receiving the protocol data packet transmitted by the transmitting end by using the communication link.
8. The data interactive system according to claim 7, wherein the step of receiving the protocol data packet transmitted by the transmitting end comprises:
receiving a packet header of the protocol data packet, wherein the packet header comprises a data additional information length and a body data packet length;
acquiring fixed-length data additional information and a fixed-length body data packet according to the length of the data additional information and the length of the body data packet in the packet header;
and executing the service command in the packet header by using the data additional information with the fixed length and the body data packet with the fixed length.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the data interaction method of any one of claims 1-6.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the data interaction method according to any one of claims 1 to 6.
CN202210677491.8A 2022-06-16 2022-06-16 Data interaction method, system, electronic equipment and storage medium Active CN114785864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210677491.8A CN114785864B (en) 2022-06-16 2022-06-16 Data interaction method, system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210677491.8A CN114785864B (en) 2022-06-16 2022-06-16 Data interaction method, system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114785864A CN114785864A (en) 2022-07-22
CN114785864B true CN114785864B (en) 2022-09-02

Family

ID=82420905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210677491.8A Active CN114785864B (en) 2022-06-16 2022-06-16 Data interaction method, system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114785864B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761123A (en) * 2013-12-31 2014-04-30 广州华多网络科技有限公司 Method and device for function starting and terminal
CN106324572A (en) * 2016-08-24 2017-01-11 湖北三江航天红峰控制有限公司 GPS simulator and realizing method thereof
CN106411907A (en) * 2016-10-13 2017-02-15 广西咪付网络技术有限公司 Data transmission method and system
EP3364627A1 (en) * 2017-02-21 2018-08-22 Netscout Systems, Inc. Adaptive session intelligence extender
JP2020057376A (en) * 2018-09-10 2020-04-09 スラック テクノロジーズ, インコーポレイテッド Dynamic object update subscriptions based on user interactions with interface
CN111382201A (en) * 2018-12-29 2020-07-07 广州市百果园信息技术有限公司 Heterogeneous database synchronization method and device, computer equipment and storage medium
CN112311664A (en) * 2020-11-18 2021-02-02 昆高新芯微电子(江苏)有限公司 Industrial Internet data interaction method and system and industrial gateway
CN112866190A (en) * 2020-12-25 2021-05-28 宝能(广州)汽车研究院有限公司 Data interaction method, storage medium, electronic device and vehicle
CN113887173A (en) * 2021-10-20 2022-01-04 中国电子科技集团公司第三十研究所 XML-based protocol dynamic packaging and analyzing method
CN114244821A (en) * 2021-12-16 2022-03-25 北京百度网讯科技有限公司 Data processing method, device, equipment, electronic equipment and storage medium
CN114513566A (en) * 2022-02-17 2022-05-17 上海阅维科技股份有限公司 Custom network protocol analysis method, system, medium and electronic device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11182185B2 (en) * 2014-06-27 2021-11-23 Vmware, Inc. Network-based signaling to control virtual machine placement

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761123A (en) * 2013-12-31 2014-04-30 广州华多网络科技有限公司 Method and device for function starting and terminal
CN106324572A (en) * 2016-08-24 2017-01-11 湖北三江航天红峰控制有限公司 GPS simulator and realizing method thereof
CN106411907A (en) * 2016-10-13 2017-02-15 广西咪付网络技术有限公司 Data transmission method and system
EP3364627A1 (en) * 2017-02-21 2018-08-22 Netscout Systems, Inc. Adaptive session intelligence extender
JP2020057376A (en) * 2018-09-10 2020-04-09 スラック テクノロジーズ, インコーポレイテッド Dynamic object update subscriptions based on user interactions with interface
CN111382201A (en) * 2018-12-29 2020-07-07 广州市百果园信息技术有限公司 Heterogeneous database synchronization method and device, computer equipment and storage medium
CN112311664A (en) * 2020-11-18 2021-02-02 昆高新芯微电子(江苏)有限公司 Industrial Internet data interaction method and system and industrial gateway
CN112866190A (en) * 2020-12-25 2021-05-28 宝能(广州)汽车研究院有限公司 Data interaction method, storage medium, electronic device and vehicle
CN113887173A (en) * 2021-10-20 2022-01-04 中国电子科技集团公司第三十研究所 XML-based protocol dynamic packaging and analyzing method
CN114244821A (en) * 2021-12-16 2022-03-25 北京百度网讯科技有限公司 Data processing method, device, equipment, electronic equipment and storage medium
CN114513566A (en) * 2022-02-17 2022-05-17 上海阅维科技股份有限公司 Custom network protocol analysis method, system, medium and electronic device

Also Published As

Publication number Publication date
CN114785864A (en) 2022-07-22

Similar Documents

Publication Publication Date Title
CN111917661B (en) Data transmission method, device, electronic equipment and computer readable storage medium
CN114513552B (en) Data processing method, device, equipment and storage medium
CN114430366B (en) Information acquisition application issuing method, related device and computer program product
CN114448802B (en) Gateway configuration method, device, electronic equipment and storage medium
CN115001897A (en) Communication method and device, electronic equipment and automatic driving vehicle
CN113012695B (en) Intelligent control method and device, electronic equipment and computer readable storage medium
CN116938777B (en) Network telemetry method and device, electronic equipment and storage medium
CN114785864B (en) Data interaction method, system, electronic equipment and storage medium
CN108989157B (en) Method and device for controlling intelligent equipment
CN114363704B (en) Video playing method, device, equipment and storage medium
CN113327602A (en) Method and device for speech recognition, electronic equipment and readable storage medium
CN115361290B (en) Configuration comparison method, device, electronic equipment and storage medium
CN115102850B (en) Configuration comparison method, device, electronic equipment and storage medium
CN115623070B (en) IDL message processing method and device, electronic equipment and storage medium
CN113132480B (en) Data transmission method, device and system
CN116633847A (en) Communication system, method, device, equipment and storage medium
CN117632286A (en) OpenApi implementation method and device based on dynamic class loading
CN116320092A (en) Protocol transmission method, device, electronic equipment and storage medium
CN117221422A (en) Fusion method of Ethernet protocol and optical fiber bus protocol
CN116170188A (en) Network access control method, device, electronic equipment and storage medium
CN117880159A (en) Protocol stack monitoring method, device, equipment and storage medium
CN117278473A (en) Congestion control method and related equipment
CN117235005A (en) Chip, information transmission method and electronic equipment
CN117914836A (en) Vehicle service processing method, device, equipment and computer readable storage medium
CN116527950A (en) Live streaming method, edge node, platform, electronic equipment and storage medium

Legal Events

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