CN117857416A - Data packet sending method and device, storage medium and electronic device - Google Patents

Data packet sending method and device, storage medium and electronic device Download PDF

Info

Publication number
CN117857416A
CN117857416A CN202311864750.9A CN202311864750A CN117857416A CN 117857416 A CN117857416 A CN 117857416A CN 202311864750 A CN202311864750 A CN 202311864750A CN 117857416 A CN117857416 A CN 117857416A
Authority
CN
China
Prior art keywords
data packet
equipment
target
state
determining
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.)
Pending
Application number
CN202311864750.9A
Other languages
Chinese (zh)
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202311864750.9A priority Critical patent/CN117857416A/en
Publication of CN117857416A publication Critical patent/CN117857416A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a data packet sending method and device, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the data packet sending method comprises the following steps: under the condition that a data packet sent by cloud equipment is received, determining an equipment identifier carried by the data packet, and inquiring a state index corresponding to the equipment identifier in an equipment state table; and transmitting the data packet to the target device by using the configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device. By adopting the technical scheme, the problem that the forwarding time is long because the device information table is queried again under the condition that the routing table is traversed in the process of forwarding the data to the target device by the current cloud is solved.

Description

Data packet sending method and device, storage medium and electronic device
Technical Field
The present invention relates to the technical field of smart home, and in particular, to a method and apparatus for sending a data packet, a storage medium, and an electronic apparatus.
Background
In the related art, on an internet of things terminal device, a network module load is communicated with a cloud server through ethernet, wifi or other modes, cloud data are simultaneously forwarded to sub-devices connected with the cloud module load, part of the sub-devices have proxy functions, and a downlink of the sub-devices can be connected with other secondary sub-devices. Two tables of a routing table and equipment information are maintained in the network module, one piece of forwarding information of the routing table takes an Identification (ID) of a target equipment as an index, and the main content of the forwarding information is a port or gateway (through a proxy) through which the forwarding information is sent to the equipment and protocol information which needs to be packaged. The device id, the current state of the device, the port to which the device is connected, and the like are recorded in the device state table. The current state of the device, including initialization, ready, sleep, exit, etc.
The normal flow of receiving the data packet is that after the data packet is received from the cloud service, the transmission protocol is firstly analyzed, then the routing table is checked, the target equipment id of the packet is obtained, then the equipment state table is checked, the information of the current equipment connection port, the equipment state, the bus address and the like is obtained, the forwarding channel is determined, and then the forwarding flow is started.
In the above scheme, no matter which type of message is received, all the flows need to be executed, the state of the target device is not fully considered, and the omitted operation in some scenes cannot be omitted. No matter how the entries of the routing table or the device state table are indexed, the look-up table is overhead.
Aiming at the problem that the forwarding time is long because the device information table is queried again under the condition that the routing table is traversed in the process of forwarding the data to the target device by the current cloud, no effective solution is proposed yet.
Accordingly, there is a need for improvements in the related art to overcome the drawbacks of the related art.
Disclosure of Invention
The embodiment of the application provides a data packet sending method and device, a storage medium and an electronic device, which at least solve the problems that whether to update cache data or not cannot be determined according to a query request in the related art.
According to an aspect of an embodiment of the present application, there is provided a method for transmitting a data packet, including: under the condition that a data packet sent by cloud equipment is received, determining an equipment identifier carried by the data packet, and inquiring a state index corresponding to the equipment identifier in an equipment state table; and transmitting the data packet to the target device by using the configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device.
In an exemplary embodiment, before querying the device state table for the state index corresponding to the device identifier, the method further includes: determining a number of available devices present in the device state table; stopping sending the data packet and executing deleting operation on the data packet under the condition that the number is smaller than a preset value; under the condition that the number is equal to a preset value, determining whether the equipment identifier carried by the data packet is the same as the target equipment identifier corresponding to the available equipment; and under the condition that the number is larger than a preset value, determining to execute a query operation in the equipment state table.
In an exemplary embodiment, determining whether the carried device identifier is the same as a target device identifier corresponding to the available device includes: determining a first character corresponding to the equipment identifier and determining a second character corresponding to the target equipment; calculating the similarity of the first character and the second character; under the condition that the similarity is larger than a preset similarity, determining that the equipment identifier is the same as the target equipment identifier, and allowing the data packet to be directly transmitted to the available equipment; and under the condition that the similarity is smaller than or equal to the preset similarity, determining that the equipment identifier is different from the target equipment identifier, stopping sending the data packet, and executing deleting operation on the data packet.
In an exemplary embodiment, transmitting the data packet to the target device using the configured target protocol pointer in the state index includes: accessing protocol information in a routing table using the target protocol pointer; determining a transmitting mode of the data corresponding to the data packet according to the protocol information, and transmitting the data packet to the target equipment according to the transmitting mode.
In an exemplary embodiment, the method further comprises: acquiring a preset updating period of the equipment state table; collecting first state information of each device in the device state table according to the updating period, and determining a corresponding relation between the first state information and the device identifier; and updating the historical state information of each device in the device state table according to the first state information and the corresponding relation.
In an exemplary embodiment, after transmitting the data packet to the target device using the configured target protocol pointer in the state index, the method further comprises: determining whether first feedback information sent by the target equipment is received within a preset time period; under the condition that the first feedback information of the target equipment is received, determining that the data packet is successfully transmitted; and sending the first feedback information to a cloud device to instruct the cloud device to allow the target device to continue sending other data packets.
In an exemplary embodiment, the method further comprises: under the condition that the first feedback information of the target equipment is not received, determining that the transmission of the data packet fails; and sending second feedback information to the cloud device to instruct the cloud device to stop sending other data packets to the target device continuously.
According to another aspect of the embodiments of the present application, there is also provided a device for transmitting a data packet, including: the first determining module is used for determining a device identifier carried by a data packet and inquiring a state index corresponding to the device identifier in a device state table under the condition that the data packet sent by the cloud device is received; and the transmission module is used for transmitting the data packet to the target device by using the configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device.
According to still another aspect of the embodiments of the present application, there is further provided a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described method for transmitting a data packet when executed.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the method for sending the data packet by using the computer program.
According to the method and the device, under the condition that a data packet sent by cloud equipment is received, equipment identification carried by the data packet is determined, and a state index corresponding to the equipment identification is queried in an equipment state table; transmitting the data packet to the target device by using a configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device; by adopting the technical scheme, the problem that the forwarding time is long because the device information table is queried again under the condition that the routing table is traversed in the process of forwarding the data to the target device by the current cloud is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of an alternative method for transmitting data packets according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative method of transmitting data packets according to an embodiment of the present application;
fig. 3 is a schematic technical basis of an alternative method for transmitting a data packet according to an embodiment of the present application;
FIG. 4 is an alternative route representation intent according to an embodiment of the present application;
FIG. 5 is an alternative device state representation intent in accordance with an embodiment of the present application;
FIG. 6 is a flow chart of an alternative prior art method of receiving a data packet according to an embodiment of the present application;
fig. 7 is a schematic technical principle diagram of an alternative data packet transmission method according to an embodiment of the present application;
fig. 8 is a schematic diagram of an alternative method for sending a data packet according to an embodiment of the present application;
fig. 9 is a block diagram of an alternative data packet transmission device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a method for transmitting a data packet is provided. The data packet sending method is widely applied to full-house intelligent digital control application scenes such as Smart Home (Smart Home), intelligent Home equipment ecology, intelligent Home (intelligent house) ecology and the like. Alternatively, in the present embodiment, the above-described transmission method of the data packet may be applied to a hardware environment constituted by a plurality of terminal devices 102 and servers 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to a plurality of terminal devices 102 through a network, and may be used to provide services (such as application services, etc.) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data operation services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a method for sending a data packet is provided, including but not limited to being applied to a computer terminal, and fig. 2 is a flowchart of an alternative method for sending a data packet according to an embodiment of the present application, where the flowchart includes the following steps:
step S202: under the condition that a data packet sent by cloud equipment is received, determining an equipment identifier carried by the data packet, and inquiring a state index corresponding to the equipment identifier in an equipment state table;
step S204: and transmitting the data packet to the target device by using the configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device.
Through the steps, under the condition that a data packet sent by cloud equipment is received, an equipment identifier carried by the data packet is determined, and a state index corresponding to the equipment identifier is queried in an equipment state table; transmitting the data packet to the target device by using a configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device; by adopting the technical scheme, the problem that the forwarding time is long because the device information table is queried again under the condition that the routing table is traversed in the process of forwarding the data to the target device by the current cloud is solved.
In an exemplary embodiment, before querying the device state table for the state index corresponding to the device identifier, the method further includes: determining a number of available devices present in the device state table; stopping sending the data packet and executing deleting operation on the data packet under the condition that the number is smaller than a preset value; under the condition that the number is equal to a preset value, determining whether the equipment identifier carried by the data packet is the same as the target equipment identifier corresponding to the available equipment; and under the condition that the number is larger than a preset value, determining to execute a query operation in the equipment state table.
That is, before determining the state corresponding to the device, the number of currently available devices may be determined first, and if the number of available devices is smaller than the preset value, which indicates that the currently available devices are not enough to receive the data packet, the current data packet sending operation is stopped directly, and the data packet is deleted. And under the condition that the number of the available devices is equal to a preset value, the current available devices just meet the requirement of receiving the data packet, and only the fact that whether the device identifier carried by the data packet is identical to the target device identifier corresponding to the available devices is determined. If the equipment identifier carried by the data packet is the same as the target equipment identifier corresponding to the available equipment, the data packet can be directly sent to the target equipment. If the number of available devices is greater than the preset value, it is indicated that the current available devices exceed the requirement of receiving the data packet, and then a query operation needs to be performed in the device state table, so as to further determine the target device specifically receiving the data packet.
In an alternative embodiment, if the preset value is 1, then in the case where the number of available devices is 0, it is indicated that no device can accept the data packet currently. The current packet transmission operation can be directly stopped and the packet can be deleted. In the case where the number of available devices is equal to 1, it is only necessary to determine whether the device identifications in the device identification data packet of the available devices are identical. And under the condition that the number of the available devices is larger than 1, the fact that a plurality of devices can accept the data packet is indicated, and then a query operation is executed from the device state table to query the available devices for target devices consistent with the device identification in the data packet.
In an exemplary embodiment, determining whether the carried device identifier is the same as a target device identifier corresponding to the available device includes: determining a first character corresponding to the equipment identifier and determining a second character corresponding to the target equipment; calculating the similarity of the first character and the second character; under the condition that the similarity is larger than a preset similarity, determining that the equipment identifier is the same as the target equipment identifier, and allowing the data packet to be directly transmitted to the available equipment; and under the condition that the similarity is smaller than or equal to the preset similarity, determining that the equipment identifier is different from the target equipment identifier, stopping sending the data packet, and executing deleting operation on the data packet.
That is, in order to determine whether the device identifier carried by the data packet is the same as the target device identifier corresponding to the available device, the device identifier and the target device identifier may be determined to be the same according to the similarity between the first character and the second character by comparing the first character corresponding to the device identifier and the second character corresponding to the target device. If the similarity of the first character and the second character is greater than the preset similarity, the description may send the data packet to the available device. If the similarity between the first character and the second character is smaller than the preset similarity, the data packet cannot be sent to the available equipment, and the data packet can be deleted directly.
In an alternative embodiment, the device identifier carried by the data packet is 00001, the target device identifier is 00001, the similarity between the device identifier and the target device is 100%, and in the case that the preset similarity is 99%, the description is used for sending the data packet to the available device. If the device identifier carried by the data packet is 00001 and the target device identifier is 00002, the similarity of the device identifier and the target device identifier is 80%, that is, the similarity is smaller than the preset similarity, which indicates that the data packet cannot be sent to the available device and the data packet can be deleted directly.
In an exemplary embodiment, transmitting the data packet to the target device using the configured target protocol pointer in the state index includes: accessing protocol information in a routing table using the target protocol pointer; determining a transmitting mode of the data corresponding to the data packet according to the protocol information, and transmitting the data packet to the target equipment according to the transmitting mode.
That is, the corresponding transport protocol is determined from the routing table based on the protocol pointer.
In an exemplary embodiment, the method further comprises: acquiring a preset updating period of the equipment state table; collecting first state information of each device in the device state table according to the updating period, and determining a corresponding relation between the first state information and the device identifier; and updating the historical state information of each device in the device state table according to the first state information and the corresponding relation.
That is, the actual state of each device is collected according to the update period of the device state table, so that the state information in the device state table can show the actual state of each device.
In an exemplary embodiment, after transmitting the data packet to the target device using the configured target protocol pointer in the state index, the method further comprises: determining whether first feedback information sent by the target equipment is received within a preset time period; under the condition that the first feedback information of the target equipment is received, determining that the data packet is successfully transmitted; and sending the first feedback information to a cloud device to instruct the cloud device to allow the target device to continue sending other data packets.
That is, after the data packet is transmitted to the target device according to the protocol pointer, it is further required to determine whether the data packet is successfully transmitted, and further, whether it is possible to continue to transmit other data packets to the target device. If the feedback information sent by the target equipment is received, the success of the data packet sending is indicated, and other data packets can be continuously sent to the target equipment.
In an exemplary embodiment, the method further comprises: under the condition that the first feedback information of the target equipment is not received, determining that the transmission of the data packet fails; and sending second feedback information to the cloud device to instruct the cloud device to stop sending other data packets to the target device continuously.
That is, if feedback information sent by the target device is not received, it is indicated that the data packet transmission has failed. Then, feedback information preventing the cloud device from continuously sending other data packets needs to be sent to the cloud device.
It will be apparent that the embodiments described above are only some, but not all, of the embodiments of the present application. In order to better understand the foregoing method for transmitting the data packet, the following description will explain the foregoing process with reference to the embodiments, but is not intended to limit the technical solution of the embodiments of the present application, specifically:
fig. 3 is a schematic technical basis diagram of an alternative method for sending a data packet according to an embodiment of the present application, as shown in fig. 3, with the following steps:
on the terminal equipment of the internet of things, the network module load is communicated with the cloud server through Ethernet, wifi or other modes, cloud data are simultaneously forwarded to the sub-equipment connected with the cloud module load, part of the sub-equipment has an agent function, such as the sub-equipment 3, and the downlink of the sub-equipment can be connected with other secondary sub-equipment, such as the sub-equipment 4.
FIG. 4 is an alternative route representation intent, as shown in FIG. 3, with the following in accordance with an embodiment of the present application:
two tables of a routing table and device information are maintained in the network module, one piece of forwarding information of the routing table is shown in fig. 4, the forwarding information is indexed by the target device id, and the main content of the forwarding information is a port or gateway (through proxy) through which the forwarding information is sent to the device and protocol information which needs to be packaged. The transmission protocol, forwarding port/gateway corresponding to the target device can be determined by the target device ID.
FIG. 5 is an alternative device state representation intent, as shown in FIG. 5, according to an embodiment of the present application, with the following:
information such as the device id, the current state of the device, the port to which the device is connected, and the like is recorded. The current state of the device, including initialization, ready, sleep, exit, etc.
Fig. 6 is a flowchart of an alternative prior art method for receiving a data packet according to an embodiment of the present application, specifically as follows:
after receiving the data packet from the cloud service, analyzing the transmission protocol, checking the routing table to obtain the target device id of the packet, checking the device state table to obtain the information such as the current device connection port, the device state and the bus address, determining the forwarding channel, and starting the forwarding flow.
Fig. 7 is a schematic technical principle diagram of an alternative data packet transmission method according to an embodiment of the present application, as shown in fig. 7:
an entry is added for each device in the device state table, the contents of which are references to the device transport protocol and port. With this, the forwarding protocol and port can be directly obtained by the reference without consulting the routing table, and downstream data forwarding can be started.
An index of available devices (devices in an initialized, ready, operational state) is built in a device state table, and updated in real-time as any device state changes. Through this index, a list of currently available devices can be obtained without entering any device id. When the list is empty, it indicates that no devices are currently available.
After receiving the downlink data message, the available device index table is accessed first, and when no available device exists, the downlink data message is directly discarded. When the available equipment index table has only one equipment, directly comparing the equipment id with the target equipment id in the message data, and if the equipment id is not matched with the target equipment id, directly discarding the data message; if so, the message is directly forwarded to the device.
When the available equipment index table is formed by a plurality of available equipment, after receiving a data message, the original flow of firstly checking the routing table and then checking the equipment table is changed into the flow of directly checking the equipment state table through the equipment id, if the equipment exists and is normal, the routing information in the routing table is directly abandoned through the protocol stack pointer added on the inner surface of the equipment information table, and the process of checking the routing table is omitted.
Fig. 8 is a schematic diagram of an alternative method for sending a data packet according to an embodiment of the present application, as shown in fig. 8:
adding available equipment index to the equipment state table, after receiving the data message, before analyzing the message, firstly inquiring the equipment state table, and directly deleting the message under the condition that no available equipment exists currently; and for the case that only one available device exists currently, recording the entry of the available device, comparing the available device id with the target device id in the data message, if the available device id is matched with the target device id in the data message, directly forwarding the message to the device, and if the available device id is not matched with the target device id, deleting the message.
In the downlink data forwarding logic in the internet of things (internet of Things, simply referred to as IOT) module, after receiving the downlink data message, the message may not be parsed temporarily, the device state is queried first, and forwarding information may be found only through the device information table under part of the scenarios, so as to realize blind forwarding. And adding a reference to the routing information in the equipment information table, directly finding the protocol information required by forwarding through the reference after determining the forwarding port, directly starting data message encapsulation and forwarding, and reducing the table look-up times.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
The embodiment also provides a device for sending a data packet, which is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
Fig. 9 is a block diagram of an alternative data packet transmission apparatus according to an embodiment of the present application, where the apparatus includes:
the first determining module 92 is configured to determine, when a data packet sent by a cloud device is received, a device identifier carried by the data packet, and query a device state table for a state index corresponding to the device identifier;
a transmitting module 94, configured to transmit the data packet to the target device using the configured target protocol pointer in the state index, where the state information in the state index indicates that the target device corresponding to the device identifier is an available device.
Through the device, under the condition that the data packet sent by the cloud device is received, the device identifier carried by the data packet is determined, and the state index corresponding to the device identifier is queried in the device state table; transmitting the data packet to the target device by using a configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device; by adopting the technical scheme, the problem that the forwarding time is long because the device information table is queried again under the condition that the routing table is traversed in the process of forwarding the data to the target device by the current cloud is solved.
In an exemplary embodiment, the above apparatus further includes: the processing module is used for determining the number of available devices existing in the device state table before inquiring the state index corresponding to the device identifier in the device state table; stopping sending the data packet and executing deleting operation on the data packet under the condition that the number is smaller than a preset value; under the condition that the number is equal to a preset value, determining whether the equipment identifier carried by the data packet is the same as the target equipment identifier corresponding to the available equipment; and under the condition that the number is larger than a preset value, determining to execute a query operation in the equipment state table.
In an exemplary embodiment, the above apparatus further includes: a second determining module, configured to determine whether the carried device identifier is the same as a target device identifier corresponding to the available device, includes: determining a first character corresponding to the equipment identifier and determining a second character corresponding to the target equipment; calculating the similarity of the first character and the second character; under the condition that the similarity is larger than a preset similarity, determining that the equipment identifier is the same as the target equipment identifier, and allowing the data packet to be directly transmitted to the available equipment; and under the condition that the similarity is smaller than or equal to the preset similarity, determining that the equipment identifier is different from the target equipment identifier, stopping sending the data packet, and executing deleting operation on the data packet.
In an exemplary embodiment, the above apparatus further includes: a third determining module for transmitting the data packet to the target device using the configured target protocol pointer in the state index, including: accessing protocol information in a routing table using the target protocol pointer; determining a transmitting mode of the data corresponding to the data packet according to the protocol information, and transmitting the data packet to the target equipment according to the transmitting mode.
In an exemplary embodiment, the above apparatus further includes: the acquisition module is used for acquiring an update period preset by the equipment state table; collecting first state information of each device in the device state table according to the updating period, and determining a corresponding relation between the first state information and the device identifier; and updating the historical state information of each device in the device state table according to the first state information and the corresponding relation.
In an exemplary embodiment, the above apparatus further includes: the first sending module is used for determining whether first feedback information sent by the target equipment is received in a preset time period or not; under the condition that the first feedback information of the target equipment is received, determining that the data packet is successfully transmitted; and sending the first feedback information to a cloud device to instruct the cloud device to allow the target device to continue sending other data packets.
In an exemplary embodiment, the above apparatus further includes: the second sending module determines that the sending of the data packet fails under the condition that the first feedback information of the target equipment is not received; and sending second feedback information to the cloud device to instruct the cloud device to stop sending other data packets to the target device continuously.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, under the condition that a data packet sent by cloud equipment is received, determining an equipment identifier carried by the data packet, and inquiring a state index corresponding to the equipment identifier in an equipment state table;
s2, under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device, the data packet is transmitted to the target device by using the configured target protocol pointer in the state index.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, under the condition that a data packet sent by cloud equipment is received, determining an equipment identifier carried by the data packet, and inquiring a state index corresponding to the equipment identifier in an equipment state table;
s2, under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device, the data packet is transmitted to the target device by using the configured target protocol pointer in the state index.
In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method for transmitting a data packet, comprising:
under the condition that a data packet sent by cloud equipment is received, determining an equipment identifier carried by the data packet, and inquiring a state index corresponding to the equipment identifier in an equipment state table;
and transmitting the data packet to the target device by using the configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device.
2. The method for sending a data packet according to claim 1, wherein before querying a state index corresponding to the device identifier in a device state table, the method further comprises:
determining a number of available devices present in the device state table;
stopping sending the data packet and executing deleting operation on the data packet under the condition that the number is smaller than a preset value;
under the condition that the number is equal to a preset value, determining whether the equipment identifier carried by the data packet is the same as the target equipment identifier corresponding to the available equipment;
and under the condition that the number is larger than a preset value, determining to execute a query operation in the equipment state table.
3. The method for transmitting a data packet according to claim 2, wherein determining whether the carried device identifier is the same as the target device identifier corresponding to the available device comprises:
determining a first character corresponding to the equipment identifier and determining a second character corresponding to the target equipment;
calculating the similarity of the first character and the second character;
under the condition that the similarity is larger than a preset similarity, determining that the equipment identifier is the same as the target equipment identifier, and allowing the data packet to be directly transmitted to the available equipment;
and under the condition that the similarity is smaller than or equal to the preset similarity, determining that the equipment identifier is different from the target equipment identifier, stopping sending the data packet, and executing deleting operation on the data packet.
4. The method according to claim 1, wherein transmitting the data packet to the target device using the configured target protocol pointer in the state index, comprises:
accessing protocol information in a routing table using the target protocol pointer;
determining a transmitting mode of the data corresponding to the data packet according to the protocol information, and transmitting the data packet to the target equipment according to the transmitting mode.
5. The method for transmitting a data packet according to claim 1, further comprising:
acquiring a preset updating period of the equipment state table;
collecting first state information of each device in the device state table according to the updating period, and determining a corresponding relation between the first state information and the device identifier;
and updating the historical state information of each device in the device state table according to the first state information and the corresponding relation.
6. The method for sending a data packet according to claim 1, wherein after the data packet is transmitted to the target device using the configured target protocol pointer in the state index, the method further comprises:
determining whether first feedback information sent by the target equipment is received within a preset time period;
under the condition that the first feedback information of the target equipment is received, determining that the data packet is successfully transmitted;
and sending the first feedback information to a cloud device to instruct the cloud device to allow the target device to continue sending other data packets.
7. The method for transmitting a data packet according to claim 6, further comprising:
under the condition that the first feedback information of the target equipment is not received, determining that the transmission of the data packet fails;
and sending second feedback information to the cloud device to instruct the cloud device to stop sending other data packets to the target device continuously.
8. A data packet transmission apparatus, comprising:
the first determining module is used for determining a device identifier carried by a data packet and inquiring a state index corresponding to the device identifier in a device state table under the condition that the data packet sent by the cloud device is received;
and the transmission module is used for transmitting the data packet to the target device by using the configured target protocol pointer in the state index under the condition that the state information in the state index indicates that the target device corresponding to the device identifier is an available device.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of claims 1 to 7 by means of the computer program.
CN202311864750.9A 2023-12-29 2023-12-29 Data packet sending method and device, storage medium and electronic device Pending CN117857416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311864750.9A CN117857416A (en) 2023-12-29 2023-12-29 Data packet sending method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311864750.9A CN117857416A (en) 2023-12-29 2023-12-29 Data packet sending method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN117857416A true CN117857416A (en) 2024-04-09

Family

ID=90537669

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311864750.9A Pending CN117857416A (en) 2023-12-29 2023-12-29 Data packet sending method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN117857416A (en)

Similar Documents

Publication Publication Date Title
CN108737221B (en) Packet loss detection method and communication link system
WO2014143118A1 (en) Loop-free hybrid network
CN114697150B (en) Command issuing method and device, storage medium and electronic device
US10965605B2 (en) Communication system, communication control method, and communication apparatus
CN116614858A (en) Data transmission method and device, storage medium and electronic equipment
CN107634868B (en) Method and system for managing network service
CN110868348B (en) Multi-gateway communication method, device and system and electronic equipment
CN111274319A (en) State information query method and device
CN117857416A (en) Data packet sending method and device, storage medium and electronic device
CN115442221B (en) Distributed home equipment service management method and system
US20160127143A1 (en) Apparatus and method for managing devices
CN113452763B (en) Smart home business registration method and device and smart home system
CN114422437B (en) Heterogeneous message forwarding method and device
CN116225834A (en) Alarm information sending method and device, storage medium and electronic device
CN111095893A (en) Conditional routing apparatus and method
KR102481403B1 (en) Multicast packet processing method and network device
CN115296948B (en) Scene information updating method and device, storage medium and electronic device
WO2020150349A1 (en) Device presence method and system for mesh network management
US10044523B2 (en) Communication apparatus, server, communication system, and communication method
US6847996B2 (en) Method for managing an open computer system
CN115314549B (en) Offline equipment management method, storage medium and electronic device
CN115297345B (en) Method and device for processing screen-throwing request, storage medium and electronic device
CN115296947B (en) Control command response method and device, storage medium and electronic device
CN116266845B (en) Data transmission method and device
WO2023053158A1 (en) Communication system, communication control device, communication control method, and program

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