Disclosure of Invention
Accordingly, an objective of the embodiments of the present invention is to provide a data transmission method and an electronic fence system, so as to solve the problem that the status information of the fence cannot be obtained in the prior art.
In a first aspect, an embodiment of the present invention provides a data transmission method, which is applied to an electronic fence system, where the electronic fence system includes a first electronic fence and a second electronic fence with closed edge profiles, where the first electronic fence and the second electronic fence include a plurality of electronic piles sequentially arranged, at least one electronic pile is shared by the first electronic fence and the second electronic fence, and the plurality of electronic piles are respectively provided with a first wireless communication device and receive and transmit data through the first wireless communication device, and the method includes:
the common electronic pile receives a first state information table sent by one electronic pile adjacent to the first electronic fence and a second state information table sent by one electronic pile adjacent to the second electronic fence;
the common electronic pile writes the content of the second state information table into the first state information table to obtain an updated first state information table, and writes the content of the first state information table into the second state information table to obtain an updated second state information table;
the common electronic pile sends the updated first state information table to another electronic pile adjacent to the updated first state information table in the first electronic fence, and sends the updated second state information table to another electronic pile adjacent to the updated second state information table in the second electronic fence;
and the electronic pile which receives the first state information table or the second state information table writes the respective state information and alarm information into the corresponding state information table, and transmits the first state information table or the second state information table in which the information is written to the electronic pile adjacent to the first state information table or the second state information table according to a preset rule.
In a second aspect, an embodiment of the present invention provides a data transmission method, which is applied to an electronic fence system, where the electronic fence system includes an electronic fence with a closed edge profile, the electronic fence includes a plurality of electronic piles sequentially arranged, and the plurality of electronic piles are respectively provided with a first wireless communication device and receive and transmit data through the first wireless communication device, and the method includes:
the method comprises the steps that a current electronic pile receives a state information table sent by one electronic pile adjacent to the current electronic pile, wherein the state information table carries state information and alarm information of the one electronic pile adjacent to the current electronic pile;
updating the state information table by the current electronic pile to obtain an updated state information table;
the current electronic stake transmits the updated state information list to another electronic stake adjacent to the current electronic stake.
In a third aspect, an embodiment of the present invention provides an electronic fence system, where the electronic fence system includes a first electronic fence and a second electronic fence with closed edge profiles, where the first electronic fence and the second electronic fence include a plurality of electronic piles sequentially arranged, at least one electronic pile is shared by the first electronic fence and the second electronic fence, and the plurality of electronic piles are respectively provided with a first wireless communication device and receive and transmit data through the first wireless communication device;
the shared electronic pile is used for receiving a first state information table sent by one electronic pile adjacent to the shared electronic pile in the first electronic fence and a second state information table sent by one electronic pile adjacent to the shared electronic pile in the second electronic fence;
writing the content of the second state information table into the first state information table to obtain an updated first state information table, and writing the content of the first state information table into the second state information table to obtain an updated second state information table;
transmitting the updated first state information table to another electronic pile adjacent to the updated first state information table in the first electronic fence, and transmitting the updated second state information table to another electronic pile adjacent to the updated second state information table in the second electronic fence;
and the electronic pile which receives the first state information table or the second state information table is used for writing the respective state information and the alarm information into the corresponding state information table and transmitting the first state information table or the second state information table with the written information to the electronic pile adjacent to the first state information table or the second state information table according to a preset rule.
In a fourth aspect, an embodiment of the present invention provides an electronic fence system, where the electronic fence system includes an electronic fence with a closed edge profile, and the electronic fence includes a plurality of electronic piles sequentially arranged, where the plurality of electronic piles are respectively provided with a first wireless communication device and receive and transmit data through the first wireless communication device;
the current electronic pile is used for receiving a state information table sent by one electronic pile adjacent to the current electronic pile, and the state information table carries state information and alarm information of the one electronic pile adjacent to the current electronic pile;
updating the state information table to obtain an updated state information table;
and sending the updated state information table to another electronic pile adjacent to the updated state information table.
According to the data transmission method and the electronic fence system provided by the embodiment of the invention, after the electronic piles of the electronic fence in the system are in wireless connection with the adjacent electronic piles, after the state information table sent by the adjacent electronic piles is received, the received state information table is updated, and the updated state information table is transmitted to the adjacent other electronic piles, so that each electronic pile can store the state information of the other electronic piles, and the state information of all electronic piles can be uploaded by one electronic pile, so that a manager can acquire the state information of each electronic pile in time.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present invention.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
First embodiment
Referring to fig. 1-3, an electronic fence system according to a first embodiment of the present invention includes a first electronic fence 100 and a second electronic fence 200. The first electronic fence 100 includes a plurality of electronic piles sequentially arranged, and the edge profile of the first electronic fence 100 forming the edge after the plurality of electronic piles are sequentially arranged is closed. The second electronic fence 200 also includes a plurality of electronic piles sequentially arranged, and the edge profile of the second electronic fence 200 formed by sequentially arranging the plurality of electronic piles is closed. The edge profiles of the first electronic fence 100 and the second electronic fence 200 may be square in fig. 1 or circular in fig. 2.
As shown in fig. 3, each electronic peg is provided with a first wireless communication device 400 and receives and transmits data through the first wireless communication device 400, respectively. When the electronic fence system is applied to livestock farm management livestock, the above-described first electronic fence 100 and second electronic fence 200 may be used to monitor the distance of the internal livestock from the electronic stake of the first electronic fence 100 or the second electronic fence 200. For example, the second wireless communication device may be worn on the livestock, and the first wireless communication device 400 of the electronic stake may determine to set the distance between the second wireless communication device and the first wireless communication device 400 by detecting the received wireless signal strength of the second wireless communication device. When the first wireless communication device 400 determines that the distance between the second wireless communication device and the first wireless communication device 400 is smaller than the preset threshold distance, alarm information can be added in the state information of the electronic pile.
It should be noted that the status information of the electronic pile is used to characterize the working status of the electronic pile. Each electronic pile is provided with mark information for unique identification, and when the electronic pile generates state information, the mark information of the electronic pile is written into the state information for unique identification of the state information of the electronic pile. If the electronic stake detects a second wireless communication device with a spacing less than a preset threshold, the electronic stake generates alarm information representing the detected second wireless communication device with a spacing less than the preset threshold and writes the alarm information into the state information.
In order that any one electronic pile can obtain status information of other electronic piles, at least one electronic pile 300 is shared by the first electronic fence 100 and the second electronic fence 200.
The common electronic pile 300 is configured to receive a first status information table sent by an electronic pile adjacent to the first electronic fence 100, and a second status information table sent by an electronic pile adjacent to the second electronic fence 200.
After the common electronic stake 300 receives the first status information table and the second status information table, in order for the electronic stake in the first electronic fence 100 to obtain the status information of the electronic stake in the second electronic fence 200 and for the electronic stake in the second electronic fence 200 to obtain the status information of the electronic stake in the first electronic fence 100, the common electronic stake 300 needs to write the content of the second status information table into the first status information table to obtain an updated first status information table, and write the content of the first status information table into the second status information table to obtain an updated second status information table.
And then, the updated first state information table is sent to another electronic pile adjacent to the first electronic fence 100, and the updated second state information table is sent to another electronic pile adjacent to the second electronic fence 200.
And the electronic pile which receives the first state information table or the second state information table is used for writing the respective state information and the alarm information into the corresponding state information table and transmitting the first state information table or the second state information table with the written information to the electronic pile adjacent to the first state information table or the second state information table according to a preset rule.
As an implementation mode, after the gateway for network access is arranged on any electronic pile, the electronic pile provided with the gateway can communicate with the background server through the gateway, and the state information table received by the electronic pile is uploaded to the server, so that management staff in an animal farm can acquire the working state of the electronic fence in time through the server, and whether livestock turn over the electronic fence is judged.
According to the electronic fence system provided by the first embodiment of the invention, after the electronic piles of the electronic fence in the system are in wireless connection with the adjacent electronic piles, after the state information table sent by the adjacent electronic piles is received, the received state information table is updated, and the updated state information table is transmitted to the adjacent other electronic piles, so that each electronic pile can store the state information of the other electronic piles, and the electronic pile can upload the state information of all the electronic piles, so that a manager can acquire the state information of each electronic pile in time.
Second embodiment
Referring to fig. 4-5, a second embodiment of the present invention provides an electronic fence system, which includes an electronic fence 500 with a closed edge profile, wherein the electronic fence 500 includes a plurality of electronic piles arranged in sequence. The edge profile of the electronic fence 500 can be square in fig. 4 or circular in fig. 5. The electronic piles are respectively provided with a first wireless communication device and receive and transmit data through the first wireless communication device;
the current electronic pile is used for receiving a state information table sent by one electronic pile adjacent to the current electronic pile, and the state information table carries state information and alarm information of the one electronic pile adjacent to the current electronic pile; updating the state information table to obtain an updated state information table; and sending the updated state information table to another electronic pile adjacent to the updated state information table.
Third embodiment
Referring to fig. 6, an embodiment of the present invention provides a data transmission method, which is applied to an electronic fence system, where the electronic fence system includes a first electronic fence and a second electronic fence with closed edge profiles, the first electronic fence and the second electronic fence respectively include a plurality of electronic piles sequentially arranged, at least one common electronic pile is provided for the first electronic fence and the second electronic fence, and the plurality of electronic piles are respectively provided with a first wireless communication device and receive and transmit data through the first wireless communication device, and the method includes:
step S310: and the common electronic pile receives a first state information table sent by one electronic pile adjacent to the first electronic fence and a second state information table sent by one electronic pile adjacent to the second electronic fence.
It should be noted that the status information of the electronic pile is used to characterize the working status of the electronic pile. Each electronic pile is provided with mark information for unique identification, and when the electronic pile generates state information, the mark information of the electronic pile is written into the state information for unique identification of the state information of the electronic pile. If the electronic stake detects a second wireless communication device with a spacing less than a preset threshold, the electronic stake generates alarm information representing the detected second wireless communication device with a spacing less than the preset threshold and writes the alarm information into the state information.
Each electronic pile can store the state information of each electronic pile by arranging a memory, wherein the state information carries the identification information of the electronic pile. If the electronic pile generates alarm information, the state information also carries the alarm information. The alarm information is generated when the first wireless communication device of the electronic pile detects that the distance between the second wireless communication device and the first wireless communication device, which are worn by livestock in the first electronic fence or the second electronic fence, is smaller than a preset threshold value.
Preferably, the common electronic pile sends feedback information representing successful information receiving to an adjacent electronic pile in the first electronic fence and an adjacent electronic pile in the second electronic fence respectively.
Step S320: and the common electronic pile writes the content of the second state information table into the first state information table to obtain an updated first state information table, and writes the content of the first state information table into the second state information table to obtain an updated second state information table.
After the common electronic pile receives the first state information table and the second state information table, in order to enable the electronic pile in the first electronic fence to obtain the state information of the electronic pile in the second electronic fence and enable the electronic pile in the second electronic fence to obtain the state information of the electronic pile in the first electronic fence, the common electronic pile needs to write the content of the second state information table into the first state information table and write the content of the first state information table into the second state information table.
For example, as shown in fig. 7-9, fig. 7 is a first status information table received by the common electronic pile, fig. 8 is a second status information table received by the common electronic pile, in fig. 7, a field "num" indicates a number of status information, a field "add" is flag information of an electronic pile to which the status information belongs, and in fig. 7 and 8, a field "add" stores a network address of the electronic pile. The field "state" stores the working state of the electronic pile, for example, when the value of the field "state" is "normal", the electronic pile is indicated to work normally, and when the value of the field "state" is "fault", the electronic pile is indicated to fail.
After the common electronic pile writes the state information in the second state information table into the first state information table, an updated first state information table as shown in fig. 9 can be obtained.
It should be noted that, when the common electronic pile receives the first state information table, the first state information table may be cached in the memory of the common electronic pile, and after the common electronic pile receives the second state information table, the latest first state information table cached in the memory is obtained, and the state information in the latest first state information table is added to the second state information table to obtain an updated second state information table, and then the cached first state information table is deleted, so as to save storage space. The principle of updating the first state information table may also be the same, and will not be described in detail here.
Step S330: and the common electronic pile sends the updated first state information table to another electronic pile adjacent to the updated first state information table in the first electronic fence, and sends the updated second state information table to another electronic pile adjacent to the updated second state information table in the second electronic fence.
In the process of setting the first electronic fence and the second electronic fence, in order to facilitate the electronic piles to carry out data transmission, each electronic pile is correspondingly stored with the network address of the adjacent electronic pile in the same electronic fence. When each electronic pile sends the state information table, the electronic pile can send the own network address at the same time, so that the electronic pile which receives the state information table can send the updated state information table to the electronic pile which the network address corresponding to the network address belongs to.
When the electronic pile fails to perform data communication wirelessly, in order to facilitate a manager to find the failed electronic pile in time, as an optimization, the common electronic pile judges that the other electronic pile in the first electronic fence fails when no feedback information which is sent by the other electronic pile in the first electronic fence and is successfully received is received within a preset time period; and writing the state information representing the fault of the other electronic pile in the first electronic fence into the updated first state information table.
When the shared electronic pile does not receive the feedback information which is sent by the other electronic pile in the second electronic fence and is successfully received in a preset time period, judging that the other electronic pile in the second electronic fence fails; and writing the state information representing the fault of the other electronic pile in the second electronic fence into the updated second state information table.
When the common electronic pile judges that one adjacent electronic pile in the first electronic fence fails, as a preference, the updated first state information table can be transmitted to the other adjacent electronic pile again, so that the first state information table can still be transmitted in the first electronic fence. The second electronic fence may also be the same, and will not be described here again.
Step S340: and the electronic pile which receives the first state information table or the second state information table writes the respective state information and alarm information into the corresponding state information table, and transmits the first state information table or the second state information table in which the information is written to the electronic pile adjacent to the first state information table or the second state information table according to a preset rule.
As an implementation manner, the electronic pile that receives the first state information table or the second state information table obtains a source network address of the electronic pile that sends the first state information table or the second state information table; searching a network address corresponding table pre-stored in the electronic pile to obtain a destination network address corresponding to the source network address; and sending the first state information table or the second state information table of the written information to an adjacent electronic pile with the network address being the destination network address.
For example, as shown in fig. 10, the status information table received by the electronic pile is sent by the electronic pile with the network address 38:bc:1a:c1:99:71, and the network address 38:bc:1a:c1:99:71 is the source network address. And correspondingly storing network addresses 38:BC:1A:C1:99:71 and 38:BC:1A:C1:99:72 in a network address corresponding table in the electronic pile, and after updating the state information table, the electronic pile sends the updated state information table to the electronic pile to which the network addresses 38:BC:1A:C1:99:71 and the network addresses 38:BC:1A:99:72 belong.
Therefore, each electronic pile can obtain the state information of other electronic piles. As an implementation manner, after a gateway is set on one electronic pile in the first electronic fence or the second electronic fence, the electronic pile with the network can upload the obtained state information of all the electronic piles through the gateway.
According to the data transmission method provided by the third embodiment of the invention, after the electronic piles of the electronic fence in the system are in wireless connection with the adjacent electronic piles, after the state information table sent by the adjacent electronic piles is received, the received state information table is updated, and the updated state information table is transmitted to the adjacent other electronic piles, so that each electronic pile can store the state information of the other electronic piles, and the state information of all the electronic piles can be uploaded by one electronic pile, so that a manager can acquire the state information of each electronic pile in time.
Fourth embodiment
Referring to fig. 11, a fourth embodiment of the present invention provides a data transmission method applied to an electronic fence system, the electronic fence system including an electronic fence with a closed edge profile, the electronic fence including a plurality of electronic piles sequentially arranged, the plurality of electronic piles respectively provided with a first wireless communication device and receiving and transmitting data through the first wireless communication device, the method comprising:
step S410: the current electronic pile receives a state information table sent by one electronic pile adjacent to the current electronic pile, wherein the state information table carries state information and alarm information of the one electronic pile adjacent to the current electronic pile.
Step S420: and the current electronic pile updates the state information table to obtain an updated state information table.
In the process of updating a state information table by an electronic pile, checking whether the state information of the current electronic pile exists in the state information table by the current electronic pile; if not, the current electronic pile writes the state information of the current electronic pile into the state information table; if yes, the current electronic pile replaces the state information of the current electronic pile in the state information table with the current state information.
Step S430: the current electronic stake transmits the updated state information list to another electronic stake adjacent to the current electronic stake.
In order to enable the state information table to carry the state information of each electronic pile, the updated state information table is sent to another electronic pile adjacent to the electronic pile.
After the current electronic pile sends the updated state information table, in order to facilitate the current electronic pile to judge whether the next electronic pile successfully receives the updated state information table in time, preferably, when the current electronic pile does not receive the feedback information which is sent by the other electronic pile adjacent to the current electronic pile and is successfully received in a preset time period, judging that the other electronic pile adjacent to the current electronic pile fails; and writing the state information representing that the other electronic pile adjacent to the electronic pile fails into the updated state information table.
In order to facilitate the electronic stake to upload and summarize the state information table, electronic fence system still includes the server, current electronic stake still is provided with treater and second wireless communication device. The current electronic stake communicates the status information table to the processor to cause the processor to send the status information table to the server via the second wireless communication device.
Preferably, the electronic pile may upload the status information table through the second wireless communication device when detecting that the status information table carries status information of all electronic piles. As one mode, the number of the electronic piles in the electronic fence can be preset, and when the electronic piles detect that the number of the state information which is not repeated in the state information table is the same as the number of the electronic piles, the state information table is judged to carry the state information of all the electronic piles.
It should be noted that, in the similar parts of the present embodiment as those of the foregoing embodiment, reference may be directly made to the corresponding content of the foregoing embodiment, and this embodiment is not repeated.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present invention may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes. It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.